aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-02-04 12:42:55 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-04 12:42:55 -0500
commit5659c0e4708d2893606df3335cb453f17220bd60 (patch)
treefd95210d250ec87b1498186c8b3388ecfd801597 /arch/arm
parentdc6d6844111d953d3fa2121da28d38be9359c911 (diff)
parent8e64806672466392acf19e14427d1c29df3e58b9 (diff)
Merge branch 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm
Pull ARM fixes from Russell King: "A number of ARM fixes, the biggest is fixing a regression caused by appended DT blobs exceeding 64K, causing the decompressor fixup code to fail to patch the DT blob. Another important fix is for the ASID allocator from Will Deacon which prevents some rare crashes seen on some systems. Lastly, there's a build fix for v7M systems when printk support is disabled. The last two remaining fixes are more cosmetic - the IOMMU one prevents an annoying harmless warning message, and we disable the kernel strict memory permissions on non-MMU which can't support it anyway" * 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm: ARM: 8299/1: mm: ensure local active ASID is marked as allocated on rollover ARM: 8298/1: ARM_KERNMEM_PERMS only works with MMU enabled ARM: 8295/1: fix v7M build for !CONFIG_PRINTK ARM: 8294/1: ATAG_DTB_COMPAT: remove the DT workspace's hardcoded 64KB size ARM: 8288/1: dma-mapping: don't detach devices without an IOMMU during teardown
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/boot/compressed/head.S39
-rw-r--r--arch/arm/kernel/entry-v7m.S2
-rw-r--r--arch/arm/mm/Kconfig1
-rw-r--r--arch/arm/mm/context.c26
-rw-r--r--arch/arm/mm/dma-mapping.c3
5 files changed, 47 insertions, 24 deletions
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index 68be9017593d..132c70e2d2f1 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -263,16 +263,37 @@ restart: adr r0, LC0
263 * OK... Let's do some funky business here. 263 * OK... Let's do some funky business here.
264 * If we do have a DTB appended to zImage, and we do have 264 * If we do have a DTB appended to zImage, and we do have
265 * an ATAG list around, we want the later to be translated 265 * an ATAG list around, we want the later to be translated
266 * and folded into the former here. To be on the safe side, 266 * and folded into the former here. No GOT fixup has occurred
267 * let's temporarily move the stack away into the malloc 267 * yet, but none of the code we're about to call uses any
268 * area. No GOT fixup has occurred yet, but none of the 268 * global variable.
269 * code we're about to call uses any global variable.
270 */ 269 */
271 add sp, sp, #0x10000 270
271 /* Get the initial DTB size */
272 ldr r5, [r6, #4]
273#ifndef __ARMEB__
274 /* convert to little endian */
275 eor r1, r5, r5, ror #16
276 bic r1, r1, #0x00ff0000
277 mov r5, r5, ror #8
278 eor r5, r5, r1, lsr #8
279#endif
280 /* 50% DTB growth should be good enough */
281 add r5, r5, r5, lsr #1
282 /* preserve 64-bit alignment */
283 add r5, r5, #7
284 bic r5, r5, #7
285 /* clamp to 32KB min and 1MB max */
286 cmp r5, #(1 << 15)
287 movlo r5, #(1 << 15)
288 cmp r5, #(1 << 20)
289 movhi r5, #(1 << 20)
290 /* temporarily relocate the stack past the DTB work space */
291 add sp, sp, r5
292
272 stmfd sp!, {r0-r3, ip, lr} 293 stmfd sp!, {r0-r3, ip, lr}
273 mov r0, r8 294 mov r0, r8
274 mov r1, r6 295 mov r1, r6
275 sub r2, sp, r6 296 mov r2, r5
276 bl atags_to_fdt 297 bl atags_to_fdt
277 298
278 /* 299 /*
@@ -285,11 +306,11 @@ restart: adr r0, LC0
285 bic r0, r0, #1 306 bic r0, r0, #1
286 add r0, r0, #0x100 307 add r0, r0, #0x100
287 mov r1, r6 308 mov r1, r6
288 sub r2, sp, r6 309 mov r2, r5
289 bleq atags_to_fdt 310 bleq atags_to_fdt
290 311
291 ldmfd sp!, {r0-r3, ip, lr} 312 ldmfd sp!, {r0-r3, ip, lr}
292 sub sp, sp, #0x10000 313 sub sp, sp, r5
293#endif 314#endif
294 315
295 mov r8, r6 @ use the appended device tree 316 mov r8, r6 @ use the appended device tree
@@ -306,7 +327,7 @@ restart: adr r0, LC0
306 subs r1, r5, r1 327 subs r1, r5, r1
307 addhi r9, r9, r1 328 addhi r9, r9, r1
308 329
309 /* Get the dtb's size */ 330 /* Get the current DTB size */
310 ldr r5, [r6, #4] 331 ldr r5, [r6, #4]
311#ifndef __ARMEB__ 332#ifndef __ARMEB__
312 /* convert r5 (dtb size) to little endian */ 333 /* convert r5 (dtb size) to little endian */
diff --git a/arch/arm/kernel/entry-v7m.S b/arch/arm/kernel/entry-v7m.S
index 2260f1855820..8944f4991c3c 100644
--- a/arch/arm/kernel/entry-v7m.S
+++ b/arch/arm/kernel/entry-v7m.S
@@ -22,10 +22,12 @@
22 22
23__invalid_entry: 23__invalid_entry:
24 v7m_exception_entry 24 v7m_exception_entry
25#ifdef CONFIG_PRINTK
25 adr r0, strerr 26 adr r0, strerr
26 mrs r1, ipsr 27 mrs r1, ipsr
27 mov r2, lr 28 mov r2, lr
28 bl printk 29 bl printk
30#endif
29 mov r0, sp 31 mov r0, sp
30 bl show_regs 32 bl show_regs
311: b 1b 331: b 1b
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 03823e784f63..c43c71455566 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -1012,6 +1012,7 @@ config ARCH_SUPPORTS_BIG_ENDIAN
1012 1012
1013config ARM_KERNMEM_PERMS 1013config ARM_KERNMEM_PERMS
1014 bool "Restrict kernel memory permissions" 1014 bool "Restrict kernel memory permissions"
1015 depends on MMU
1015 help 1016 help
1016 If this is set, kernel memory other than kernel text (and rodata) 1017 If this is set, kernel memory other than kernel text (and rodata)
1017 will be made non-executable. The tradeoff is that each region is 1018 will be made non-executable. The tradeoff is that each region is
diff --git a/arch/arm/mm/context.c b/arch/arm/mm/context.c
index 91892569710f..845769e41332 100644
--- a/arch/arm/mm/context.c
+++ b/arch/arm/mm/context.c
@@ -144,21 +144,17 @@ static void flush_context(unsigned int cpu)
144 /* Update the list of reserved ASIDs and the ASID bitmap. */ 144 /* Update the list of reserved ASIDs and the ASID bitmap. */
145 bitmap_clear(asid_map, 0, NUM_USER_ASIDS); 145 bitmap_clear(asid_map, 0, NUM_USER_ASIDS);
146 for_each_possible_cpu(i) { 146 for_each_possible_cpu(i) {
147 if (i == cpu) { 147 asid = atomic64_xchg(&per_cpu(active_asids, i), 0);
148 asid = 0; 148 /*
149 } else { 149 * If this CPU has already been through a
150 asid = atomic64_xchg(&per_cpu(active_asids, i), 0); 150 * rollover, but hasn't run another task in
151 /* 151 * the meantime, we must preserve its reserved
152 * If this CPU has already been through a 152 * ASID, as this is the only trace we have of
153 * rollover, but hasn't run another task in 153 * the process it is still running.
154 * the meantime, we must preserve its reserved 154 */
155 * ASID, as this is the only trace we have of 155 if (asid == 0)
156 * the process it is still running. 156 asid = per_cpu(reserved_asids, i);
157 */ 157 __set_bit(asid & ~ASID_MASK, asid_map);
158 if (asid == 0)
159 asid = per_cpu(reserved_asids, i);
160 __set_bit(asid & ~ASID_MASK, asid_map);
161 }
162 per_cpu(reserved_asids, i) = asid; 158 per_cpu(reserved_asids, i) = asid;
163 } 159 }
164 160
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index a673c7f7e208..903dba064a03 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -2048,6 +2048,9 @@ static void arm_teardown_iommu_dma_ops(struct device *dev)
2048{ 2048{
2049 struct dma_iommu_mapping *mapping = dev->archdata.mapping; 2049 struct dma_iommu_mapping *mapping = dev->archdata.mapping;
2050 2050
2051 if (!mapping)
2052 return;
2053
2051 __arm_iommu_detach_device(dev); 2054 __arm_iommu_detach_device(dev);
2052 arm_iommu_release_mapping(mapping); 2055 arm_iommu_release_mapping(mapping);
2053} 2056}