History

Merge branch 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm

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

Linus Torvalds committed 9 years ago

Commit 697ed8d2 parents 77079b1 2a381105 files · +30 −36Browse files

Unified · Split

5 files
  1. arch/arm/kernel/traps.c +20 −0
  2. arch/arm/kernel/vmlinux-xip.lds.S +5 −0
  3. arch/arm/lib/backtrace.S +3 −34
  4. arch/arm/mm/dma-mapping.c +1 −1
  5. arch/arm/mm/proc-v7m.S +1 −1
arch/arm/kernel/traps.c+20−0
@@ -74,6 +74,26 @@ void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long · 73 unmodified lines
7474 dump_mem("", "Exception stack", frame + 4, frame + 4 + sizeof(struct pt_regs));
7575 }
7676
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+
7797 #ifndef CONFIG_ARM_UNWIND
7898 /*
7999 * Stack pointers should always be within the kernels view of
arch/arm/kernel/vmlinux-xip.lds.S+5−0
@@ -3,6 +3,9 @@ · 2 unmodified lines
33 * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>
44 */
55
6+/* No __ro_after_init data in the .rodata section - which will always be ro */
7+#define RO_AFTER_INIT_DATA
8+
69 #include <asm-generic/vmlinux.lds.h>
710 #include <asm/cache.h>
811 #include <asm/thread_info.h>
@@ -223,6 +226,8 @@ SECTIONS · 214 unmodified lines
223226 . = ALIGN(PAGE_SIZE);
224227 __init_end = .;
225228
229+ *(.data..ro_after_init)
230+
226231 NOSAVE_DATA
227232 CACHELINE_ALIGNED_DATA(L1_CACHE_BYTES)
228233 READ_MOSTLY_DATA(L1_CACHE_BYTES)
arch/arm/lib/backtrace.S+3−34
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 * 27/03/03 Ian Molton Clean up CONFIG_CPU
1111 *
1212 */
13+#include <linux/kern_levels.h>
1314 #include <linux/linkage.h>
1415 #include <asm/assembler.h>
1516 .text
@@ -83,13 +84,13 @@ for_each_frame: tst frame, mask @ Check for address exceptions · 67 unmodified lines
8384 teq r3, r1, lsr #11
8485 ldreq r0, [frame, #-8] @ get sp
8586 subeq r0, r0, #4 @ point at the last arg
86− bleq .Ldumpstm @ dump saved registers
87+ bleq dump_backtrace_stm @ dump saved registers
8788
8889 1004: ldr r1, [sv_pc, #0] @ if stmfd sp!, {..., fp, ip, lr, pc}
8990 ldr r3, .Ldsi @ instruction exists,
9091 teq r3, r1, lsr #11
9192 subeq r0, frame, #16
92− bleq .Ldumpstm @ dump saved registers
93+ bleq dump_backtrace_stm @ dump saved registers
9394
9495 teq sv_fp, #0 @ zero saved fp means
9596 beq no_frame @ no further frames
@@ -112,38 +113,6 @@ ENDPROC(c_backtrace) · 16 unmodified lines
112113 .long 1004b, 1006b
113114 .popsection
114115
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"
147116 .Lbad: .asciz "Backtrace aborted due to bad frame pointer <%p>\n"
148117 .align
149118 .Ldsi: .word 0xe92dd800 >> 11 @ stmfd sp!, {... fp, ip, lr, pc}
arch/arm/mm/dma-mapping.c+1−1
@@ -1167,7 +1167,7 @@ static int __init dma_debug_do_init(void) · 1166 unmodified lines
11671167 dma_debug_init(PREALLOC_DMA_DEBUG_ENTRIES);
11681168 return 0;
11691169 }
1170−fs_initcall(dma_debug_do_init);
1170+core_initcall(dma_debug_do_init);
11711171
11721172 #ifdef CONFIG_ARM_DMA_USE_IOMMU
11731173
arch/arm/mm/proc-v7m.S+1−1
@@ -96,7 +96,7 @@ ENTRY(cpu_cm7_proc_fin) · 95 unmodified lines
9696 ret lr
9797 ENDPROC(cpu_cm7_proc_fin)
9898
99− .section ".text.init", #alloc, #execinstr
99+ .section ".init.text", #alloc, #execinstr
100100
101101 __v7m_cm7_setup:
102102 mov r8, #(V7M_SCB_CCR_DC | V7M_SCB_CCR_IC| V7M_SCB_CCR_BP)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t