hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/arch/parisc/include/asm/futex.h
....@@ -16,7 +16,7 @@
1616 _futex_spin_lock_irqsave(u32 __user *uaddr, unsigned long int *flags)
1717 {
1818 extern u32 lws_lock_start[];
19
- long index = ((long)uaddr & 0xf0) >> 2;
19
+ long index = ((long)uaddr & 0x7f8) >> 1;
2020 arch_spinlock_t *s = (arch_spinlock_t *)&lws_lock_start[index];
2121 local_irq_save(*flags);
2222 arch_spin_lock(s);
....@@ -26,7 +26,7 @@
2626 _futex_spin_unlock_irqrestore(u32 __user *uaddr, unsigned long int *flags)
2727 {
2828 extern u32 lws_lock_start[];
29
- long index = ((long)uaddr & 0xf0) >> 2;
29
+ long index = ((long)uaddr & 0x7f8) >> 1;
3030 arch_spinlock_t *s = (arch_spinlock_t *)&lws_lock_start[index];
3131 arch_spin_unlock(s);
3232 local_irq_restore(*flags);
....@@ -40,7 +40,6 @@
4040 u32 tmp;
4141
4242 _futex_spin_lock_irqsave(uaddr, &flags);
43
- pagefault_disable();
4443
4544 ret = -EFAULT;
4645 if (unlikely(get_user(oldval, uaddr) != 0))
....@@ -73,7 +72,6 @@
7372 ret = -EFAULT;
7473
7574 out_pagefault_enable:
76
- pagefault_enable();
7775 _futex_spin_unlock_irqrestore(uaddr, &flags);
7876
7977 if (!ret)
....@@ -95,7 +93,7 @@
9593 if (uaccess_kernel() && !uaddr)
9694 return -EFAULT;
9795
98
- if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
96
+ if (!access_ok(uaddr, sizeof(u32)))
9997 return -EFAULT;
10098
10199 /* HPPA has no cmpxchg in hardware and therefore the