mirror of
https://github.com/torvalds/linux.git
synced 2026-06-02 19:43:40 +02:00
KVM: SVM: WARN if (de)activating guest mode in IOMMU fails
WARN if (de)activating "guest mode" for an IRTE entry fails as modifying an IRTE should only fail if KVM is buggy, e.g. has stale metadata. Link: https://lore.kernel.org/r/20250611224604.313496-48-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
This commit is contained in:
parent
fe0213923d
commit
16562766f1
|
|
@ -725,10 +725,9 @@ void avic_apicv_post_state_restore(struct kvm_vcpu *vcpu)
|
|||
avic_handle_ldr_update(vcpu);
|
||||
}
|
||||
|
||||
static int avic_set_pi_irte_mode(struct kvm_vcpu *vcpu, bool activate)
|
||||
static void avic_set_pi_irte_mode(struct kvm_vcpu *vcpu, bool activate)
|
||||
{
|
||||
int apic_id = kvm_cpu_get_apicid(vcpu->cpu);
|
||||
int ret = 0;
|
||||
unsigned long flags;
|
||||
struct vcpu_svm *svm = to_svm(vcpu);
|
||||
struct kvm_kernel_irqfd *irqfd;
|
||||
|
|
@ -743,16 +742,15 @@ static int avic_set_pi_irte_mode(struct kvm_vcpu *vcpu, bool activate)
|
|||
goto out;
|
||||
|
||||
list_for_each_entry(irqfd, &svm->ir_list, vcpu_list) {
|
||||
void *data = irqfd->irq_bypass_data;
|
||||
|
||||
if (activate)
|
||||
ret = amd_iommu_activate_guest_mode(irqfd->irq_bypass_data, apic_id);
|
||||
WARN_ON_ONCE(amd_iommu_activate_guest_mode(data, apic_id));
|
||||
else
|
||||
ret = amd_iommu_deactivate_guest_mode(irqfd->irq_bypass_data);
|
||||
if (ret)
|
||||
break;
|
||||
WARN_ON_ONCE(amd_iommu_deactivate_guest_mode(data));
|
||||
}
|
||||
out:
|
||||
spin_unlock_irqrestore(&svm->ir_list_lock, flags);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void svm_ir_list_del(struct kvm_kernel_irqfd *irqfd)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user