Description: AMD,IOMMU: Make per-device interrupt remapping table default
 Using global interrupt remapping table may be insecure, as
 described by XSA-36. This patch makes per-device mode default.
From: Boris Ostrovsky <boris.ostrovsky@amd.com>
From: Jan Beulich <jbeulich@suse.com>
Origin: upstream, commit:23451:e5ed73d172eb
Id: CVE-2013-0153
---
--- a/xen/arch/x86/irq.c	Tue Feb 05 15:30:31 2013 +0100
+++ b/xen/arch/x86/irq.c	Tue Feb 05 15:30:59 2013 +0100
@@ -1942,9 +1942,6 @@
         spin_lock_irqsave(&desc->lock, flags);
         set_domain_irq_pirq(d, irq, info);
         spin_unlock_irqrestore(&desc->lock, flags);
-
-        if ( opt_irq_vector_map == OPT_IRQ_VECTOR_MAP_PERDEV )
-            printk(XENLOG_INFO "Per-device vector maps for GSIs not implemented yet.\n");
     }
 
 done:
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c	Tue Feb 05 15:30:31 2013 +0100
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c	Tue Feb 05 15:30:59 2013 +0100
@@ -205,6 +205,8 @@
     {
         printk("AMD-Vi: Not overriding irq_vector_map setting\n");
     }
+    if ( !amd_iommu_perdev_intremap )
+        printk(XENLOG_WARNING "AMD-Vi: Using global interrupt remap table is not recommended (see XSA-36)!\n");
     return scan_pci_devices();
 }
 
--- a/xen/drivers/passthrough/iommu.c	Tue Feb 05 15:30:31 2013 +0100
+++ b/xen/drivers/passthrough/iommu.c	Tue Feb 05 15:30:59 2013 +0100
@@ -52,7 +52,7 @@
 bool_t __read_mostly iommu_intremap = 1;
 bool_t __read_mostly iommu_hap_pt_share = 1;
 bool_t __read_mostly iommu_debug;
-bool_t __read_mostly amd_iommu_perdev_intremap;
+bool_t __read_mostly amd_iommu_perdev_intremap = 1;
 
 DEFINE_PER_CPU(bool_t, iommu_dont_flush_iotlb);
 
