Skip to content

Commit ded3ef0

Browse files
author
Russell King
committed
ARM: Fix broken commit 0cc41e4 corrupting kernel messages
Commit 0cc41e4 (arch: remove direct definitions of KERN_<LEVEL> uses) is broken - not enough thought was put into changing: .asciz "string" to .asciz "string1" "string2" The problem is that each string gets _separately_ NUL terminated, so the result is a string containing: "string1\0string2\0" rather than: "string1string2\0" With our new printk levels, this ends up as - eg, KERN_DEBUG "string": 0x01 0x00 0x07 0x00 "string" 0x00 which produces lots of \x01 in the kernel log. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
1 parent b255188 commit ded3ef0

1 file changed

Lines changed: 21 additions & 15 deletions

File tree

‎arch/arm/vfp/vfphw.S‎

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,29 @@
2222
.macro DBGSTR, str
2323
#ifdef DEBUG
2424
stmfd sp!, {r0-r3, ip, lr}
25-
add r0, pc, #4
25+
ldr r0, =1f
2626
bl printk
27-
b 1f
28-
.asciz KERN_DEBUG "VFP: \str\n"
29-
.balign 4
30-
1: ldmfd sp!, {r0-r3, ip, lr}
27+
ldmfd sp!, {r0-r3, ip, lr}
28+
29+
.pushsection .rodata, "a"
30+
1: .ascii KERN_DEBUG "VFP: \str\n"
31+
.byte 0
32+
.previous
3133
#endif
3234
.endm
3335

3436
.macro DBGSTR1, str, arg
3537
#ifdef DEBUG
3638
stmfd sp!, {r0-r3, ip, lr}
3739
mov r1, \arg
38-
add r0, pc, #4
40+
ldr r0, =1f
3941
bl printk
40-
b 1f
41-
.asciz KERN_DEBUG "VFP: \str\n"
42-
.balign 4
43-
1: ldmfd sp!, {r0-r3, ip, lr}
42+
ldmfd sp!, {r0-r3, ip, lr}
43+
44+
.pushsection .rodata, "a"
45+
1: .ascii KERN_DEBUG "VFP: \str\n"
46+
.byte 0
47+
.previous
4448
#endif
4549
.endm
4650

@@ -50,12 +54,14 @@
5054
mov r3, \arg3
5155
mov r2, \arg2
5256
mov r1, \arg1
53-
add r0, pc, #4
57+
ldr r0, =1f
5458
bl printk
55-
b 1f
56-
.asciz KERN_DEBUG "VFP: \str\n"
57-
.balign 4
58-
1: ldmfd sp!, {r0-r3, ip, lr}
59+
ldmfd sp!, {r0-r3, ip, lr}
60+
61+
.pushsection .rodata, "a"
62+
1: .ascii KERN_DEBUG "VFP: \str\n"
63+
.byte 0
64+
.previous
5965
#endif
6066
.endm
6167

0 commit comments

Comments
 (0)