x86/swiotlb: Enable swiotlb for > 4GiG RAM on 32-bit kernels
authorChristoph Hellwig <[email protected]>
Sun, 14 Oct 2018 07:52:08 +0000 (09:52 +0200)
committerIngo Molnar <[email protected]>
Fri, 19 Oct 2018 05:49:32 +0000 (07:49 +0200)
We already build the swiotlb code for 32-bit kernels with PAE support,
but the code to actually use swiotlb has only been enabled for 64-bit
kernels for an unknown reason.

Before Linux v4.18 we paper over this fact because the networking code,
the SCSI layer and some random block drivers implemented their own
bounce buffering scheme.

[ mingo: Changelog fixes. ]

Fixes: 21e07dba9fb1 ("scsi: reduce use of block bounce buffers")
Fixes: ab74cfebafa3 ("net: remove the PCI_DMA_BUS_IS_PHYS check in illegal_highdma")
Reported-by: Matthew Whitehead <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Tested-by: Matthew Whitehead <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
arch/x86/kernel/pci-swiotlb.c

index 661583662430ee19a8fd4dc1e48e90ca4cdca32e..71c0b01d93b1b3d1befa524c31ecc88ae65f0b82 100644 (file)
@@ -42,10 +42,8 @@ IOMMU_INIT_FINISH(pci_swiotlb_detect_override,
 int __init pci_swiotlb_detect_4gb(void)
 {
        /* don't initialize swiotlb if iommu=off (no_iommu=1) */
-#ifdef CONFIG_X86_64
        if (!no_iommu && max_possible_pfn > MAX_DMA32_PFN)
                swiotlb = 1;
-#endif
 
        /*
         * If SME is active then swiotlb will be set to 1 so that bounce