Skip to content

Commit 730ad0e

Browse files
ssuthiku-amdjoergroedel
authored andcommitted
iommu/amd: Fix IOMMU AVIC not properly update the is_run bit in IRTE
Commit b9c6ff9 ("iommu/amd: Re-factor guest virtual APIC (de-)activation code") accidentally left out the ir_data pointer when calling modity_irte_ga(), which causes the function amd_iommu_update_ga() to return prematurely due to struct amd_ir_data.ref is NULL and the "is_run" bit of IRTE does not get updated properly. This results in bad I/O performance since IOMMU AVIC always generate GA Log entry and notify IOMMU driver and KVM when it receives interrupt from the PCI pass-through device instead of directly inject interrupt to the vCPU. Fixes by passing ir_data when calling modify_irte_ga() as done previously. Fixes: b9c6ff9 ("iommu/amd: Re-factor guest virtual APIC (de-)activation code") Signed-off-by: Suravee Suthikulpanit <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
1 parent da72a37 commit 730ad0e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/iommu/amd_iommu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3826,7 +3826,7 @@ int amd_iommu_activate_guest_mode(void *data)
38263826
entry->lo.fields_vapic.ga_tag = ir_data->ga_tag;
38273827

38283828
return modify_irte_ga(ir_data->irq_2_irte.devid,
3829-
ir_data->irq_2_irte.index, entry, NULL);
3829+
ir_data->irq_2_irte.index, entry, ir_data);
38303830
}
38313831
EXPORT_SYMBOL(amd_iommu_activate_guest_mode);
38323832

@@ -3852,7 +3852,7 @@ int amd_iommu_deactivate_guest_mode(void *data)
38523852
APICID_TO_IRTE_DEST_HI(cfg->dest_apicid);
38533853

38543854
return modify_irte_ga(ir_data->irq_2_irte.devid,
3855-
ir_data->irq_2_irte.index, entry, NULL);
3855+
ir_data->irq_2_irte.index, entry, ir_data);
38563856
}
38573857
EXPORT_SYMBOL(amd_iommu_deactivate_guest_mode);
38583858

0 commit comments

Comments
 (0)