Skip to contentSkip to conversation

arch/x86/virt/vmx/tdx/tdx.c:663:27: sparse: sparse: incorrect type in argument 1 (different address spaces)

PATCH kernel test robot 1 participant 1 message Dec 31, 2023

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://github.com/ls-zhu/linux test
head:   62a15ffb17f55ec915aedff138ef7dd490f44532
commit: d111994fe80fd5a91e4677d6e7e624b10de7b66e [49/294] x86/virt/tdx: Configure global KeyID on all packages
config: x86_64-randconfig-123-20231229 (https://download.01.org/0day-ci/archive/20231231/[email protected]/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/20231231/[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]/

sparse warnings: (new ones prefixed by >>)

>> arch/x86/virt/vmx/tdx/tdx.c:663:27: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __iomem *dst @@     got void * @@

arch/x86/virt/vmx/tdx/tdx.c:663:27: sparse: expected void [noderef] __iomem *dst
arch/x86/virt/vmx/tdx/tdx.c:663:27: sparse: got void *
arch/x86/virt/vmx/tdx/tdx.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/xarray.h, ...):
include/linux/page-flags.h:242:46: sparse: sparse: self-comparison always evaluates to false arch/x86/virt/vmx/tdx/tdx.c: note: in included file (through include/linux/rculist.h, include/linux/pid.h, include/linux/sched.h, ...):
include/linux/list.h:83:21: sparse: sparse: self-comparison always evaluates to true

vim +663 arch/x86/virt/vmx/tdx/tdx.c

650
651 /*
652 * Convert TDX private pages back to normal by using MOVDIR64B to
653 * clear these pages. Note this function doesn't flush cache of
654 * these TDX private pages. The caller should make sure of that.
655 */
656 static void reset_tdx_pages(unsigned long base, unsigned long size)
657 {
658 const void *zero_page = (const void *)page_address(ZERO_PAGE(0));
659 unsigned long phys, end;
660
661 end = base + size;
662 for (phys = base; phys < end; phys += 64)

 > 663			movdir64b(__va(phys), zero_page);

664
665 /*
666 * MOVDIR64B uses WC protocol. Use memory barrier to
667 * make sure any later user of these pages sees the
668 * updated data.
669 */
670 mb();
671 }
672

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