diff options
Diffstat (limited to 'arch/s390/kernel')
-rw-r--r-- | arch/s390/kernel/dis.c | 7 | ||||
-rw-r--r-- | arch/s390/kernel/stacktrace.c | 26 |
2 files changed, 15 insertions, 18 deletions
diff --git a/arch/s390/kernel/dis.c b/arch/s390/kernel/dis.c index a057ebf108a7..d3057318f2bf 100644 --- a/arch/s390/kernel/dis.c +++ b/arch/s390/kernel/dis.c | |||
@@ -240,8 +240,8 @@ static const unsigned char formats[][7] = { | |||
240 | [INSTR_RXY_FRRD] = { 0xff, F_8,D20_20,X_12,B_16,0,0 },/* e.g. ley */ | 240 | [INSTR_RXY_FRRD] = { 0xff, F_8,D20_20,X_12,B_16,0,0 },/* e.g. ley */ |
241 | [INSTR_RX_FRRD] = { 0xff, F_8,D_20,X_12,B_16,0,0 }, /* e.g. ae */ | 241 | [INSTR_RX_FRRD] = { 0xff, F_8,D_20,X_12,B_16,0,0 }, /* e.g. ae */ |
242 | [INSTR_RX_RRRD] = { 0xff, R_8,D_20,X_12,B_16,0,0 }, /* e.g. l */ | 242 | [INSTR_RX_RRRD] = { 0xff, R_8,D_20,X_12,B_16,0,0 }, /* e.g. l */ |
243 | [INSTR_RX_URRD] = { 0x00, U4_8,D_20,X_12,B_16,0,0 }, /* e.g. bc */ | 243 | [INSTR_RX_URRD] = { 0xff, U4_8,D_20,X_12,B_16,0,0 }, /* e.g. bc */ |
244 | [INSTR_SI_URD] = { 0x00, D_20,B_16,U8_8,0,0,0 }, /* e.g. cli */ | 244 | [INSTR_SI_URD] = { 0xff, D_20,B_16,U8_8,0,0,0 }, /* e.g. cli */ |
245 | [INSTR_SIY_URD] = { 0xff, D20_20,B_16,U8_8,0,0,0 }, /* e.g. tmy */ | 245 | [INSTR_SIY_URD] = { 0xff, D20_20,B_16,U8_8,0,0,0 }, /* e.g. tmy */ |
246 | [INSTR_SSE_RDRD] = { 0xff, D_20,B_16,D_36,B_32,0,0 }, /* e.g. mvsdk */ | 246 | [INSTR_SSE_RDRD] = { 0xff, D_20,B_16,D_36,B_32,0,0 }, /* e.g. mvsdk */ |
247 | [INSTR_SS_L0RDRD] = { 0xff, D_20,L8_8,B_16,D_36,B_32,0 }, | 247 | [INSTR_SS_L0RDRD] = { 0xff, D_20,L8_8,B_16,D_36,B_32,0 }, |
@@ -1190,7 +1190,8 @@ static int print_insn(char *buffer, unsigned char *code, unsigned long addr) | |||
1190 | else if (operand->flags & OPERAND_CR) | 1190 | else if (operand->flags & OPERAND_CR) |
1191 | ptr += sprintf(ptr, "%%c%i", value); | 1191 | ptr += sprintf(ptr, "%%c%i", value); |
1192 | else if (operand->flags & OPERAND_PCREL) | 1192 | else if (operand->flags & OPERAND_PCREL) |
1193 | ptr += sprintf(ptr, "%lx", value + addr); | 1193 | ptr += sprintf(ptr, "%lx", (signed int) value |
1194 | + addr); | ||
1194 | else if (operand->flags & OPERAND_SIGNED) | 1195 | else if (operand->flags & OPERAND_SIGNED) |
1195 | ptr += sprintf(ptr, "%i", value); | 1196 | ptr += sprintf(ptr, "%i", value); |
1196 | else | 1197 | else |
diff --git a/arch/s390/kernel/stacktrace.c b/arch/s390/kernel/stacktrace.c index 515ff9011dd7..da6924729964 100644 --- a/arch/s390/kernel/stacktrace.c +++ b/arch/s390/kernel/stacktrace.c | |||
@@ -12,7 +12,6 @@ | |||
12 | #include <linux/kallsyms.h> | 12 | #include <linux/kallsyms.h> |
13 | 13 | ||
14 | static unsigned long save_context_stack(struct stack_trace *trace, | 14 | static unsigned long save_context_stack(struct stack_trace *trace, |
15 | unsigned int *skip, | ||
16 | unsigned long sp, | 15 | unsigned long sp, |
17 | unsigned long low, | 16 | unsigned long low, |
18 | unsigned long high) | 17 | unsigned long high) |
@@ -28,10 +27,10 @@ static unsigned long save_context_stack(struct stack_trace *trace, | |||
28 | sf = (struct stack_frame *)sp; | 27 | sf = (struct stack_frame *)sp; |
29 | while(1) { | 28 | while(1) { |
30 | addr = sf->gprs[8] & PSW_ADDR_INSN; | 29 | addr = sf->gprs[8] & PSW_ADDR_INSN; |
31 | if (!(*skip)) | 30 | if (!trace->skip) |
32 | trace->entries[trace->nr_entries++] = addr; | 31 | trace->entries[trace->nr_entries++] = addr; |
33 | else | 32 | else |
34 | (*skip)--; | 33 | trace->skip--; |
35 | if (trace->nr_entries >= trace->max_entries) | 34 | if (trace->nr_entries >= trace->max_entries) |
36 | return sp; | 35 | return sp; |
37 | low = sp; | 36 | low = sp; |
@@ -48,10 +47,10 @@ static unsigned long save_context_stack(struct stack_trace *trace, | |||
48 | return sp; | 47 | return sp; |
49 | regs = (struct pt_regs *)sp; | 48 | regs = (struct pt_regs *)sp; |
50 | addr = regs->psw.addr & PSW_ADDR_INSN; | 49 | addr = regs->psw.addr & PSW_ADDR_INSN; |
51 | if (!(*skip)) | 50 | if (!trace->skip) |
52 | trace->entries[trace->nr_entries++] = addr; | 51 | trace->entries[trace->nr_entries++] = addr; |
53 | else | 52 | else |
54 | (*skip)--; | 53 | trace->skip--; |
55 | if (trace->nr_entries >= trace->max_entries) | 54 | if (trace->nr_entries >= trace->max_entries) |
56 | return sp; | 55 | return sp; |
57 | low = sp; | 56 | low = sp; |
@@ -65,20 +64,17 @@ void save_stack_trace(struct stack_trace *trace) | |||
65 | unsigned long orig_sp, new_sp; | 64 | unsigned long orig_sp, new_sp; |
66 | 65 | ||
67 | orig_sp = sp & PSW_ADDR_INSN; | 66 | orig_sp = sp & PSW_ADDR_INSN; |
68 | 67 | new_sp = save_context_stack(trace, orig_sp, | |
69 | new_sp = save_context_stack(trace, &trace->skip, orig_sp, | 68 | S390_lowcore.panic_stack - PAGE_SIZE, |
70 | S390_lowcore.panic_stack - PAGE_SIZE, | 69 | S390_lowcore.panic_stack); |
71 | S390_lowcore.panic_stack); | ||
72 | if (new_sp != orig_sp) | 70 | if (new_sp != orig_sp) |
73 | return; | 71 | return; |
74 | new_sp = save_context_stack(trace, &trace->skip, new_sp, | 72 | new_sp = save_context_stack(trace, new_sp, |
75 | S390_lowcore.async_stack - ASYNC_SIZE, | 73 | S390_lowcore.async_stack - ASYNC_SIZE, |
76 | S390_lowcore.async_stack); | 74 | S390_lowcore.async_stack); |
77 | if (new_sp != orig_sp) | 75 | if (new_sp != orig_sp) |
78 | return; | 76 | return; |
79 | 77 | save_context_stack(trace, new_sp, | |
80 | save_context_stack(trace, &trace->skip, new_sp, | ||
81 | S390_lowcore.thread_info, | 78 | S390_lowcore.thread_info, |
82 | S390_lowcore.thread_info + THREAD_SIZE); | 79 | S390_lowcore.thread_info + THREAD_SIZE); |
83 | return; | ||
84 | } | 80 | } |