|   | 
      | 
  
  
      | 
      | 
  
 
     | 
    | 
  
  
     | 
    | 
  
  
    |   | 
      | 
  
  
    | 
         
xen-devel
[Xen-devel] [PATCH 02/31] Enable Xen-SWIOTLB if running in	[non-]privile
 
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>
 |  
- [Xen-devel] [PATCH PV_OPS PCIFRONT], Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 01/31] [xen-core] Provide a variant of	xen_poll_irq with timeout., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 02/31] Enable Xen-SWIOTLB if running in	[non-]privileged and disable the Xen-IOMMU if an IOMMU is detected.,
Konrad Rzeszutek Wilk <=
- [Xen-devel] [PATCH 03/31] Initial copy from linux-2.6.18.hg of the	pcifront driver., Konrad Rzeszutek Wilk
 - [Xen-devel] [PATCH 04/31] Fix include header name change., Konrad Rzeszutek Wilk
 - [Xen-devel] [PATCH 05/31] Fix compile warning: ignoring return	value of 'pci_bus_add_device',	declared with attribute warn_unused_result, Konrad Rzeszutek Wilk
 - [Xen-devel] [PATCH 06/31] Fix compile warning: passing argument 2	of 'pci_walk_bus' from incompatible pointer type, Konrad Rzeszutek Wilk
 - [Xen-devel] [PATCH 07/31] Fix compile error. The	bind_to_irq_handler has different arguments., Konrad Rzeszutek Wilk
 - [Xen-devel] [PATCH 08/31] Fix compile error: implicit declaration	of function 'virt_to_mfn', Konrad Rzeszutek Wilk
 - [Xen-devel] [PATCH 09/31] Fix compile error: implicit declaration	of function 'clear_evtchn', Konrad Rzeszutek Wilk
 - [Xen-devel] [PATCH 10/31] Fix compile error: implicit declaration	of function 'gnttab_end_foreign_access', Konrad Rzeszutek Wilk
 - [Xen-devel] [PATCH 11/31] Fix compile error: too few arguments to	function 'gnttab_end_foreign_access', Konrad Rzeszutek Wilk
 - [Xen-devel] [PATCH 12/31] Remove function declerations	(CONFIG_PCI_DOMAIN) that exist in recent kernels., Konrad Rzeszutek Wilk
 
  
  
  
 
 |  
  
 | 
    | 
  
  
    |   | 
    |