]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
parisc: Avoid clobbering the C/B bits in the PSW with tophys and tovirt macros
authorJohn David Anglin <dave.anglin@bell.net>
Fri, 23 Feb 2024 15:40:51 +0000 (16:40 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2024 14:18:36 +0000 (16:18 +0200)
[ Upstream commit 4603fbaa76b5e703b38ac8cc718102834eb6e330 ]

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+
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/parisc/include/asm/assembly.h

index fd8c1ebd2747096775d246c817ef4cb44b414ed5..12b9236effbc437552da753848756db8eaf69719 100644 (file)
         * 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