From patchwork Thu Aug 22 15:11:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13773695 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7542C3DA4A for ; Thu, 22 Aug 2024 15:13:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6153A6B00DC; Thu, 22 Aug 2024 11:13:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5C53F6B012B; Thu, 22 Aug 2024 11:13:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 43D806B026F; Thu, 22 Aug 2024 11:13:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 26A166B00DC for ; Thu, 22 Aug 2024 11:13:15 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id D97A812180F for ; Thu, 22 Aug 2024 15:13:14 +0000 (UTC) X-FDA: 82480224708.22.EA4873F Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf13.hostedemail.com (Postfix) with ESMTP id 2403B20018 for ; Thu, 22 Aug 2024 15:13:12 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf13.hostedemail.com: domain of joey.gouly@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=joey.gouly@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724339502; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JsKeRVCeIw9Bgaagj+6EgsxIap0Jm8Cb3TcgpNGDGbw=; b=MlBcv8AqWe5ySjFZQbyofhXW3hNXR4vIqYDsJ73hzgi+TU0AiMCpSTVGXRMna1qXOiA+dG N9HXSpP0um9OOCkzY1B2Y+9GB3c7HYV9xHMOe4/QmmpYWOPklR4iCr34VIwAXY03UXme3+ wjpCs+M034padQN2AqbvNBVGMsz6ZnY= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724339502; a=rsa-sha256; cv=none; b=6X700hUQdnrK+aLaqFmYDVDEGW30FrCNwHyKRUJYNLRUixHP5+2mnUCe6IKLDukcAUzFLV 1XvVQhrsDMLhec7OjkA6r4098HfZjOVqcUMSaCulCD1Bl7ejcncR8/PclEBuivSTL9NhjH dpTPSrR5z97TcwwRvKA/RuwfF08dYNU= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf13.hostedemail.com: domain of joey.gouly@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=joey.gouly@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7ED1F1682; Thu, 22 Aug 2024 08:13:38 -0700 (PDT) Received: from e124191.cambridge.arm.com (e124191.cambridge.arm.com [10.1.197.45]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 60AA93F58B; Thu, 22 Aug 2024 08:13:08 -0700 (PDT) From: Joey Gouly To: linux-arm-kernel@lists.infradead.org Cc: nd@arm.com, akpm@linux-foundation.org, aneesh.kumar@kernel.org, aneesh.kumar@linux.ibm.com, anshuman.khandual@arm.com, bp@alien8.de, broonie@kernel.org, catalin.marinas@arm.com, christophe.leroy@csgroup.eu, dave.hansen@linux.intel.com, hpa@zytor.com, joey.gouly@arm.com, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, maz@kernel.org, mingo@redhat.com, mpe@ellerman.id.au, naveen.n.rao@linux.ibm.com, npiggin@gmail.com, oliver.upton@linux.dev, shuah@kernel.org, skhan@linuxfoundation.org, szabolcs.nagy@arm.com, tglx@linutronix.de, will@kernel.org, x86@kernel.org, kvmarm@lists.linux.dev, linux-kselftest@vger.kernel.org Subject: [PATCH v5 25/30] selftests: mm: move fpregs printing Date: Thu, 22 Aug 2024 16:11:08 +0100 Message-Id: <20240822151113.1479789-26-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240822151113.1479789-1-joey.gouly@arm.com> References: <20240822151113.1479789-1-joey.gouly@arm.com> MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 2403B20018 X-Stat-Signature: n5pkfcqipyoxgjyjzbb1ekrs6w3nhb9f X-Rspam-User: X-HE-Tag: 1724339592-637627 X-HE-Meta: U2FsdGVkX1+tPPOuFtk+BatITmH7eAaxX+ODxXZiSg1qFG+HO3LAo96coMzSAC024JM52+boj3IgAz9w2CdKhOz/j3GNXLgn9ED0tUqDv5vSToyJ2j1N4xWN8aLZ60yyd1ysx9kFh37ENGT3rWTH6/Bg7vCWoa5WFhw1vBofEw73IkOxsGsuka9rhgsUbeFRNPchN8mHQfkufWwlGL5X6JCcGh0ESJR8Alw7+qi9z5GdJ0hsBL1cQCFyMMrnSMFz3ebULSZclJUkdvSvmy+aAl7GaO9VCjZciBQNmStptUbCJjowCRjeLds0sFQywuYr53IRvhBLCxKXlc3MU8jKPi/lDb3PHl+iNPDIwQDZPXlCTqFpNq4prQ+L4LkzbcjxKJbqEeCcjYbzPVwlP6oh66dqbSv6eCjYjeCTnmc+OGYYnG3/rXMgiV4NXEbqL+51y8JUT1UFyTX0fdD45f+MCSTNngMWK2f8TeNywr3AadQopQiMfCuO8oAuEXm05C3E9z64vvPn2aiXYrDHJuc2Bm3DPuN3TN1t1Yf97ST8peUIPggcCNBgesueP6SY2jhle6G2rnEtDb0CEoZn6QRrmbjajmr24aQZ0mJ2JLIxKeAdwqcAO9VjneG19s04T8c+ZTYaJ101lmlqALr1s+S3Bxmadravgb+Wgu33MQs+dcJNLMsbQJ9LFsSlqXQeCbNHWRRp1i9TaqE1BePcT/NQtRksDMD1vpXxMNE/oJ3XKn0UXVtr3zDbUc4IC0OBddhWCXD1JxTmwfNtADNNaSlHMN96pDGG6w/SQNrQoO0MB1M1q+v28Gn7goWNucDubvAQBk5b+3froW7DPE6qGMpabAhoAEyAa1+8q6pkOBoiL5N1Wsha33J3MqeEgYvdCHz53wDTSGqsCG86zmJoQRXmXLJ4tJhtpZBwjtkMkW1QYSsydk9A/sG8i2CyMh4DRpFXYbPyCam0ia5q3Qt6Vq7 wj/Mz4td ZC6iM066Hh4nOB0nViWaW1rC2Qdy4nEFathIArRCI4ZKLxbXZ88BDmZznay7lTBME6BYqJF9Fy2vFdE68ceMXZzWlf18TUK64srvB8YRCJJOdYTkvZGvlFi9U6GBrMkDqU09FI2Wu/cP+gFk1EGNPbg1FAokLDhdwef7cjaMHmuT4I8zVqiJD9gOHCG4jVsqA38xVKqr+a/9MakucP0erofuSR7QFStOsX7d2gMO0fMu8Kys+c+W56+0xh/er5fEp1wUJjB1vbkkrxtHs+ouCq6RcItXcmUuy+Tu8mcqy0RHoLTqgM+NcDWUpjiH8L4LSC3+t X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: arm64's fpregs are not at a constant offset from sigcontext. Since this is not an important part of the test, don't print the fpregs pointer on arm64. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon Cc: Andrew Morton Cc: Shuah Khan Cc: Dave Hansen Cc: Aneesh Kumar K.V Acked-by: Dave Hansen --- tools/testing/selftests/mm/pkey-powerpc.h | 1 + tools/testing/selftests/mm/pkey-x86.h | 2 ++ tools/testing/selftests/mm/protection_keys.c | 6 ++++++ 3 files changed, 9 insertions(+) diff --git tools/testing/selftests/mm/pkey-powerpc.h tools/testing/selftests/mm/pkey-powerpc.h index ae5df26104e5..6275d0f474b3 100644 --- tools/testing/selftests/mm/pkey-powerpc.h +++ tools/testing/selftests/mm/pkey-powerpc.h @@ -9,6 +9,7 @@ #endif #define REG_IP_IDX PT_NIP #define REG_TRAPNO PT_TRAP +#define MCONTEXT_FPREGS #define gregs gp_regs #define fpregs fp_regs #define si_pkey_offset 0x20 diff --git tools/testing/selftests/mm/pkey-x86.h tools/testing/selftests/mm/pkey-x86.h index 814758e109c0..b9170a26bfcb 100644 --- tools/testing/selftests/mm/pkey-x86.h +++ tools/testing/selftests/mm/pkey-x86.h @@ -15,6 +15,8 @@ #endif +#define MCONTEXT_FPREGS + #ifndef PKEY_DISABLE_ACCESS # define PKEY_DISABLE_ACCESS 0x1 #endif diff --git tools/testing/selftests/mm/protection_keys.c tools/testing/selftests/mm/protection_keys.c index eaa6d1fc5328..4337106a985e 100644 --- tools/testing/selftests/mm/protection_keys.c +++ tools/testing/selftests/mm/protection_keys.c @@ -314,7 +314,9 @@ void signal_handler(int signum, siginfo_t *si, void *vucontext) ucontext_t *uctxt = vucontext; int trapno; unsigned long ip; +#ifdef MCONTEXT_FPREGS char *fpregs; +#endif #if defined(__i386__) || defined(__x86_64__) /* arch */ u32 *pkey_reg_ptr; int pkey_reg_offset; @@ -330,7 +332,9 @@ void signal_handler(int signum, siginfo_t *si, void *vucontext) trapno = uctxt->uc_mcontext.gregs[REG_TRAPNO]; ip = uctxt->uc_mcontext.gregs[REG_IP_IDX]; +#ifdef MCONTEXT_FPREGS fpregs = (char *) uctxt->uc_mcontext.fpregs; +#endif dprintf2("%s() trapno: %d ip: 0x%016lx info->si_code: %s/%d\n", __func__, trapno, ip, si_code_str(si->si_code), @@ -359,7 +363,9 @@ void signal_handler(int signum, siginfo_t *si, void *vucontext) #endif /* arch */ dprintf1("siginfo: %p\n", si); +#ifdef MCONTEXT_FPREGS dprintf1(" fpregs: %p\n", fpregs); +#endif if ((si->si_code == SEGV_MAPERR) || (si->si_code == SEGV_ACCERR) ||