From patchwork Thu Mar 28 04:55:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rohan McLure X-Patchwork-Id: 13607973 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 A4276CD1280 for ; Thu, 28 Mar 2024 04:57:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 34E4A6B0089; Thu, 28 Mar 2024 00:57:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2FB646B008A; Thu, 28 Mar 2024 00:57:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 19CB86B008C; Thu, 28 Mar 2024 00:57:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id E8D956B0089 for ; Thu, 28 Mar 2024 00:57:12 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id A0B1E80F1A for ; Thu, 28 Mar 2024 04:57:12 +0000 (UTC) X-FDA: 81945238704.11.90575E2 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf11.hostedemail.com (Postfix) with ESMTP id 58DF340010 for ; Thu, 28 Mar 2024 04:57:10 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=mhOO9Qif; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf11.hostedemail.com: domain of rmclure@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=rmclure@linux.ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711601830; 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:dkim-signature; bh=+k6vsLec1pcg2vE2qJpdFE2QORhER0/WgwCnGamDgpg=; b=lQJbinfCxPcimu5oz6snD4OM4WTaVshgdYF6zrv6YdN1AKDZZI8Xar+PdnD6Ihrv9cXQHe QwYp9xR/A8Z9XToXmcryorIhnM5ytmF0x4KgNIsNgYJStoETJ9ll3J+ZSbCzlS5sf8P4X4 ZFtViCVPxzXaRB0qFO3LicSzgmTHVFM= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=mhOO9Qif; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf11.hostedemail.com: domain of rmclure@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=rmclure@linux.ibm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711601830; a=rsa-sha256; cv=none; b=WI1tnJaRfQw422zKNw0VjU5l2mwn/VX+2/h0D4LKPTCxC89nMiPtofu0thza1W5cNxIH/q zViBhA1CMq+FmUVnH2a/UEgUpzAFe9LFcfhTtkqlxX9MtQjFrk7FU7KJnfa8Hwdv59Lhr3 SwSOADFBzZscxON20gRcso0TqhX61+8= Received: from pps.filterd (m0353728.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 42S4RTA0012155; Thu, 28 Mar 2024 04:57:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=+k6vsLec1pcg2vE2qJpdFE2QORhER0/WgwCnGamDgpg=; b=mhOO9Qif0VHAbJS0c0Qp4H2UDoYL5E4Ld3W/7U2v5KUCvM92dJN5x+gmrPMgg+sZj8lc VgtEBypRTFJEmiGS/ROT0CPC7ZpYpilVd+BVFSo55PzdhhmS47vp4+8vEEV7CMLp8vvR JUY19XPruZ9aNTvYKExTn/LDjWUFYYtbRX7mzY1TM1/mNKlSKTwPA2pHatHDG3qCLh3p HiMOgWHMzAXxvwt8BfXKau6lqg3ZvS3Hf5KoIlyqOhidaBSl9ByR+grPlMGCMlWfRd6n KOCnYEgYBqVfgZt7Sbg10FSfWtqy5xZmBVkGd63itryfDnIetimSUrrwksJoO5sAWlwp pg== Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3x51hj01y9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 28 Mar 2024 04:57:02 +0000 Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 42S4eOoj028650; Thu, 28 Mar 2024 04:57:01 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3x2adpkbqm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 28 Mar 2024 04:57:00 +0000 Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 42S4uuHp32506280 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Mar 2024 04:56:59 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C43322004F; Thu, 28 Mar 2024 04:56:56 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E6AB32004D; Thu, 28 Mar 2024 04:56:55 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 28 Mar 2024 04:56:55 +0000 (GMT) Received: from socotra.ibm.com (unknown [9.66.88.97]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 7C49760429; Thu, 28 Mar 2024 15:56:50 +1100 (AEDT) From: Rohan McLure To: linuxppc-dev@lists.ozlabs.org Cc: Rohan McLure , mpe@ellerman.id.au, christophe.leroy@csgroup.eu, linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, x86@kernel.org Subject: [PATCH v11 05/11] Revert "mm/page_table_check: remove unused parameter in [__]page_table_check_pmd_clear" Date: Thu, 28 Mar 2024 15:55:25 +1100 Message-ID: <20240328045535.194800-8-rmclure@linux.ibm.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240328045535.194800-3-rmclure@linux.ibm.com> References: <20240328045535.194800-3-rmclure@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: l_TYlGBAizY8qd4jQ3qAEWGlP1Lv1m6t X-Proofpoint-ORIG-GUID: l_TYlGBAizY8qd4jQ3qAEWGlP1Lv1m6t X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-28_04,2024-03-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 spamscore=0 lowpriorityscore=0 adultscore=0 mlxlogscore=999 bulkscore=0 impostorscore=0 mlxscore=0 clxscore=1015 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2403210000 definitions=main-2403280028 X-Rspamd-Queue-Id: 58DF340010 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: d6wqjktyoshdazkhtcmxb1n4tza5px7f X-HE-Tag: 1711601830-631843 X-HE-Meta: U2FsdGVkX1/Nx5oBP7hkc2c4ENMQHkjnxS9we3zdeHRbajB8iG6G9RF36/kz2j8PZqcGhy+yefQ6ews6DGAQ35U3l3qr1w8Qe/EA7lxvHBZkTIW6UDbTJgZLdkIp5GuElZS+nSAEzqWCnBcg/rM18GaK5CzLqyNJQCv9UHpr322c9gtcXsH8aRoxv5uld8Y+9SxZJItZq/69uobjk6tMAV1Ca0Hmxh1v5wAtHRSSF7E09AuMqTDvlepTduon2MKiQHWwtr5gkewmDYTJnU5SPM2rJ+mPhaEAylA16uyYQS9dHSXH/2UxUzrG7NHNrsNkq6N7IsQXl1X8dKrpMphtCqnbhqalP7hNmkarP3L32lOzp8W3inxulxUDPN5itXUETLSjGNYeWRJs3NJ+265wLB0M8L5Omnf7VyheHn6u2722OXI2+zXnp0+Y41VNIN7pU4oId6aT+wt9Md0wBqlWjRIehUMwptdICau3NLqJT/imydh9xwQ7NBxpQ6cPczDfw2eYrG2t9c1qeH/qdUVHo3jraNX3GzIIsw3BTvC2wTMqDyHRQBVHGinWkD560+8BqyW+Sy9QXYHDILE4Xn4YTc1lTRTyZaGJa30L3rr3oPzS16+aAg/xp0N3VBLPCWo5aBrvjtXETfXxqZt10gFTehC2qkm+x2A45TyozNEohrOIw76fp8BqYiXn/5OdET2YSh9YWIV+oI1CxxVxR1RShK6rKYuj0asPjgT3FlyNIstB7cikhBeZ3zMmzbQTZsq16BN/ldC19/5zBkfeTATmpoceHNFRfMmwGPqgQkuFonZoliBRaW6YbSq8i6EdAJvk/1e2acJETZf1bAJO2cGyYEggOa2ZsySBmkiCvYPGOPd2s9bd+nEdrjZIM6MskwjKCEdzJhwDGKeHlVQTkK1RS0ehlF5Mo1e8OpK7kC3ltML6Ffll75HePuqf2+mjUUwU/XDdUfzQmd+DDmpRPWX jl4JFJ3o ldzWeysfLksqqnUByDW8I9lTfPp/0FRGquSC7Fai3iEk3Lc4mI1bj5gmanT/GyqyaB2hgmvz6x1DRZq7SWYK5usGODE8T5LzDyNvwdHFT1O8QNYBIwUOf0nJup0FhS/bdlkeTyEashbjsaJ3WqxqEPB1W2Wbflp33oe963FK5jTD7MDG1iYWRQPsveupmlKmWTken5iAUNwcDryHFDCB6zD8eGyKt7BxpSGfjmspjRZ99+F8a4WVzjiq95LDKwmwzvTURpkR78jSlsmo= 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: This reverts commit 1831414cd729a34af937d56ad684a66599de6344. 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. Signed-off-by: Rohan McLure --- arch/arm64/include/asm/pgtable.h | 2 +- arch/riscv/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 +++-- 6 files changed, 14 insertions(+), 10 deletions(-) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index b3938f80a1b6..d20afcfae530 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -1188,7 +1188,7 @@ static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm, { pmd_t pmd = __pmd(xchg_relaxed(&pmd_val(*pmdp), 0)); - page_table_check_pmd_clear(mm, pmd); + page_table_check_pmd_clear(mm, address, pmd); return pmd; } diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h index a153d3d143d2..0066626159a5 100644 --- a/arch/riscv/include/asm/pgtable.h +++ b/arch/riscv/include/asm/pgtable.h @@ -767,7 +767,7 @@ static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm, { pmd_t pmd = __pmd(atomic_long_xchg((atomic_long_t *)pmdp, 0)); - page_table_check_pmd_clear(mm, pmd); + page_table_check_pmd_clear(mm, address, pmd); return pmd; } diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index e35b2b4f5ea1..9876e6d92799 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h @@ -1345,7 +1345,7 @@ static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm, unsigned long { pmd_t pmd = native_pmdp_get_and_clear(pmdp); - page_table_check_pmd_clear(mm, pmd); + page_table_check_pmd_clear(mm, addr, pmd); return pmd; } diff --git a/include/linux/page_table_check.h b/include/linux/page_table_check.h index d01a00ffc1f9..0a6ebfa46a31 100644 --- a/include/linux/page_table_check.h +++ b/include/linux/page_table_check.h @@ -15,7 +15,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_pmd_clear(struct mm_struct *mm, unsigned long addr, + pmd_t pmd); 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, @@ -52,12 +53,13 @@ static inline void page_table_check_pte_clear(struct mm_struct *mm, pte_t pte) __page_table_check_pte_clear(mm, pte); } -static inline void page_table_check_pmd_clear(struct mm_struct *mm, pmd_t pmd) +static inline void page_table_check_pmd_clear(struct mm_struct *mm, + unsigned long addr, pmd_t pmd) { if (static_branch_likely(&page_table_check_disabled)) return; - __page_table_check_pmd_clear(mm, pmd); + __page_table_check_pmd_clear(mm, addr, pmd); } static inline void page_table_check_pud_clear(struct mm_struct *mm, @@ -123,7 +125,8 @@ static inline void page_table_check_pte_clear(struct mm_struct *mm, pte_t pte) { } -static inline void page_table_check_pmd_clear(struct mm_struct *mm, pmd_t pmd) +static inline void page_table_check_pmd_clear(struct mm_struct *mm, + unsigned long addr, pmd_t pmd) { } diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index 6a5c44c2208e..d17fbca4da7b 100644 --- a/include/linux/pgtable.h +++ b/include/linux/pgtable.h @@ -557,7 +557,7 @@ static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm, pmd_t pmd = *pmdp; pmd_clear(pmdp); - page_table_check_pmd_clear(mm, pmd); + page_table_check_pmd_clear(mm, address, pmd); return pmd; } diff --git a/mm/page_table_check.c b/mm/page_table_check.c index a8c8fd7f06f8..7afaad9c6e6f 100644 --- a/mm/page_table_check.c +++ b/mm/page_table_check.c @@ -160,7 +160,8 @@ void __page_table_check_pte_clear(struct mm_struct *mm, pte_t pte) } EXPORT_SYMBOL(__page_table_check_pte_clear); -void __page_table_check_pmd_clear(struct mm_struct *mm, pmd_t pmd) +void __page_table_check_pmd_clear(struct mm_struct *mm, unsigned long addr, + pmd_t pmd) { if (&init_mm == mm) return; @@ -204,7 +205,7 @@ void __page_table_check_pmd_set(struct mm_struct *mm, unsigned long addr, if (&init_mm == mm) return; - __page_table_check_pmd_clear(mm, *pmdp); + __page_table_check_pmd_clear(mm, addr, *pmdp); if (pmd_user_accessible_page(pmd)) { page_table_check_set(pmd_pfn(pmd), PMD_SIZE >> PAGE_SHIFT, pmd_write(pmd));