From patchwork Fri Oct 27 18:08:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13438790 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 496EDC25B47 for ; Fri, 27 Oct 2023 18:09:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4653C6B03E8; Fri, 27 Oct 2023 14:09:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 414CE6B03E9; Fri, 27 Oct 2023 14:09:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 28E2B6B03EA; Fri, 27 Oct 2023 14:09:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 168B06B03E8 for ; Fri, 27 Oct 2023 14:09:53 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id D6EA6A09CB for ; Fri, 27 Oct 2023 18:09:52 +0000 (UTC) X-FDA: 81392029824.03.97D44D5 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf22.hostedemail.com (Postfix) with ESMTP id 2C20EC0007 for ; Fri, 27 Oct 2023 18:09:51 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=none; spf=pass (imf22.hostedemail.com: domain of joey.gouly@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=joey.gouly@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1698430191; 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=mahUG169CRYo2ClgSeGU5ApVWY5clwKRz3GhLChJo3HJIW3UyJyo91JUtmCgZW6bciMwFU CI50BQnB0yQldmE+p5FCw6WeQ/2anVEsSE+MMWk1UjZTWcs4/BakXk0STW3z7XVdvKjprb tEze7Jq+LPEAzJ9dpLeb/ceF3cwq//s= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1698430191; a=rsa-sha256; cv=none; b=lNW/72UQrCScI3r6gMtGiO626REKlg1xrn9GdXZwTjlynsWJLl6eI6jExNR+U34g+XiX+0 o7cJql8x3d2RR8UO7lNrsxMOwxxuTJx6BFPKF3IMg3SxKcqol2y3qTb/lWOMsYdIKKuUTh 5/YzkazNQcARdieSrVxtwphbHHPos18= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=none; spf=pass (imf22.hostedemail.com: domain of joey.gouly@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=joey.gouly@arm.com; dmarc=pass (policy=none) header.from=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 35F2C143D; Fri, 27 Oct 2023 11:10:32 -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 67EAA3F64C; Fri, 27 Oct 2023 11:09:48 -0700 (PDT) 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 v2 19/24] selftests: mm: move fpregs printing Date: Fri, 27 Oct 2023 19:08:45 +0100 Message-Id: <20231027180850.1068089-20-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231027180850.1068089-1-joey.gouly@arm.com> References: <20231027180850.1068089-1-joey.gouly@arm.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 2C20EC0007 X-Rspam-User: X-Stat-Signature: kwqyg7chtobahggefjiejeses11iizho X-Rspamd-Server: rspam03 X-HE-Tag: 1698430191-623552 X-HE-Meta: U2FsdGVkX1+XmKaPTbNXwdzrtuhlXY8s9yF67DKqROphPEKsevKzJLs0WlZwREWsETU66kClYe5xokm87RA2Vkn5QkglCEyzj/Wi0pambtdde1ooQ9pquGpDqFh7m0Kn6Wp/R/Lij3azariZ+h4E6elkOiiKfaFzd1sxz0z4s/WpNRK4wD5dYEHa9cG3J9NQEqdV8wqfRxzGTSOLG8qqpyl1KWBUqT94IbrTjHjtbQX1isp5Sz5qzst1tjjZL/xw1YNR0tK3ptaMJyo2W4qLFJ/2HJjA+NhYG6n0tyeZzablP88DXfaMR1M31Hies+H/Yxxaa3APmaEmyZiGUmVkhaKOaAISDiO2VNCuqf0b/mpeSjQSGYPBgw52LNHtpRP20nd4yhaHE6KdtK+FIdr3IyudlyceD2TZ4hMREyhi6KGb5mqqujEs7BU5bT4A5sDh19Pb6koG2wwDekcqAI+UN7D05LAXvjkau+0K/XaesLoop6IvJVC5OKknn74T/9jvvhHKB6Cj9F93pXohb1GnYvM0z/7CbffMN1rx/XlUJzNuLLwubDN7lvrVzOfZ1LdfYERIyaaANEPd+JjBWQHtumoVTrBOmsaJ1fzsabNabT1fRT3WLfxJaI5kms42zVsVyHyt2I8e3RrpQ5Yx/8xLZVyNPZd0ugi/OkPjGJTzUOF0QRdwdrsJNde356g0HvQaEm094xmKr1NeVr4mbVdB5mcczz3JYq6QyBwzh2pWPBxGHSn5H+enD8l7NQvhmuJvSAA0C2vXH8C87cjnbeIFNOxMbjdK6V7SseO5UiQ7X6kTCiTwswEBC7u7TKPd9VgyiNLwjrOkA5abOb+LY9mHtGkGpnpMbn5V7dmXKVhjGSEl0JwRtjIS46w7f9xs19AupFTdrAKWlsbQAvAUQWza/OT+1e5tY+PJeK3WqorZzKpU0gTkuwfTGojzAjxeb7XXY3HILoVp1qs/kPA1ioo qp9EoUbk ueIOqYPvvPaWxF8fRs6g3G/6SOVHUl+bO8XOWfOwWikQgjKWF4X9VamxPOLt66auKKxsy8Kz3llWSca3VpfS4HvmmTxLK+VzirtLnxmogQhS/3SRc8vggk+ojZHFvY6IhlEhmhQdf3539hLyXdtcNAQq8z6et3dW07NpScRM8b9Sb9DkgOyzrk6RgjptIdrRxXskf24QbmNz7k3imn4mLMmTPf4HRl1+X6q8+w/lmFicUP/2zHqiq76odVqb1BL/ad4pGK3Zn+W2o0eZazZUmqRbxJtaYhoQHLvs791fVCBwBXnVnSW5E6AjZxGVBUHVcH7Cp 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) ||