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: e804413fbbd504bc7b5b84dc7b86307f2b127a83 commit: 8a7e6f51a756aa6e88ebd5da8a5f3b6744cd07b5 [2588/2588] KVM: x86: Introduce kvm_post_set_cr4 to post handle the CR4 emulation config: x86_64-randconfig-121-20241218 (https://download.01.org/0day-ci/archive/20241221/202412211034.4bD5Ydra-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/20241221/202412211034.4bD5Ydra-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/202412211034.4bD5Ydra-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, include/linux/memory_hotplug.h, include/linux/mmzone.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