[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1343335407-5465-3-git-send-email-konrad.wilk@oracle.com>
Date: Thu, 26 Jul 2012 16:43:27 -0400
From: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
To: linux-kernel@...r.kernel.org
Cc: xen-devel@...ts.xensource.com,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
Subject: [PATCH 2/2] xen/swiotlb: If user supplied e820_hole=1 in the guest config, enable SWIOTLB.
We can detect that the user is using e820_hole=1 by parsing the E820.
If it shows regions other than E820_RAM or E820_RESV then the
user is bent on providing us with a PCI device and forgot
to do 'iommu=soft'. So lets enable it for him/her.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
---
arch/x86/xen/pci-swiotlb-xen.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/arch/x86/xen/pci-swiotlb-xen.c b/arch/x86/xen/pci-swiotlb-xen.c
index 56f373e..9b1aebb 100644
--- a/arch/x86/xen/pci-swiotlb-xen.c
+++ b/arch/x86/xen/pci-swiotlb-xen.c
@@ -74,6 +74,11 @@ int __init pci_xen_swiotlb_detect(void)
if (xen_pv_domain())
swiotlb = 0;
+ /* If it hasn't been activated yet, and it has E820 that looks like
+ * the user supplied e820_hole=1, then turn it on. */
+ if (xen_pv_domain() && !xen_initial_domain() &&
+ !xen_swiotlb && e820_has_acpi())
+ xen_swiotlb = 1;
return xen_swiotlb;
}
--
1.7.7.6
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists