From patchwork Mon Dec 9 09:50:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Brodsky X-Patchwork-Id: 13899189 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 A4A03E7717D for ; Mon, 9 Dec 2024 09:50:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2F9E48D0035; Mon, 9 Dec 2024 04:50:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 281BA8D0029; Mon, 9 Dec 2024 04:50:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 039888D0035; Mon, 9 Dec 2024 04:50:55 -0500 (EST) 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 C286E8D0029 for ; Mon, 9 Dec 2024 04:50:55 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 78FEB1A02E4 for ; Mon, 9 Dec 2024 09:50:55 +0000 (UTC) X-FDA: 82874951082.12.A2C2223 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf29.hostedemail.com (Postfix) with ESMTP id EA8FC120015 for ; Mon, 9 Dec 2024 09:50:24 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf29.hostedemail.com: domain of kevin.brodsky@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=kevin.brodsky@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733737844; 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=UOq30mCTMw8bLBxJLSt678CfNIOCZrff0ceauMXHs6E=; b=gwt5sjQMg0NFCyAvtk3ANO7sBTsRgDad/dGlLlni2g3gEPe2X2I1sYCnjWhqgMR3DzL5YZ WTpsl/5UibJEDSusxDRmsNx8msC+/zURN7vECEm1XDeoizpLAHj2lsQN2Zzvhuv/JBH+Il RNXj6KtW5U8GYKc+CbyfOIOWdl8iX+Y= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733737844; a=rsa-sha256; cv=none; b=me++k5q4OdbuIHSDyaj6ovmlsGyBMNZPZq6dUHATKXKJ66+ki/p0kovrpTefQMSeVovKCN FThMfu7Pq8TBYSvcY5WvMw+I1ZCiruJcGfdaGsechsGt1elFvBr40e2/OXxlJKMfkSAOe6 D3bwdxhLKwi7Nu0wJSPC9LyQiVTrHUE= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf29.hostedemail.com: domain of kevin.brodsky@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=kevin.brodsky@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 20D711650; Mon, 9 Dec 2024 01:51:21 -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 173E63F720; Mon, 9 Dec 2024 01:50:50 -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 06/14] selftests/mm: Remove unused pkey helpers Date: Mon, 9 Dec 2024 09:50:11 +0000 Message-ID: <20241209095019.1732120-7-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-Stat-Signature: ify9qw3rjqu9hiiwn6cqhpsbosaon9d6 X-Rspamd-Queue-Id: EA8FC120015 X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1733737824-129822 X-HE-Meta: U2FsdGVkX1/0/EcFRmbr89Qc7dwofFh8kj1sYBWskhsbu8c+P4wvjwXo6s3ousoAmK+y9FbY2zN/nj1gGAc18KBpv5m5DnGTaKEEAzWfuY1qm4sOJpJPZ3HrM67n/ooGbhAq4dxcXkd21oS5ydn6CXjx79UWwt3HJqkA9woUwc1bBFRxqyUvh+h+Q8VJfQBWpnxlpE0jm2Dm532jn7f6MneDyyKNu2hv9dVJAW2Mj/oR00Y7lZzogoOf4Ka2gox7UEr4PpixImxd6i6FG+Ojk5h4vW/KFdf4vOeAwTDMYWD0qKLk9UOMbrmeRL0Y6buBU+hCdjQk+4PpCut3isXs0mStiJECakmK5lrQ4worl/WEb+MKn/GOe3iZmhrdWlMAa9zKRFZ03A+tirs73oVzELN6lyMViv8wd68TRqu24zJwBLIG+NGg9TKvUlttK1xm95SDt7GejdXiQcHi7Y0gf8hgtATYUhwLYyxufITJ2RjcujHoQSZQrO0EbqRN1KBpIhYz5hFXGcACz20q2dMTi7QDE1Wz1WC8j3iEciOi5KwIUX5ilvBZmR0fFr3Mjtjn6VbGurmAOE6FtP/VLblzcZtajr18eSMsBhF3NuPXL3hVfpA0XTXinGZ2La1rpXTXtNV5k5SBDNyqfTk0348jd0KiAJtYcH8qU9LimkkUan0urH7oFRbWqRRNSRqPSTQDnPyet9aq+uPxR8EuImR0yXCAk77UtrelXRD3FnBSMb2wzXxIJaFj9fb2p0tXMp6g0tzAhBHY4QnAgHG5iRDrFUcKow/0DKr0Y18NJMx/+Y6tKqUF/yQCT8OdNIgtMYMvgse+mEReO9VtwLwjU0GQWv6kFsIo2e+3jPD+zz+5rNWz0qqoPt8gDcyxa40ghzG5Wq533B2piA6bn5iDdm+goyDI+sgmMFi5uZPE0uzlzaa6LqC4yncYv4KcQA0NbL1E/0jKWI95dsqQtBlq5yu 3C7Ctyir tUA5cZ+GB0CNNMm61AND9wanHzvfFbMBa/bIvdZwElIzZYaiOGeWPsC3onQFkT8YCGFrJcf03Wj5FClcSkY+ERGOy64DMfM69GFtUhrwjouXwHMYIOLqFgA09OOa6e2m+Rs+ffM2PsgfRGBpbQ0M2+Rdh5oRBSmDfY9J0uzBxruQFWh9IQImK6YI91hjRLiJvnu6pVRXxWhqvuhEfaF7mbpXTe3FOfJb7tbLhxw3jPHRc5XYng1saENKvkQ== 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: Commit 5f23f6d082a9 ("x86/pkeys: Add self-tests") introduced a number of helpers and functions that don't seem to have ever been used. Let's remove them. Signed-off-by: Kevin Brodsky --- tools/testing/selftests/mm/pkey-helpers.h | 34 -------------------- tools/testing/selftests/mm/protection_keys.c | 34 -------------------- 2 files changed, 68 deletions(-) diff --git a/tools/testing/selftests/mm/pkey-helpers.h b/tools/testing/selftests/mm/pkey-helpers.h index f7cfe163b0ff..472febd992eb 100644 --- a/tools/testing/selftests/mm/pkey-helpers.h +++ b/tools/testing/selftests/mm/pkey-helpers.h @@ -26,9 +26,7 @@ #ifndef DEBUG_LEVEL #define DEBUG_LEVEL 0 #endif -#define DPRINT_IN_SIGNAL_BUF_SIZE 4096 extern int dprint_in_signal; -extern char dprint_in_signal_buffer[DPRINT_IN_SIGNAL_BUF_SIZE]; extern int test_nr; extern int iteration_nr; @@ -171,38 +169,6 @@ static inline void write_pkey_reg(u64 pkey_reg) pkey_reg, __read_pkey_reg()); } -/* - * These are technically racy. since something could - * change PKEY register between the read and the write. - */ -static inline void __pkey_access_allow(int pkey, int do_allow) -{ - u64 pkey_reg = read_pkey_reg(); - int bit = pkey * 2; - - if (do_allow) - pkey_reg &= (1<= 0); - - ptr = mmap(0, size, prot, MAP_SHARED, fd, 0); - pkey_assert(ptr != (void *)-1); - - mprotect_pkey(ptr, size, prot, pkey); - - record_pkey_malloc(ptr, size, prot); - - dprintf1("mmap()'d for pkey %d @ %p\n", pkey, ptr); - close(fd); - return ptr; -} - void *(*pkey_malloc[])(long size, int prot, u16 pkey) = { malloc_pkey_with_mprotect, malloc_pkey_with_mprotect_subpage, malloc_pkey_anon_huge, malloc_pkey_hugetlb -/* can not do direct with the pkey_mprotect() API: - malloc_pkey_mmap_direct, - malloc_pkey_mmap_dax, -*/ }; void *malloc_pkey(long size, int prot, u16 pkey)