From patchwork Mon Mar 20 16:39:28 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: 72291 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp1325448wrt; Mon, 20 Mar 2023 10:01:27 -0700 (PDT) X-Google-Smtp-Source: AK7set8R7wvJKC5BObo55ByX8rJtg0OSWxxgX7wy8reUyhXizVyHhUApW4zC2Ujs+zTWnpOELwks X-Received: by 2002:a17:903:283:b0:19e:68b1:65b9 with SMTP id j3-20020a170903028300b0019e68b165b9mr22708300plr.12.1679331687046; Mon, 20 Mar 2023 10:01:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679331687; cv=none; d=google.com; s=arc-20160816; b=JhIaa6bp3mfAgrqCcQraXcwc9BKCsvRfnG58xdCzpu1Bsj3GVa8m7a8jydAFjpmmcv KsVDEtGgZiA62wju3o8B6OGbWTtDjRj7OaNE779wyjzBEtzWuX8Lp/0KerLt4joPebQW 6QFVyeMou3IiB4U0WT4wllvHxWvJ3bgoYLwup2ZxhI0/tS2tJ5Xfm49Qg9eECbk7DRm9 Tq0LoZKMOUopHEN3vw6wCy/XYJEqwTPNcSYZXQJtO8dR9LPrDCykm6F0jj2u/39Qbx8B jquV6DpXYzdCNs9sMPZHBQTLaIHt6BKeBeq7Ev14xbe37MdLG0YmjwyEEIedd4Ns5gyd +vsw== 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=JclONcM3q88flWv+1QnbZOc3tgl+cmLOauM0+1SWPos=; b=R9TXOgJcDK404rlCmqxuIj9fXd2k6ywucuha/HWXuMfXrRkqCTqreDJnaP1Ns9cw/b lzJuZV4tLdZE6C5c8bKSM6iVkchQUqIWPmI+dVlN2gOZBq744y/z5GBGMTQjYLFhFdRN buyyl0uKCPWDCnyQ6TU6TVdFpWvcoAW1FGKEOE2sO1ABg+0KYjtr1EOjAtmfxOBXgCGQ whx6lMPqJkavZVH/RXgFnBvQqbkSYaqAAIVBNiI3GIJPGGbsB0Qcec40aYY7Ghi5BRUS ChmOPwFaokAmJxYR1od06Z9qGEt/1XmkxqkQdxzA0JLp83YG1/uzgldhwPh6oic6390z yRMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=uKfvceH1; 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 d10-20020a170902854a00b0019aa8d665bdsi10329811plo.71.2023.03.20.10.01.12; Mon, 20 Mar 2023 10:01:27 -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=uKfvceH1; 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 S231680AbjCTQuD (ORCPT + 99 others); Mon, 20 Mar 2023 12:50:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232565AbjCTQsF (ORCPT ); Mon, 20 Mar 2023 12:48:05 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C03F636691; Mon, 20 Mar 2023 09:41:42 -0700 (PDT) Date: Mon, 20 Mar 2023 16:39:28 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1679330369; 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=JclONcM3q88flWv+1QnbZOc3tgl+cmLOauM0+1SWPos=; b=uKfvceH1L8S58LEWVcR6PsFnSapsJW7ICzKRUtdnB0OHCsHDxE2q4nKgm53lEgvAJqbHTh j/CqMNpXUV5XsSWTDq8zYwd6va3Vs/aV1FXwvBi4Uk0Jfc87hozLSkQ+brSfcM+ADBuAHN C0zAn5sWlkAyPnCyFtjM9Y1zibarYqi3GgAvK2SMoqqMy0tousAmitTy0q1ycHnG2xF9IT GZBFO8yvNbG93oDGcmqfKtbVXA6BZ/tJpI7d+A0TN3jNXhpjErgoONc7SZ7DDS2IFKiGVN e84ZSnSXBfdmCkuc0+Rdheink7XslMZdH26hHOJySmR8Ys1XCoN6DQS0dnWyZg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1679330369; 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=JclONcM3q88flWv+1QnbZOc3tgl+cmLOauM0+1SWPos=; b=rFWQOkt4ZOorQfpLoW5VMIzNDbHmCS+3hEc/KPnh1rgqs0FkMUiCx2HYhMqGlZEKe4dhvA 197k77SvKm8984AQ== 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: <167933036886.5837.2269713864868973810.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 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?1760906903059725291?= X-GMAIL-MSGID: =?utf-8?q?1760906903059725291?= The following commit has been merged into the x86/shstk branch of tip: Commit-ID: d2b3a938b6be98ea30eaae7a4151156ebd4546fa Gitweb: https://git.kernel.org/tip/d2b3a938b6be98ea30eaae7a4151156ebd4546fa Author: Rick Edgecombe AuthorDate: Sat, 18 Mar 2023 17:15:05 -07:00 Committer: Dave Hansen CommitterDate: Mon, 20 Mar 2023 09:01:08 -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/20230319001535.23210-11-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 7425f32..56eea96 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,