arch/x86/mm/pgtable.c:600: warning: Function parameter or member 'p4d' not described in 'p4d_set_huge'

From: kernel test robot
Date: Sat Dec 09 2023 - 08:01:41 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: f2e8a57ee9036c7d5443382b6c3c09b51a92ec7e
commit: b8504058a06bd19286c8b59539eebfda69d1ecb5 x86/mm: Add basic defines/helpers for CONFIG_X86_5LEVEL=y
date: 7 years ago
config: i386-allnoconfig (https://download.01.org/0day-ci/archive/20231209/202312092055.UWtOrFJM-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231209/202312092055.UWtOrFJM-lkp@xxxxxxxxx/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 <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312092055.UWtOrFJM-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

arch/x86/mm/pgtable.c: In function 'pgd_alloc':
arch/x86/mm/pgtable.c:380:13: warning: 'preallocate_pmds' accessing 4 bytes in a region of size 0 [-Wstringop-overflow=]
380 | if (preallocate_pmds(mm, pmds) != 0)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/mm/pgtable.c:380:13: note: referencing argument 2 of type 'pmd_t *[0]'
arch/x86/mm/pgtable.c:214:12: note: in a call to function 'preallocate_pmds'
214 | static int preallocate_pmds(struct mm_struct *mm, pmd_t *pmds[])
| ^~~~~~~~~~~~~~~~
arch/x86/mm/pgtable.c:401:9: warning: 'free_pmds' accessing 4 bytes in a region of size 0 [-Wstringop-overflow=]
401 | free_pmds(mm, pmds);
| ^~~~~~~~~~~~~~~~~~~
arch/x86/mm/pgtable.c:401:9: note: referencing argument 2 of type 'pmd_t *[0]'
arch/x86/mm/pgtable.c:202:13: note: in a call to function 'free_pmds'
202 | static void free_pmds(struct mm_struct *mm, pmd_t *pmds[])
| ^~~~~~~~~
arch/x86/mm/pgtable.c:394:9: warning: 'pgd_prepopulate_pmd' accessing 4 bytes in a region of size 0 [-Wstringop-overflow=]
394 | pgd_prepopulate_pmd(mm, pgd, pmds);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/mm/pgtable.c:394:9: note: referencing argument 3 of type 'pmd_t *[0]'
arch/x86/mm/pgtable.c:270:13: note: in a call to function 'pgd_prepopulate_pmd'
270 | static void pgd_prepopulate_pmd(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmds[])
| ^~~~~~~~~~~~~~~~~~~
arch/x86/include/asm/bitops.h: Assembler messages:
arch/x86/include/asm/bitops.h:265: Warning: no instruction mnemonic suffix given and no register operands; using default for `btr'
arch/x86/include/asm/bitops.h:265: Warning: no instruction mnemonic suffix given and no register operands; using default for `btr'
arch/x86/mm/pgtable.c:563: warning: Function parameter or member 'reserve' not described in 'reserve_top_address'
>> arch/x86/mm/pgtable.c:600: warning: Function parameter or member 'p4d' not described in 'p4d_set_huge'
>> arch/x86/mm/pgtable.c:600: warning: Function parameter or member 'addr' not described in 'p4d_set_huge'
>> arch/x86/mm/pgtable.c:600: warning: Function parameter or member 'prot' not described in 'p4d_set_huge'
>> arch/x86/mm/pgtable.c:610: warning: Function parameter or member 'p4d' not described in 'p4d_clear_huge'
arch/x86/mm/pgtable.c:634: warning: Function parameter or member 'pud' not described in 'pud_set_huge'
arch/x86/mm/pgtable.c:634: warning: Function parameter or member 'addr' not described in 'pud_set_huge'
arch/x86/mm/pgtable.c:634: warning: Function parameter or member 'prot' not described in 'pud_set_huge'
arch/x86/mm/pgtable.c:659: warning: Function parameter or member 'pmd' not described in 'pmd_set_huge'
arch/x86/mm/pgtable.c:659: warning: Function parameter or member 'addr' not described in 'pmd_set_huge'
arch/x86/mm/pgtable.c:659: warning: Function parameter or member 'prot' not described in 'pmd_set_huge'
arch/x86/mm/pgtable.c:685: warning: Function parameter or member 'pud' not described in 'pud_clear_huge'
arch/x86/mm/pgtable.c:700: warning: Function parameter or member 'pmd' not described in 'pmd_clear_huge'


vim +600 arch/x86/mm/pgtable.c

591
592 #ifdef CONFIG_HAVE_ARCH_HUGE_VMAP
593 #ifdef CONFIG_X86_5LEVEL
594 /**
595 * p4d_set_huge - setup kernel P4D mapping
596 *
597 * No 512GB pages yet -- always return 0
598 */
599 int p4d_set_huge(p4d_t *p4d, phys_addr_t addr, pgprot_t prot)
> 600 {
601 return 0;
602 }
603
604 /**
605 * p4d_clear_huge - clear kernel P4D mapping when it is set
606 *
607 * No 512GB pages yet -- always return 0
608 */
609 int p4d_clear_huge(p4d_t *p4d)
> 610 {
611 return 0;
612 }
613 #endif
614

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki