arch/x86/hyperv/hv_crash.c:512:45-51: ERROR: application of sizeof to pointer
From: kernel test robot
Date: Tue Mar 10 2026 - 00:30:25 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 1f318b96cc84d7c2ab792fcc0bfd42a7ca890681
commit: 77c860d2dbb72d1f3c6a2e882a07d19eca399db5 x86/hyperv: Enable build of hypervisor crashdump collection files
date: 4 months ago
config: x86_64-randconfig-r061-20260310 (https://download.01.org/0day-ci/archive/20260310/202603101143.qUL1R1iy-lkp@xxxxxxxxx/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
rustc: rustc 1.88.0 (6b00bc388 2025-06-23)
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/202603101143.qUL1R1iy-lkp@xxxxxxxxx/
cocci warnings: (new ones prefixed by >>)
>> arch/x86/hyperv/hv_crash.c:512:45-51: ERROR: application of sizeof to pointer
arch/x86/hyperv/hv_crash.c:517:45-51: ERROR: application of sizeof to pointer
arch/x86/hyperv/hv_crash.c:521:45-51: ERROR: application of sizeof to pointer
arch/x86/hyperv/hv_crash.c:525:45-51: ERROR: application of sizeof to pointer
vim +512 arch/x86/hyperv/hv_crash.c
94212d34618c26 Mukesh Rathor 2025-10-06 499
94212d34618c26 Mukesh Rathor 2025-10-06 500 /*
94212d34618c26 Mukesh Rathor 2025-10-06 501 * Build 32bit trampoline page table for transition from protected mode
94212d34618c26 Mukesh Rathor 2025-10-06 502 * non-paging to long-mode paging. This transition needs pagetables below 4G.
94212d34618c26 Mukesh Rathor 2025-10-06 503 */
94212d34618c26 Mukesh Rathor 2025-10-06 504 static void hv_crash_build_tramp_pt(void)
94212d34618c26 Mukesh Rathor 2025-10-06 505 {
94212d34618c26 Mukesh Rathor 2025-10-06 506 p4d_t *p4d;
94212d34618c26 Mukesh Rathor 2025-10-06 507 pud_t *pud;
94212d34618c26 Mukesh Rathor 2025-10-06 508 pmd_t *pmd;
94212d34618c26 Mukesh Rathor 2025-10-06 509 pte_t *pte;
94212d34618c26 Mukesh Rathor 2025-10-06 510 u64 pa, addr = trampoline_pa;
94212d34618c26 Mukesh Rathor 2025-10-06 511
94212d34618c26 Mukesh Rathor 2025-10-06 @512 p4d = hv_crash_ptpgs[0] + pgd_index(addr) * sizeof(p4d);
94212d34618c26 Mukesh Rathor 2025-10-06 513 pa = virt_to_phys(hv_crash_ptpgs[1]);
94212d34618c26 Mukesh Rathor 2025-10-06 514 set_p4d(p4d, __p4d(_PAGE_TABLE | pa));
94212d34618c26 Mukesh Rathor 2025-10-06 515 p4d->p4d &= ~(_PAGE_NX); /* enable execute */
94212d34618c26 Mukesh Rathor 2025-10-06 516
94212d34618c26 Mukesh Rathor 2025-10-06 517 pud = hv_crash_ptpgs[1] + pud_index(addr) * sizeof(pud);
94212d34618c26 Mukesh Rathor 2025-10-06 518 pa = virt_to_phys(hv_crash_ptpgs[2]);
94212d34618c26 Mukesh Rathor 2025-10-06 519 set_pud(pud, __pud(_PAGE_TABLE | pa));
94212d34618c26 Mukesh Rathor 2025-10-06 520
94212d34618c26 Mukesh Rathor 2025-10-06 521 pmd = hv_crash_ptpgs[2] + pmd_index(addr) * sizeof(pmd);
94212d34618c26 Mukesh Rathor 2025-10-06 522 pa = virt_to_phys(hv_crash_ptpgs[3]);
94212d34618c26 Mukesh Rathor 2025-10-06 523 set_pmd(pmd, __pmd(_PAGE_TABLE | pa));
94212d34618c26 Mukesh Rathor 2025-10-06 524
94212d34618c26 Mukesh Rathor 2025-10-06 525 pte = hv_crash_ptpgs[3] + pte_index(addr) * sizeof(pte);
94212d34618c26 Mukesh Rathor 2025-10-06 526 set_pte(pte, pfn_pte(addr >> PAGE_SHIFT, PAGE_KERNEL_EXEC));
94212d34618c26 Mukesh Rathor 2025-10-06 527 }
94212d34618c26 Mukesh Rathor 2025-10-06 528
:::::: The code at line 512 was first introduced by commit
:::::: 94212d34618c2608758128da32ddac2ad834cb9f x86/hyperv: Implement hypervisor RAM collection into vmcore
:::::: TO: Mukesh Rathor <mrathor@xxxxxxxxxxxxxxxxxxx>
:::::: CC: Wei Liu <wei.liu@xxxxxxxxxx>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki