diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2011-05-28 09:16:08 +0100 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2011-05-28 09:16:08 +0100 |
commit | bdfd430bc639a48dd48a19a2677ea8376f61b8a6 (patch) | |
tree | 3ed686265c104ba55ced918c9e5ccd20eb691b88 | |
parent | 59a57952bd96c1a22373cf326a1f340dbad0069c (diff) | |
download | xen-bdfd430bc639a48dd48a19a2677ea8376f61b8a6.tar.gz xen-bdfd430bc639a48dd48a19a2677ea8376f61b8a6.tar.bz2 xen-bdfd430bc639a48dd48a19a2677ea8376f61b8a6.zip |
IOMMU: Fail if intremap is not available and iommu=required/force.
Rather than sprinkling panic()s throughout the setup code hoist the
check up into common code.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset: 23402:f979a1a69fe3
xen-unstable date: Thu May 26 08:18:44 2011 +0100
-rw-r--r-- | xen/drivers/passthrough/iommu.c | 7 | ||||
-rw-r--r-- | xen/drivers/passthrough/vtd/iommu.c | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c index 0d66fe5cdb..822aa5ecf0 100644 --- a/xen/drivers/passthrough/iommu.c +++ b/xen/drivers/passthrough/iommu.c @@ -309,6 +309,7 @@ int deassign_device(struct domain *d, u8 bus, u8 devfn) int __init iommu_setup(void) { int rc = -ENODEV; + bool_t force_intremap = force_iommu && iommu_intremap; if ( iommu_dom0_strict ) iommu_passthrough = 0; @@ -319,8 +320,10 @@ int __init iommu_setup(void) iommu_enabled = (rc == 0); } - if ( force_iommu && !iommu_enabled ) - panic("IOMMU setup failed, crash Xen for security purpose!\n"); + if ( (force_iommu && !iommu_enabled) || + (force_intremap && !iommu_intremap) ) + panic("Couldn't enable %s and iommu=required/force\n", + !iommu_enabled ? "IOMMU" : "Interrupt Remapping"); if ( !iommu_enabled ) { diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c index b33cff22e1..e8c7f668d3 100644 --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -1996,6 +1996,7 @@ static int init_vtd_hw(void) iommu = drhd->iommu; if ( enable_intremap(iommu, 0) != 0 ) { + iommu_intremap = 0; dprintk(XENLOG_WARNING VTDPREFIX, "Failed to enable Interrupt Remapping!\n"); break; |