diff options
author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2010-03-18 13:53:24 -0400 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad@kernel.org> | 2010-08-02 15:18:33 -0400 |
commit | fe96eb404e33b59bb39f7050205f7c56c1c7d686 (patch) | |
tree | ee1aee5aa59706c08579520b7072db0ed0ea9191 | |
parent | bbbe57386e857eb2a8d4abcae71063c819c06ff1 (diff) |
x86: Detect whether we should use Xen SWIOTLB.
It is paramount that we call pci_xen_swiotlb_detect before
pci_swiotlb_detect as both implementations use the 'swiotlb'
and 'swiotlb_force' flags. The pci-xen_swiotlb_detect inhibits
the swiotlb_force and swiotlb flag so that the native SWIOTLB
implementation is not enabled when running under Xen.
[since v1 changed two Cc's to Acked-by]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
[http://lkml.org/lkml/2010/7/27/374]
Cc: Albert Herranz <albert_herranz@yahoo.es>
Cc: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Acked-by: "H. Peter Anvin" <hpa@zytor.com>
[conditional http://lkml.org/lkml/2010/8/2/324]
Cc: x86@kernel.org
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
-rw-r--r-- | arch/x86/kernel/pci-dma.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c index 4b7e3d8b01dd..9f07cfcbd3a5 100644 --- a/arch/x86/kernel/pci-dma.c +++ b/arch/x86/kernel/pci-dma.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <asm/calgary.h> | 13 | #include <asm/calgary.h> |
14 | #include <asm/amd_iommu.h> | 14 | #include <asm/amd_iommu.h> |
15 | #include <asm/x86_init.h> | 15 | #include <asm/x86_init.h> |
16 | #include <asm/xen/swiotlb-xen.h> | ||
16 | 17 | ||
17 | static int forbid_dac __read_mostly; | 18 | static int forbid_dac __read_mostly; |
18 | 19 | ||
@@ -132,7 +133,7 @@ void __init pci_iommu_alloc(void) | |||
132 | /* free the range so iommu could get some range less than 4G */ | 133 | /* free the range so iommu could get some range less than 4G */ |
133 | dma32_free_bootmem(); | 134 | dma32_free_bootmem(); |
134 | 135 | ||
135 | if (pci_swiotlb_detect()) | 136 | if (pci_xen_swiotlb_detect() || pci_swiotlb_detect()) |
136 | goto out; | 137 | goto out; |
137 | 138 | ||
138 | gart_iommu_hole_init(); | 139 | gart_iommu_hole_init(); |
@@ -144,6 +145,8 @@ void __init pci_iommu_alloc(void) | |||
144 | /* needs to be called after gart_iommu_hole_init */ | 145 | /* needs to be called after gart_iommu_hole_init */ |
145 | amd_iommu_detect(); | 146 | amd_iommu_detect(); |
146 | out: | 147 | out: |
148 | pci_xen_swiotlb_init(); | ||
149 | |||
147 | pci_swiotlb_init(); | 150 | pci_swiotlb_init(); |
148 | } | 151 | } |
149 | 152 | ||
@@ -296,7 +299,7 @@ static int __init pci_iommu_init(void) | |||
296 | #endif | 299 | #endif |
297 | x86_init.iommu.iommu_init(); | 300 | x86_init.iommu.iommu_init(); |
298 | 301 | ||
299 | if (swiotlb) { | 302 | if (swiotlb || xen_swiotlb) { |
300 | printk(KERN_INFO "PCI-DMA: " | 303 | printk(KERN_INFO "PCI-DMA: " |
301 | "Using software bounce buffering for IO (SWIOTLB)\n"); | 304 | "Using software bounce buffering for IO (SWIOTLB)\n"); |
302 | swiotlb_print_info(); | 305 | swiotlb_print_info(); |