mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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
This commit is contained in:
1 parent
59a57952bd
commit
bdfd430bc6
2 files changed
+6
-2
No files matched your search
@@ -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 )
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||