From patchwork Fri Nov 24 16:35:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13467935 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 D8404C61DF4 for ; Fri, 24 Nov 2023 16:36:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 10A646B0328; Fri, 24 Nov 2023 11:36:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 092616B032E; Fri, 24 Nov 2023 11:36:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E75186B0332; Fri, 24 Nov 2023 11:36:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id D30926B0328 for ; Fri, 24 Nov 2023 11:36:13 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id B5E1516081A for ; Fri, 24 Nov 2023 16:36:13 +0000 (UTC) X-FDA: 81493400226.13.1BC8476 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf04.hostedemail.com (Postfix) with ESMTP id 1CA004002B for ; Fri, 24 Nov 2023 16:36:11 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf04.hostedemail.com: domain of joey.gouly@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=joey.gouly@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1700843772; a=rsa-sha256; cv=none; b=KW+6zbDgZlUfogYbTFtuT6PB+J0dDADi3/fcnhrOUcfuoGX2NR6NPzVO07pVHL/jidWN9f 2qcEX+wSQOtODlS+oHeulu5B/Q3NKMxCelwHEPjZg3tTkTS/+R9bu8Qhqa3k2kJY7HaMQe 146B4y8N9ZBI5UArZt3JRouQ1Nd0gik= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf04.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=1700843772; 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=bFApcpeKH9/aYUB6S7B0VMgouR12oeke1ZWSRkeAv2Mep2J+UQJCTeNohAX1bskP+0jnc9 unEi9KSl6UofPZUa4EsaSj53bgdYpk54vwow1kSpTnntbuizp+WdakcMdKciN0CFq/IF37 OJUhC0P5fkhnTalKYxt5PJqjIEwWuok= 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 00AC61C0A; Fri, 24 Nov 2023 08:36:58 -0800 (PST) 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 515EF3F73F; Fri, 24 Nov 2023 08:36:09 -0800 (PST) From: Joey Gouly To: linux-arm-kernel@lists.infradead.org Cc: akpm@linux-foundation.org, aneesh.kumar@linux.ibm.com, broonie@kernel.org, catalin.marinas@arm.com, dave.hansen@linux.intel.com, joey.gouly@arm.com, maz@kernel.org, oliver.upton@linux.dev, shuah@kernel.org, will@kernel.org, kvmarm@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, James Morse , Suzuki K Poulose , Zenghui Yu Subject: [PATCH v3 20/25] selftests: mm: move fpregs printing Date: Fri, 24 Nov 2023 16:35:05 +0000 Message-Id: <20231124163510.1835740-21-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231124163510.1835740-1-joey.gouly@arm.com> References: <20231124163510.1835740-1-joey.gouly@arm.com> MIME-Version: 1.0 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 1CA004002B X-Stat-Signature: wn73341e7prrcnr7kgto8aguy34hdkbh X-Rspam-User: X-HE-Tag: 1700843771-422929 X-HE-Meta: U2FsdGVkX192sJD3z83gkefdtKQXfeVwR1I5kOvt2txl3MFzj+aQVsxWlLxYs2rRXbUY1zKcaybY34Eo/waSedrDrtfsiz8qz4EEcMPrUqH12xqa169QkxVeUo3hp3lXh5HBJhgh2/xEVMo3hqyVySDNdYQBIr4gHFHWPiFSYDIhLhvZWaGQEpJcOhznnczYjv5O1EqVvqtoVRHCgshVR6KJvrmcBEWB1OJnC/4hxv45JxCo0HV0IerMVNqlOW1pL3QnnX2YdYcCTCf71YZYNfv1ESWOdltc3Ac7iqEliff+QjjG0lPQS9R8yJIKNLWTCkPfghzXHMi7qQqOE29VB65BYDKdJ+jZIg2wnY9ulp4ps0ix4NUrVDf/VwiXI5bcWTNIJlV/cslbV36IHUmOn1BXc/WHnHcnfYeFk71athQYo0SkPHMldAUI5XtZ2GjwjbuqApz59/2t5Px72qk9sOmlV1OdW6j4iuzYUsgCyb1AYbNpbkMXMiWN30zlF/noR58FLqIvLdZNt2m/TY9MgkupAUKCT/mzZ1xMmBbHQe2aHSB3OrUCJPuhbcoKIbWMFcCyHK+aRwfXhsCLpHKZlZHM2yWMFWZK5QO6SJxHTwFHMudwp3LCCY2HhC+0c3GEJNnwWouWhClyQEb/s3Gt/LFhbb60U1lyBkRD9QS3hRWbY/xfBoF2JYQeeVzBkT+JyNYn8YMn33PZsbvFONDGibfablmdA+dG8a6vflEw5m1fxOsym6/ZNv9J2dal8JShRfAIb7urg5nyo+1S5ugmBtQ08be9YaBY0tHOtb9Z8v8DmwMsFoKakWY0m3spbGZ5CoT4Mg9C66/QL/qSM7Lnkvi1/kcO4Px9hfvANZfXGS42EHbqV6I3y23X4s6whHs1gSmkIA72hNRRn8zkVgI+yjZBk1+TRMuwaBXLhjSbql51mkFvKVFZuM5PaFZfxBZqxMyVHycMDQZrzltSIu/ G0gZ9+/w 4Ayf/dX11YcWHM5T2GEI90Bf50Bp0zPOC9v5Jyjg/TOHjxS7+O/r1/5ktRq0vl4024yR9PgxcA+jdwSoPDVtgOb2cmhPdVfW4MKIPgjrAvsuCQsDVEjET/YEzSNJPQg8V82CY+n5TeVdHsox3rBLsZD/D9AoLhSObSVhWDMjHuc+ptd8PQQfl6YLhzEBHuBDfN9iy5EMW4efwz3kljVtw+uiNKo0cY6iW6Ht4rUtTqe2jfu/f41Vc+v6V8NS41851lJk+96FTODkgxqaFQEAh3O7jCn876W19Ts9CXPXqyXmV4TEYluRPK6LwQiFK/jsIwbzu8O2ZDdGAdFQ= 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) ||