Hi Yu,
FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.
tree: https://gitee.com/openeuler/kernel.git OLK-5.10 head: edbc98270a614911e6064ff3675e6f8a0a6dde0b commit: 8a7e6f51a756aa6e88ebd5da8a5f3b6744cd07b5 [26966/30000] KVM: x86: Introduce kvm_post_set_cr4 to post handle the CR4 emulation config: x86_64-randconfig-123-20240910 (https://download.01.org/0day-ci/archive/20240912/202409121652.VtoLzgNf-lkp@i...) 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/20240912/202409121652.VtoLzgNf-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/202409121652.VtoLzgNf-lkp@intel.com/
sparse warnings: (new ones prefixed by >>) arch/x86/kvm/x86.c:893:6: sparse: sparse: symbol 'kvm_post_set_cr0' was not declared. Should it be static?
arch/x86/kvm/x86.c:1076:6: sparse: sparse: symbol 'kvm_post_set_cr4' was not declared. Should it be static?
arch/x86/kvm/x86.c:3051:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __user * @@ got unsigned char [usertype] * @@ arch/x86/kvm/x86.c:3051:38: sparse: expected void const [noderef] __user * arch/x86/kvm/x86.c:3051:38: sparse: got unsigned char [usertype] * arch/x86/kvm/x86.c:8615:15: sparse: sparse: incompatible types in comparison expression (different address spaces): arch/x86/kvm/x86.c:8615:15: sparse: struct kvm_apic_map [noderef] __rcu * arch/x86/kvm/x86.c:8615:15: sparse: struct kvm_apic_map * arch/x86/kvm/x86.c:11015:32: sparse: sparse: Using plain integer as NULL pointer arch/x86/kvm/x86.c:11068:16: sparse: sparse: incompatible types in comparison expression (different address spaces): arch/x86/kvm/x86.c:11068:16: sparse: struct kvm_apic_map [noderef] __rcu * arch/x86/kvm/x86.c:11068:16: sparse: struct kvm_apic_map * arch/x86/kvm/x86.c:11069:15: sparse: sparse: incompatible types in comparison expression (different address spaces): arch/x86/kvm/x86.c:11069:15: sparse: struct kvm_pmu_event_filter [noderef] __rcu * arch/x86/kvm/x86.c:11069:15: sparse: struct kvm_pmu_event_filter * arch/x86/kvm/x86.c:4141:42: sparse: sparse: self-comparison always evaluates to false arch/x86/kvm/x86.c: note: in included file (through include/linux/notifier.h, arch/x86/include/asm/uprobes.h, include/linux/uprobes.h, ...): include/linux/srcu.h:182:9: sparse: sparse: context imbalance in 'vcpu_enter_guest' - unexpected unlock
vim +/kvm_post_set_cr4 +1076 arch/x86/kvm/x86.c
1075
1076 void kvm_post_set_cr4(struct kvm_vcpu *vcpu, unsigned long old_cr4, unsigned long cr4)
1077 { 1078 unsigned long mmu_role_bits = X86_CR4_PGE | X86_CR4_PSE | X86_CR4_PAE | 1079 X86_CR4_SMEP | X86_CR4_SMAP | X86_CR4_PKE; 1080 1081 if (((cr4 ^ old_cr4) & mmu_role_bits) || 1082 (!(cr4 & X86_CR4_PCIDE) && (old_cr4 & X86_CR4_PCIDE))) 1083 kvm_mmu_reset_context(vcpu); 1084 } 1085