Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp622523pxb; Tue, 1 Feb 2022 07:10:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJwxXUGe5HuPjEdRm0EHXdzq/WqTTxiZYz4qBI58F92EbfLo4m3puZkhd0TTulGOwa2Q6YfU X-Received: by 2002:a17:907:c19:: with SMTP id ga25mr22866870ejc.606.1643728246564; Tue, 01 Feb 2022 07:10:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643728246; cv=none; d=google.com; s=arc-20160816; b=vOjqoZK/PDbDFNSzCrIPwL6E3LIP3Tq5UNgVrEa+ZgANHR2LCtZ6ZQh4XEw5A8HmSJ uRccJDugI4H2PwZWzdWQ8MsCoF8UzS0JIg65PmjebSA36uaYvTiJuPXQKqaUA/f9iydz ZdIioxgsN1f+jcBry9XkiRv0MDNhZ5QJVvlZAZWusNBUPQrSyvi3RF3GVl+1VJof/9cn rB7ODT2Q3kdtbfmIE/5L2nzp0LLb+0t2G4CKu5Lb7aOwyvAJVCetEDmYIdMf5j4q7ySs l8sbzWGdvzaYzbrl0v3Qm0MwlIDIZ4pCFPt4l2MHP1IgYkU/v1yhLeBSWGDUM2UZyPeM iCXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=tJ8n3HWbNq+QmYkPep3Lh9gquVwsFbYyvj1z4SyKwRA=; b=vxFle+X73I4Ii/yPJqKKCc3aTP4uiizbFYlkWNHTEBOTTAoyoZ48WiE6v3yHLEsMsc pGj8couaMBVf/mjnQgcHK0yFr34Mh9yjYXGFoAEgbiSwHyBq5HzrWcyt6GXsfrvaOkxa DKgon2h18HzM2/Ly62agc5ls/GK9dOKRCPNvVXAR+uLM1v2l/bMQcgf2+2l+gG7vZT9d KchxiNGdTceQX+r7Dn1h3sGH5ThC1DgxWIIMpK8SjX7TyAtUv/9DVi1NZLAUVcHk7L/q hT1YqVmnWDeZZou9fUyLpnGhfhBDEDWxidFSfv/i5kggNLOpp+IrjqJwIKhapQf59lN1 Gv0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=OoB5wgpc; 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=pass (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 dr3si9300038ejc.277.2022.02.01.07.10.18; Tue, 01 Feb 2022 07:10:46 -0800 (PST) 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; dkim=pass header.i=@intel.com header.s=Intel header.b=OoB5wgpc; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356661AbiA3VWT (ORCPT + 99 others); Sun, 30 Jan 2022 16:22:19 -0500 Received: from mga06.intel.com ([134.134.136.31]:52029 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356477AbiA3VV4 (ORCPT ); Sun, 30 Jan 2022 16:21:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643577716; x=1675113716; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=oKgQSRP9S/kqW3HSqD2DF7a0CZx0ho0AcrTJmlbuSJk=; b=OoB5wgpcPEv5ssTOO89fn0qldMkY+FjjH0COjGx+Bza4QAEjJ46P1Ycj ROdF9DA5uTNiurg/mQ1GnXqGk9StnAcZb8aeH5Q7bN4xGzMmJNusv+H3a fkPAyfgxE+esUGTsWIz//woiij93BFS8QzuVd++i6ZynYGopVCymAPkGh +KmNEUATQ/9Y9ZFxI/sw2CMmHC0VWBLL9I2AcJmbQvAF5iLJOVf9Lmya1 4NKVP9Co+YrzlQAB5vxwBm3eAz8okvR28vHWrO/UpEHGF3G4LNOycCEp0 Jv+DQw3JwfmpJNwThuyonUnOB6Zyma5cuFPtnKi1m3h3ECleChdcev8qJ g==; X-IronPort-AV: E=McAfee;i="6200,9189,10243"; a="308104910" X-IronPort-AV: E=Sophos;i="5.88,329,1635231600"; d="scan'208";a="308104910" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2022 13:21:52 -0800 X-IronPort-AV: E=Sophos;i="5.88,329,1635231600"; d="scan'208";a="536856724" Received: from avmallar-mobl1.amr.corp.intel.com (HELO rpedgeco-desk.amr.corp.intel.com) ([10.209.123.171]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2022 13:21:51 -0800 From: Rick Edgecombe 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" , Dave Martin , Weijiang Yang , "Kirill A . Shutemov" , joao.moreira@intel.com, John Allen , kcc@google.com, eranian@google.com Cc: rick.p.edgecombe@intel.com, Yu-cheng Yu Subject: [PATCH 08/35] x86/mm: Move pmd_write(), pud_write() up in the file Date: Sun, 30 Jan 2022 13:18:11 -0800 Message-Id: <20220130211838.8382-9-rick.p.edgecombe@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220130211838.8382-1-rick.p.edgecombe@intel.com> References: <20220130211838.8382-1-rick.p.edgecombe@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yu-cheng Yu 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. No functional changes. Signed-off-by: Yu-cheng Yu Reviewed-by: Kirill A. Shutemov Signed-off-by: Rick Edgecombe --- 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 8a9432fb3802..aff5e489ff17 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h @@ -158,6 +158,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; @@ -1116,12 +1128,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) @@ -1151,12 +1157,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.17.1