Skip to content

Commit 3f066e8

Browse files
committed
Merge tag 'for-5.16/parisc-7' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux
Pull parisc architecture fixes from Helge Deller: - Fix a bug in the C code which calculates the relevant futex spinlock based on the futex virtual address. In some cases a wrong spinlock (compared to what is calculated in the assembly code path) was choosen which then can lead to deadlocks. - The 64-bit kernel missed to clip the LWS number in the Light-weight-syscall path for 32-bit processes. - Prevent CPU register dump to show stale value in IIR register on access rights traps. - Remove unused ARCH_DEFCONFIG entries. * tag 'for-5.16/parisc-7' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: remove ARCH_DEFCONFIG parisc: Fix mask used to select futex spinlock parisc: Correct completer in lws start parisc: Clear stale IIR value on instruction access rights trap
2 parents 0740040 + aacb201 commit 3f066e8

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

arch/parisc/Kconfig

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,6 @@ config MMU
8585
config STACK_GROWSUP
8686
def_bool y
8787

88-
config ARCH_DEFCONFIG
89-
string
90-
default "arch/parisc/configs/generic-32bit_defconfig" if !64BIT
91-
default "arch/parisc/configs/generic-64bit_defconfig" if 64BIT
92-
9388
config GENERIC_LOCKBREAK
9489
bool
9590
default y

arch/parisc/include/asm/futex.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ static inline void
1414
_futex_spin_lock(u32 __user *uaddr)
1515
{
1616
extern u32 lws_lock_start[];
17-
long index = ((long)uaddr & 0x3f8) >> 1;
17+
long index = ((long)uaddr & 0x7f8) >> 1;
1818
arch_spinlock_t *s = (arch_spinlock_t *)&lws_lock_start[index];
1919
preempt_disable();
2020
arch_spin_lock(s);
@@ -24,7 +24,7 @@ static inline void
2424
_futex_spin_unlock(u32 __user *uaddr)
2525
{
2626
extern u32 lws_lock_start[];
27-
long index = ((long)uaddr & 0x3f8) >> 1;
27+
long index = ((long)uaddr & 0x7f8) >> 1;
2828
arch_spinlock_t *s = (arch_spinlock_t *)&lws_lock_start[index];
2929
arch_spin_unlock(s);
3030
preempt_enable();

arch/parisc/kernel/syscall.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ lws_start:
472472
extrd,u %r1,PSW_W_BIT,1,%r1
473473
/* sp must be aligned on 4, so deposit the W bit setting into
474474
* the bottom of sp temporarily */
475-
or,ev %r1,%r30,%r30
475+
or,od %r1,%r30,%r30
476476

477477
/* Clip LWS number to a 32-bit value for 32-bit processes */
478478
depdi 0, 31, 32, %r20

arch/parisc/kernel/traps.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,8 @@ void notrace handle_interruption(int code, struct pt_regs *regs)
730730
}
731731
mmap_read_unlock(current->mm);
732732
}
733+
/* CPU could not fetch instruction, so clear stale IIR value. */
734+
regs->iir = 0xbaadf00d;
733735
fallthrough;
734736
case 27:
735737
/* Data memory protection ID trap */

0 commit comments

Comments
 (0)