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: 7c98201b2598a42ac2ce6a9036ee4e4349a406ac commit: 1686d271f795f8756b49151978b95b095c0598ad [26967/30000] KVM: x86: Introduce kvm_post_set_cr0 to post handle the CR0 emulation config: x86_64-randconfig-123-20240910 (https://download.01.org/0day-ci/archive/20240912/202409121221.f86WxXWu-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/202409121221.f86WxXWu-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/202409121221.f86WxXWu-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:3044: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:3044:38: sparse: expected void const [noderef] __user * arch/x86/kvm/x86.c:3044:38: sparse: got unsigned char [usertype] * arch/x86/kvm/x86.c:8608:15: sparse: sparse: incompatible types in comparison expression (different address spaces): arch/x86/kvm/x86.c:8608:15: sparse: struct kvm_apic_map [noderef] __rcu * arch/x86/kvm/x86.c:8608:15: sparse: struct kvm_apic_map * arch/x86/kvm/x86.c:11008:32: sparse: sparse: Using plain integer as NULL pointer arch/x86/kvm/x86.c:11061:16: sparse: sparse: incompatible types in comparison expression (different address spaces): arch/x86/kvm/x86.c:11061:16: sparse: struct kvm_apic_map [noderef] __rcu * arch/x86/kvm/x86.c:11061:16: sparse: struct kvm_apic_map * arch/x86/kvm/x86.c:11062:15: sparse: sparse: incompatible types in comparison expression (different address spaces): arch/x86/kvm/x86.c:11062:15: sparse: struct kvm_pmu_event_filter [noderef] __rcu * arch/x86/kvm/x86.c:11062:15: sparse: struct kvm_pmu_event_filter * arch/x86/kvm/x86.c:4134: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_cr0 +893 arch/x86/kvm/x86.c
892
893 void kvm_post_set_cr0(struct kvm_vcpu *vcpu, unsigned long old_cr0, unsigned long cr0)
894 { 895 unsigned long update_bits = X86_CR0_PG | X86_CR0_WP; 896 897 if ((cr0 ^ old_cr0) & X86_CR0_PG) { 898 kvm_clear_async_pf_completion_queue(vcpu); 899 kvm_async_pf_hash_reset(vcpu); 900 } 901 902 if ((cr0 ^ old_cr0) & update_bits) 903 kvm_mmu_reset_context(vcpu); 904 905 if (((cr0 ^ old_cr0) & X86_CR0_CD) && 906 kvm_arch_has_noncoherent_dma(vcpu->kvm) && 907 !kvm_check_has_quirk(vcpu->kvm, KVM_X86_QUIRK_CD_NW_CLEARED)) 908 kvm_zap_gfn_range(vcpu->kvm, 0, ~0ULL); 909 } 910