diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-06-30 13:37:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-06-30 13:37:48 -0400 |
commit | 27ab862a3afdd7a0285b69a7475f8af7bd2434c4 (patch) | |
tree | ba8b6be81c3019b1e59c00ec526113c779f65747 | |
parent | 4adc6b9382d5a2c1f39fa44b1e6ff29467e844e5 (diff) | |
parent | 84a21dbdef0b96d773599c33c2afbb002198d303 (diff) |
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
-rw-r--r-- | arch/x86/kernel/tboot.c | 2 | ||||
-rw-r--r-- | drivers/iommu/amd_iommu.c | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c index 4b1724059909..a4eb27918ceb 100644 --- a/arch/x86/kernel/tboot.c +++ b/arch/x86/kernel/tboot.c | |||
@@ -514,7 +514,7 @@ int tboot_force_iommu(void) | |||
514 | if (!tboot_enabled()) | 514 | if (!tboot_enabled()) |
515 | return 0; | 515 | return 0; |
516 | 516 | ||
517 | if (!intel_iommu_tboot_noforce) | 517 | if (intel_iommu_tboot_noforce) |
518 | return 1; | 518 | return 1; |
519 | 519 | ||
520 | if (no_iommu || swiotlb || dmar_disabled) | 520 | if (no_iommu || swiotlb || dmar_disabled) |
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 63cacf5d6cf2..0f1219fa8561 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c | |||
@@ -3879,11 +3879,9 @@ static void irte_ga_prepare(void *entry, | |||
3879 | u8 vector, u32 dest_apicid, int devid) | 3879 | u8 vector, u32 dest_apicid, int devid) |
3880 | { | 3880 | { |
3881 | struct irte_ga *irte = (struct irte_ga *) entry; | 3881 | struct irte_ga *irte = (struct irte_ga *) entry; |
3882 | struct iommu_dev_data *dev_data = search_dev_data(devid); | ||
3883 | 3882 | ||
3884 | irte->lo.val = 0; | 3883 | irte->lo.val = 0; |
3885 | irte->hi.val = 0; | 3884 | irte->hi.val = 0; |
3886 | irte->lo.fields_remap.guest_mode = dev_data ? dev_data->use_vapic : 0; | ||
3887 | irte->lo.fields_remap.int_type = delivery_mode; | 3885 | irte->lo.fields_remap.int_type = delivery_mode; |
3888 | irte->lo.fields_remap.dm = dest_mode; | 3886 | irte->lo.fields_remap.dm = dest_mode; |
3889 | irte->hi.fields.vector = vector; | 3887 | irte->hi.fields.vector = vector; |
@@ -3939,10 +3937,10 @@ static void irte_ga_set_affinity(void *entry, u16 devid, u16 index, | |||
3939 | struct irte_ga *irte = (struct irte_ga *) entry; | 3937 | struct irte_ga *irte = (struct irte_ga *) entry; |
3940 | struct iommu_dev_data *dev_data = search_dev_data(devid); | 3938 | struct iommu_dev_data *dev_data = search_dev_data(devid); |
3941 | 3939 | ||
3942 | if (!dev_data || !dev_data->use_vapic) { | 3940 | if (!dev_data || !dev_data->use_vapic || |
3941 | !irte->lo.fields_remap.guest_mode) { | ||
3943 | irte->hi.fields.vector = vector; | 3942 | irte->hi.fields.vector = vector; |
3944 | irte->lo.fields_remap.destination = dest_apicid; | 3943 | irte->lo.fields_remap.destination = dest_apicid; |
3945 | irte->lo.fields_remap.guest_mode = 0; | ||
3946 | modify_irte_ga(devid, index, irte, NULL); | 3944 | modify_irte_ga(devid, index, irte, NULL); |
3947 | } | 3945 | } |
3948 | } | 3946 | } |