aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2011-05-28 09:29:40 +0100
committerIan Campbell <ian.campbell@citrix.com>2011-05-28 09:29:40 +0100
commite25a1b02cfcf9899e1984983b51512feefeb44f4 (patch)
tree1d634d73848eaba95296c580a1d47b969b1f27fb
parent5f5629809ee01aefc6e2118fe07845909f97e241 (diff)
downloadxen-e25a1b02cfcf9899e1984983b51512feefeb44f4.tar.gz
xen-e25a1b02cfcf9899e1984983b51512feefeb44f4.tar.bz2
xen-e25a1b02cfcf9899e1984983b51512feefeb44f4.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.c7
-rw-r--r--xen/drivers/passthrough/vtd/iommu.c1
2 files changed, 6 insertions, 2 deletions
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 62c801c1c2..0dad6ef099 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -308,6 +308,7 @@ int deassign_device(struct domain *d, u8 bus, u8 devfn)
int iommu_setup(void)
{
int rc = -ENODEV;
+ bool_t force_intremap = force_iommu && iommu_intremap;
if ( iommu_dom0_strict )
iommu_passthrough = 0;
@@ -318,8 +319,10 @@ int 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 52638101cd..eb003384ba 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1908,6 +1908,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;