m68k: Remove redefinitions of `PMD_SIZE`, `PMD_MASK`, etc.
PATCH 1/1 m68k: Remove redefinitions of `PMD_SIZE`, `PMD_MASK`, etc.
Remove redefinitions of PMD_SIZE, PMD_MASK, PTRS_PER_PMD, and __PAGETABLE_PMD_FOLDED when PGTABLE_LEVELS == 2 (i.e. SUN3 || COLDFIRE). They have already been defined in asm-generic/pgtable-nopmd.h.
See also https://lore.kernel.org/lkml/[email protected]/#t
--- arch/m68k/include/asm/pgtable_mm.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
arch/m68k/include/asm/pgtable_mm.h +1 -5
@@ -37,9 +37,9 @@/* PMD_SHIFT determines the size of the area a second-level page table can map */ #if CONFIG_PGTABLE_LEVELS ==3 #define PMD_SHIFT 18 -#endif #define PMD_SIZE (1UL << PMD_SHIFT)#define PMD_MASK (~(PMD_SIZE-1)) +#endif /* PGDIR_SHIFT determines what a third-level page table entry can map */ #ifdef CONFIG_SUN3
@@ -58,13 +58,9 @@*/ #ifdef CONFIG_SUN3 #define PTRS_PER_PTE 16 -#define __PAGETABLE_PMD_FOLDED 1 -#define PTRS_PER_PMD 1#define PTRS_PER_PGD 2048#elif defined(CONFIG_COLDFIRE )#define PTRS_PER_PTE 512 -#define __PAGETABLE_PMD_FOLDED 1 -#define PTRS_PER_PMD 1#define PTRS_PER_PGD 1024#else #define PTRS_PER_PTE 64
Signature · 1 line
2.25.1
Geert Uytterhoeven
maintainerHi Wende,
Quoted 4 lines · Wende Tan
Remove redefinitions of
PMD_SIZE,PMD_MASK,PTRS_PER_PMD, and__PAGETABLE_PMD_FOLDEDwhenPGTABLE_LEVELS== 2 (i.e. SUN3 || COLDFIRE). They have already been defined inasm-generic/pgtable-nopmd.h.
Thanks for your patch!
Quoted 1 line
I'm a bit confused: is this a new issue introduced by the patch from the above thread, or is this a pre-existing issue?
If the latter, do you know when it was introduced, and how to reproduce it?
Quoted 2 lines
Reported-by kernel test robot <[email protected]>Signed-off-by Wende Tan <[email protected]>
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Quoted 7 lines · Geert Uytterhoeven
Hi Wende,
Quoted 4 lines · Wende Tan
Remove redefinitions of
PMD_SIZE,PMD_MASK,PTRS_PER_PMD, and__PAGETABLE_PMD_FOLDEDwhenPGTABLE_LEVELS== 2 (i.e. SUN3 || COLDFIRE). They have already been defined inasm-generic/pgtable-nopmd.h.
Quoted 6 lines
Thanks for your patch!
Quoted 1 line
I'm a bit confused: is this a new issue introduced by the patch from the above thread, or is this a pre-existing issue?
If the latter, do you know when it was introduced, and how to reproduce it?
I think this is a pre-existing issue, introduced in
commit 60e50f34b13e ("m68k: mm: use pgtable-nopXd instead of 4level-fixup") . This commit replaced the usage of 4level-fixup.h in pgtable_mm.h to pgtable-nop*d.h and removed the redundent definition of PMD_SHIFT but forgot to clean up other macros like PMD_SIZE (it should be moved into the #if condition) [1].
And, GCC will not complain until two definitions of a macro with the same name differ (as the above thread changes 1UL to _UL(1)), hiding this issue.
Thanks.
Wende
Quoted 6 lines
Quoted 2 lines
Reported-by kernel test robot <[email protected]>Signed-off-by Wende Tan <[email protected]>Gr{oetje,eeting}s,
Geert