From patchwork Fri May 3 13:01:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13652803 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 9DD38C4345F for ; Fri, 3 May 2024 13:03:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2A62C6B00BF; Fri, 3 May 2024 09:03:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 22C456B00C1; Fri, 3 May 2024 09:03:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 07F5D6B00C2; Fri, 3 May 2024 09:03:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id D843A6B00BF for ; Fri, 3 May 2024 09:03:17 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 996A51C1811 for ; Fri, 3 May 2024 13:03:17 +0000 (UTC) X-FDA: 82077100434.07.AEFC882 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf01.hostedemail.com (Postfix) with ESMTP id CD3C84001A for ; Fri, 3 May 2024 13:03:15 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf01.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=1714741396; 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=Nf0bnlih327pJ9LVoEnFCmIEPGMwPw+b0fVcM0ZWIqM=; b=Y0+VoZypuU8JRSMJSNGgWk3bWUBf5bEh3QrS6uYbTSpfEwgzaiBVcZoaB4t8fHlskkM7Oy cLKZPhs798661/AFGszFb6xcdnLLYGYw1LnabOIvC6xrzL1e8d9TMwXMxmiQKzdc7HF6RM XIArusW+Rx+zX54iVt83bCf3C+gQNSo= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1714741396; a=rsa-sha256; cv=none; b=RfIaMHjBakEM/roOIgTJI9Lm7uSNoZknVY+VRlfWlCEAICdC7n4IKWDqIycd9Sdjf6Z9rZ 5+KLokZ0yDepo/pbOqLr+e8g1L2LFLRNIKtLN1tkudqwKjBeX85hYMAskhl3blTGZFmSWy Kx3V2ExS2+L5vludVPHMu2N453vPjgA= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf01.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 6752F1756; Fri, 3 May 2024 06:03:40 -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 0FFD63F73F; Fri, 3 May 2024 06:03:11 -0700 (PDT) From: Joey Gouly To: linux-arm-kernel@lists.infradead.org Cc: akpm@linux-foundation.org, aneesh.kumar@kernel.org, aneesh.kumar@linux.ibm.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, szabolcs.nagy@arm.com, tglx@linutronix.de, will@kernel.org, x86@kernel.org, kvmarm@lists.linux.dev Subject: [PATCH v4 24/29] selftests: mm: move fpregs printing Date: Fri, 3 May 2024 14:01:42 +0100 Message-Id: <20240503130147.1154804-25-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240503130147.1154804-1-joey.gouly@arm.com> References: <20240503130147.1154804-1-joey.gouly@arm.com> MIME-Version: 1.0 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: CD3C84001A X-Stat-Signature: g114c8uia6suu3u385cckiwm87gc7us7 X-Rspam-User: X-HE-Tag: 1714741395-327735 X-HE-Meta: U2FsdGVkX19yIjcThxu5+5ZxSD0mMxAvARwBCJ7DF1EMW/VUHPPyPpRPLMv0ONfUeF7HHA3vvq3Q9Ona5dji9OjiZy18PiLFS8X24QL92MykAJ/qs/S1nfVcZkvmq7ZlX8WitV3XH743YAtEeRoxNYTKVZbcRwUsd+ecEMnu+M8MtRWeoptERLbka/tke9uv93p9011hSVAvFTTQrZ9RddjiUbfsYJodoycMdtcBc846cgPTlMThpmqvuu9sja3NG8yPnCMy4BS82hpSXtbEn7LF3TwRVMtlhmmnALtW4a7vu16XsNkc0M4mNiNCVM2zF1i5KLh57vplCLg3hbkyZyyB+h19uNW0uZQHZtYNenrR9EOhYIhwqIcOauqFqFU8cgHb0AIZE8Adxhen1Q2ARwQzqbd1ozOZ2W7xi8uBg0xreTh7oH/TJiTGvIOMBVCyMau6i8o4fOdK64OFImTJmrRqR1/yC9wNw4bqUR3wO6Mllh9jVcP0Hll1Njln+o7oFPYXVaHy9CV6A4EV/CYeUwQXnQegIqC3d3K8+dtG91CqSC0oEcN0ar8tQu4vZmC3u+RcAnW6/P4YVTy2wthChzsUUbo2DmzaDWTxYS0uw+Z4MLm9o5G6sFquSemfTjxnr3sBdGS7CpPv/YLCjbAokHGx0Fn9+K4SFwIkBON/gwolVpYFmQ/VflilLJk3/DLVRNnZ8NgdQbIlKsfT/VaDx+CDBn/fLxtjTJTqlxsKyzt4la5gMN+g6c3+YYryjNDgtE9BPUR/gSHYZckWS2/KC6S2JHSW6kebSP/MwztgysAgH2h3fv+q28/IfI/ia2MdHH9oLwEMfSMWeSA+ScKbZgLaUsT4v7AgE9+YYPyDeXuXeh20A91ivDpT1CNdAEpaLX9RwZI68lCYjj2U3lJer8wZ2mh8dP4u+KoXNKUR94B9hbjQYgPLffXw9G1P/fMCyngzZqe5Wa3PPxtcD8a qe+5f1oB HT2s+TTVTiK/ugKpRBOsfg8xgfYEXwJWTBLB7jLoacupt8m0R9iEMWdw78ITtSvaX5px6IGMVuaednrMDkZ7GmA4R4/sHH+HuZcAxkBfytHFkb0l+bXPzGF1fa51nPl35ANwt+WFBF5qgbg8bhd3EJBp5imtk8sbYaD1zqVba+uVsyyoqvmA0NJ195CYIqNrKeXusZl7VcdecKWdvrH1m1jjNZ4RLtEwgc1ON++ugGu/p3TcKz8guxNpSPSxl2PJE+PqRHvsLyJgy5tZkQPHd5IX7crhsad6YoiZAxAl3M9Ho+mLaMuHTx+iu5ADDNoJxNSLH 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 a/tools/testing/selftests/mm/pkey-powerpc.h b/tools/testing/selftests/mm/pkey-powerpc.h index ae5df26104e5..6275d0f474b3 100644 --- a/tools/testing/selftests/mm/pkey-powerpc.h +++ b/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 a/tools/testing/selftests/mm/pkey-x86.h b/tools/testing/selftests/mm/pkey-x86.h index 814758e109c0..b9170a26bfcb 100644 --- a/tools/testing/selftests/mm/pkey-x86.h +++ b/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 a/tools/testing/selftests/mm/protection_keys.c b/tools/testing/selftests/mm/protection_keys.c index 48dc151f8fca..b3dbd76ea27c 100644 --- a/tools/testing/selftests/mm/protection_keys.c +++ b/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) ||