Hi Song,
First bad commit (maybe != root cause):
tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 604e996dd0189ddb0875f389b87fa2084b3a9424 commit: 031d5914323febe9668956dfa7fe8443b7dc597c [1693/1693] LoongArch: KVM: Add PMU support for guest config: loongarch-randconfig-r112-20250103 (https://download.01.org/0day-ci/archive/20250103/202501032224.CjyqUkQC-lkp@i...) compiler: loongarch64-linux-gcc (GCC) 14.2.0 reproduce: (https://download.01.org/0day-ci/archive/20250103/202501032224.CjyqUkQC-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/202501032224.CjyqUkQC-lkp@intel.com/
sparse warnings: (new ones prefixed by >>) arch/loongarch/kvm/vcpu.c:17:49: sparse: sparse: array of flexible structures arch/loongarch/kvm/vcpu.c: note: in included file: include/linux/kvm_host.h:2045:56: sparse: sparse: array of flexible structures arch/loongarch/kvm/vcpu.c:104:15: sparse: sparse: undefined identifier '__builtin_loongarch_csrrd_d' arch/loongarch/kvm/vcpu.c:106:9: sparse: sparse: undefined identifier '__builtin_loongarch_csrwr_d' arch/loongarch/kvm/vcpu.c:124:9: sparse: sparse: undefined identifier '__builtin_loongarch_csrwr_d'
arch/loongarch/kvm/vcpu.c:224:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
arch/loongarch/kvm/vcpu.c:224:9: sparse: expected void *ptr arch/loongarch/kvm/vcpu.c:224:9: sparse: got unsigned int [noderef] __percpu *
arch/loongarch/kvm/vcpu.c:224:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
arch/loongarch/kvm/vcpu.c:224:9: sparse: expected void *ptr arch/loongarch/kvm/vcpu.c:224:9: sparse: got unsigned int [noderef] __percpu *
arch/loongarch/kvm/vcpu.c:224:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
arch/loongarch/kvm/vcpu.c:224:9: sparse: expected void *ptr arch/loongarch/kvm/vcpu.c:224:9: sparse: got unsigned int [noderef] __percpu *
arch/loongarch/kvm/vcpu.c:224:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
arch/loongarch/kvm/vcpu.c:224:9: sparse: expected void *ptr arch/loongarch/kvm/vcpu.c:224:9: sparse: got unsigned int [noderef] __percpu *
arch/loongarch/kvm/vcpu.c:224:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
arch/loongarch/kvm/vcpu.c:224:9: sparse: expected void *ptr arch/loongarch/kvm/vcpu.c:224:9: sparse: got int [noderef] __percpu *
arch/loongarch/kvm/vcpu.c:224:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
arch/loongarch/kvm/vcpu.c:224:9: sparse: expected void *ptr arch/loongarch/kvm/vcpu.c:224:9: sparse: got int [noderef] __percpu *
arch/loongarch/kvm/vcpu.c:224:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
arch/loongarch/kvm/vcpu.c:224:9: sparse: expected void *ptr arch/loongarch/kvm/vcpu.c:224:9: sparse: got int [noderef] __percpu *
arch/loongarch/kvm/vcpu.c:224:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
arch/loongarch/kvm/vcpu.c:224:9: sparse: expected void *ptr arch/loongarch/kvm/vcpu.c:224:9: sparse: got int [noderef] __percpu * arch/loongarch/kvm/vcpu.c:290:42: sparse: sparse: undefined identifier '__builtin_loongarch_csrrd_d' arch/loongarch/kvm/vcpu.c:1442:33: sparse: sparse: undefined identifier '__builtin_loongarch_csrrd_w' arch/loongarch/kvm/vcpu.c:1529:9: sparse: sparse: undefined identifier '__builtin_loongarch_csrwr_d' arch/loongarch/kvm/vcpu.c:1578:9: sparse: sparse: undefined identifier '__builtin_loongarch_csrwr_d' arch/loongarch/kvm/vcpu.c:1671:42: sparse: sparse: undefined identifier '__builtin_loongarch_csrrd_d' arch/loongarch/kvm/vcpu.c:40:33: sparse: sparse: undefined identifier '__builtin_loongarch_csrrd_d' arch/loongarch/kvm/vcpu.c:41:33: sparse: sparse: undefined identifier '__builtin_loongarch_csrrd_d' arch/loongarch/kvm/vcpu.c:42:33: sparse: sparse: undefined identifier '__builtin_loongarch_csrrd_d' arch/loongarch/kvm/vcpu.c:43:33: sparse: sparse: undefined identifier '__builtin_loongarch_csrrd_d' arch/loongarch/kvm/vcpu.c:44:33: sparse: sparse: undefined identifier '__builtin_loongarch_csrwr_d' arch/loongarch/kvm/vcpu.c:45:33: sparse: sparse: undefined identifier '__builtin_loongarch_csrwr_d' arch/loongarch/kvm/vcpu.c:46:33: sparse: sparse: undefined identifier '__builtin_loongarch_csrwr_d' arch/loongarch/kvm/vcpu.c:47:33: sparse: sparse: undefined identifier '__builtin_loongarch_csrwr_d' arch/loongarch/kvm/vcpu.c:55:9: sparse: sparse: undefined identifier '__builtin_loongarch_csrwr_d' arch/loongarch/kvm/vcpu.c:56:9: sparse: sparse: undefined identifier '__builtin_loongarch_csrwr_d' arch/loongarch/kvm/vcpu.c:57:9: sparse: sparse: undefined identifier '__builtin_loongarch_csrwr_d' arch/loongarch/kvm/vcpu.c:58:9: sparse: sparse: undefined identifier '__builtin_loongarch_csrwr_d' arch/loongarch/kvm/vcpu.c:59:9: sparse: sparse: undefined identifier '__builtin_loongarch_csrwr_d' arch/loongarch/kvm/vcpu.c:60:9: sparse: sparse: undefined identifier '__builtin_loongarch_csrwr_d' arch/loongarch/kvm/vcpu.c:61:9: sparse: sparse: undefined identifier '__builtin_loongarch_csrwr_d' arch/loongarch/kvm/vcpu.c:62:9: sparse: sparse: undefined identifier '__builtin_loongarch_csrwr_d' arch/loongarch/kvm/vcpu.c: note: in included file (through arch/loongarch/include/asm/loongarch.h, arch/loongarch/include/asm/cpu-info.h, ...): ../lib/gcc/loongarch64-linux/14.2.0/include/larchintrin.h:107:10: sparse: sparse: undefined identifier '__builtin_loongarch_cpucfg' arch/loongarch/kvm/vcpu.c: note: in included file (through arch/loongarch/include/asm/cpu-info.h, arch/loongarch/include/asm/processor.h, ...): arch/loongarch/include/asm/loongarch.h:1282:1: sparse: sparse: undefined identifier '__builtin_loongarch_csrrd_w' arch/loongarch/include/asm/loongarch.h:1282:1: sparse: sparse: undefined identifier '__builtin_loongarch_csrwr_w' arch/loongarch/include/asm/loongarch.h:1282:1: sparse: sparse: undefined identifier '__builtin_loongarch_csrrd_w' arch/loongarch/include/asm/loongarch.h:1282:1: sparse: sparse: undefined identifier '__builtin_loongarch_csrwr_w' arch/loongarch/kvm/vcpu.c: note: in included file (through arch/loongarch/kvm/trace.h): arch/loongarch/include/asm/kvm_csr.h:167:1: sparse: sparse: undefined identifier '__builtin_loongarch_csrrd_d' arch/loongarch/include/asm/kvm_csr.h:167:1: sparse: sparse: undefined identifier '__builtin_loongarch_csrwr_d' arch/loongarch/kvm/vcpu.c: note: in included file: arch/loongarch/include/asm/fpu.h:76:17: sparse: sparse: undefined identifier '__builtin_loongarch_csrrd_w' arch/loongarch/include/asm/fpu.h:85:17: sparse: sparse: undefined identifier '__builtin_loongarch_csrrd_w'
vim +224 arch/loongarch/kvm/vcpu.c
3ec7320b0a2844 Tianrui Zhao 2023-10-02 221 3f5dde7efb48ae Bibo Mao 2024-07-09 222 static void kvm_late_check_requests(struct kvm_vcpu *vcpu) 3f5dde7efb48ae Bibo Mao 2024-07-09 223 { 3f5dde7efb48ae Bibo Mao 2024-07-09 @224 lockdep_assert_irqs_disabled(); 3f5dde7efb48ae Bibo Mao 2024-07-09 225 if (kvm_check_request(KVM_REQ_TLB_FLUSH_GPA, vcpu)) 3f5dde7efb48ae Bibo Mao 2024-07-09 226 if (vcpu->arch.flush_gpa != INVALID_GPA) { 3f5dde7efb48ae Bibo Mao 2024-07-09 227 kvm_flush_tlb_gpa(vcpu, vcpu->arch.flush_gpa); 3f5dde7efb48ae Bibo Mao 2024-07-09 228 vcpu->arch.flush_gpa = INVALID_GPA; 3f5dde7efb48ae Bibo Mao 2024-07-09 229 } 3f5dde7efb48ae Bibo Mao 2024-07-09 230 } 3f5dde7efb48ae Bibo Mao 2024-07-09 231
:::::: The code at line 224 was first introduced by commit :::::: 3f5dde7efb48ae2725aebecfbd47aacfa3def181 LoongArch: KVM: Delay secondary mmu tlb flush until guest entry
:::::: TO: Bibo Mao maobibo@loongson.cn :::::: CC: Xianglai Li lixianglai@loongson.cn