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

xen/swiotlb: With more than 4GB on 64-bit, disable the native SWIOTLB.

If a PV guest is booted the native SWIOTLB should not be
turned on. It does not help us (we don't have any PCI devices)
and it eats 64MB of good memory. In the case of PV guests
with PCI devices we need the Xen-SWIOTLB one.

[v1: Rewrite comment per Stefano's suggestion]
Acked-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
上级 988f0e24
...@@ -8,6 +8,11 @@ ...@@ -8,6 +8,11 @@
#include <xen/xen.h> #include <xen/xen.h>
#include <asm/iommu_table.h> #include <asm/iommu_table.h>
#ifdef CONFIG_X86_64
#include <asm/iommu.h>
#include <asm/dma.h>
#endif
int xen_swiotlb __read_mostly; int xen_swiotlb __read_mostly;
static struct dma_map_ops xen_swiotlb_dma_ops = { static struct dma_map_ops xen_swiotlb_dma_ops = {
...@@ -49,6 +54,15 @@ int __init pci_xen_swiotlb_detect(void) ...@@ -49,6 +54,15 @@ int __init pci_xen_swiotlb_detect(void)
* the 'swiotlb' flag is the only one turning it on. */ * the 'swiotlb' flag is the only one turning it on. */
swiotlb = 0; swiotlb = 0;
#ifdef CONFIG_X86_64
/* pci_swiotlb_detect_4gb turns on native SWIOTLB if no_iommu == 0
* (so no iommu=X command line over-writes).
* Considering that PV guests do not want the *native SWIOTLB* but
* only Xen SWIOTLB it is not useful to us so set no_iommu=1 here.
*/
if (max_pfn > MAX_DMA32_PFN)
no_iommu = 1;
#endif
return xen_swiotlb; return xen_swiotlb;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册