[x86] swiotlb: Enable swiotlb for > 4GiG RAM on 32-bit kernels

Closes: #908924
This commit is contained in:
Salvatore Bonaccorso 2018-10-20 21:26:22 +02:00
parent 07cd30904b
commit b2e84defa2
3 changed files with 55 additions and 0 deletions

4
debian/changelog vendored
View File

@ -267,6 +267,10 @@ linux (4.18.12-1) UNRELEASED; urgency=medium
* [arm64] Update pinebook/teres-i device-tree patches to 4.19.x:
- Enables the lid to wakeup from suspend.
[ Salvatore Bonaccorso ]
* [x86] swiotlb: Enable swiotlb for > 4GiG RAM on 32-bit kernels
(Closes: #908924)
-- Ben Hutchings <ben@decadent.org.uk> Mon, 08 Oct 2018 19:02:53 +0100
linux (4.18.10-2) unstable; urgency=medium

View File

@ -0,0 +1,50 @@
From: Christoph Hellwig <hch@lst.de>
Date: Sun, 14 Oct 2018 09:52:08 +0200
Subject: x86/swiotlb: Enable swiotlb for > 4GiG RAM on 32-bit kernels
Origin: https://git.kernel.org/linus/485734f3fc77c1eb77ffe138c027b9a4bf0178f3
Bug-Debian: https://bugs.debian.org/908924
Bug: https://bugzilla.kernel.org/show_bug.cgi?id=200709
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 <tedheadster@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Matthew Whitehead <tedheadster@gmail.com>
Cc: konrad.wilk@oracle.com
Cc: iommu@lists.linux-foundation.org
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20181014075208.2715-1-hch@lst.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/kernel/pci-swiotlb.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/x86/kernel/pci-swiotlb.c b/arch/x86/kernel/pci-swiotlb.c
index 661583662430..71c0b01d93b1 100644
--- a/arch/x86/kernel/pci-swiotlb.c
+++ b/arch/x86/kernel/pci-swiotlb.c
@@ -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
--
2.19.1

View File

@ -100,6 +100,7 @@ bugfix/all/partially-revert-usb-kconfig-using-select-for-usb_co.patch
bugfix/all/kbuild-include-addtree-remove-quotes-before-matching-path.patch
debian/revert-objtool-fix-config_stack_validation-y-warning.patch
bugfix/all/netfilter-ipvs-Fix-invalid-bytes-in-IP_VS_MH_TAB_IND.patch
bugfix/x86/x86-swiotlb-Enable-swiotlb-for-4GiG-RAM-on-32-bit-ke.patch
# Miscellaneous features
features/all/kbuild-add-build-salt-to-the-kernel-and-modules.patch