aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/xen/pci-swiotlb-xen.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/x86/xen/pci-swiotlb-xen.c b/arch/x86/xen/pci-swiotlb-xen.c
index 967633ad98c4..b6a534002ab2 100644
--- a/arch/x86/xen/pci-swiotlb-xen.c
+++ b/arch/x86/xen/pci-swiotlb-xen.c
@@ -34,19 +34,20 @@ static struct dma_map_ops xen_swiotlb_dma_ops = {
34int __init pci_xen_swiotlb_detect(void) 34int __init pci_xen_swiotlb_detect(void)
35{ 35{
36 36
37 if (!xen_pv_domain())
38 return 0;
39
37 /* If running as PV guest, either iommu=soft, or swiotlb=force will 40 /* If running as PV guest, either iommu=soft, or swiotlb=force will
38 * activate this IOMMU. If running as PV privileged, activate it 41 * activate this IOMMU. If running as PV privileged, activate it
39 * irregardless. 42 * irregardless.
40 */ 43 */
41 if ((xen_initial_domain() || swiotlb || swiotlb_force) && 44 if ((xen_initial_domain() || swiotlb || swiotlb_force))
42 (xen_pv_domain()))
43 xen_swiotlb = 1; 45 xen_swiotlb = 1;
44 46
45 /* If we are running under Xen, we MUST disable the native SWIOTLB. 47 /* If we are running under Xen, we MUST disable the native SWIOTLB.
46 * Don't worry about swiotlb_force flag activating the native, as 48 * Don't worry about swiotlb_force flag activating the native, as
47 * the 'swiotlb' flag is the only one turning it on. */ 49 * the 'swiotlb' flag is the only one turning it on. */
48 if (xen_pv_domain()) 50 swiotlb = 0;
49 swiotlb = 0;
50 51
51 return xen_swiotlb; 52 return xen_swiotlb;
52} 53}