From patchwork Wed Jul 19 22:47:40 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: 122914 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp2771522vqt; Wed, 19 Jul 2023 16:27:59 -0700 (PDT) X-Google-Smtp-Source: APBJJlFnN3dX1UvLyvonq+8NnjFN7f9blCNRtMrVMCBFwDgvb9MhkVFV+vhs6JM1Z7YXjbEDxNEC X-Received: by 2002:a17:90b:8f:b0:262:b22b:8ab5 with SMTP id bb15-20020a17090b008f00b00262b22b8ab5mr14496766pjb.17.1689809278980; Wed, 19 Jul 2023 16:27:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689809278; cv=none; d=google.com; s=arc-20160816; b=xl2K1OvZyGCOkpLNEyKT1jQnEiFSirSfVRKaiZYzIKayRU7sbcIHlIf05IgEx+n3Uj IYuRahRkzQywohPiimyQS5CkMChKFOqBDHfZ5agvx+jCWNy/Al+ZXHIFJwFJ3tZ645SM +7ozCpfJsSHtk21SlPBtYDMHvtthoZed3tiM9RD7b4tgHHWqJwLJ2XQ1hdhLOg/j2Bg2 ndjPOJkaTxGiTEF8+Css1262PKa6HZvwh4deQPpS42A7AY1TC5I0+gEniMm1iSo8/zEZ L/Iv0AdZaUffyN7twVNT2iYDUy+D73lUmJaeZGY5dgbAEG98Oukst9xfv0TSV3TbAMje xQAQ== 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=NjE9B+nzQu8pouAo4v5duSCj1r9uS4+mal7ymvz1xfo=; fh=FcZi+Nuku/P4Zifaz1iTa1dPqa8tGvxsrFwlyMZBoFo=; b=WCKjUQTUsHCLBLMJLUUe4zErhK2WdOMeaNL+osPOsNhrkAyMTc88hyzDzXijdmScn5 LWGfPAz+Y3nO/pAG93K68Ot5PwcdSwCy3GvZMzCJsJA8StulP2ymgDLYF8uF4rCvdSVz 53Q2G3ylR6zSwy+NEsQMRcN1B/AFiLOFE50vrMQ/0ttP/A7nh4DnDo+RJacZ4O9bpbfF 4Fo/gsFa/3ZtFxwIvKf1FGekmdcMSLAPelk3UEw07dStsiXv83Ey8uq/P2CEA1tUdrxP TeYyZpwTbcTx281FFZSH1HAsx7N4JZAMP3aHxBWCWDmq5vUivDkkYxMo6uWUBDPqCeIk IanQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="D/m3w797"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=eKHxMK1V; 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 i14-20020a17090ad34e00b00262d1b39524si2208271pjx.116.2023.07.19.16.27.45; Wed, 19 Jul 2023 16:27:58 -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="D/m3w797"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=eKHxMK1V; 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 S230124AbjGSWtY (ORCPT + 99 others); Wed, 19 Jul 2023 18:49:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231241AbjGSWrz (ORCPT ); Wed, 19 Jul 2023 18:47:55 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7ABC2703; Wed, 19 Jul 2023 15:47:42 -0700 (PDT) Date: Wed, 19 Jul 2023 22:47:40 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1689806860; 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=NjE9B+nzQu8pouAo4v5duSCj1r9uS4+mal7ymvz1xfo=; b=D/m3w797e1gBYN8m9WJYv9dfkTe3nu+NM2gUR1S2Vz2NRtlGC22AUQvZ884y48JIYc37M9 N7RP8LA5NFfasTfbkeElWXXSq8rl6iUisD8/3CHaUN5Bs60C9LDwM+pf/5k0PxtxSfU4sk C3y1zbq114cRLGbYUQml4x9l2bvOSw0uxJAcEqhEmo8KESAEfMrMUWQkIJCU+oSJtmzSc7 wfOMFK2lnge1reTEQD28Nv2tKM5Jnn3vkdMpmNQOxKPd/iAQU7Dh+17p9UyDfjxIG871s9 7RkS8ol2vPhokDjz6xcc+IidNqGLd5ozWZ6VtHdmCkrbwiYonr3KArYr5WAiqQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1689806860; 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=NjE9B+nzQu8pouAo4v5duSCj1r9uS4+mal7ymvz1xfo=; b=eKHxMK1VgJVCuwOtlqZRRRTdo5jYdFWl9aQjY4FQitYNa5sBKATVhFdjDA/pAtZnozHqJP johi4c/1e6/hyIAQ== 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: <168980686029.28540.10685579278645068504.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, 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: INBOX X-GMAIL-THRID: 1771893454087018672 X-GMAIL-MSGID: 1771893454087018672 The following commit has been merged into the x86/shstk branch of tip: Commit-ID: a956efc09b106173c6c85da7e3bb6e0f452a5681 Gitweb: https://git.kernel.org/tip/a956efc09b106173c6c85da7e3bb6e0f452a5681 Author: Rick Edgecombe AuthorDate: Mon, 12 Jun 2023 17:10:35 -07:00 Committer: Rick Edgecombe CommitterDate: Tue, 11 Jul 2023 14:12:19 -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 0aa295c..5f6e4ac 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h @@ -161,6 +161,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; @@ -1121,12 +1133,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) @@ -1156,12 +1162,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,