From patchwork Mon Dec 9 09:50:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Brodsky X-Patchwork-Id: 13899192 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 629DEE7717D for ; Mon, 9 Dec 2024 09:51:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9FED38D0038; Mon, 9 Dec 2024 04:51:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9874E8D0029; Mon, 9 Dec 2024 04:51:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 801298D0038; Mon, 9 Dec 2024 04:51:02 -0500 (EST) 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 5E8AF8D0029 for ; Mon, 9 Dec 2024 04:51:02 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 2A7FB1602A7 for ; Mon, 9 Dec 2024 09:51:02 +0000 (UTC) X-FDA: 82874951502.05.DBA65E3 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf23.hostedemail.com (Postfix) with ESMTP id F324E14000A for ; Mon, 9 Dec 2024 09:50:46 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=none; spf=pass (imf23.hostedemail.com: domain of kevin.brodsky@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=kevin.brodsky@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=1733737846; 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=w2y+Dg42mIu9JWvjXkfAniTHPccqNpvaYDKwTs4BPKw=; b=IK65EYAHgdKyRkqcKs3kRDBoVnjTVP+XYcsY7PSmGsENCnXlNyjTXfo/mfJUQ3d9SYXfdk L0UCna2/sFszRtZsHfJvfAGQQzomBlnGA4UqhJmWqir+Y+CQCQ/L6P1WNpkRJdO9iIkui5 X0oO9dA+I46Lb6sJNd7pBC+c2ubYqTA= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=none; spf=pass (imf23.hostedemail.com: domain of kevin.brodsky@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=kevin.brodsky@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733737846; a=rsa-sha256; cv=none; b=ai19Gw3HiLmXh2h1yu9KE5sEmDc75kBNPmX9k2JsHMkPJ7tGbo4PC0agrEO/T3zZiC3160 BJqgIQ+cDesY33D+l4WzkCHVxxvdu3oS8zgg/Yajnfioj//RjSu/j6gTUb/wpd7u1UBYQP D+ayqm16EAUCNbAwVysnPueUBQ9QjJo= 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 F0FA0143D; Mon, 9 Dec 2024 01:51:27 -0800 (PST) Received: from e123572-lin.arm.com (e123572-lin.cambridge.arm.com [10.1.194.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E7F5E3F720; Mon, 9 Dec 2024 01:50:57 -0800 (PST) From: Kevin Brodsky To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, Kevin Brodsky , akpm@linux-foundation.org, aruna.ramakrishna@oracle.com, catalin.marinas@arm.com, dave.hansen@linux.intel.com, joey.gouly@arm.com, keith.lucas@oracle.com, ryan.roberts@arm.com, shuah@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, x86@kernel.org Subject: [PATCH 09/14] selftests/mm: Remove empty pkey helper definition Date: Mon, 9 Dec 2024 09:50:14 +0000 Message-ID: <20241209095019.1732120-10-kevin.brodsky@arm.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241209095019.1732120-1-kevin.brodsky@arm.com> References: <20241209095019.1732120-1-kevin.brodsky@arm.com> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Stat-Signature: xhpy3eq1yeeneqq36kpahb5bq5x4efzj X-Rspamd-Queue-Id: F324E14000A X-Rspam-User: X-HE-Tag: 1733737846-487069 X-HE-Meta: U2FsdGVkX195IWZPLZ70oPgKsoOm0ttGf9n1g0JR5xq7kBMsBaCMfbUHaReiE/jvQUZNi7QC0Xryw0f9G3q3pPYCn9Y6KWdnuxqAcfeA6Pd5AuVodSSsGwh9L/uHSSsg1M3K4uvP7c4EX5EbeSWKBwD39e3qnQiSo+lapk+kJdpwOvu8CAclpXOa/5+7eqo2oRMh+fm8jHU1ZtLu+8GsUAYFTlKxK12en2j91XBbxsweDkZQ1s8giQJz6/IHrmCMhD++O04jnnd29YETus4/OKJAnHcKBRrBWpi0+KSwEc2rK8XOlBQJ3cT9h+boZCyZHzgOoPl0vNw8rcZ33oU/RZm/0GXqXGymKAYYcQlEuMzMoBJKHJUaWiSD0ndNARuxunGYZeVcvVFOXX6qwANyvD4cpnVyfYMJiiLvkjWvMLLMk/BxI+kDrnvxt3b/p0PtOfYafsW63rIWPDkRVqnlBXkL6MKBYrPuKEHxbaz56MrZTX0TrelYmZYbx4MgHdhL2RijYsjWtBwAe7HGPEQ5FCPTTg63v1Gh2R0cxfrFe5PhNPP8fzsrylYWXBEmnfJtYH3JKc4X5ZILKA2DaN2k5jm8xYqYhCCTl5ef84ZR7V8jeesxXGcZ07Cx+u15kNOPt9jGmaiZIDwJnMMIyFnxRRTyhQc0kT9Rn24TAF1JlnlQpbCjyp6o2rBuuBMD2BE+T1QXibEyZ4y4mNUsCjSzSb1DB6HtHcv5g0nsyPAPxWVefEjegYtNc7ZfByirHG2BRZ+4sMxC6zTQO+tlnKvSt+bLO0qnQV/8/KVUfWlEN1/i1wOHZfMJBrwEbj0SLDQLr+nWDY7QR2tajSRkrF38Wh/Q9ZWrDdQEXgf18Rwe2zU0IcdhAPjAo+jmbcvXEAOC9jVcwj+xfM89MF5jS5uqGI/h5UFKa2aAzE5AggT0uT4REMqWjyfh918vAptz6zpe0QLTlXu2ZylZMkCVlAz Xv7AjVeS UCCGP9L91YQ4K0EfLZr01BxCp2zEmphQluVkcHoDVU6f4AmY/G1GpJGR/hXOn6Ocjf2hvauIDpbUFECe9Ri5RqDW5NpL1Y5KWaKoa5nQa57gZWuoYk/0x+YQCUGtjNMkFO2jollnaOs7lW0jj0v1dVoaBPV8ZbCEpS8U+Z/CNUh0rlQHh4+oB67bXzD2jjKOXWhp+n/0h1fAlsFoYceGKNa7OVB0hDarVQJThm4qL5ZRhN/CfXshgp/PR0Q== 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: Some of the functions declared in pkey-helpers.h are actually defined in protections_keys.c, meaning they can only be called from protections_keys.c. This is less than ideal, but it is hard to avoid as these helpers are themselves called from inline functions in pkey-.h. Let's at least add a comment clarifying that. We can also remove the empty definition in pkey_sighandler_tests.c: expected_pkey_fault() is not meant to be called from there. Signed-off-by: Kevin Brodsky --- tools/testing/selftests/mm/pkey-helpers.h | 6 ++++-- tools/testing/selftests/mm/pkey_sighandler_tests.c | 2 -- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/mm/pkey-helpers.h b/tools/testing/selftests/mm/pkey-helpers.h index bc81275a89d9..7604cc66ef0e 100644 --- a/tools/testing/selftests/mm/pkey-helpers.h +++ b/tools/testing/selftests/mm/pkey-helpers.h @@ -84,10 +84,12 @@ extern void abort_hooks(void); # define noinline __attribute__((noinline)) #endif -noinline int read_ptr(int *ptr); -void expected_pkey_fault(int pkey); int sys_pkey_alloc(unsigned long flags, unsigned long init_val); int sys_pkey_free(unsigned long pkey); + +/* For functions called from protection_keys.c only */ +noinline int read_ptr(int *ptr); +void expected_pkey_fault(int pkey); int mprotect_pkey(void *ptr, size_t size, unsigned long orig_prot, unsigned long pkey); void record_pkey_malloc(void *ptr, long size, int prot); diff --git a/tools/testing/selftests/mm/pkey_sighandler_tests.c b/tools/testing/selftests/mm/pkey_sighandler_tests.c index e7b91794f184..d18e38b19792 100644 --- a/tools/testing/selftests/mm/pkey_sighandler_tests.c +++ b/tools/testing/selftests/mm/pkey_sighandler_tests.c @@ -32,8 +32,6 @@ #define STACK_SIZE PTHREAD_STACK_MIN -void expected_pkey_fault(int pkey) {} - pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t cond = PTHREAD_COND_INITIALIZER; siginfo_t siginfo = {0};