Pull ARM fixes from Russell King: "A few more ARM fixes: - the assembly backtrace code suffers problems with the new printk() implementation which assumes that kernel messages without KERN_CONT should have newlines inserted between them. Fix this. - fix a section naming error - ".init.text" rather than ".text.init" - preallocate DMA debug memory at core_initcall() time rather than fs_initcall(), as we have some core drivers that need to use DMA mapping - and that triggers a kernel warning from the DMA debug code. - fix XIP kernels after the ro_after_init changes made this data permanently read-only" * 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: Fix XIP kernels ARM: 8628/1: dma-mapping: preallocate DMA-debug hash tables in core_initcall ARM: 8624/1: proc-v7m.S: fix init section name ARM: fix backtrace
Unified · Split
| @@ -74,6 +74,26 @@ void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long · 73 unmodified lines | |||
| 74 | dump_mem("", "Exception stack", frame + 4, frame + 4 + sizeof(struct pt_regs)); | 74 | dump_mem("", "Exception stack", frame + 4, frame + 4 + sizeof(struct pt_regs)); |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | void dump_backtrace_stm(u32 *stack, u32 instruction) | ||
| 78 | { | ||
| 79 | char str[80], *p; | ||
| 80 | unsigned int x; | ||
| 81 | int reg; | ||
| 82 | |||
| 83 | for (reg = 10, x = 0, p = str; reg >= 0; reg--) { | ||
| 84 | if (instruction & BIT(reg)) { | ||
| 85 | p += sprintf(p, " r%d:%08x", reg, *stack--); | ||
| 86 | if (++x == 6) { | ||
| 87 | x = 0; | ||
| 88 | p = str; | ||
| 89 | printk("%s\n", str); | ||
| 90 | } | ||
| 91 | } | ||
| 92 | } | ||
| 93 | if (p != str) | ||
| 94 | printk("%s\n", str); | ||
| 95 | } | ||
| 96 | |||
| 77 | #ifndef CONFIG_ARM_UNWIND | 97 | #ifndef CONFIG_ARM_UNWIND |
| 78 | /* | 98 | /* |
| 79 | * Stack pointers should always be within the kernels view of | 99 | * Stack pointers should always be within the kernels view of |
| @@ -3,6 +3,9 @@ · 2 unmodified lines | |||
| 3 | * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz> | 3 | * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz> |
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| 6 | /* No __ro_after_init data in the .rodata section - which will always be ro */ | ||
| 7 | #define RO_AFTER_INIT_DATA | ||
| 8 | |||
| 6 | #include <asm-generic/vmlinux.lds.h> | 9 | #include <asm-generic/vmlinux.lds.h> |
| 7 | #include <asm/cache.h> | 10 | #include <asm/cache.h> |
| 8 | #include <asm/thread_info.h> | 11 | #include <asm/thread_info.h> |
| @@ -223,6 +226,8 @@ SECTIONS · 214 unmodified lines | |||
| 223 | . = ALIGN(PAGE_SIZE); | 226 | . = ALIGN(PAGE_SIZE); |
| 224 | __init_end = .; | 227 | __init_end = .; |
| 225 | 228 | ||
| 229 | *(.data..ro_after_init) | ||
| 230 | |||
| 226 | NOSAVE_DATA | 231 | NOSAVE_DATA |
| 227 | CACHELINE_ALIGNED_DATA(L1_CACHE_BYTES) | 232 | CACHELINE_ALIGNED_DATA(L1_CACHE_BYTES) |
| 228 | READ_MOSTLY_DATA(L1_CACHE_BYTES) | 233 | READ_MOSTLY_DATA(L1_CACHE_BYTES) |
| @@ -10,6 +10,7 @@ · 9 unmodified lines | |||
| 10 | * 27/03/03 Ian Molton Clean up CONFIG_CPU | 10 | * 27/03/03 Ian Molton Clean up CONFIG_CPU |
| 11 | * | 11 | * |
| 12 | */ | 12 | */ |
| 13 | #include <linux/kern_levels.h> | ||
| 13 | #include <linux/linkage.h> | 14 | #include <linux/linkage.h> |
| 14 | #include <asm/assembler.h> | 15 | #include <asm/assembler.h> |
| 15 | .text | 16 | .text |
| @@ -83,13 +84,13 @@ for_each_frame: tst frame, mask @ Check for address exceptions · 67 unmodified lines | |||
| 83 | teq r3, r1, lsr #11 | 84 | teq r3, r1, lsr #11 |
| 84 | ldreq r0, [frame, #-8] @ get sp | 85 | ldreq r0, [frame, #-8] @ get sp |
| 85 | subeq r0, r0, #4 @ point at the last arg | 86 | subeq r0, r0, #4 @ point at the last arg |
| 86 | bleq .Ldumpstm @ dump saved registers | 87 | bleq dump_backtrace_stm @ dump saved registers |
| 87 | 88 | ||
| 88 | 1004: ldr r1, [sv_pc, #0] @ if stmfd sp!, {..., fp, ip, lr, pc} | 89 | 1004: ldr r1, [sv_pc, #0] @ if stmfd sp!, {..., fp, ip, lr, pc} |
| 89 | ldr r3, .Ldsi @ instruction exists, | 90 | ldr r3, .Ldsi @ instruction exists, |
| 90 | teq r3, r1, lsr #11 | 91 | teq r3, r1, lsr #11 |
| 91 | subeq r0, frame, #16 | 92 | subeq r0, frame, #16 |
| 92 | bleq .Ldumpstm @ dump saved registers | 93 | bleq dump_backtrace_stm @ dump saved registers |
| 93 | 94 | ||
| 94 | teq sv_fp, #0 @ zero saved fp means | 95 | teq sv_fp, #0 @ zero saved fp means |
| 95 | beq no_frame @ no further frames | 96 | beq no_frame @ no further frames |
| @@ -112,38 +113,6 @@ ENDPROC(c_backtrace) · 16 unmodified lines | |||
| 112 | .long 1004b, 1006b | 113 | .long 1004b, 1006b |
| 113 | .popsection | 114 | .popsection |
| 114 | 115 | ||
| 115 | #define instr r4 | ||
| 116 | #define reg r5 | ||
| 117 | #define stack r6 | ||
| 118 | |||
| 119 | .Ldumpstm: stmfd sp!, {instr, reg, stack, r7, lr} | ||
| 120 | mov stack, r0 | ||
| 121 | mov instr, r1 | ||
| 122 | mov reg, #10 | ||
| 123 | mov r7, #0 | ||
| 124 | 1: mov r3, #1 | ||
| 125 | ARM( tst instr, r3, lsl reg ) | ||
| 126 | THUMB( lsl r3, reg ) | ||
| 127 | THUMB( tst instr, r3 ) | ||
| 128 | beq 2f | ||
| 129 | add r7, r7, #1 | ||
| 130 | teq r7, #6 | ||
| 131 | moveq r7, #0 | ||
| 132 | adr r3, .Lcr | ||
| 133 | addne r3, r3, #1 @ skip newline | ||
| 134 | ldr r2, [stack], #-4 | ||
| 135 | mov r1, reg | ||
| 136 | adr r0, .Lfp | ||
| 137 | bl printk | ||
| 138 | 2: subs reg, reg, #1 | ||
| 139 | bpl 1b | ||
| 140 | teq r7, #0 | ||
| 141 | adrne r0, .Lcr | ||
| 142 | blne printk | ||
| 143 | ldmfd sp!, {instr, reg, stack, r7, pc} | ||
| 144 | |||
| 145 | .Lfp: .asciz " r%d:%08x%s" | ||
| 146 | .Lcr: .asciz "\n" | ||
| 147 | .Lbad: .asciz "Backtrace aborted due to bad frame pointer <%p>\n" | 116 | .Lbad: .asciz "Backtrace aborted due to bad frame pointer <%p>\n" |
| 148 | .align | 117 | .align |
| 149 | .Ldsi: .word 0xe92dd800 >> 11 @ stmfd sp!, {... fp, ip, lr, pc} | 118 | .Ldsi: .word 0xe92dd800 >> 11 @ stmfd sp!, {... fp, ip, lr, pc} |
| @@ -1167,7 +1167,7 @@ static int __init dma_debug_do_init(void) · 1166 unmodified lines | |||
| 1167 | dma_debug_init(PREALLOC_DMA_DEBUG_ENTRIES); | 1167 | dma_debug_init(PREALLOC_DMA_DEBUG_ENTRIES); |
| 1168 | return 0; | 1168 | return 0; |
| 1169 | } | 1169 | } |
| 1170 | fs_initcall(dma_debug_do_init); | 1170 | core_initcall(dma_debug_do_init); |
| 1171 | 1171 | ||
| 1172 | #ifdef CONFIG_ARM_DMA_USE_IOMMU | 1172 | #ifdef CONFIG_ARM_DMA_USE_IOMMU |
| 1173 | 1173 | ||
| @@ -96,7 +96,7 @@ ENTRY(cpu_cm7_proc_fin) · 95 unmodified lines | |||
| 96 | ret lr | 96 | ret lr |
| 97 | ENDPROC(cpu_cm7_proc_fin) | 97 | ENDPROC(cpu_cm7_proc_fin) |
| 98 | 98 | ||
| 99 | .section ".text.init", #alloc, #execinstr | 99 | .section ".init.text", #alloc, #execinstr |
| 100 | 100 | ||
| 101 | __v7m_cm7_setup: | 101 | __v7m_cm7_setup: |
| 102 | mov r8, #(V7M_SCB_CCR_DC | V7M_SCB_CCR_IC| V7M_SCB_CCR_BP) | 102 | mov r8, #(V7M_SCB_CCR_DC | V7M_SCB_CCR_IC| V7M_SCB_CCR_BP) |