Commit a4d2fa08 authored by Linus Walleij's avatar Linus Walleij Committed by Greg Kroah-Hartman

ARM: 8613/1: Fix the uaccess crash on PB11MPCore

commit 90f92c63 upstream.

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 <linux@armlinux.org.uk>
Cc: Will Deacon <will.deacon@arm.com>
Fixes: a5e090ac ("ARM: software-based priviledged-no-access support")
Tested-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent baa2610c
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
*/ */
#include <linux/preempt.h> #include <linux/preempt.h>
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/uaccess.h>
#include <asm/smp_plat.h> #include <asm/smp_plat.h>
#include <asm/tlbflush.h> #include <asm/tlbflush.h>
...@@ -40,8 +41,11 @@ static inline void ipi_flush_tlb_mm(void *arg) ...@@ -40,8 +41,11 @@ static inline void ipi_flush_tlb_mm(void *arg)
static inline void ipi_flush_tlb_page(void *arg) static inline void ipi_flush_tlb_page(void *arg)
{ {
struct tlb_args *ta = (struct tlb_args *)arg; struct tlb_args *ta = (struct tlb_args *)arg;
unsigned int __ua_flags = uaccess_save_and_enable();
local_flush_tlb_page(ta->ta_vma, ta->ta_start); local_flush_tlb_page(ta->ta_vma, ta->ta_start);
uaccess_restore(__ua_flags);
} }
static inline void ipi_flush_tlb_kernel_page(void *arg) static inline void ipi_flush_tlb_kernel_page(void *arg)
...@@ -54,8 +58,11 @@ static inline void ipi_flush_tlb_kernel_page(void *arg) ...@@ -54,8 +58,11 @@ static inline void ipi_flush_tlb_kernel_page(void *arg)
static inline void ipi_flush_tlb_range(void *arg) static inline void ipi_flush_tlb_range(void *arg)
{ {
struct tlb_args *ta = (struct tlb_args *)arg; struct tlb_args *ta = (struct tlb_args *)arg;
unsigned int __ua_flags = uaccess_save_and_enable();
local_flush_tlb_range(ta->ta_vma, ta->ta_start, ta->ta_end); local_flush_tlb_range(ta->ta_vma, ta->ta_start, ta->ta_end);
uaccess_restore(__ua_flags);
} }
static inline void ipi_flush_tlb_kernel_range(void *arg) static inline void ipi_flush_tlb_kernel_range(void *arg)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment