summaryrefslogtreecommitdiffstats
path: root/arch/parisc
diff options
context:
space:
mode:
authorJohn David Anglin <dave.anglin@bell.net>2024-02-23 16:40:51 +0100
committerHelge Deller <deller@gmx.de>2024-02-27 22:51:44 +0100
commit4603fbaa76b5e703b38ac8cc718102834eb6e330 (patch)
tree13c693d452008376e3d2c3d7c0ee0d081b812106 /arch/parisc
parente5db6a74571a8baf87a116ea39aab946283362ff (diff)
downloadlinux-stable-4603fbaa76b5e703b38ac8cc718102834eb6e330.tar.gz
linux-stable-4603fbaa76b5e703b38ac8cc718102834eb6e330.tar.bz2
linux-stable-4603fbaa76b5e703b38ac8cc718102834eb6e330.zip
parisc: Avoid clobbering the C/B bits in the PSW with tophys and tovirt macros
Use add,l to avoid clobbering the C/B bits in the PSW. Signed-off-by: John David Anglin <dave.anglin@bell.net> Signed-off-by: Helge Deller <deller@gmx.de> Cc: stable@vger.kernel.org # v5.10+
Diffstat (limited to 'arch/parisc')
-rw-r--r--arch/parisc/include/asm/assembly.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/arch/parisc/include/asm/assembly.h b/arch/parisc/include/asm/assembly.h
index 5937d5edaba1..000a28e1c5e8 100644
--- a/arch/parisc/include/asm/assembly.h
+++ b/arch/parisc/include/asm/assembly.h
@@ -97,26 +97,28 @@
* version takes two arguments: a src and destination register.
* However, the source and destination registers can not be
* the same register.
+ *
+ * We use add,l to avoid clobbering the C/B bits in the PSW.
*/
.macro tophys grvirt, grphys
- ldil L%(__PAGE_OFFSET), \grphys
- sub \grvirt, \grphys, \grphys
+ ldil L%(-__PAGE_OFFSET), \grphys
+ addl \grvirt, \grphys, \grphys
.endm
-
+
.macro tovirt grphys, grvirt
ldil L%(__PAGE_OFFSET), \grvirt
- add \grphys, \grvirt, \grvirt
+ addl \grphys, \grvirt, \grvirt
.endm
.macro tophys_r1 gr
- ldil L%(__PAGE_OFFSET), %r1
- sub \gr, %r1, \gr
+ ldil L%(-__PAGE_OFFSET), %r1
+ addl \gr, %r1, \gr
.endm
-
+
.macro tovirt_r1 gr
ldil L%(__PAGE_OFFSET), %r1
- add \gr, %r1, \gr
+ addl \gr, %r1, \gr
.endm
.macro delay value