[openeuler:OLK-6.6 2464/2464] arch/arm64/kvm/tmi.c:25:24: sparse: sparse: cast removes address space '__iomem' of expression

tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 4467208a8b5583a77c842c4eb7673166deb5b717 commit: c5161d7e11a7e30755b2ec55aaebfd500193cbbc [2464/2464] virtCCA supports SR-IOV in CoDA scenarios. config: arm64-randconfig-r111-20250705 (https://download.01.org/0day-ci/archive/20250709/202507092132.Hy6EMke7-lkp@i...) compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project 61529d9e36fa86782a2458e6bdeedf7f376ef4b5) reproduce: (https://download.01.org/0day-ci/archive/20250709/202507092132.Hy6EMke7-lkp@i...) 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@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202507092132.Hy6EMke7-lkp@intel.com/ sparse warnings: (new ones prefixed by >>)
arch/arm64/kvm/tmi.c:25:24: sparse: sparse: cast removes address space '__iomem' of expression arch/arm64/kvm/tmi.c:33:16: sparse: sparse: cast removes address space '__iomem' of expression arch/arm64/kvm/tmi.c:37:25: sparse: sparse: cast removes address space '__iomem' of expression
vim +/__iomem +25 arch/arm64/kvm/tmi.c 67e11ee6347c43 Jingxian He 2024-08-03 11 4038e2b6238582 yangxiangkai 2024-09-18 12 /** 4038e2b6238582 yangxiangkai 2024-09-18 13 * mmio_va_to_pa - To convert the virtual address of the mmio space 4038e2b6238582 yangxiangkai 2024-09-18 14 * to a physical address, it is necessary to implement this interface 4038e2b6238582 yangxiangkai 2024-09-18 15 * because the kernel insterface __pa has an error when converting the 4038e2b6238582 yangxiangkai 2024-09-18 16 * physical address of the virtual address of the mmio space 4038e2b6238582 yangxiangkai 2024-09-18 17 * @addr: MMIO virtual address 4038e2b6238582 yangxiangkai 2024-09-18 18 */ c5161d7e11a7e3 yxk 2025-05-07 19 u64 mmio_va_to_pa(const void __iomem *addr) 95542c9cac98d1 yangxiangkai 2024-09-11 20 { 95542c9cac98d1 yangxiangkai 2024-09-11 21 uint64_t pa, par_el1; 95542c9cac98d1 yangxiangkai 2024-09-11 22 95542c9cac98d1 yangxiangkai 2024-09-11 23 asm volatile( 95542c9cac98d1 yangxiangkai 2024-09-11 24 "AT S1E1W, %0\n" 95542c9cac98d1 yangxiangkai 2024-09-11 @25 ::"r"((uint64_t)(addr)) 95542c9cac98d1 yangxiangkai 2024-09-11 26 ); 95542c9cac98d1 yangxiangkai 2024-09-11 27 isb(); 95542c9cac98d1 yangxiangkai 2024-09-11 28 asm volatile( 95542c9cac98d1 yangxiangkai 2024-09-11 29 "mrs %0, par_el1\n" 95542c9cac98d1 yangxiangkai 2024-09-11 30 : "=r"(par_el1) 95542c9cac98d1 yangxiangkai 2024-09-11 31 ); 95542c9cac98d1 yangxiangkai 2024-09-11 32 95542c9cac98d1 yangxiangkai 2024-09-11 33 pa = ((uint64_t)(addr) & (PAGE_SIZE - 1)) | 95542c9cac98d1 yangxiangkai 2024-09-11 34 (par_el1 & ULL(0x000ffffffffff000)); 95542c9cac98d1 yangxiangkai 2024-09-11 35 95542c9cac98d1 yangxiangkai 2024-09-11 36 if (par_el1 & UL(1 << 0)) 95542c9cac98d1 yangxiangkai 2024-09-11 37 return (uint64_t)(addr); 95542c9cac98d1 yangxiangkai 2024-09-11 38 else 95542c9cac98d1 yangxiangkai 2024-09-11 39 return pa; 95542c9cac98d1 yangxiangkai 2024-09-11 40 } 4038e2b6238582 yangxiangkai 2024-09-18 41 EXPORT_SYMBOL(mmio_va_to_pa); 95542c9cac98d1 yangxiangkai 2024-09-11 42 :::::: The code at line 25 was first introduced by commit :::::: 95542c9cac98d1fe33e1c1a4616cc9e638e73973 virtcca feature: read or write config space forwarding to secure world :::::: TO: yangxiangkai <yangxiangkai@huawei.com> :::::: CC: yangxiangkai <yangxiangkai@huawei.com> -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
participants (1)
-
kernel test robot