diff options
Diffstat (limited to 'arch/arm/mm')
-rw-r--r-- | arch/arm/mm/Kconfig | 14 | ||||
-rw-r--r-- | arch/arm/mm/abort-ev6.S | 16 | ||||
-rw-r--r-- | arch/arm/mm/mm-armv.c | 5 |
3 files changed, 33 insertions, 2 deletions
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig index 5b670c9ac5ef..007766a0644c 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig | |||
@@ -409,3 +409,17 @@ config CPU_BPREDICT_DISABLE | |||
409 | depends on CPU_ARM1020 | 409 | depends on CPU_ARM1020 |
410 | help | 410 | help |
411 | Say Y here to disable branch prediction. If unsure, say N. | 411 | Say Y here to disable branch prediction. If unsure, say N. |
412 | |||
413 | config HAS_TLS_REG | ||
414 | bool | ||
415 | depends on CPU_32v6 && !CPU_32v5 && !CPU_32v4 && !CPU_32v3 | ||
416 | help | ||
417 | This selects support for the CP15 thread register. | ||
418 | It is defined to be available on ARMv6 or later. However | ||
419 | if the kernel is configured to support multiple CPUs including | ||
420 | a pre-ARMv6 processors, or if a given ARMv6 processor doesn't | ||
421 | implement the thread register for some reason, then access to | ||
422 | this register from user space must be trapped and emulated. | ||
423 | If user space is relying on the __kuser_get_tls code then | ||
424 | there should not be any impact. | ||
425 | |||
diff --git a/arch/arm/mm/abort-ev6.S b/arch/arm/mm/abort-ev6.S index 38b2cbb89beb..8f76f3df7b4c 100644 --- a/arch/arm/mm/abort-ev6.S +++ b/arch/arm/mm/abort-ev6.S | |||
@@ -1,5 +1,6 @@ | |||
1 | #include <linux/linkage.h> | 1 | #include <linux/linkage.h> |
2 | #include <asm/assembler.h> | 2 | #include <asm/assembler.h> |
3 | #include "abort-macro.S" | ||
3 | /* | 4 | /* |
4 | * Function: v6_early_abort | 5 | * Function: v6_early_abort |
5 | * | 6 | * |
@@ -13,11 +14,26 @@ | |||
13 | * : sp = pointer to registers | 14 | * : sp = pointer to registers |
14 | * | 15 | * |
15 | * Purpose : obtain information about current aborted instruction. | 16 | * Purpose : obtain information about current aborted instruction. |
17 | * Note: we read user space. This means we might cause a data | ||
18 | * abort here if the I-TLB and D-TLB aren't seeing the same | ||
19 | * picture. Unfortunately, this does happen. We live with it. | ||
16 | */ | 20 | */ |
17 | .align 5 | 21 | .align 5 |
18 | ENTRY(v6_early_abort) | 22 | ENTRY(v6_early_abort) |
19 | mrc p15, 0, r1, c5, c0, 0 @ get FSR | 23 | mrc p15, 0, r1, c5, c0, 0 @ get FSR |
20 | mrc p15, 0, r0, c6, c0, 0 @ get FAR | 24 | mrc p15, 0, r0, c6, c0, 0 @ get FAR |
25 | /* | ||
26 | * Faulty SWP instruction on 1136 doesn't set bit 11 in DFSR. | ||
27 | * The test below covers all the write situations, including Java bytecodes | ||
28 | */ | ||
29 | bic r1, r1, #1 << 11 | 1 << 10 @ clear bits 11 and 10 of FSR | ||
30 | tst r3, #PSR_J_BIT @ Java? | ||
31 | movne pc, lr | ||
32 | do_thumb_abort | ||
33 | ldreq r3, [r2] @ read aborted ARM instruction | ||
34 | do_ldrd_abort | ||
35 | tst r3, #1 << 20 @ L = 0 -> write | ||
36 | orreq r1, r1, #1 << 11 @ yes. | ||
21 | mov pc, lr | 37 | mov pc, lr |
22 | 38 | ||
23 | 39 | ||
diff --git a/arch/arm/mm/mm-armv.c b/arch/arm/mm/mm-armv.c index f5a87db8b498..585dfb8e20b9 100644 --- a/arch/arm/mm/mm-armv.c +++ b/arch/arm/mm/mm-armv.c | |||
@@ -411,9 +411,10 @@ static void __init build_mem_type_table(void) | |||
411 | mem_types[MT_MEMORY].prot_sect &= ~PMD_BIT4; | 411 | mem_types[MT_MEMORY].prot_sect &= ~PMD_BIT4; |
412 | mem_types[MT_ROM].prot_sect &= ~PMD_BIT4; | 412 | mem_types[MT_ROM].prot_sect &= ~PMD_BIT4; |
413 | /* | 413 | /* |
414 | * Mark cache clean areas read only from SVC mode | 414 | * Mark cache clean areas and XIP ROM read only |
415 | * and no access from userspace. | 415 | * from SVC mode and no access from userspace. |
416 | */ | 416 | */ |
417 | mem_types[MT_ROM].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; | ||
417 | mem_types[MT_MINICLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; | 418 | mem_types[MT_MINICLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; |
418 | mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; | 419 | mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; |
419 | } | 420 | } |