Home Home > GIT Browse > SLE12-SP5-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Suchanek <msuchanek@suse.de>2019-08-21 14:07:31 +0200
committerMichal Suchanek <msuchanek@suse.de>2019-08-21 14:07:31 +0200
commit1af9ac2fb707d26e93aefa8eb406b1c13a398538 (patch)
treee17536ebddf94bb3dd847d49cb9b96ec237b2b7b
parent58b47126e37ac424acce5efb04e61148f9abab82 (diff)
powerpc: Allow flush_(inval_)dcache_range to work across ranges
>4GB (bsc#1146575 ltc#180764).
-rw-r--r--patches.arch/v2-powerpc-Allow-flush_-inval_-dcache_range-to-work-across-ranges-4GB.patch58
-rw-r--r--series.conf1
2 files changed, 59 insertions, 0 deletions
diff --git a/patches.arch/v2-powerpc-Allow-flush_-inval_-dcache_range-to-work-across-ranges-4GB.patch b/patches.arch/v2-powerpc-Allow-flush_-inval_-dcache_range-to-work-across-ranges-4GB.patch
new file mode 100644
index 0000000000..3bd2b96a34
--- /dev/null
+++ b/patches.arch/v2-powerpc-Allow-flush_-inval_-dcache_range-to-work-across-ranges-4GB.patch
@@ -0,0 +1,58 @@
+From patchwork Wed Aug 21 00:19:27 2019
+X-Patchwork-Submitter: Alastair D'Silva <alastair@au1.ibm.com>
+X-Patchwork-Id: 1150498
+From: Alastair D'Silva <alastair@d-silva.org>
+Subject: [PATCH v2] powerpc: Allow flush_(inval_)dcache_range to work across
+ ranges >4GB
+Date: Wed, 21 Aug 2019 10:19:27 +1000
+
+References: bsc#1146575 ltc#180764
+Patch-mainline: no, stable-only
+
+The upstream commit:
+22e9c88d486a ("powerpc/64: reuse PPC32 static inline flush_dcache_range()")
+has a similar effect, but since it is a rewrite of the assembler to C, is
+too invasive for stable. This patch is a minimal fix to address the issue in
+assembler.
+
+This patch applies cleanly to v5.2, v4.19 & v4.14.
+
+When calling flush_(inval_)dcache_range with a size >4GB, we were masking
+off the upper 32 bits, so we would incorrectly flush a range smaller
+than intended.
+
+This patch replaces the 32 bit shifts with 64 bit ones, so that
+the full size is accounted for.
+
+Changelog:
+v2
+ - Add related upstream commit
+
+Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
+Acked-by: Michal Suchanek <msuchanek@suse.de>
+---
+ arch/powerpc/kernel/misc_64.S | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S
+index 1ad4089dd110..d4d096f80f4b 100644
+--- a/arch/powerpc/kernel/misc_64.S
++++ b/arch/powerpc/kernel/misc_64.S
+@@ -130,7 +130,7 @@ _GLOBAL_TOC(flush_dcache_range)
+ subf r8,r6,r4 /* compute length */
+ add r8,r8,r5 /* ensure we get enough */
+ lwz r9,DCACHEL1LOGBLOCKSIZE(r10) /* Get log-2 of dcache block size */
+- srw. r8,r8,r9 /* compute line count */
++ srd. r8,r8,r9 /* compute line count */
+ beqlr /* nothing to do? */
+ mtctr r8
+ 0: dcbst 0,r6
+@@ -148,7 +148,7 @@ _GLOBAL(flush_inval_dcache_range)
+ subf r8,r6,r4 /* compute length */
+ add r8,r8,r5 /* ensure we get enough */
+ lwz r9,DCACHEL1LOGBLOCKSIZE(r10)/* Get log-2 of dcache block size */
+- srw. r8,r8,r9 /* compute line count */
++ srd. r8,r8,r9 /* compute line count */
+ beqlr /* nothing to do? */
+ sync
+ isync
diff --git a/series.conf b/series.conf
index 2517773daa..6a90cea28e 100644
--- a/series.conf
+++ b/series.conf
@@ -23649,6 +23649,7 @@
########################################################
# powerpc/generic
########################################################
+ patches.arch/v2-powerpc-Allow-flush_-inval_-dcache_range-to-work-across-ranges-4GB.patch
patches.suse/Fix-build-error-in-drmem.c.patch
patches.arch/Documentation-x86-Move-protecton-key-documentation-t.patch
patches.arch/Documentation-vm-PowerPC-specific-updates-to-memory-.patch