From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C37E0C77B7C for ; Wed, 25 Jun 2025 06:43:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=38JUqnmMvQ5EuRM069Y/fd06J//BHQwkg7HugjQcG2I=; b=FxHFSj9bzspRVNqKbEVPUW+bMS U2z6rxFh+3JLSRjstKkrkXuy8o1NEFyeEF1vwnW6Bz2uF4OBppsCJ49D/ST7BFMS3y4cYX+mOiT+6 J5cfDUFPOPd1jgTOl811AtFloVQtkcbBrJjYMTwhnOlhSjVw2AZspxUmyJmzbPBw4jOaIfwCdqtd+ OnZkCT1ePTspEnwFP5d4PBLioCub/SZWW9TcJXE5I+nN+RFD3UWTiV2iQjFwe6GTvsCYlLw+2w5Ue OEK2npRmdkU8Vw8bYVjXvGgSKTjMDPkSWLqw38Y3JPrXJ5hNSpz7g6OA2/0qDP3Bu5aEzllYr7U40 JxJEoSdQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uUJqk-00000007hIj-036w; Wed, 25 Jun 2025 06:43:14 +0000 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uUJmq-00000007gWS-3otN; Wed, 25 Jun 2025 06:39:14 +0000 Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 55P2O5Zt008193; Wed, 25 Jun 2025 06:39:04 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=38JUqnmMvQ5EuRM06 9Y/fd06J//BHQwkg7HugjQcG2I=; b=pYYiZ1MDMq/9NG1mbqLUAZ7E9B8k2x46/ EYXBq3xhKLKvhf3TAlQxMinoXLWyG4JiFG+ZscZGtH8RdPg6OXJpPIAqqpJhCuqy Gn3zHsX+s4Es0h26syAF/AuanmXg3i0mdQLbvh+d6OmVG04Lss8YKvpDdr3wRPlo ZYrmpErmgZgTfknYVmGMmCIxiwSId6djPskEQh3DhQ6urdNkLDRPpI+4mGVoQdnp 2CudTe0lCSCWxGF8v5TSl4PTgETspvgibWQ1RgS3qxV8jrPUea/8nRLMYq8gYvwk hJITJepDZ0eqDddWVTFXKQRS/XpnhRhOpFE4fWbf2QOuaaJJNdLTA== Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 47dj5twg3p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 25 Jun 2025 06:39:03 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 55P32mdp003989; Wed, 25 Jun 2025 06:39:02 GMT Received: from smtprelay02.wdc07v.mail.ibm.com ([172.16.1.69]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 47e99kqq4x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 25 Jun 2025 06:39:02 +0000 Received: from smtpav02.dal12v.mail.ibm.com (smtpav02.dal12v.mail.ibm.com [10.241.53.101]) by smtprelay02.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 55P6d19o26870340 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Jun 2025 06:39:02 GMT Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B178B588F2; Wed, 25 Jun 2025 06:39:01 +0000 (GMT) Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 093DA588E2; Wed, 25 Jun 2025 06:38:57 +0000 (GMT) Received: from jarvis.ozlabs.ibm.com.com (unknown [9.36.18.35]) by smtpav02.dal12v.mail.ibm.com (Postfix) with ESMTP; Wed, 25 Jun 2025 06:38:51 +0000 (GMT) From: Andrew Donnellan To: linuxppc-dev@lists.ozlabs.org, pasha.tatashin@soleen.com, akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, x86@kernel.org, linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, sweettea-kernel@dorminy.me, christophe.leroy@csgroup.eu, mingo@kernel.org Subject: [PATCH v15 06/13] mm/page_table_check: Reinstate address parameter in [__]page_table_check_pud_clear() Date: Wed, 25 Jun 2025 16:37:46 +1000 Message-ID: <20250625063753.77511-7-ajd@linux.ibm.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250625063753.77511-1-ajd@linux.ibm.com> References: <20250625063753.77511-1-ajd@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: Z47N1cbQhimo-l2AzNSEI6V8jfUK-36n X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjI1MDA0NSBTYWx0ZWRfX5aJ1GyCyt+lF RNkSPUbQAiFCg2w9HFwZ5wnxrZBEiDB324ljkSwuZE0PRfCiUY/GGBiiyH96909WjzSdwylTxrt 2mBtYPLlhRZgyXo0yWqmx9Nzb3hBvDmKn7XJaLlFIvwmRlsciigeO/dKefMvl842D8uVxg6ITlW bv9XUKhVFLmihfIGOAirKO9H6IksjWFEVbREh4YIseKDnYGUtN2692uDui3PW+jopomfpP7syed z9GqcqQTtP3U5dOSKo5XsdLB3wDmPGRapnJfLpuvph+nsOa8013fUGkNuSNl9Liu2iDTXljHweI 0+NvTFNh3iEFdkGwMUqUcI632Dc023XL0CUz9ECN8Y0Bv0LGiRQJ7fv2svvL/C0bGrwj7LsIn7z +qSBD8bpE9cPw0AIMeXo5kS3zcFX33mYIZ+r3HqaZtc035AOTdwOOAvDVsIN7vegF6BqV1G9 X-Authority-Analysis: v=2.4 cv=MshS63ae c=1 sm=1 tr=0 ts=685b9987 cx=c_pps a=AfN7/Ok6k8XGzOShvHwTGQ==:117 a=AfN7/Ok6k8XGzOShvHwTGQ==:17 a=6IFa9wvqVegA:10 a=VnNF1IyMAAAA:8 a=7ipKWUHlAAAA:8 a=VwQbUJbxAAAA:8 a=ocrGMPNeQj1hKc7Dx3AA:9 a=gpc5p9EgBqZVLdJeV_V1:22 X-Proofpoint-GUID: Z47N1cbQhimo-l2AzNSEI6V8jfUK-36n X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.7,FMLib:17.12.80.40 definitions=2025-06-25_01,2025-06-23_07,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 bulkscore=0 lowpriorityscore=0 spamscore=0 mlxlogscore=916 impostorscore=0 clxscore=1011 phishscore=0 malwarescore=0 suspectscore=0 adultscore=0 priorityscore=1501 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2506250045 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250624_233913_069380_2F5EDE8B X-CRM114-Status: GOOD ( 15.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Rohan McLure This reverts commit 931c38e16499 ("mm/page_table_check: remove unused parameter in [__]page_table_check_pud_clear"). Reinstate previously unused parameters for the purpose of supporting powerpc platforms, as many do not encode user/kernel ownership of the page in the pte, but instead in the address of the access. [ajd@linux.ibm.com: rebase on arm64 changes] Signed-off-by: Rohan McLure Reviewed-by: Pasha Tatashin Acked-by: Ingo Molnar # x86 Signed-off-by: Andrew Donnellan --- v15: rebase --- arch/arm64/include/asm/pgtable.h | 2 +- arch/x86/include/asm/pgtable.h | 2 +- include/linux/page_table_check.h | 11 +++++++---- include/linux/pgtable.h | 2 +- mm/page_table_check.c | 5 +++-- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 383c01f9cae9..72ccbd810b13 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -1398,7 +1398,7 @@ static inline pte_t __ptep_get_and_clear_anysz(struct mm_struct *mm, break; #ifndef __PAGETABLE_PMD_FOLDED case PUD_SIZE: - page_table_check_pud_clear(mm, pte_pud(pte)); + page_table_check_pud_clear(mm, address, pte_pud(pte)); break; #endif default: diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 995ca7e6e0e9..4d6da32e77a6 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h @@ -1376,7 +1376,7 @@ static inline pud_t pudp_huge_get_and_clear(struct mm_struct *mm, { pud_t pud = native_pudp_get_and_clear(pudp); - page_table_check_pud_clear(mm, pud); + page_table_check_pud_clear(mm, addr, pud); return pud; } diff --git a/include/linux/page_table_check.h b/include/linux/page_table_check.h index 66e109238416..808cc3a48c28 100644 --- a/include/linux/page_table_check.h +++ b/include/linux/page_table_check.h @@ -16,7 +16,8 @@ extern struct page_ext_operations page_table_check_ops; void __page_table_check_zero(struct page *page, unsigned int order); void __page_table_check_pte_clear(struct mm_struct *mm, pte_t pte); void __page_table_check_pmd_clear(struct mm_struct *mm, pmd_t pmd); -void __page_table_check_pud_clear(struct mm_struct *mm, pud_t pud); +void __page_table_check_pud_clear(struct mm_struct *mm, unsigned long addr, + pud_t pud); void __page_table_check_ptes_set(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte, unsigned int nr); void __page_table_check_pmds_set(struct mm_struct *mm, unsigned long addr, @@ -59,12 +60,13 @@ static inline void page_table_check_pmd_clear(struct mm_struct *mm, pmd_t pmd) __page_table_check_pmd_clear(mm, pmd); } -static inline void page_table_check_pud_clear(struct mm_struct *mm, pud_t pud) +static inline void page_table_check_pud_clear(struct mm_struct *mm, + unsigned long addr, pud_t pud) { if (static_branch_likely(&page_table_check_disabled)) return; - __page_table_check_pud_clear(mm, pud); + __page_table_check_pud_clear(mm, addr, pud); } static inline void page_table_check_ptes_set(struct mm_struct *mm, @@ -123,7 +125,8 @@ static inline void page_table_check_pmd_clear(struct mm_struct *mm, pmd_t pmd) { } -static inline void page_table_check_pud_clear(struct mm_struct *mm, pud_t pud) +static inline void page_table_check_pud_clear(struct mm_struct *mm, + unsigned long addr, pud_t pud) { } diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index d06b5fec9540..765451864de3 100644 --- a/include/linux/pgtable.h +++ b/include/linux/pgtable.h @@ -650,7 +650,7 @@ static inline pud_t pudp_huge_get_and_clear(struct mm_struct *mm, pud_t pud = *pudp; pud_clear(pudp); - page_table_check_pud_clear(mm, pud); + page_table_check_pud_clear(mm, address, pud); return pud; } diff --git a/mm/page_table_check.c b/mm/page_table_check.c index 0957767a2940..bd1242087a35 100644 --- a/mm/page_table_check.c +++ b/mm/page_table_check.c @@ -167,7 +167,8 @@ void __page_table_check_pmd_clear(struct mm_struct *mm, pmd_t pmd) } EXPORT_SYMBOL(__page_table_check_pmd_clear); -void __page_table_check_pud_clear(struct mm_struct *mm, pud_t pud) +void __page_table_check_pud_clear(struct mm_struct *mm, unsigned long addr, + pud_t pud) { if (&init_mm == mm) return; @@ -246,7 +247,7 @@ void __page_table_check_puds_set(struct mm_struct *mm, unsigned long addr, return; for (i = 0; i < nr; i++) - __page_table_check_pud_clear(mm, *(pudp + i)); + __page_table_check_pud_clear(mm, addr + PUD_SIZE * i, *(pudp + i)); if (pud_user_accessible_page(pud)) page_table_check_set(pud_pfn(pud), stride * nr, pud_write(pud)); } -- 2.49.0 From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BFDD0C77B7C for ; Wed, 25 Jun 2025 06:40:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rchy93k7KMS8tI/v1HWJHUIs0p+FDSpkTU9/bXJ0RO0=; b=2s00J5S33Al/gQ yyUhlcJSqftKzitPGfgD8VhQ6rOFv/apeeLj3Ig/j8wkX4h2MzP3OsUEyHApm+0ILSzvKPeUlSerm OhUdHpTB558gknOtBprkEZiKldiylI+mRWsqvp0KSdkSdcUlKxD8ErHVaLAkx3JQlFb1OojunpY6y jZ2QklHOQ/dTFH2/FPoIGQzaKNpFdr6izau02BvgCoKJPEtvyrYcYjYL+I7cD8gNulGa2kAel0LKh ZS3Abk2aEFuprpDZzDEPFEpsE7s6f2Bb5+BSVkcS/KuPxnc+76Pv3pxd0TfEeg3ptcR3q1Vyxxh3A ihsRnfp9MIxr9v3Skclg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uUJoT-00000007gxo-0aNa; Wed, 25 Jun 2025 06:40:53 +0000 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uUJmq-00000007gWS-3otN; Wed, 25 Jun 2025 06:39:14 +0000 Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 55P2O5Zt008193; Wed, 25 Jun 2025 06:39:04 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=38JUqnmMvQ5EuRM06 9Y/fd06J//BHQwkg7HugjQcG2I=; b=pYYiZ1MDMq/9NG1mbqLUAZ7E9B8k2x46/ EYXBq3xhKLKvhf3TAlQxMinoXLWyG4JiFG+ZscZGtH8RdPg6OXJpPIAqqpJhCuqy Gn3zHsX+s4Es0h26syAF/AuanmXg3i0mdQLbvh+d6OmVG04Lss8YKvpDdr3wRPlo ZYrmpErmgZgTfknYVmGMmCIxiwSId6djPskEQh3DhQ6urdNkLDRPpI+4mGVoQdnp 2CudTe0lCSCWxGF8v5TSl4PTgETspvgibWQ1RgS3qxV8jrPUea/8nRLMYq8gYvwk hJITJepDZ0eqDddWVTFXKQRS/XpnhRhOpFE4fWbf2QOuaaJJNdLTA== Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 47dj5twg3p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 25 Jun 2025 06:39:03 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 55P32mdp003989; Wed, 25 Jun 2025 06:39:02 GMT Received: from smtprelay02.wdc07v.mail.ibm.com ([172.16.1.69]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 47e99kqq4x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 25 Jun 2025 06:39:02 +0000 Received: from smtpav02.dal12v.mail.ibm.com (smtpav02.dal12v.mail.ibm.com [10.241.53.101]) by smtprelay02.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 55P6d19o26870340 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Jun 2025 06:39:02 GMT Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B178B588F2; Wed, 25 Jun 2025 06:39:01 +0000 (GMT) Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 093DA588E2; Wed, 25 Jun 2025 06:38:57 +0000 (GMT) Received: from jarvis.ozlabs.ibm.com.com (unknown [9.36.18.35]) by smtpav02.dal12v.mail.ibm.com (Postfix) with ESMTP; Wed, 25 Jun 2025 06:38:51 +0000 (GMT) From: Andrew Donnellan To: linuxppc-dev@lists.ozlabs.org, pasha.tatashin@soleen.com, akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, x86@kernel.org, linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, sweettea-kernel@dorminy.me, christophe.leroy@csgroup.eu, mingo@kernel.org Subject: [PATCH v15 06/13] mm/page_table_check: Reinstate address parameter in [__]page_table_check_pud_clear() Date: Wed, 25 Jun 2025 16:37:46 +1000 Message-ID: <20250625063753.77511-7-ajd@linux.ibm.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250625063753.77511-1-ajd@linux.ibm.com> References: <20250625063753.77511-1-ajd@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: Z47N1cbQhimo-l2AzNSEI6V8jfUK-36n X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjI1MDA0NSBTYWx0ZWRfX5aJ1GyCyt+lF RNkSPUbQAiFCg2w9HFwZ5wnxrZBEiDB324ljkSwuZE0PRfCiUY/GGBiiyH96909WjzSdwylTxrt 2mBtYPLlhRZgyXo0yWqmx9Nzb3hBvDmKn7XJaLlFIvwmRlsciigeO/dKefMvl842D8uVxg6ITlW bv9XUKhVFLmihfIGOAirKO9H6IksjWFEVbREh4YIseKDnYGUtN2692uDui3PW+jopomfpP7syed z9GqcqQTtP3U5dOSKo5XsdLB3wDmPGRapnJfLpuvph+nsOa8013fUGkNuSNl9Liu2iDTXljHweI 0+NvTFNh3iEFdkGwMUqUcI632Dc023XL0CUz9ECN8Y0Bv0LGiRQJ7fv2svvL/C0bGrwj7LsIn7z +qSBD8bpE9cPw0AIMeXo5kS3zcFX33mYIZ+r3HqaZtc035AOTdwOOAvDVsIN7vegF6BqV1G9 X-Authority-Analysis: v=2.4 cv=MshS63ae c=1 sm=1 tr=0 ts=685b9987 cx=c_pps a=AfN7/Ok6k8XGzOShvHwTGQ==:117 a=AfN7/Ok6k8XGzOShvHwTGQ==:17 a=6IFa9wvqVegA:10 a=VnNF1IyMAAAA:8 a=7ipKWUHlAAAA:8 a=VwQbUJbxAAAA:8 a=ocrGMPNeQj1hKc7Dx3AA:9 a=gpc5p9EgBqZVLdJeV_V1:22 X-Proofpoint-GUID: Z47N1cbQhimo-l2AzNSEI6V8jfUK-36n X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.7,FMLib:17.12.80.40 definitions=2025-06-25_01,2025-06-23_07,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 bulkscore=0 lowpriorityscore=0 spamscore=0 mlxlogscore=916 impostorscore=0 clxscore=1011 phishscore=0 malwarescore=0 suspectscore=0 adultscore=0 priorityscore=1501 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2506250045 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250624_233913_069380_2F5EDE8B X-CRM114-Status: GOOD ( 15.98 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Rohan McLure This reverts commit 931c38e16499 ("mm/page_table_check: remove unused parameter in [__]page_table_check_pud_clear"). Reinstate previously unused parameters for the purpose of supporting powerpc platforms, as many do not encode user/kernel ownership of the page in the pte, but instead in the address of the access. [ajd@linux.ibm.com: rebase on arm64 changes] Signed-off-by: Rohan McLure Reviewed-by: Pasha Tatashin Acked-by: Ingo Molnar # x86 Signed-off-by: Andrew Donnellan --- v15: rebase --- arch/arm64/include/asm/pgtable.h | 2 +- arch/x86/include/asm/pgtable.h | 2 +- include/linux/page_table_check.h | 11 +++++++---- include/linux/pgtable.h | 2 +- mm/page_table_check.c | 5 +++-- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 383c01f9cae9..72ccbd810b13 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -1398,7 +1398,7 @@ static inline pte_t __ptep_get_and_clear_anysz(struct mm_struct *mm, break; #ifndef __PAGETABLE_PMD_FOLDED case PUD_SIZE: - page_table_check_pud_clear(mm, pte_pud(pte)); + page_table_check_pud_clear(mm, address, pte_pud(pte)); break; #endif default: diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 995ca7e6e0e9..4d6da32e77a6 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h @@ -1376,7 +1376,7 @@ static inline pud_t pudp_huge_get_and_clear(struct mm_struct *mm, { pud_t pud = native_pudp_get_and_clear(pudp); - page_table_check_pud_clear(mm, pud); + page_table_check_pud_clear(mm, addr, pud); return pud; } diff --git a/include/linux/page_table_check.h b/include/linux/page_table_check.h index 66e109238416..808cc3a48c28 100644 --- a/include/linux/page_table_check.h +++ b/include/linux/page_table_check.h @@ -16,7 +16,8 @@ extern struct page_ext_operations page_table_check_ops; void __page_table_check_zero(struct page *page, unsigned int order); void __page_table_check_pte_clear(struct mm_struct *mm, pte_t pte); void __page_table_check_pmd_clear(struct mm_struct *mm, pmd_t pmd); -void __page_table_check_pud_clear(struct mm_struct *mm, pud_t pud); +void __page_table_check_pud_clear(struct mm_struct *mm, unsigned long addr, + pud_t pud); void __page_table_check_ptes_set(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte, unsigned int nr); void __page_table_check_pmds_set(struct mm_struct *mm, unsigned long addr, @@ -59,12 +60,13 @@ static inline void page_table_check_pmd_clear(struct mm_struct *mm, pmd_t pmd) __page_table_check_pmd_clear(mm, pmd); } -static inline void page_table_check_pud_clear(struct mm_struct *mm, pud_t pud) +static inline void page_table_check_pud_clear(struct mm_struct *mm, + unsigned long addr, pud_t pud) { if (static_branch_likely(&page_table_check_disabled)) return; - __page_table_check_pud_clear(mm, pud); + __page_table_check_pud_clear(mm, addr, pud); } static inline void page_table_check_ptes_set(struct mm_struct *mm, @@ -123,7 +125,8 @@ static inline void page_table_check_pmd_clear(struct mm_struct *mm, pmd_t pmd) { } -static inline void page_table_check_pud_clear(struct mm_struct *mm, pud_t pud) +static inline void page_table_check_pud_clear(struct mm_struct *mm, + unsigned long addr, pud_t pud) { } diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index d06b5fec9540..765451864de3 100644 --- a/include/linux/pgtable.h +++ b/include/linux/pgtable.h @@ -650,7 +650,7 @@ static inline pud_t pudp_huge_get_and_clear(struct mm_struct *mm, pud_t pud = *pudp; pud_clear(pudp); - page_table_check_pud_clear(mm, pud); + page_table_check_pud_clear(mm, address, pud); return pud; } diff --git a/mm/page_table_check.c b/mm/page_table_check.c index 0957767a2940..bd1242087a35 100644 --- a/mm/page_table_check.c +++ b/mm/page_table_check.c @@ -167,7 +167,8 @@ void __page_table_check_pmd_clear(struct mm_struct *mm, pmd_t pmd) } EXPORT_SYMBOL(__page_table_check_pmd_clear); -void __page_table_check_pud_clear(struct mm_struct *mm, pud_t pud) +void __page_table_check_pud_clear(struct mm_struct *mm, unsigned long addr, + pud_t pud) { if (&init_mm == mm) return; @@ -246,7 +247,7 @@ void __page_table_check_puds_set(struct mm_struct *mm, unsigned long addr, return; for (i = 0; i < nr; i++) - __page_table_check_pud_clear(mm, *(pudp + i)); + __page_table_check_pud_clear(mm, addr + PUD_SIZE * i, *(pudp + i)); if (pud_user_accessible_page(pud)) page_table_check_set(pud_pfn(pud), stride * nr, pud_write(pud)); } -- 2.49.0 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv