tree: https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue head: 45eb29140e68ffe8e93a5471006858a018480a45 commit: 268cbfe65bb9096f78f98d1e092b1939d3caa382 [9/13] KVM: SVM: WARN if an invalid posted interrupt IRTE entry is added config: x86_64-randconfig-002-20250427 (https://download.01.org/0day-ci/archive/20250427/202504271426.qgsP6QxR-lkp@xxxxxxxxx/config) 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/20250427/202504271426.qgsP6QxR-lkp@xxxxxxxxx/reproduce) 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@xxxxxxxxx> | Closes: https://lore.kernel.org/oe-kbuild-all/202504271426.qgsP6QxR-lkp@xxxxxxxxx/ All warnings (new ones prefixed by >>): >> arch/x86/kvm/svm/avic.c:807: warning: Function parameter or struct member 'pi->prev_ga_tag' not described in 'if' arch/x86/kvm/svm/avic.c:807: warning: expecting prototype for In some cases, the existing irte is updated and re(). Prototype was for if() instead arch/x86/kvm/svm/avic.c:823: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Allocating new amd_iommu_pi_data, which will get arch/x86/kvm/svm/avic.c:936: warning: Function parameter or struct member 'kvm_vcpu_apicv_active(&svm->vcpu' not described in 'if' arch/x86/kvm/svm/avic.c:936: warning: expecting prototype for Here, we setup with legacy mode in the following cases(). Prototype was for if() instead arch/x86/kvm/svm/avic.c:951: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Here, we successfully setting up vcpu affinity in arch/x86/kvm/svm/avic.c:983: warning: cannot understand function prototype: 'pi.prev_ga_tag = 0; ' arch/x86/kvm/svm/avic.c:988: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Check if the posted interrupt was previously arch/x86/kvm/svm/avic.c:1128: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * During AVIC temporary deactivation, guest could update vim +807 arch/x86/kvm/svm/avic.c 791 792 static int svm_ir_list_add(struct vcpu_svm *svm, struct amd_iommu_pi_data *pi) 793 { 794 int ret = 0; 795 unsigned long flags; 796 struct amd_svm_iommu_ir *ir; 797 u64 entry; 798 799 if (WARN_ON_ONCE(!pi->ir_data)) 800 return -EINVAL; 801 802 /** 803 * In some cases, the existing irte is updated and re-set, 804 * so we need to check here if it's already been * added 805 * to the ir_list. 806 */ > 807 if (pi->prev_ga_tag) { 808 struct kvm *kvm = svm->vcpu.kvm; 809 u32 vcpu_id = AVIC_GATAG_TO_VCPUID(pi->prev_ga_tag); 810 struct kvm_vcpu *prev_vcpu = kvm_get_vcpu_by_id(kvm, vcpu_id); 811 struct vcpu_svm *prev_svm; 812 813 if (!prev_vcpu) { 814 ret = -EINVAL; 815 goto out; 816 } 817 818 prev_svm = to_svm(prev_vcpu); 819 svm_ir_list_del(prev_svm, pi); 820 } 821 822 /** 823 * Allocating new amd_iommu_pi_data, which will get 824 * add to the per-vcpu ir_list. 825 */ 826 ir = kzalloc(sizeof(struct amd_svm_iommu_ir), GFP_ATOMIC | __GFP_ACCOUNT); 827 if (!ir) { 828 ret = -ENOMEM; 829 goto out; 830 } 831 ir->data = pi->ir_data; 832 833 spin_lock_irqsave(&svm->ir_list_lock, flags); 834 835 /* 836 * Update the target pCPU for IOMMU doorbells if the vCPU is running. 837 * If the vCPU is NOT running, i.e. is blocking or scheduled out, KVM 838 * will update the pCPU info when the vCPU awkened and/or scheduled in. 839 * See also avic_vcpu_load(). 840 */ 841 entry = READ_ONCE(*(svm->avic_physical_id_cache)); 842 if (entry & AVIC_PHYSICAL_ID_ENTRY_IS_RUNNING_MASK) 843 amd_iommu_update_ga(entry & AVIC_PHYSICAL_ID_ENTRY_HOST_PHYSICAL_ID_MASK, 844 true, pi->ir_data); 845 846 list_add(&ir->node, &svm->ir_list); 847 spin_unlock_irqrestore(&svm->ir_list_lock, flags); 848 out: 849 return ret; 850 } 851 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki