aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/xen/iommu.h
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2012-11-02 17:15:30 +0100
committerJan Beulich <jbeulich@suse.com>2012-11-02 17:15:30 +0100
commit7a8f6d0607a38c64506b4e8b473d955bf8e2a71f (patch)
treeaddc701cdee69b8f8a0e49d5376af13bfce58f84 /xen/include/xen/iommu.h
parentcfba0545007fd18659917d8ec5ebde044cd9418b (diff)
downloadxen-7a8f6d0607a38c64506b4e8b473d955bf8e2a71f.tar.gz
xen-7a8f6d0607a38c64506b4e8b473d955bf8e2a71f.tar.bz2
xen-7a8f6d0607a38c64506b4e8b473d955bf8e2a71f.zip
IOMMU: keep disabled until iommu_setup() is called
The iommu is enabled by default when xen is booting and later disabled in iommu_setup() when no iommu is present. But under some circumstances iommu code can be called before iommu_setup() is processed. If there is no iommu available xen crashes. This can happen for example when panic(...) is called as introduced with the patch "x86-64: detect processors subject to AMD erratum #121 and refuse to boot" since xen 4.1.3, resulting in find_iommu_for_device() to be called in the context of disable_IO_APIC() / __stop_this_cpu(). This patch fixes this by keeping the iommu disabled until iommu_setup() is entered. Originally-by: Ronny Hegewald <ronny.hegewald@online.de> In order for iommu_enable to be off initially, iommu_supports_eim() must not depend on it anymore, nor must acpi_parse_dmar(). The former in turn requires that iommu_intremap gets uncoupled from iommu_enabled (in particular, failure during IOMMU setup should no longer result in iommu_intremap getting cleared by generic code; IOMMU specific code can still do so provided in can live with the consequences). This could have the nice side effect of allowing to use "iommu=off" even when x2APIC was pre-enabled by the BIOS (in which case interrupt remapping is a requirement, but DMA translation [obviously] isn't), but that doesn't currently work (and hence x2apic_bsp_setup() forces the IOMMU on rather than just interrupt remapping). For consistency with VT-d, make the AMD IOMMU code also skip all ACPI table parsing when neither iommu_enable nor iommu_intremap are set. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Xiantao Zhang <xiantao.zhang@intel.com> Acked-by: "Huang2, Wei" <Wei.Huang2@amd.com>
Diffstat (limited to 'xen/include/xen/iommu.h')
-rw-r--r--xen/include/xen/iommu.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 88420a5fce..3026e54606 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -26,7 +26,7 @@
#include <public/hvm/ioreq.h>
#include <public/domctl.h>
-extern bool_t iommu_enabled;
+extern bool_t iommu_enable, iommu_enabled;
extern bool_t force_iommu, iommu_verbose;
extern bool_t iommu_workaround_bios_bug, iommu_passthrough;
extern bool_t iommu_snoop, iommu_qinval, iommu_intremap;