|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 02/31] Enable Xen-SWIOTLB if running in [non-]privileged and disable the Xen-IOMMU if an IOMMU is detected.
From: root <root@xxxxxxxxxxxxxxxxxxxxx>
For PCI passthrough to work correctly, we need the Xen-SWIOTLB.
Otherwise PCI devices in the non-privileged domains might not be
able to do DMA.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
---
arch/x86/xen/pci-swiotlb.c | 2 +-
drivers/pci/xen-iommu.c | 3 +++
2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/arch/x86/xen/pci-swiotlb.c b/arch/x86/xen/pci-swiotlb.c
index 00f2260..ecdbfe2 100644
--- a/arch/x86/xen/pci-swiotlb.c
+++ b/arch/x86/xen/pci-swiotlb.c
@@ -984,7 +984,7 @@ static struct dma_map_ops xen_swiotlb_dma_ops = {
void __init xen_swiotlb_init(void)
{
- if (xen_initial_domain()) {
+ if (xen_domain()) {
printk(KERN_INFO "PCI-DMA: Using Xen software bounce buffering
for IO (Xen-SWIOTLB)\n");
xen_swiotlb_init_with_default_size(64 * (1<<20)); /*
default to 64MB */
dma_ops = &xen_swiotlb_dma_ops;
diff --git a/drivers/pci/xen-iommu.c b/drivers/pci/xen-iommu.c
index 9ba63b1..c9a2af5 100644
--- a/drivers/pci/xen-iommu.c
+++ b/drivers/pci/xen-iommu.c
@@ -263,6 +263,9 @@ void __init xen_iommu_init(void)
if (xen_initial_domain()) /* For dom0, the IOMMU is handled by
arch/x86/xen/pci-swiotlb.c. */
return;
+ if (iommu_detected)
+ return;
+
printk(KERN_INFO "Xen: Initializing Xen DMA ops\n");
force_iommu = 0;
--
1.6.2.5
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |