diff options
author | Vineet Gupta <vgupta@synopsys.com> | 2015-12-21 03:22:01 -0500 |
---|---|---|
committer | Vineet Gupta <vgupta@synopsys.com> | 2015-12-21 03:31:49 -0500 |
commit | 6b538db7c6b091960c57b23feae5431fc82286e7 (patch) | |
tree | 5234d25ae6c466a2c97414f691033068b5a42d20 /arch/arc/kernel | |
parent | 6d0d506012c93d3393b8d3d0cac62e46e541c5b6 (diff) |
ARC: dw2 unwind: Catch Dwarf SNAFUs early
Instead of seeing empty stack traces, let kernel fail early so dwarf
issues can be fixed sooner
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc/kernel')
-rw-r--r-- | arch/arc/kernel/unwind.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/arc/kernel/unwind.c b/arch/arc/kernel/unwind.c index f34599abe182..5eb707640e9c 100644 --- a/arch/arc/kernel/unwind.c +++ b/arch/arc/kernel/unwind.c | |||
@@ -296,10 +296,10 @@ static void init_unwind_hdr(struct unwind_table *table, | |||
296 | if (cie == ¬_fde) | 296 | if (cie == ¬_fde) |
297 | continue; | 297 | continue; |
298 | if (cie == NULL || cie == &bad_cie) | 298 | if (cie == NULL || cie == &bad_cie) |
299 | return; | 299 | goto ret_err; |
300 | ptrType = fde_pointer_type(cie); | 300 | ptrType = fde_pointer_type(cie); |
301 | if (ptrType < 0) | 301 | if (ptrType < 0) |
302 | return; | 302 | goto ret_err; |
303 | 303 | ||
304 | ptr = (const u8 *)(fde + 2); | 304 | ptr = (const u8 *)(fde + 2); |
305 | if (!read_pointer(&ptr, (const u8 *)(fde + 1) + *fde, | 305 | if (!read_pointer(&ptr, (const u8 *)(fde + 1) + *fde, |
@@ -315,14 +315,14 @@ static void init_unwind_hdr(struct unwind_table *table, | |||
315 | } | 315 | } |
316 | 316 | ||
317 | if (tableSize || !n) | 317 | if (tableSize || !n) |
318 | return; | 318 | goto ret_err; |
319 | 319 | ||
320 | hdrSize = 4 + sizeof(unsigned long) + sizeof(unsigned int) | 320 | hdrSize = 4 + sizeof(unsigned long) + sizeof(unsigned int) |
321 | + 2 * n * sizeof(unsigned long); | 321 | + 2 * n * sizeof(unsigned long); |
322 | 322 | ||
323 | header = alloc(hdrSize); | 323 | header = alloc(hdrSize); |
324 | if (!header) | 324 | if (!header) |
325 | return; | 325 | goto ret_err; |
326 | 326 | ||
327 | header->version = 1; | 327 | header->version = 1; |
328 | header->eh_frame_ptr_enc = DW_EH_PE_abs | DW_EH_PE_native; | 328 | header->eh_frame_ptr_enc = DW_EH_PE_abs | DW_EH_PE_native; |
@@ -361,6 +361,10 @@ static void init_unwind_hdr(struct unwind_table *table, | |||
361 | table->hdrsz = hdrSize; | 361 | table->hdrsz = hdrSize; |
362 | smp_wmb(); | 362 | smp_wmb(); |
363 | table->header = (const void *)header; | 363 | table->header = (const void *)header; |
364 | return; | ||
365 | |||
366 | ret_err: | ||
367 | panic("Attention !!! Dwarf FDE parsing errors\n");; | ||
364 | } | 368 | } |
365 | 369 | ||
366 | #ifdef CONFIG_MODULES | 370 | #ifdef CONFIG_MODULES |