Skip to content

Commit 90f92c6

Browse files
Linus WalleijRussell King
authored andcommitted
ARM: 8613/1: Fix the uaccess crash on PB11MPCore
The following patch was sketched by Russell in response to my crashes on the PB11MPCore after the patch for software-based priviledged no access support for ARMv8.1. See this thread: http://marc.info/?l=linux-arm-kernel&m=144051749807214&w=2 I am unsure what is going on, I suspect everyone involved in the discussion is. I just want to repost this to get the discussion restarted, as I still have to apply this patch with every kernel iteration to get my PB11MPCore Realview running. Testing by Neil Armstrong on the Oxnas NAS has revealed that this bug exist also on that widely deployed hardware, so we are probably currently regressing all ARM11MPCore systems. Cc: Russell King <[email protected]> Cc: Will Deacon <[email protected]> Fixes: a5e090a ("ARM: software-based priviledged-no-access support") Tested-by: Neil Armstrong <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Russell King <[email protected]>
1 parent 0d7f4f0 commit 90f92c6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

arch/arm/kernel/smp_tlb.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010
#include <linux/preempt.h>
1111
#include <linux/smp.h>
12+
#include <linux/uaccess.h>
1213

1314
#include <asm/smp_plat.h>
1415
#include <asm/tlbflush.h>
@@ -40,8 +41,11 @@ static inline void ipi_flush_tlb_mm(void *arg)
4041
static inline void ipi_flush_tlb_page(void *arg)
4142
{
4243
struct tlb_args *ta = (struct tlb_args *)arg;
44+
unsigned int __ua_flags = uaccess_save_and_enable();
4345

4446
local_flush_tlb_page(ta->ta_vma, ta->ta_start);
47+
48+
uaccess_restore(__ua_flags);
4549
}
4650

4751
static inline void ipi_flush_tlb_kernel_page(void *arg)
@@ -54,8 +58,11 @@ static inline void ipi_flush_tlb_kernel_page(void *arg)
5458
static inline void ipi_flush_tlb_range(void *arg)
5559
{
5660
struct tlb_args *ta = (struct tlb_args *)arg;
61+
unsigned int __ua_flags = uaccess_save_and_enable();
5762

5863
local_flush_tlb_range(ta->ta_vma, ta->ta_start, ta->ta_end);
64+
65+
uaccess_restore(__ua_flags);
5966
}
6067

6168
static inline void ipi_flush_tlb_kernel_range(void *arg)

0 commit comments

Comments
 (0)