Skip to contentSkip to conversation

arch/arm64/include/asm/pgtable.h:1102:16: error: implicit declaration of function 'pud_valid'; did you mean 'pmd_valid'?

PATCH kernel test robot 3 participants 4 messages May 8, 2024 – May 9, 2024

Subsystems (2)
lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   e7b4ef8fffaca247809337bb78daceb406659f2d
commit: f0f5863a0fb0fb48a5881c3f6acca1958899dd76 [10159/12060] arm64/mm: Remove PTE_PROT_NONE bit
config: arm64-randconfig-r013-20230528 (https://download.01.org/0day-ci/archive/20240508/[email protected]/config)
compiler: aarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240508/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

In file included from include/linux/pgtable.h:6,

                    from arch/arm64/include/asm/io.h:12,
                    from include/linux/io.h:13,
                    from include/linux/irq.h:20,
                    from include/asm-generic/hardirq.h:17,
                    from arch/arm64/include/asm/hardirq.h:17,
                    from include/linux/hardirq.h:11,
                    from include/linux/interrupt.h:11,
                    from include/linux/trace_recursion.h:5,
                    from include/linux/ftrace.h:10,
                    from arch/arm64/kernel/asm-offsets.c:12:
   arch/arm64/include/asm/pgtable.h: In function 'pud_user_accessible_page':
>> arch/arm64/include/asm/pgtable.h:1102:16: error: implicit declaration of function 'pud_valid'; did you mean 'pmd_valid'? [-Werror=implicit-function-declaration]
    1102 |         return pud_valid(pud) && !pud_table(pud) && (pud_user(pud) || pud_user_exec(pud));
         |                ^~~~~~~~~
         |                pmd_valid

cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:117: arch/arm64/kernel/asm-offsets.s] Error 1 make[3]: Target 'prepare' not remade because of errors.
make[2]: *** [Makefile:1197: prepare0] Error 2
make[2]: Target 'prepare' not remade because of errors.
make[1]: *** [Makefile:240: __sub-make] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:240: __sub-make] Error 2
make: Target 'prepare' not remade because of errors.

vim +1102 arch/arm64/include/asm/pgtable.h

1099
1100 static inline bool pud_user_accessible_page(pud_t pud)
1101 {

> 1102		return pud_valid(pud) && !pud_table(pud) && (pud_user(pud) || pud_user_exec(pud));

1103 }
1104 #endif
1105

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#1 lore raw
Quoted 26 lines · kernel test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   e7b4ef8fffaca247809337bb78daceb406659f2d
commit: f0f5863a0fb0fb48a5881c3f6acca1958899dd76 [10159/12060] arm64/mm: Remove PTE_PROT_NONE bit
config: arm64-randconfig-r013-20230528 (https://download.01.org/0day-ci/archive/20240508/[email protected]/config)
compiler: aarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240508/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

   In file included from include/linux/pgtable.h:6,
                    from arch/arm64/include/asm/io.h:12,
                    from include/linux/io.h:13,
                    from include/linux/irq.h:20,
                    from include/asm-generic/hardirq.h:17,
                    from arch/arm64/include/asm/hardirq.h:17,
                    from include/linux/hardirq.h:11,
                    from include/linux/interrupt.h:11,
                    from include/linux/trace_recursion.h:5,
                    from include/linux/ftrace.h:10,
                    from arch/arm64/kernel/asm-offsets.c:12:
   arch/arm64/include/asm/pgtable.h: In function 'pud_user_accessible_page':
Quoted 4 lines
Quoted 1 line
Quoted 1 line

arch/arm64/include/asm/pgtable.h:1102:16: error: implicit declaration of function 'pud_valid'; did you mean 'pmd_valid'? [-Werror=implicit-function-declaration]

    1102 |         return pud_valid(pud) && !pud_table(pud) && (pud_user(pud) || pud_user_exec(pud));
         |                ^~~~~~~~~
         |                pmd_valid

Hi Will,

Looks like this is due to pud_valid() not being defined for CONFIG_PGTABLE_LEVELS <= 2. Seems to me that this is the cleanest solution. But pgtable folding breaks my brain so perhaps there is a better way?

What's the process here? Can you just merge this into the broken patch, or do I need to re-post the series, or post a fix patch formally?

--8<----

arch/arm64/include/asm/pgtable.h +1 -0
index c60dcb455ebd..f8efbc128446 100644
@@ -810,6 +810,7 @@ static inline pmd_t *pud_pgtable(pud_t pud)
 
 #else
 
+#define pud_valid(pud)         false
 #define pud_page_paddr(pud)    ({ BUILD_BUG(); 0; })
 #define pud_user_exec(pud)     pud_user(pud) /* Always 0 with folding */
 

--8<----

Thanks,
Ryan

Quoted 21 lines

cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:117: arch/arm64/kernel/asm-offsets.s] Error 1 make[3]: Target 'prepare' not remade because of errors.
make[2]: *** [Makefile:1197: prepare0] Error 2
make[2]: Target 'prepare' not remade because of errors.
make[1]: *** [Makefile:240: __sub-make] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:240: __sub-make] Error 2
make: Target 'prepare' not remade because of errors.

vim +1102 arch/arm64/include/asm/pgtable.h

1099
1100 static inline bool pud_user_accessible_page(pud_t pud)
1101 {

Quoted 1 line

1102 return pud_valid(pud) && !pud_table(pud) && (pud_user(pud) || pud_user_exec(pud));

1103 }
1104 #endif
1105

maintainer
#2 lore raw

Hey Ryan,

Quoted 32 lines · Ryan Roberts
Quoted 26 lines · kernel test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   e7b4ef8fffaca247809337bb78daceb406659f2d
commit: f0f5863a0fb0fb48a5881c3f6acca1958899dd76 [10159/12060] arm64/mm: Remove PTE_PROT_NONE bit
config: arm64-randconfig-r013-20230528 (https://download.01.org/0day-ci/archive/20240508/[email protected]/config)
compiler: aarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240508/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

   In file included from include/linux/pgtable.h:6,
                    from arch/arm64/include/asm/io.h:12,
                    from include/linux/io.h:13,
                    from include/linux/irq.h:20,
                    from include/asm-generic/hardirq.h:17,
                    from arch/arm64/include/asm/hardirq.h:17,
                    from include/linux/hardirq.h:11,
                    from include/linux/interrupt.h:11,
                    from include/linux/trace_recursion.h:5,
                    from include/linux/ftrace.h:10,
                    from arch/arm64/kernel/asm-offsets.c:12:
   arch/arm64/include/asm/pgtable.h: In function 'pud_user_accessible_page':
Quoted 4 lines
Quoted 1 line
Quoted 1 line

arch/arm64/include/asm/pgtable.h:1102:16: error: implicit declaration of function 'pud_valid'; did you mean 'pmd_valid'? [-Werror=implicit-function-declaration]

    1102 |         return pud_valid(pud) && !pud_table(pud) && (pud_user(pud) || pud_user_exec(pud));
         |                ^~~~~~~~~
         |                pmd_valid
Quoted 5 lines

Hi Will,

Looks like this is due to pud_valid() not being defined for CONFIG_PGTABLE_LEVELS <= 2. Seems to me that this is the cleanest solution. But pgtable folding breaks my brain so perhaps there is a better way?

I think your approach is the right idea. pgtable-nopmd.h defines pud_present() as 'return 1', but I think pud_valid() can be false given that it's only used directly by the arch code.

Quoted 2 lines

What's the process here? Can you just merge this into the broken patch, or do I need to re-post the series, or post a fix patch formally?

for-next/mm is stable, so please just submit proper patches on top of that (and you can add a Fixes: tag as well).

Cheers,

Will

#3 lore raw
Quoted 45 lines · Will Deacon

Hey Ryan,

Quoted 32 lines · Ryan Roberts
Quoted 26 lines · kernel test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   e7b4ef8fffaca247809337bb78daceb406659f2d
commit: f0f5863a0fb0fb48a5881c3f6acca1958899dd76 [10159/12060] arm64/mm: Remove PTE_PROT_NONE bit
config: arm64-randconfig-r013-20230528 (https://download.01.org/0day-ci/archive/20240508/[email protected]/config)
compiler: aarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240508/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

   In file included from include/linux/pgtable.h:6,
                    from arch/arm64/include/asm/io.h:12,
                    from include/linux/io.h:13,
                    from include/linux/irq.h:20,
                    from include/asm-generic/hardirq.h:17,
                    from arch/arm64/include/asm/hardirq.h:17,
                    from include/linux/hardirq.h:11,
                    from include/linux/interrupt.h:11,
                    from include/linux/trace_recursion.h:5,
                    from include/linux/ftrace.h:10,
                    from arch/arm64/kernel/asm-offsets.c:12:
   arch/arm64/include/asm/pgtable.h: In function 'pud_user_accessible_page':
Quoted 4 lines
Quoted 1 line
Quoted 1 line

arch/arm64/include/asm/pgtable.h:1102:16: error: implicit declaration of function 'pud_valid'; did you mean 'pmd_valid'? [-Werror=implicit-function-declaration]

    1102 |         return pud_valid(pud) && !pud_table(pud) && (pud_user(pud) || pud_user_exec(pud));
         |                ^~~~~~~~~
         |                pmd_valid
Quoted 5 lines

Hi Will,

Looks like this is due to pud_valid() not being defined for CONFIG_PGTABLE_LEVELS <= 2. Seems to me that this is the cleanest solution. But pgtable folding breaks my brain so perhaps there is a better way?

I think your approach is the right idea. pgtable-nopmd.h defines pud_present() as 'return 1', but I think pud_valid() can be false given that it's only used directly by the arch code.

Quoted 5 lines
Quoted 2 lines

What's the process here? Can you just merge this into the broken patch, or do I need to re-post the series, or post a fix patch formally?

for-next/mm is stable, so please just submit proper patches on top of that (and you can add a Fixes: tag as well).

OK no problem - I've posted the patch. Sorry about this!

Quoted 4 lines

Cheers,

Will