Home Home > GIT Browse > SLE15-SP1
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Tesarik <ptesarik@suse.cz>2019-07-19 15:20:39 +0200
committerPetr Tesarik <ptesarik@suse.cz>2019-07-19 15:20:39 +0200
commit7b4c9830d3dc1ff97f126718221a2b25ba9a3ca4 (patch)
tree0d59813e988740640751f1aa9c2de31e669315c4
parenteecf2f8f3856f7006e03403510365e256a45e7fa (diff)
- iommu-helper: mark iommu_is_span_boundary as inline
(jsc#SLE-6197 FATE#327012 bsc#1140559 LTC#173150). - Update config files.
-rw-r--r--config/arm64/default1
-rw-r--r--patches.suse/iommu-helper-mark-iommu_is_span_boundary-as-inline221
-rw-r--r--series.conf1
3 files changed, 222 insertions, 1 deletions
diff --git a/config/arm64/default b/config/arm64/default
index 41af0f8f76..edcd488f1a 100644
--- a/config/arm64/default
+++ b/config/arm64/default
@@ -29,7 +29,6 @@ CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_SMP=y
CONFIG_SWIOTLB=y
-CONFIG_IOMMU_HELPER=y
CONFIG_KERNEL_MODE_NEON=y
CONFIG_FIX_EARLYCON_MEM=y
CONFIG_PGTABLE_LEVELS=4
diff --git a/patches.suse/iommu-helper-mark-iommu_is_span_boundary-as-inline b/patches.suse/iommu-helper-mark-iommu_is_span_boundary-as-inline
new file mode 100644
index 0000000000..3b09bbe803
--- /dev/null
+++ b/patches.suse/iommu-helper-mark-iommu_is_span_boundary-as-inline
@@ -0,0 +1,221 @@
+From: Christoph Hellwig <hch@lst.de>
+Date: Tue, 3 Apr 2018 15:41:07 +0200
+Subject: iommu-helper: mark iommu_is_span_boundary as inline
+Git-commit: 79c1879ee5473e3404469b07f9bccfe6d0814b93
+Patch-mainline: v4.18-rc1
+References: jsc#SLE-6197 FATE#327012 bsc#1140559 LTC#173150
+
+This avoids selecting IOMMU_HELPER just for this function. And we only
+use it once or twice in normal builds so this often even is a size
+reduction.
+
+Signed-off-by: Christoph Hellwig <hch@lst.de>
+Acked-by: Petr Tesarik <ptesarik@suse.com>
+---
+ arch/alpha/Kconfig | 3 ---
+ arch/arm/Kconfig | 3 ---
+ arch/arm64/Kconfig | 3 ---
+ arch/ia64/Kconfig | 3 ---
+ arch/mips/cavium-octeon/Kconfig | 4 ----
+ arch/mips/loongson64/Kconfig | 4 ----
+ arch/mips/netlogic/Kconfig | 3 ---
+ arch/powerpc/Kconfig | 1 -
+ arch/unicore32/mm/Kconfig | 3 ---
+ arch/x86/Kconfig | 2 +-
+ drivers/parisc/Kconfig | 5 -----
+ include/linux/iommu-helper.h | 13 ++++++++++---
+ lib/iommu-helper.c | 12 +-----------
+ 13 files changed, 12 insertions(+), 47 deletions(-)
+
+--- a/arch/alpha/Kconfig
++++ b/arch/alpha/Kconfig
+@@ -342,9 +342,6 @@ config PCI_DOMAINS
+ config PCI_SYSCALL
+ def_bool PCI
+
+-config IOMMU_HELPER
+- def_bool PCI
+-
+ config ALPHA_NONAME
+ bool
+ depends on ALPHA_BOOK1 || ALPHA_NONAME_CH
+--- a/arch/arm/Kconfig
++++ b/arch/arm/Kconfig
+@@ -1782,9 +1782,6 @@ config SECCOMP
+ config SWIOTLB
+ def_bool y
+
+-config IOMMU_HELPER
+- def_bool SWIOTLB
+-
+ config PARAVIRT
+ bool "Enable paravirtualization code"
+ help
+--- a/arch/arm64/Kconfig
++++ b/arch/arm64/Kconfig
+@@ -229,9 +229,6 @@ config SMP
+ config SWIOTLB
+ def_bool y
+
+-config IOMMU_HELPER
+- def_bool SWIOTLB
+-
+ config KERNEL_MODE_NEON
+ def_bool y
+
+--- a/arch/ia64/Kconfig
++++ b/arch/ia64/Kconfig
+@@ -607,6 +607,3 @@ source "security/Kconfig"
+ source "crypto/Kconfig"
+
+ source "lib/Kconfig"
+-
+-config IOMMU_HELPER
+- def_bool (IA64_HP_ZX1 || IA64_HP_ZX1_SWIOTLB || IA64_GENERIC || SWIOTLB)
+--- a/arch/mips/cavium-octeon/Kconfig
++++ b/arch/mips/cavium-octeon/Kconfig
+@@ -66,15 +66,11 @@ config CAVIUM_OCTEON_LOCK_L2_MEMCPY
+ help
+ Lock the kernel's implementation of memcpy() into L2.
+
+-config IOMMU_HELPER
+- bool
+-
+ config NEED_SG_DMA_LENGTH
+ bool
+
+ config SWIOTLB
+ def_bool y
+- select IOMMU_HELPER
+ select NEED_SG_DMA_LENGTH
+
+ config OCTEON_ILM
+--- a/arch/mips/loongson64/Kconfig
++++ b/arch/mips/loongson64/Kconfig
+@@ -125,9 +125,6 @@ config LOONGSON_UART_BASE
+ default y
+ depends on EARLY_PRINTK || SERIAL_8250
+
+-config IOMMU_HELPER
+- bool
+-
+ config NEED_SG_DMA_LENGTH
+ bool
+
+@@ -135,7 +132,6 @@ config SWIOTLB
+ bool "Soft IOMMU Support for All-Memory DMA"
+ default y
+ depends on CPU_LOONGSON3
+- select IOMMU_HELPER
+ select NEED_SG_DMA_LENGTH
+ select NEED_DMA_MAP_STATE
+
+--- a/arch/mips/netlogic/Kconfig
++++ b/arch/mips/netlogic/Kconfig
+@@ -82,9 +82,6 @@ endif
+ config NLM_COMMON
+ bool
+
+-config IOMMU_HELPER
+- bool
+-
+ config NEED_SG_DMA_LENGTH
+ bool
+
+--- a/arch/powerpc/Kconfig
++++ b/arch/powerpc/Kconfig
+@@ -475,7 +475,6 @@ config IOMMU_HELPER
+ config SWIOTLB
+ bool "SWIOTLB support"
+ default n
+- select IOMMU_HELPER
+ ---help---
+ Support for IO bounce buffering for systems without an IOMMU.
+ This allows us to DMA to the full physical address space on
+--- a/arch/unicore32/mm/Kconfig
++++ b/arch/unicore32/mm/Kconfig
+@@ -42,9 +42,6 @@ config CPU_TLB_SINGLE_ENTRY_DISABLE
+ config SWIOTLB
+ def_bool y
+
+-config IOMMU_HELPER
+- def_bool SWIOTLB
+-
+ config NEED_SG_DMA_LENGTH
+ def_bool SWIOTLB
+
+--- a/arch/x86/Kconfig
++++ b/arch/x86/Kconfig
+@@ -919,7 +919,7 @@ config SWIOTLB
+
+ config IOMMU_HELPER
+ def_bool y
+- depends on CALGARY_IOMMU || GART_IOMMU || SWIOTLB || AMD_IOMMU
++ depends on CALGARY_IOMMU || GART_IOMMU
+
+ config MAXSMP
+ bool "Enable Maximum number of SMP Processors and NUMA Nodes"
+--- a/drivers/parisc/Kconfig
++++ b/drivers/parisc/Kconfig
+@@ -103,11 +103,6 @@ config IOMMU_SBA
+ depends on PCI_LBA
+ default PCI_LBA
+
+-config IOMMU_HELPER
+- bool
+- depends on IOMMU_SBA || IOMMU_CCIO
+- default y
+-
+ source "drivers/pcmcia/Kconfig"
+
+ endmenu
+--- a/include/linux/iommu-helper.h
++++ b/include/linux/iommu-helper.h
+@@ -1,6 +1,7 @@
+ #ifndef _LINUX_IOMMU_HELPER_H
+ #define _LINUX_IOMMU_HELPER_H
+
++#include <linux/bug.h>
+ #include <linux/kernel.h>
+
+ static inline unsigned long iommu_device_max_index(unsigned long size,
+@@ -13,9 +14,15 @@ static inline unsigned long iommu_device
+ return size;
+ }
+
+-extern int iommu_is_span_boundary(unsigned int index, unsigned int nr,
+- unsigned long shift,
+- unsigned long boundary_size);
++static inline int iommu_is_span_boundary(unsigned int index, unsigned int nr,
++ unsigned long shift, unsigned long boundary_size)
++{
++ BUG_ON(!is_power_of_2(boundary_size));
++
++ shift = (shift + index) & (boundary_size - 1);
++ return shift + nr > boundary_size;
++}
++
+ extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size,
+ unsigned long start, unsigned int nr,
+ unsigned long shift,
+--- a/lib/iommu-helper.c
++++ b/lib/iommu-helper.c
+@@ -4,17 +4,7 @@
+
+ #include <linux/export.h>
+ #include <linux/bitmap.h>
+-#include <linux/bug.h>
+-
+-int iommu_is_span_boundary(unsigned int index, unsigned int nr,
+- unsigned long shift,
+- unsigned long boundary_size)
+-{
+- BUG_ON(!is_power_of_2(boundary_size));
+-
+- shift = (shift + index) & (boundary_size - 1);
+- return shift + nr > boundary_size;
+-}
++#include <linux/iommu-helper.h>
+
+ unsigned long iommu_area_alloc(unsigned long *map, unsigned long size,
+ unsigned long start, unsigned int nr,
diff --git a/series.conf b/series.conf
index 5c40bc96b8..25c13aaf15 100644
--- a/series.conf
+++ b/series.conf
@@ -30611,6 +30611,7 @@
patches.drivers/0002-dma-mapping-move-dma-configuration-to-bus-infrastruc.patch
patches.drivers/0003-drivers-remove-force-dma-flag-from-buses.patch
patches.fixes/scsi-reduce-use-of-block-bounce-buffers.patch
+ patches.suse/iommu-helper-mark-iommu_is_span_boundary-as-inline
patches.drivers/hwmon-k10temp-add-support-for-stoney-ridge-and-bristol.patch
patches.drivers/hwmon-k10temp-display-both-tctl-and-tdie.patch
patches.drivers/hwmon-ltc2990-Fix-incorrect-conversion-of-negative-t