[PATCH] ARM: 2698/1: Enable kernel r/w access to user pages on ARMv6

Patch from Catalin Marinas

cpu_v6_set_pte() sets the kernel access rights to r/o for user
pages (L_PTE_USER) when neither L_PTE_WRITE nor L_PTE_DIRTY are
set. This causes a kernel data abort when writing the TLS value
in the 0xffff0000 page. This patch enables the kernel r/w access.

Signed-off-by: Catalin Marinas
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by Catalin Marinas and committed by Russell King 79042f08 5932ae3f

+3 -3
+3 -3
arch/arm/mm/proc-v6.S
··· 132 * 100x 1 0 1 r/o no acc 133 * 10x0 1 0 1 r/o no acc 134 * 1011 0 0 1 r/w no acc 135 - * 110x 1 1 0 r/o r/o 136 - * 11x0 1 1 0 r/o r/o 137 * 1111 0 1 1 r/w r/w 138 */ 139 ENTRY(cpu_v6_set_pte) ··· 150 tst r1, #L_PTE_USER 151 orrne r2, r2, #AP1 | nG 152 tstne r2, #APX 153 - eorne r2, r2, #AP0 154 155 tst r1, #L_PTE_YOUNG 156 biceq r2, r2, #APX | AP1 | AP0
··· 132 * 100x 1 0 1 r/o no acc 133 * 10x0 1 0 1 r/o no acc 134 * 1011 0 0 1 r/w no acc 135 + * 110x 0 1 0 r/w r/o 136 + * 11x0 0 1 0 r/w r/o 137 * 1111 0 1 1 r/w r/w 138 */ 139 ENTRY(cpu_v6_set_pte) ··· 150 tst r1, #L_PTE_USER 151 orrne r2, r2, #AP1 | nG 152 tstne r2, #APX 153 + bicne r2, r2, #APX | AP0 154 155 tst r1, #L_PTE_YOUNG 156 biceq r2, r2, #APX | AP1 | AP0