kernel: work around CONFIG_CPU_SW_DOMAIN_PAN breakage on ARM11 MPCore
[openwrt/openwrt.git] / target / linux / generic / patches-4.4 / 100-ARM-work-around-CONFIG_CPU_SW_DOMAIN_PAN-breakage-on.patch
1 From: Felix Fietkau <nbd@openwrt.org>
2 Date: Tue, 19 Jan 2016 00:18:09 +0100
3 Subject: [PATCH] ARM: work around CONFIG_CPU_SW_DOMAIN_PAN breakage on ARM11
4 MPCore
5
6 Patch taken from http://www.spinics.net/lists/arm-kernel/msg450888.html
7
8 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
9 ---
10
11 --- a/arch/arm/kernel/smp_tlb.c
12 +++ b/arch/arm/kernel/smp_tlb.c
13 @@ -9,6 +9,7 @@
14 */
15 #include <linux/preempt.h>
16 #include <linux/smp.h>
17 +#include <linux/uaccess.h>
18
19 #include <asm/smp_plat.h>
20 #include <asm/tlbflush.h>
21 @@ -40,8 +41,11 @@ static inline void ipi_flush_tlb_mm(void
22 static inline void ipi_flush_tlb_page(void *arg)
23 {
24 struct tlb_args *ta = (struct tlb_args *)arg;
25 + unsigned int __ua_flags = uaccess_save_and_enable();
26
27 local_flush_tlb_page(ta->ta_vma, ta->ta_start);
28 +
29 + uaccess_restore(__ua_flags);
30 }
31
32 static inline void ipi_flush_tlb_kernel_page(void *arg)
33 @@ -54,8 +58,11 @@ static inline void ipi_flush_tlb_kernel_
34 static inline void ipi_flush_tlb_range(void *arg)
35 {
36 struct tlb_args *ta = (struct tlb_args *)arg;
37 + unsigned int __ua_flags = uaccess_save_and_enable();
38
39 local_flush_tlb_range(ta->ta_vma, ta->ta_start, ta->ta_end);
40 +
41 + uaccess_restore(__ua_flags);
42 }
43
44 static inline void ipi_flush_tlb_kernel_range(void *arg)