From patchwork Thu Feb 15 10:31:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Roberts X-Patchwork-Id: 13557859 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 D51CFC48BEB for ; Thu, 15 Feb 2024 10:32:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6B03A6B0088; Thu, 15 Feb 2024 05:32:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5E8458D001E; Thu, 15 Feb 2024 05:32:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 488D88D001D; Thu, 15 Feb 2024 05:32:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 343436B0088 for ; Thu, 15 Feb 2024 05:32:53 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 13A17120F1B for ; Thu, 15 Feb 2024 10:32:53 +0000 (UTC) X-FDA: 81793675026.20.86A1134 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf21.hostedemail.com (Postfix) with ESMTP id 7AAC91C0019 for ; Thu, 15 Feb 2024 10:32:51 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf21.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707993171; a=rsa-sha256; cv=none; b=pJoGn7iFqyy84l6pIWpkbniVo14TE5EAtnbws+XJnC5BnjlzBjziXStqt2QUYeoaJ89lI4 7VXoQ5fWT/+Hg7BAZ7oiQy4e3m23t5ljvlMz96e+ogaoqS3qcsxj06cotDUG/CCXLvHgW8 ROctppPz3KKy63SZPYF/D8IntYUPA+8= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf21.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707993171; 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=NNqJIU65wxbHkraYUk5NQY8zX49rVnFHXTzrcPivxfA=; b=xaWoJ1CgpeN5uEH5YxIZij4A0LRU6s0NHqx64wZbMDynJiRGZz7r47bld6oZB8xMyiqDAZ ysC0YaNU6SHkwTvMmSVxZARvdfsd4JOgL+JNRpJfxnyZ39o98wsplI3lg58oM0SY2jlqMg 6NXdTVuoSRjCKrt13uxATvlILcXM2q4= 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 86F1E1570; Thu, 15 Feb 2024 02:33:31 -0800 (PST) Received: from e125769.cambridge.arm.com (e125769.cambridge.arm.com [10.1.196.26]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7D7603F7B4; Thu, 15 Feb 2024 02:32:47 -0800 (PST) From: Ryan Roberts To: Catalin Marinas , Will Deacon , Ard Biesheuvel , Marc Zyngier , James Morse , Andrey Ryabinin , Andrew Morton , Matthew Wilcox , Mark Rutland , David Hildenbrand , Kefeng Wang , John Hubbard , Zi Yan , Barry Song <21cnbao@gmail.com>, Alistair Popple , Yang Shi , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" Cc: Ryan Roberts , linux-arm-kernel@lists.infradead.org, x86@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 09/18] arm64/mm: Convert ptep_clear() to ptep_get_and_clear() Date: Thu, 15 Feb 2024 10:31:56 +0000 Message-Id: <20240215103205.2607016-10-ryan.roberts@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240215103205.2607016-1-ryan.roberts@arm.com> References: <20240215103205.2607016-1-ryan.roberts@arm.com> MIME-Version: 1.0 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 7AAC91C0019 X-Stat-Signature: o9sn1uf5xcxztdfz1kbsg5nii7fwzbdp X-Rspam-User: X-HE-Tag: 1707993171-329934 X-HE-Meta: U2FsdGVkX188JuuG6Lj2XuoZAY9WsJZwxkBjnDcfuETsDd/NfzD4HbCahq2WZ48chUI8XBPSyY2/w0I6v3WTXlOLv3c8hkCohkb2LQdVSrhhckxbP8mimUDaJVjXsZtfKoaa9nfJkTwWahio3W8Tg9jM/2ugS+24NIYYhC5fssA6EjuQ5LnQ8s7zIotJE6tJdxVLIDncq/ZrvmrM7Mybsc0NhZYXeajvfn7bJqziKjq6mGQbfSpDX2qNfY5fbjOkNyPG7SEO0fAldG8pHU+hRNjY4XiPIjFW7i9a7k9G0in35jlBzfQzDCI5Oyz5FM8O/0JpQpd3hv78JXmpPekyyS99l8hWt+NcdYu+Xq77TGyqmoI+GuMWhGxhTx9S5X0pxPQcQgMAp3odSuLA0vcY+88cxHq9rKUsP9aHsE4afQ0rhSVu3yD+XBE93sFwE4B77VT/0nra6zhswvposT0sW4vLCc/zX1HMqRROz6PdsPrOIJQZxEogMpEsnHCegvQgzqXngv8wqwp8PCp2KDdo3SrvHNWi5AkZxcfwX8hTXaI3kZ0mjLCSHy2lAiL6Z5Ry+tz0fEqVuqbAxET3bny0jGNFh13SLV4xI3CjVhyzoDRb7g5gxmTHCDWQ9ZMYefqNZ1NNit8yRZJhkrbdIZwMrkbOG1kytIU9HME6QzA8dP7dOD2msFnsURsOIYxX5Km908IzsNDzModp41THHa0zdKGhCxJs4NtjWFCiGso9uRyksRGOS5c5uS10kksR5KlqGAz7QwSHVnf51CZBsvjtlaoycVb9fLlWGMb+SY8gRwwVoo2pAcySAdeuuAMkjt4eD6dDkqQ/XRNY8ATnqrV2qHM4FGboo/+bpcB6JZtDKCR069knJfsZ15qpeXBoua6RDDGSJPBp4/O+FylOdAhzok+bBh03nwenGXNqrXC4diFBNG+rdsGJAuhmlKqcztMiyJkdQXQoMtKLvuMH1j/ GkY+hrE2 695qj3SVrA7OSLAYkIZnIvixcfP0gZLm/WI0+/Qzo0QZ8WSTL2MTE9wX1mABF7Bt9tKDF5LjopWgOPF2yq+E+2HYnHvKoCMSP0bKZN8CKz2bn0u/usQ7afad+1LOtQzndcKds2oCEcHyAfRBkiMUZmWJw6QhDwBCHpZXGj2j7CHv8Ibb/fZEA7UPMS5hdUygTCe8z400hwz0tSLuwt3GcdT8d0SfrL8UhX85i7gxlGnbd9S4ehcc506vpMGD6v3uw/7TOGNGfe2DHNts8zT/cY2hYcKvVycAqrSl8SrqEb3CtVM4btLvuhG7iETbwya6u9kL7cM4h0zbB4vZjZWcbeJaLfnt3XlQeIfaL 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: ptep_clear() is a generic wrapper around the arch-implemented ptep_get_and_clear(). We are about to convert ptep_get_and_clear() into a public version and private version (__ptep_get_and_clear()) to support the transparent contpte work. We won't have a private version of ptep_clear() so let's convert it to directly call ptep_get_and_clear(). Tested-by: John Hubbard Signed-off-by: Ryan Roberts Acked-by: Mark Rutland Acked-by: Catalin Marinas --- arch/arm64/mm/hugetlbpage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c index 27f6160890d1..48e8b429879d 100644 --- a/arch/arm64/mm/hugetlbpage.c +++ b/arch/arm64/mm/hugetlbpage.c @@ -229,7 +229,7 @@ static void clear_flush(struct mm_struct *mm, unsigned long i, saddr = addr; for (i = 0; i < ncontig; i++, addr += pgsize, ptep++) - ptep_clear(mm, addr, ptep); + ptep_get_and_clear(mm, addr, ptep); flush_tlb_range(&vma, saddr, addr); }