From patchwork Fri Jun 16 19:17:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 109353 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1572740vqr; Fri, 16 Jun 2023 12:39:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4gAMes0YAI9r/sotdUXgncwIinBA21Xa+mZc72Q6KLummfe8lQfOd8yOifkuYtASsnOu3Z X-Received: by 2002:a17:903:44f:b0:1b5:2a81:7559 with SMTP id iw15-20020a170903044f00b001b52a817559mr2808899plb.10.1686944383973; Fri, 16 Jun 2023 12:39:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686944383; cv=none; d=google.com; s=arc-20160816; b=O9RqVPJ5LAAP88fiz1C2zo23uv9xKK2k7KeodcBVVdX4abOtMErUDDusdI46iA4W1R NWJhrAffZh25CD59elJnM50Ur9EXTmn029PLLLqm15vcaFTX0KEgcX80adSQSpK5LOl3 VNZeO+yJimB1FhK2hnBi4VT7ja+5BY83lnx/xxdFAooKR+iGQ9hpLqtYOhvvt6tBgJV6 kj8tGKnamhNmKQwcRw/YhOX8f68KYBQMVfHvLbDaU9OEwYqTNm7srJtfdsilYviAwV+i cLCEHGkbIZJ4dQlVuH/QwIWFFzCc3AxLFsZEL1diAcla9ToVu+4giahU5KGBMn1Uje8y q3sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:cc:subject:to:reply-to:sender:from :dkim-signature:dkim-signature:date; bh=hiueC9wpKoe2mgAdYX+DfkumgCSbUvjCeB87kyAQBa8=; b=TXtOGDmBC8eQeBHMxGabjKMQvuciB+qR256rDwpOGHaA7dVbrEU0CYNSGbT0X4Xtjc 3peB3NsEJF2XAnaSCM9/PkD9so4N+XCFBmP90DeEmykHMx1twfn0zbCoc/GILw0C1GR8 mWtUYUs/OwZvANm4BRxB0JlfQR0A3gnwrooAVF7upLtgCmFmwReqU6E+IdmpYnWIjBlD 08GwEsSn8+jNwbHpPTW5E3bF9aCmwmeDgFdcbCeEfJJ4tvH/9QNDMbbeQ0YzdZnzc2oe aictY9SUvwXvarYncjZ779vpA6Nr5/KOY4m9daMA77onVI7zT7N9sxHL5lP2HvlJa2vy +r0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="qnYx5fA/"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o17-20020a170902779100b001ab1a00d95dsi7711567pll.250.2023.06.16.12.39.28; Fri, 16 Jun 2023 12:39:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="qnYx5fA/"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346178AbjFPTTP (ORCPT + 99 others); Fri, 16 Jun 2023 15:19:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346013AbjFPTRL (ORCPT ); Fri, 16 Jun 2023 15:17:11 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20D2B3A89; Fri, 16 Jun 2023 12:17:06 -0700 (PDT) Date: Fri, 16 Jun 2023 19:17:04 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1686943024; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hiueC9wpKoe2mgAdYX+DfkumgCSbUvjCeB87kyAQBa8=; b=qnYx5fA/vazgd3mZEGB770Ha/TcdWPyEdQSI9FVJtBnCgoxBZSzGPHkNp7chcGwrzVG+WB IKe2cUV6/7Oi+GizveGMJu79MohCfGwAtbZf5FNJ6RwkDqTxvyska/hHVClgKYXspB5Opc mHfQwOk5yHB4hfWmK8dEiHU0ZNU3HzmpQVT1nunfOxHIOfI/M2GDcaWBdX/2SE9v47/kDh 4kyd8DSeGXBjz+0Y2f/O6oj6+aO4IAhujeFcwqntBpNMr9Ix8KZEWb1tAHN/pvoQkAAxT1 XJTdOYXwo9VDW04YTU2UzoIxQoeRlFkiLzkXbmDG5HCO3AKRr22bytlYzln4xg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1686943024; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hiueC9wpKoe2mgAdYX+DfkumgCSbUvjCeB87kyAQBa8=; b=c9R6cS4dD2fYCtYhyxVyiStwCbDvl9gGJRiq9RqYc8v0sftzzX9vff26W8RzMWmnT2SAHA dTdOlA82B6gzzsCQ== From: "tip-bot2 for Rick Edgecombe" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/shstk] x86/mm: Move pmd_write(), pud_write() up in the file Cc: "Yu-cheng Yu" , Rick Edgecombe , Dave Hansen , "Borislav Petkov (AMD)" , Kees Cook , "Kirill A. Shutemov" , "Mike Rapoport (IBM)" , Pengfei Xu , John Allen , x86@kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-ID: <168694302417.404.9459019570714899341.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768889394346115110?= X-GMAIL-MSGID: =?utf-8?q?1768889394346115110?= The following commit has been merged into the x86/shstk branch of tip: Commit-ID: f18490aca6f7bb5a628a158759027c7403599a54 Gitweb: https://git.kernel.org/tip/f18490aca6f7bb5a628a158759027c7403599a54 Author: Rick Edgecombe AuthorDate: Mon, 12 Jun 2023 17:10:35 -07:00 Committer: Dave Hansen CommitterDate: Thu, 15 Jun 2023 16:31:01 -07:00 x86/mm: Move pmd_write(), pud_write() up in the file To prepare the introduction of _PAGE_SAVED_DIRTY, move pmd_write() and pud_write() up in the file, so that they can be used by other helpers below. No functional changes. Co-developed-by: Yu-cheng Yu Signed-off-by: Yu-cheng Yu Signed-off-by: Rick Edgecombe Signed-off-by: Dave Hansen Reviewed-by: Borislav Petkov (AMD) Reviewed-by: Kees Cook Reviewed-by: Kirill A. Shutemov Acked-by: Mike Rapoport (IBM) Tested-by: Pengfei Xu Tested-by: John Allen Tested-by: Kees Cook Link: https://lore.kernel.org/all/20230613001108.3040476-10-rick.p.edgecombe%40intel.com --- arch/x86/include/asm/pgtable.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 112e606..768ee46 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h @@ -160,6 +160,18 @@ static inline int pte_write(pte_t pte) return pte_flags(pte) & _PAGE_RW; } +#define pmd_write pmd_write +static inline int pmd_write(pmd_t pmd) +{ + return pmd_flags(pmd) & _PAGE_RW; +} + +#define pud_write pud_write +static inline int pud_write(pud_t pud) +{ + return pud_flags(pud) & _PAGE_RW; +} + static inline int pte_huge(pte_t pte) { return pte_flags(pte) & _PAGE_PSE; @@ -1120,12 +1132,6 @@ extern int pmdp_clear_flush_young(struct vm_area_struct *vma, unsigned long address, pmd_t *pmdp); -#define pmd_write pmd_write -static inline int pmd_write(pmd_t pmd) -{ - return pmd_flags(pmd) & _PAGE_RW; -} - #define __HAVE_ARCH_PMDP_HUGE_GET_AND_CLEAR static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm, unsigned long addr, pmd_t *pmdp) @@ -1155,12 +1161,6 @@ static inline void pmdp_set_wrprotect(struct mm_struct *mm, clear_bit(_PAGE_BIT_RW, (unsigned long *)pmdp); } -#define pud_write pud_write -static inline int pud_write(pud_t pud) -{ - return pud_flags(pud) & _PAGE_RW; -} - #ifndef pmdp_establish #define pmdp_establish pmdp_establish static inline pmd_t pmdp_establish(struct vm_area_struct *vma,