* [PATCH 1/3] arch/x86: Drop own definition of pgd,p4d_leaf
@ 2024-07-04 6:30 Christophe Leroy
2024-07-04 6:30 ` [PATCH 2/3] mm: Remove pud_user() from asm-generic/pgtable-nopmd.h Christophe Leroy
2024-07-04 6:30 ` [PATCH 3/3] mm: Add p{g/4}d_leaf() in asm-generic/pgtable-nop{4/u}d.h Christophe Leroy
0 siblings, 2 replies; 6+ messages in thread
From: Christophe Leroy @ 2024-07-04 6:30 UTC (permalink / raw)
To: Andrew Morton, Arnd Bergmann
Cc: Christophe Leroy, linux-kernel, linux-mm, x86, linux-riscv,
Oscar Salvador
From: Oscar Salvador <osalvador@suse.de>
We provide generic definitions of pXd_leaf in pgtable.h when the arch
do not define their own, where the generic pXd_leaf always return false.
Although x86 defines {pgd,p4d}_leaf, they end up being a no-op, so drop them
and make them fallback to the generic one.
Signed-off-by: Oscar Salvador <osalvador@suse.de>
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
arch/x86/include/asm/pgtable.h | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 65b8e5bb902c..772f778bac06 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -252,13 +252,6 @@ static inline unsigned long pgd_pfn(pgd_t pgd)
return (pgd_val(pgd) & PTE_PFN_MASK) >> PAGE_SHIFT;
}
-#define p4d_leaf p4d_leaf
-static inline bool p4d_leaf(p4d_t p4d)
-{
- /* No 512 GiB pages yet */
- return 0;
-}
-
#define pte_page(pte) pfn_to_page(pte_pfn(pte))
#define pmd_leaf pmd_leaf
@@ -1396,9 +1389,6 @@ static inline bool pgdp_maps_userspace(void *__ptr)
return (((ptr & ~PAGE_MASK) / sizeof(pgd_t)) < PGD_KERNEL_START);
}
-#define pgd_leaf pgd_leaf
-static inline bool pgd_leaf(pgd_t pgd) { return false; }
-
#ifdef CONFIG_MITIGATION_PAGE_TABLE_ISOLATION
/*
* All top-level MITIGATION_PAGE_TABLE_ISOLATION page tables are order-1 pages
--
2.44.0
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 2/3] mm: Remove pud_user() from asm-generic/pgtable-nopmd.h 2024-07-04 6:30 [PATCH 1/3] arch/x86: Drop own definition of pgd,p4d_leaf Christophe Leroy @ 2024-07-04 6:30 ` Christophe Leroy 2024-07-04 6:30 ` [PATCH 3/3] mm: Add p{g/4}d_leaf() in asm-generic/pgtable-nop{4/u}d.h Christophe Leroy 1 sibling, 0 replies; 6+ messages in thread From: Christophe Leroy @ 2024-07-04 6:30 UTC (permalink / raw) To: Andrew Morton, Arnd Bergmann Cc: Christophe Leroy, linux-kernel, linux-mm, x86, linux-riscv, Oscar Salvador, Tong Tiangen Commit 2c8a81dc0cc5 ("riscv/mm: fix two page table check related issues") added pud_user() in include/asm-generic/pgtable-nopmd.h But pud_user() only exists on ARM64 and RISCV and is not expected by any part of MM. Add the missing definition in arch/riscv/include/asm/pgtable-32.h and remove it from asm-generic/pgtable-nopmd.h Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> --- arch/riscv/include/asm/pgtable-32.h | 5 +++++ include/asm-generic/pgtable-nopmd.h | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/riscv/include/asm/pgtable-32.h b/arch/riscv/include/asm/pgtable-32.h index 00f3369570a8..37878ef37466 100644 --- a/arch/riscv/include/asm/pgtable-32.h +++ b/arch/riscv/include/asm/pgtable-32.h @@ -36,4 +36,9 @@ static const __maybe_unused int pgtable_l4_enabled; static const __maybe_unused int pgtable_l5_enabled; +static inline int pud_user(pud_t pud) +{ + return 0; +} + #endif /* _ASM_RISCV_PGTABLE_32_H */ diff --git a/include/asm-generic/pgtable-nopmd.h b/include/asm-generic/pgtable-nopmd.h index 8ffd64e7a24c..b01349a312fa 100644 --- a/include/asm-generic/pgtable-nopmd.h +++ b/include/asm-generic/pgtable-nopmd.h @@ -30,7 +30,6 @@ typedef struct { pud_t pud; } pmd_t; static inline int pud_none(pud_t pud) { return 0; } static inline int pud_bad(pud_t pud) { return 0; } static inline int pud_present(pud_t pud) { return 1; } -static inline int pud_user(pud_t pud) { return 0; } static inline int pud_leaf(pud_t pud) { return 0; } static inline void pud_clear(pud_t *pud) { } #define pmd_ERROR(pmd) (pud_ERROR((pmd).pud)) -- 2.44.0 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 3/3] mm: Add p{g/4}d_leaf() in asm-generic/pgtable-nop{4/u}d.h 2024-07-04 6:30 [PATCH 1/3] arch/x86: Drop own definition of pgd,p4d_leaf Christophe Leroy 2024-07-04 6:30 ` [PATCH 2/3] mm: Remove pud_user() from asm-generic/pgtable-nopmd.h Christophe Leroy @ 2024-07-04 6:30 ` Christophe Leroy 2024-07-04 14:48 ` Peter Xu 1 sibling, 1 reply; 6+ messages in thread From: Christophe Leroy @ 2024-07-04 6:30 UTC (permalink / raw) To: Andrew Morton, Arnd Bergmann Cc: Christophe Leroy, linux-kernel, linux-mm, x86, linux-riscv, Oscar Salvador Commit 2c8a81dc0cc5 ("riscv/mm: fix two page table check related issues") added pud_leaf() in include/asm-generic/pgtable-nopmd.h Do the same for p4d_leaf() and pgd_leaf() to avoid getting them erroneously defined by architectures that do not implement the related page level. Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> --- include/asm-generic/pgtable-nop4d.h | 1 + include/asm-generic/pgtable-nopud.h | 1 + include/linux/pgtable.h | 6 +++--- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/asm-generic/pgtable-nop4d.h b/include/asm-generic/pgtable-nop4d.h index 03b7dae47dd4..75c96bbc5a96 100644 --- a/include/asm-generic/pgtable-nop4d.h +++ b/include/asm-generic/pgtable-nop4d.h @@ -21,6 +21,7 @@ typedef struct { pgd_t pgd; } p4d_t; static inline int pgd_none(pgd_t pgd) { return 0; } static inline int pgd_bad(pgd_t pgd) { return 0; } static inline int pgd_present(pgd_t pgd) { return 1; } +static inline int pgd_leaf(pgd_t pgd) { return 0; } static inline void pgd_clear(pgd_t *pgd) { } #define p4d_ERROR(p4d) (pgd_ERROR((p4d).pgd)) diff --git a/include/asm-generic/pgtable-nopud.h b/include/asm-generic/pgtable-nopud.h index eb70c6d7ceff..14aeb8ef2d8a 100644 --- a/include/asm-generic/pgtable-nopud.h +++ b/include/asm-generic/pgtable-nopud.h @@ -28,6 +28,7 @@ typedef struct { p4d_t p4d; } pud_t; static inline int p4d_none(p4d_t p4d) { return 0; } static inline int p4d_bad(p4d_t p4d) { return 0; } static inline int p4d_present(p4d_t p4d) { return 1; } +static inline int p4d_leaf(p4d_t p4d) { return 0; } static inline void p4d_clear(p4d_t *p4d) { } #define pud_ERROR(pud) (p4d_ERROR((pud).p4d)) diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index 2a6a3cccfc36..b27e66f542d6 100644 --- a/include/linux/pgtable.h +++ b/include/linux/pgtable.h @@ -1882,13 +1882,13 @@ typedef unsigned int pgtbl_mod_mask; * - It should cover all kinds of huge mappings (e.g., pXd_trans_huge(), * pXd_devmap(), or hugetlb mappings). */ -#ifndef pgd_leaf +#if !defined(__PAGETABLE_P4D_FOLDED) && !defined(pgd_leaf) #define pgd_leaf(x) false #endif -#ifndef p4d_leaf +#if !defined(__PAGETABLE_PUD_FOLDED) && !defined(p4d_leaf) #define p4d_leaf(x) false #endif -#ifndef pud_leaf +#if !defined(__PAGETABLE_PMD_FOLDED) && !defined(pud_leaf) #define pud_leaf(x) false #endif #ifndef pmd_leaf -- 2.44.0 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 3/3] mm: Add p{g/4}d_leaf() in asm-generic/pgtable-nop{4/u}d.h 2024-07-04 6:30 ` [PATCH 3/3] mm: Add p{g/4}d_leaf() in asm-generic/pgtable-nop{4/u}d.h Christophe Leroy @ 2024-07-04 14:48 ` Peter Xu 2024-07-09 19:48 ` Christophe Leroy 0 siblings, 1 reply; 6+ messages in thread From: Peter Xu @ 2024-07-04 14:48 UTC (permalink / raw) To: Christophe Leroy Cc: Andrew Morton, Arnd Bergmann, linux-kernel, linux-mm, x86, linux-riscv, Oscar Salvador On Thu, Jul 04, 2024 at 08:30:05AM +0200, Christophe Leroy wrote: > Commit 2c8a81dc0cc5 ("riscv/mm: fix two page table check related > issues") added pud_leaf() in include/asm-generic/pgtable-nopmd.h > > Do the same for p4d_leaf() and pgd_leaf() to avoid getting them > erroneously defined by architectures that do not implement the > related page level. > > Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> > --- > include/asm-generic/pgtable-nop4d.h | 1 + > include/asm-generic/pgtable-nopud.h | 1 + > include/linux/pgtable.h | 6 +++--- > 3 files changed, 5 insertions(+), 3 deletions(-) > > diff --git a/include/asm-generic/pgtable-nop4d.h b/include/asm-generic/pgtable-nop4d.h > index 03b7dae47dd4..75c96bbc5a96 100644 > --- a/include/asm-generic/pgtable-nop4d.h > +++ b/include/asm-generic/pgtable-nop4d.h > @@ -21,6 +21,7 @@ typedef struct { pgd_t pgd; } p4d_t; > static inline int pgd_none(pgd_t pgd) { return 0; } > static inline int pgd_bad(pgd_t pgd) { return 0; } > static inline int pgd_present(pgd_t pgd) { return 1; } > +static inline int pgd_leaf(pgd_t pgd) { return 0; } > static inline void pgd_clear(pgd_t *pgd) { } > #define p4d_ERROR(p4d) (pgd_ERROR((p4d).pgd)) > > diff --git a/include/asm-generic/pgtable-nopud.h b/include/asm-generic/pgtable-nopud.h > index eb70c6d7ceff..14aeb8ef2d8a 100644 > --- a/include/asm-generic/pgtable-nopud.h > +++ b/include/asm-generic/pgtable-nopud.h > @@ -28,6 +28,7 @@ typedef struct { p4d_t p4d; } pud_t; > static inline int p4d_none(p4d_t p4d) { return 0; } > static inline int p4d_bad(p4d_t p4d) { return 0; } > static inline int p4d_present(p4d_t p4d) { return 1; } > +static inline int p4d_leaf(p4d_t p4d) { return 0; } > static inline void p4d_clear(p4d_t *p4d) { } > #define pud_ERROR(pud) (p4d_ERROR((pud).p4d)) > > diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h > index 2a6a3cccfc36..b27e66f542d6 100644 > --- a/include/linux/pgtable.h > +++ b/include/linux/pgtable.h > @@ -1882,13 +1882,13 @@ typedef unsigned int pgtbl_mod_mask; > * - It should cover all kinds of huge mappings (e.g., pXd_trans_huge(), > * pXd_devmap(), or hugetlb mappings). > */ > -#ifndef pgd_leaf > +#if !defined(__PAGETABLE_P4D_FOLDED) && !defined(pgd_leaf) > #define pgd_leaf(x) false > #endif > -#ifndef p4d_leaf > +#if !defined(__PAGETABLE_PUD_FOLDED) && !defined(p4d_leaf) > #define p4d_leaf(x) false > #endif > -#ifndef pud_leaf > +#if !defined(__PAGETABLE_PMD_FOLDED) && !defined(pud_leaf) > #define pud_leaf(x) false > #endif > #ifndef pmd_leaf Is it possible to do it the other way round, so that we can still rely on "ifdef pxx_leaf" to decide whether to provide a fallback, and define them properly when needed? IMHO it was a neat way to avoid worrying on any macro defined; it'll be as simple as "if function xxx not defined, let's define a fallback for xxx". Per my limited experience it helped a lot on avoid compile issues here and there.. Thanks, -- Peter Xu ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 3/3] mm: Add p{g/4}d_leaf() in asm-generic/pgtable-nop{4/u}d.h 2024-07-04 14:48 ` Peter Xu @ 2024-07-09 19:48 ` Christophe Leroy 2024-07-09 20:05 ` Peter Xu 0 siblings, 1 reply; 6+ messages in thread From: Christophe Leroy @ 2024-07-09 19:48 UTC (permalink / raw) To: Peter Xu Cc: Andrew Morton, Arnd Bergmann, linux-kernel, linux-mm, x86, linux-riscv, Oscar Salvador Le 04/07/2024 à 16:48, Peter Xu a écrit : > On Thu, Jul 04, 2024 at 08:30:05AM +0200, Christophe Leroy wrote: >> Commit 2c8a81dc0cc5 ("riscv/mm: fix two page table check related >> issues") added pud_leaf() in include/asm-generic/pgtable-nopmd.h >> >> Do the same for p4d_leaf() and pgd_leaf() to avoid getting them >> erroneously defined by architectures that do not implement the >> related page level. >> >> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> >> --- >> include/asm-generic/pgtable-nop4d.h | 1 + >> include/asm-generic/pgtable-nopud.h | 1 + >> include/linux/pgtable.h | 6 +++--- >> 3 files changed, 5 insertions(+), 3 deletions(-) >> >> diff --git a/include/asm-generic/pgtable-nop4d.h b/include/asm-generic/pgtable-nop4d.h >> index 03b7dae47dd4..75c96bbc5a96 100644 >> --- a/include/asm-generic/pgtable-nop4d.h >> +++ b/include/asm-generic/pgtable-nop4d.h >> @@ -21,6 +21,7 @@ typedef struct { pgd_t pgd; } p4d_t; >> static inline int pgd_none(pgd_t pgd) { return 0; } >> static inline int pgd_bad(pgd_t pgd) { return 0; } >> static inline int pgd_present(pgd_t pgd) { return 1; } >> +static inline int pgd_leaf(pgd_t pgd) { return 0; } >> static inline void pgd_clear(pgd_t *pgd) { } >> #define p4d_ERROR(p4d) (pgd_ERROR((p4d).pgd)) >> >> diff --git a/include/asm-generic/pgtable-nopud.h b/include/asm-generic/pgtable-nopud.h >> index eb70c6d7ceff..14aeb8ef2d8a 100644 >> --- a/include/asm-generic/pgtable-nopud.h >> +++ b/include/asm-generic/pgtable-nopud.h >> @@ -28,6 +28,7 @@ typedef struct { p4d_t p4d; } pud_t; >> static inline int p4d_none(p4d_t p4d) { return 0; } >> static inline int p4d_bad(p4d_t p4d) { return 0; } >> static inline int p4d_present(p4d_t p4d) { return 1; } >> +static inline int p4d_leaf(p4d_t p4d) { return 0; } >> static inline void p4d_clear(p4d_t *p4d) { } >> #define pud_ERROR(pud) (p4d_ERROR((pud).p4d)) >> >> diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h >> index 2a6a3cccfc36..b27e66f542d6 100644 >> --- a/include/linux/pgtable.h >> +++ b/include/linux/pgtable.h >> @@ -1882,13 +1882,13 @@ typedef unsigned int pgtbl_mod_mask; >> * - It should cover all kinds of huge mappings (e.g., pXd_trans_huge(), >> * pXd_devmap(), or hugetlb mappings). >> */ >> -#ifndef pgd_leaf >> +#if !defined(__PAGETABLE_P4D_FOLDED) && !defined(pgd_leaf) >> #define pgd_leaf(x) false >> #endif >> -#ifndef p4d_leaf >> +#if !defined(__PAGETABLE_PUD_FOLDED) && !defined(p4d_leaf) >> #define p4d_leaf(x) false >> #endif >> -#ifndef pud_leaf >> +#if !defined(__PAGETABLE_PMD_FOLDED) && !defined(pud_leaf) >> #define pud_leaf(x) false >> #endif >> #ifndef pmd_leaf > > Is it possible to do it the other way round, so that we can still rely on > "ifdef pxx_leaf" to decide whether to provide a fallback, and define them > properly when needed? What do you mean by the "other way round" ? Did I do a mistake ? I can't see it. The purpose here is: - If the architecture has the said level and implements pXd_leaf(), that's fine - If the architecture has the said level and doesn't implement pXd_leaf(), that's also fine, a fallback is provided. - If the architecture doesn't have the said level but implements pXd_leaf(), it will conflict with the definition in include/asm-generic/pgtable-nopXd.h and the build will fail. The purpose is to make sure architectures don't implement pXd_leaf() at the wrong level, for instance: - an architecture without PMDs shall not implement anything else than pmd_leaf() - an architecture without P4Ds shall not implement pgd_leaf(). > > IMHO it was a neat way to avoid worrying on any macro defined; it'll be as > simple as "if function xxx not defined, let's define a fallback for xxx". > Per my limited experience it helped a lot on avoid compile issues here and > there.. That will still be the case. This patch adds: "if function xxx is defined for wrong level, break the build" Christophe ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 3/3] mm: Add p{g/4}d_leaf() in asm-generic/pgtable-nop{4/u}d.h 2024-07-09 19:48 ` Christophe Leroy @ 2024-07-09 20:05 ` Peter Xu 0 siblings, 0 replies; 6+ messages in thread From: Peter Xu @ 2024-07-09 20:05 UTC (permalink / raw) To: Christophe Leroy Cc: Andrew Morton, Arnd Bergmann, linux-kernel, linux-mm, x86, linux-riscv, Oscar Salvador On Tue, Jul 09, 2024 at 09:48:24PM +0200, Christophe Leroy wrote: > > > Le 04/07/2024 à 16:48, Peter Xu a écrit : > > On Thu, Jul 04, 2024 at 08:30:05AM +0200, Christophe Leroy wrote: > > > Commit 2c8a81dc0cc5 ("riscv/mm: fix two page table check related > > > issues") added pud_leaf() in include/asm-generic/pgtable-nopmd.h > > > > > > Do the same for p4d_leaf() and pgd_leaf() to avoid getting them > > > erroneously defined by architectures that do not implement the > > > related page level. > > > > > > Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> > > > --- > > > include/asm-generic/pgtable-nop4d.h | 1 + > > > include/asm-generic/pgtable-nopud.h | 1 + > > > include/linux/pgtable.h | 6 +++--- > > > 3 files changed, 5 insertions(+), 3 deletions(-) > > > > > > diff --git a/include/asm-generic/pgtable-nop4d.h b/include/asm-generic/pgtable-nop4d.h > > > index 03b7dae47dd4..75c96bbc5a96 100644 > > > --- a/include/asm-generic/pgtable-nop4d.h > > > +++ b/include/asm-generic/pgtable-nop4d.h > > > @@ -21,6 +21,7 @@ typedef struct { pgd_t pgd; } p4d_t; > > > static inline int pgd_none(pgd_t pgd) { return 0; } > > > static inline int pgd_bad(pgd_t pgd) { return 0; } > > > static inline int pgd_present(pgd_t pgd) { return 1; } > > > +static inline int pgd_leaf(pgd_t pgd) { return 0; } > > > static inline void pgd_clear(pgd_t *pgd) { } > > > #define p4d_ERROR(p4d) (pgd_ERROR((p4d).pgd)) > > > diff --git a/include/asm-generic/pgtable-nopud.h b/include/asm-generic/pgtable-nopud.h > > > index eb70c6d7ceff..14aeb8ef2d8a 100644 > > > --- a/include/asm-generic/pgtable-nopud.h > > > +++ b/include/asm-generic/pgtable-nopud.h > > > @@ -28,6 +28,7 @@ typedef struct { p4d_t p4d; } pud_t; > > > static inline int p4d_none(p4d_t p4d) { return 0; } > > > static inline int p4d_bad(p4d_t p4d) { return 0; } > > > static inline int p4d_present(p4d_t p4d) { return 1; } > > > +static inline int p4d_leaf(p4d_t p4d) { return 0; } > > > static inline void p4d_clear(p4d_t *p4d) { } > > > #define pud_ERROR(pud) (p4d_ERROR((pud).p4d)) > > > diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h > > > index 2a6a3cccfc36..b27e66f542d6 100644 > > > --- a/include/linux/pgtable.h > > > +++ b/include/linux/pgtable.h > > > @@ -1882,13 +1882,13 @@ typedef unsigned int pgtbl_mod_mask; > > > * - It should cover all kinds of huge mappings (e.g., pXd_trans_huge(), > > > * pXd_devmap(), or hugetlb mappings). > > > */ > > > -#ifndef pgd_leaf > > > +#if !defined(__PAGETABLE_P4D_FOLDED) && !defined(pgd_leaf) > > > #define pgd_leaf(x) false > > > #endif > > > -#ifndef p4d_leaf > > > +#if !defined(__PAGETABLE_PUD_FOLDED) && !defined(p4d_leaf) > > > #define p4d_leaf(x) false > > > #endif > > > -#ifndef pud_leaf > > > +#if !defined(__PAGETABLE_PMD_FOLDED) && !defined(pud_leaf) > > > #define pud_leaf(x) false > > > #endif > > > #ifndef pmd_leaf > > > > Is it possible to do it the other way round, so that we can still rely on > > "ifdef pxx_leaf" to decide whether to provide a fallback, and define them > > properly when needed? > > What do you mean by the "other way round" ? Did I do a mistake ? I can't see > it. > > The purpose here is: > - If the architecture has the said level and implements pXd_leaf(), that's > fine > - If the architecture has the said level and doesn't implement pXd_leaf(), > that's also fine, a fallback is provided. > - If the architecture doesn't have the said level but implements pXd_leaf(), > it will conflict with the definition in include/asm-generic/pgtable-nopXd.h > and the build will fail. > > The purpose is to make sure architectures don't implement pXd_leaf() at the > wrong level, for instance: > - an architecture without PMDs shall not implement anything else than > pmd_leaf() > - an architecture without P4Ds shall not implement pgd_leaf(). What I meant is it'll be nice to keep the pattern of using: #ifndef XXX #define XXX ... #endif Rather than: #if defined(YYY) && !defined(XXX) #define XXX ... #endif The reason is it is not as obvious as previous one, and we can still miss some defines depending on whether YYY was there. The current patch also didn't follow the rule where "if pxx_leaf is defined, we should define the macro" rule. Then we introduce yet another rule for defining these. In short, what I thought as "the other way round" is as simple as something like: ===8<=== diff --git a/include/asm-generic/pgtable-nopmd.h b/include/asm-generic/pgtable-nopmd.h index 8ffd64e7a24c..cce31c1f9159 100644 --- a/include/asm-generic/pgtable-nopmd.h +++ b/include/asm-generic/pgtable-nopmd.h @@ -31,8 +31,8 @@ static inline int pud_none(pud_t pud) { return 0; } static inline int pud_bad(pud_t pud) { return 0; } static inline int pud_present(pud_t pud) { return 1; } static inline int pud_user(pud_t pud) { return 0; } -static inline int pud_leaf(pud_t pud) { return 0; } static inline void pud_clear(pud_t *pud) { } +#define pud_leaf(pud) false #define pmd_ERROR(pmd) (pud_ERROR((pmd).pud)) #define pud_populate(mm, pmd, pte) do { } while (0) ===8<=== When used as a macro we don't need to touch linux/pgtable.h. Would that look nicer? Thanks, -- Peter Xu ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-07-09 20:05 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-04 6:30 [PATCH 1/3] arch/x86: Drop own definition of pgd,p4d_leaf Christophe Leroy
2024-07-04 6:30 ` [PATCH 2/3] mm: Remove pud_user() from asm-generic/pgtable-nopmd.h Christophe Leroy
2024-07-04 6:30 ` [PATCH 3/3] mm: Add p{g/4}d_leaf() in asm-generic/pgtable-nop{4/u}d.h Christophe Leroy
2024-07-04 14:48 ` Peter Xu
2024-07-09 19:48 ` Christophe Leroy
2024-07-09 20:05 ` Peter Xu
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox