Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp4832157pxy; Tue, 27 Apr 2021 13:47:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLnAoSqJ12WfxEUbZn5jKUI0lFKYp/CXy6E20u6ylLynq+psYMcpmItZSomemie/vM6bD8 X-Received: by 2002:a63:d815:: with SMTP id b21mr23857382pgh.217.1619556431570; Tue, 27 Apr 2021 13:47:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619556431; cv=none; d=google.com; s=arc-20160816; b=JiFCsShi9z7BjmeWsNTbRDkRP9c4LKo//jlXk5Zj//Xka+KqmLDpgH+bvRLM4ELskC eaBGfixdcFPhhlbdT4HnYTN80GeU7Unf6KQvFwJPzVUgMIINiJIatw9YOxdIkyzx7EWS BpUY8/V9UdKRkbEEQONoSVu1y7G0xDn/iFuJ1sRJ+INT07UXJ2wDucoaQx8NZBaB9Bir HoiLpff8uR+oUxHq00AzwsjPqgl719USYQY3BBtBUFr49cnpFwZ7+kPDpg0zaG71syus kwEcx3z2/f6E6lSKjKTWcDUKxO2mMDr1oePWD6LGL2cF8CTGDfEsmzo5dYTMcJPtx/e/ B1PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=9a8lbQRKdyqOPVyOpZUfh+/baUomMI+qeaSkyPCgZUk=; b=TFri7ztJfJRBQJ/OtawwQQAnrUKzvDecD4c9n9l5xJWkuOw3RaZaZgeXs4VD7GyR0X 9srKxu1sgZkhVOVtAGpioPUAVcgDnpaljIQ4UEcha/eRRdrUEKNHbgxYz/lmdrzW204E sPEaGSb/rYwYo6k20j4AYMaJDScr4GnqOSt0VJrAN9hWvVEm0SeRxpEqRmKYHRrvL7iH vx8KSNecTknIMLQ3lyEjk4cTAKbzKFLHiMLwQiS6ypsPNZybEAC1YCrYOsKHwNOdOTWy 1o/RAiO64LEwS4aVmqG7GeBBI5xtRgSaAvEkUCNkj/SrFUKGUL1zihnMIjdVBt8I467J 41fA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f12si5861396pfa.256.2021.04.27.13.46.58; Tue, 27 Apr 2021 13:47:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239167AbhD0UpW (ORCPT + 99 others); Tue, 27 Apr 2021 16:45:22 -0400 Received: from mga05.intel.com ([192.55.52.43]:31779 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239111AbhD0UpI (ORCPT ); Tue, 27 Apr 2021 16:45:08 -0400 IronPort-SDR: IVd0gfdTirlumbgQef5BaHEB8O3yC1JzJH+aehNoVZyeCMyOV1KsAJW3W3d9Jb3xuLKXTmcZEg z25fKCdW/sgA== X-IronPort-AV: E=McAfee;i="6200,9189,9967"; a="281922459" X-IronPort-AV: E=Sophos;i="5.82,255,1613462400"; d="scan'208";a="281922459" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2021 13:44:11 -0700 IronPort-SDR: aUWQgeFi1WwBEOmzfnlYum8c6FP6jdDZZT8yZvx27Erb1lYmKik6XfXYOEqGM4ZSX5Cr8vjhMm /VzHF4qwLtgQ== X-IronPort-AV: E=Sophos;i="5.82,255,1613462400"; d="scan'208";a="465623460" Received: from yyu32-desk.sc.intel.com ([143.183.136.146]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2021 13:44:10 -0700 From: Yu-cheng Yu To: x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , Andy Lutomirski , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , Dave Martin , Weijiang Yang , Pengfei Xu , Haitao Huang Cc: Yu-cheng Yu , "Kirill A . Shutemov" Subject: [PATCH v26 08/30] x86/mm: Move pmd_write(), pud_write() up in the file Date: Tue, 27 Apr 2021 13:42:53 -0700 Message-Id: <20210427204315.24153-9-yu-cheng.yu@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210427204315.24153-1-yu-cheng.yu@intel.com> References: <20210427204315.24153-1-yu-cheng.yu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To prepare the introduction of _PAGE_COW, move pmd_write() and pud_write() up in the file, so that they can be used by other helpers below. Signed-off-by: Yu-cheng Yu Reviewed-by: Kirill A. Shutemov --- 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 a02c67291cfc..c1650d0af1b5 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h @@ -185,6 +185,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; @@ -1128,12 +1140,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, -- 2.21.0