WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 02/31] Enable Xen-SWIOTLB if running in [non-]privile

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 02/31] Enable Xen-SWIOTLB if running in [non-]privileged and disable the Xen-IOMMU if an IOMMU is detected.
From: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Date: Thu, 5 Nov 2009 16:33:10 -0500
Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>, root <root@xxxxxxxxxxxxxxxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Delivery-date: Thu, 05 Nov 2009 13:41:40 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1257456819-782-2-git-send-email-konrad.wilk@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1257456819-782-1-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-2-git-send-email-konrad.wilk@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>