提交 fe96eb40 编写于 作者: K Konrad Rzeszutek Wilk 提交者: Konrad Rzeszutek Wilk

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: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: NJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Acked-by: NFUJITA 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: N"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>
上级 bbbe5738
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <asm/calgary.h> #include <asm/calgary.h>
#include <asm/amd_iommu.h> #include <asm/amd_iommu.h>
#include <asm/x86_init.h> #include <asm/x86_init.h>
#include <asm/xen/swiotlb-xen.h>
static int forbid_dac __read_mostly; static int forbid_dac __read_mostly;
...@@ -132,7 +133,7 @@ void __init pci_iommu_alloc(void) ...@@ -132,7 +133,7 @@ void __init pci_iommu_alloc(void)
/* free the range so iommu could get some range less than 4G */ /* free the range so iommu could get some range less than 4G */
dma32_free_bootmem(); dma32_free_bootmem();
if (pci_swiotlb_detect()) if (pci_xen_swiotlb_detect() || pci_swiotlb_detect())
goto out; goto out;
gart_iommu_hole_init(); gart_iommu_hole_init();
...@@ -144,6 +145,8 @@ void __init pci_iommu_alloc(void) ...@@ -144,6 +145,8 @@ void __init pci_iommu_alloc(void)
/* needs to be called after gart_iommu_hole_init */ /* needs to be called after gart_iommu_hole_init */
amd_iommu_detect(); amd_iommu_detect();
out: out:
pci_xen_swiotlb_init();
pci_swiotlb_init(); pci_swiotlb_init();
} }
...@@ -296,7 +299,7 @@ static int __init pci_iommu_init(void) ...@@ -296,7 +299,7 @@ static int __init pci_iommu_init(void)
#endif #endif
x86_init.iommu.iommu_init(); x86_init.iommu.iommu_init();
if (swiotlb) { if (swiotlb || xen_swiotlb) {
printk(KERN_INFO "PCI-DMA: " printk(KERN_INFO "PCI-DMA: "
"Using software bounce buffering for IO (SWIOTLB)\n"); "Using software bounce buffering for IO (SWIOTLB)\n");
swiotlb_print_info(); swiotlb_print_info();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册