Skip to content

Commit a956efc

Browse files
committed
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 <[email protected]> Signed-off-by: Yu-cheng Yu <[email protected]> Signed-off-by: Rick Edgecombe <[email protected]> Signed-off-by: Dave Hansen <[email protected]> Reviewed-by: Borislav Petkov (AMD) <[email protected]> Reviewed-by: Kees Cook <[email protected]> Reviewed-by: Kirill A. Shutemov <[email protected]> Acked-by: Mike Rapoport (IBM) <[email protected]> Tested-by: Pengfei Xu <[email protected]> Tested-by: John Allen <[email protected]> Tested-by: Kees Cook <[email protected]> Link: https://lore.kernel.org/all/20230613001108.3040476-10-rick.p.edgecombe%40intel.com
1 parent 701fb66 commit a956efc

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

arch/x86/include/asm/pgtable.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,18 @@ static inline int pte_write(pte_t pte)
161161
return pte_flags(pte) & _PAGE_RW;
162162
}
163163

164+
#define pmd_write pmd_write
165+
static inline int pmd_write(pmd_t pmd)
166+
{
167+
return pmd_flags(pmd) & _PAGE_RW;
168+
}
169+
170+
#define pud_write pud_write
171+
static inline int pud_write(pud_t pud)
172+
{
173+
return pud_flags(pud) & _PAGE_RW;
174+
}
175+
164176
static inline int pte_huge(pte_t pte)
165177
{
166178
return pte_flags(pte) & _PAGE_PSE;
@@ -1121,12 +1133,6 @@ extern int pmdp_clear_flush_young(struct vm_area_struct *vma,
11211133
unsigned long address, pmd_t *pmdp);
11221134

11231135

1124-
#define pmd_write pmd_write
1125-
static inline int pmd_write(pmd_t pmd)
1126-
{
1127-
return pmd_flags(pmd) & _PAGE_RW;
1128-
}
1129-
11301136
#define __HAVE_ARCH_PMDP_HUGE_GET_AND_CLEAR
11311137
static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm, unsigned long addr,
11321138
pmd_t *pmdp)
@@ -1156,12 +1162,6 @@ static inline void pmdp_set_wrprotect(struct mm_struct *mm,
11561162
clear_bit(_PAGE_BIT_RW, (unsigned long *)pmdp);
11571163
}
11581164

1159-
#define pud_write pud_write
1160-
static inline int pud_write(pud_t pud)
1161-
{
1162-
return pud_flags(pud) & _PAGE_RW;
1163-
}
1164-
11651165
#ifndef pmdp_establish
11661166
#define pmdp_establish pmdp_establish
11671167
static inline pmd_t pmdp_establish(struct vm_area_struct *vma,

0 commit comments

Comments
 (0)