parisc: Fix extraction of hash lock bits in syscall.S
authorJohn David Anglin <dave.anglin@bell.net>
Fri, 19 Nov 2021 21:18:47 +0000 (22:18 +0100)
committerHelge Deller <deller@gmx.de>
Mon, 22 Nov 2021 06:37:31 +0000 (07:37 +0100)
The extru instruction leaves the most significant 32 bits of the target
register in an undefined state on PA 2.0 systems. If any of these bits
are nonzero, this will break the calculation of the lock pointer.

Fix by using extrd,u instruction via extru_safe macro on 64-bit kernels.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Helge Deller <deller@gmx.de>
arch/parisc/kernel/syscall.S

index 4fb3b6a993bf6e58065462b2aa2d6a654c286627..d2497b339d139295a42a45c895a01dfd184cb352 100644 (file)
@@ -566,7 +566,7 @@ lws_compare_and_swap:
        ldo     R%lws_lock_start(%r20), %r28
 
        /* Extract eight bits from r26 and hash lock (Bits 3-11) */
-       extru  %r26, 28, 8, %r20
+       extru_safe  %r26, 28, 8, %r20
 
        /* Find lock to use, the hash is either one of 0 to
           15, multiplied by 16 (keep it 16-byte aligned)
@@ -751,7 +751,7 @@ cas2_lock_start:
        ldo     R%lws_lock_start(%r20), %r28
 
        /* Extract eight bits from r26 and hash lock (Bits 3-11) */
-       extru  %r26, 28, 8, %r20
+       extru_safe  %r26, 28, 8, %r20
 
        /* Find lock to use, the hash is either one of 0 to
           15, multiplied by 16 (keep it 16-byte aligned)