Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'iommu-fixes-v4.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu

Pull IOMMU fixes from Joerg Roedel:
"Two fixes:

- A fix for AMD IOMMU interrupt remapping code when IRQs are
forwarded directly to KVM guests

- Fixed check in the recently merged code to allow tboot with
Intel VT-d disabled"

* tag 'iommu-fixes-v4.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
iommu/amd: Fix interrupt remapping when disable guest_mode
iommu/vt-d: Correctly disable Intel IOMMU force on

+3 -5
+1 -1
arch/x86/kernel/tboot.c
··· 514 514 if (!tboot_enabled()) 515 515 return 0; 516 516 517 - if (!intel_iommu_tboot_noforce) 517 + if (intel_iommu_tboot_noforce) 518 518 return 1; 519 519 520 520 if (no_iommu || swiotlb || dmar_disabled)
+2 -4
drivers/iommu/amd_iommu.c
··· 3879 3879 u8 vector, u32 dest_apicid, int devid) 3880 3880 { 3881 3881 struct irte_ga *irte = (struct irte_ga *) entry; 3882 - struct iommu_dev_data *dev_data = search_dev_data(devid); 3883 3882 3884 3883 irte->lo.val = 0; 3885 3884 irte->hi.val = 0; 3886 - irte->lo.fields_remap.guest_mode = dev_data ? dev_data->use_vapic : 0; 3887 3885 irte->lo.fields_remap.int_type = delivery_mode; 3888 3886 irte->lo.fields_remap.dm = dest_mode; 3889 3887 irte->hi.fields.vector = vector; ··· 3937 3939 struct irte_ga *irte = (struct irte_ga *) entry; 3938 3940 struct iommu_dev_data *dev_data = search_dev_data(devid); 3939 3941 3940 - if (!dev_data || !dev_data->use_vapic) { 3942 + if (!dev_data || !dev_data->use_vapic || 3943 + !irte->lo.fields_remap.guest_mode) { 3941 3944 irte->hi.fields.vector = vector; 3942 3945 irte->lo.fields_remap.destination = dest_apicid; 3943 - irte->lo.fields_remap.guest_mode = 0; 3944 3946 modify_irte_ga(devid, index, irte, NULL); 3945 3947 } 3946 3948 }