diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-12-26 17:58:06 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-12-26 17:58:06 -0500 |
commit | 12261f4ed43d2c9d6015ee3e4300070c64a6efaf (patch) | |
tree | 3d3ae11d13c59e7998dd403627cd7dc13137e875 | |
parent | 8db7b3c54401d83a4dc370a59b8692854000ea03 (diff) | |
parent | 6b538db7c6b091960c57b23feae5431fc82286e7 (diff) |
Merge tag 'arc-4.4-rc7-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc
Pull ARC fixes from Vineet Gupta:
"Sorry for this late pull request, but these are all important fixes
for code introduced/updated in this release which we will otherwise
end up back porting.
- Unwinder rework (A revert followed by better fix)
- Build errors: MMUv2, modules with -Os
- highmem section mismatch build splat"
* tag 'arc-4.4-rc7-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc:
ARC: dw2 unwind: Catch Dwarf SNAFUs early
ARC: dw2 unwind: Don't bail for CIE.version != 1
Revert "ARC: dw2 unwind: Ignore CIE version !=1 gracefully instead of bailing"
ARC: Fix linking errors with CONFIG_MODULE + CONFIG_CC_OPTIMIZE_FOR_SIZE
ARC: mm: fix building for MMU v2
ARC: mm: HIGHMEM: Fix section mismatch splat
-rw-r--r-- | arch/arc/Makefile | 2 | ||||
-rw-r--r-- | arch/arc/include/asm/cache.h | 2 | ||||
-rw-r--r-- | arch/arc/kernel/unwind.c | 28 | ||||
-rw-r--r-- | arch/arc/mm/highmem.c | 4 |
4 files changed, 14 insertions, 22 deletions
diff --git a/arch/arc/Makefile b/arch/arc/Makefile index cf0cf34eeb24..aeb19021099e 100644 --- a/arch/arc/Makefile +++ b/arch/arc/Makefile | |||
@@ -81,7 +81,7 @@ endif | |||
81 | LIBGCC := $(shell $(CC) $(cflags-y) --print-libgcc-file-name) | 81 | LIBGCC := $(shell $(CC) $(cflags-y) --print-libgcc-file-name) |
82 | 82 | ||
83 | # Modules with short calls might break for calls into builtin-kernel | 83 | # Modules with short calls might break for calls into builtin-kernel |
84 | KBUILD_CFLAGS_MODULE += -mlong-calls | 84 | KBUILD_CFLAGS_MODULE += -mlong-calls -mno-millicode |
85 | 85 | ||
86 | # Finally dump eveything into kernel build system | 86 | # Finally dump eveything into kernel build system |
87 | KBUILD_CFLAGS += $(cflags-y) | 87 | KBUILD_CFLAGS += $(cflags-y) |
diff --git a/arch/arc/include/asm/cache.h b/arch/arc/include/asm/cache.h index abf06e81c929..210ef3e72332 100644 --- a/arch/arc/include/asm/cache.h +++ b/arch/arc/include/asm/cache.h | |||
@@ -62,9 +62,7 @@ extern int ioc_exists; | |||
62 | #define ARC_REG_IC_IVIC 0x10 | 62 | #define ARC_REG_IC_IVIC 0x10 |
63 | #define ARC_REG_IC_CTRL 0x11 | 63 | #define ARC_REG_IC_CTRL 0x11 |
64 | #define ARC_REG_IC_IVIL 0x19 | 64 | #define ARC_REG_IC_IVIL 0x19 |
65 | #if defined(CONFIG_ARC_MMU_V3) || defined(CONFIG_ARC_MMU_V4) | ||
66 | #define ARC_REG_IC_PTAG 0x1E | 65 | #define ARC_REG_IC_PTAG 0x1E |
67 | #endif | ||
68 | #define ARC_REG_IC_PTAG_HI 0x1F | 66 | #define ARC_REG_IC_PTAG_HI 0x1F |
69 | 67 | ||
70 | /* Bit val in IC_CTRL */ | 68 | /* Bit val in IC_CTRL */ |
diff --git a/arch/arc/kernel/unwind.c b/arch/arc/kernel/unwind.c index cf2828ab0905..5eb707640e9c 100644 --- a/arch/arc/kernel/unwind.c +++ b/arch/arc/kernel/unwind.c | |||
@@ -293,13 +293,13 @@ static void init_unwind_hdr(struct unwind_table *table, | |||
293 | const u32 *cie = cie_for_fde(fde, table); | 293 | const u32 *cie = cie_for_fde(fde, table); |
294 | signed ptrType; | 294 | signed ptrType; |
295 | 295 | ||
296 | if (cie == ¬_fde) /* only process FDE here */ | 296 | if (cie == ¬_fde) |
297 | continue; | 297 | continue; |
298 | if (cie == NULL || cie == &bad_cie) | 298 | if (cie == NULL || cie == &bad_cie) |
299 | continue; /* say FDE->CIE.version != 1 */ | 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 | continue; | 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; |
@@ -343,10 +343,6 @@ static void init_unwind_hdr(struct unwind_table *table, | |||
343 | 343 | ||
344 | if (fde[1] == 0xffffffff) | 344 | if (fde[1] == 0xffffffff) |
345 | continue; /* this is a CIE */ | 345 | continue; /* this is a CIE */ |
346 | |||
347 | if (*(u8 *)(cie + 2) != 1) | ||
348 | continue; /* FDE->CIE.version not supported */ | ||
349 | |||
350 | ptr = (const u8 *)(fde + 2); | 346 | ptr = (const u8 *)(fde + 2); |
351 | header->table[n].start = read_pointer(&ptr, | 347 | header->table[n].start = read_pointer(&ptr, |
352 | (const u8 *)(fde + 1) + | 348 | (const u8 *)(fde + 1) + |
@@ -365,6 +361,10 @@ static void init_unwind_hdr(struct unwind_table *table, | |||
365 | table->hdrsz = hdrSize; | 361 | table->hdrsz = hdrSize; |
366 | smp_wmb(); | 362 | smp_wmb(); |
367 | 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");; | ||
368 | } | 368 | } |
369 | 369 | ||
370 | #ifdef CONFIG_MODULES | 370 | #ifdef CONFIG_MODULES |
@@ -523,8 +523,7 @@ static const u32 *cie_for_fde(const u32 *fde, const struct unwind_table *table) | |||
523 | 523 | ||
524 | if (*cie <= sizeof(*cie) + 4 || *cie >= fde[1] - sizeof(*fde) | 524 | if (*cie <= sizeof(*cie) + 4 || *cie >= fde[1] - sizeof(*fde) |
525 | || (*cie & (sizeof(*cie) - 1)) | 525 | || (*cie & (sizeof(*cie) - 1)) |
526 | || (cie[1] != 0xffffffff) | 526 | || (cie[1] != 0xffffffff)) |
527 | || ( *(u8 *)(cie + 2) != 1)) /* version 1 supported */ | ||
528 | return NULL; /* this is not a (valid) CIE */ | 527 | return NULL; /* this is not a (valid) CIE */ |
529 | return cie; | 528 | return cie; |
530 | } | 529 | } |
@@ -605,9 +604,6 @@ static signed fde_pointer_type(const u32 *cie) | |||
605 | const u8 *ptr = (const u8 *)(cie + 2); | 604 | const u8 *ptr = (const u8 *)(cie + 2); |
606 | unsigned version = *ptr; | 605 | unsigned version = *ptr; |
607 | 606 | ||
608 | if (version != 1) | ||
609 | return -1; /* unsupported */ | ||
610 | |||
611 | if (*++ptr) { | 607 | if (*++ptr) { |
612 | const char *aug; | 608 | const char *aug; |
613 | const u8 *end = (const u8 *)(cie + 1) + *cie; | 609 | const u8 *end = (const u8 *)(cie + 1) + *cie; |
@@ -1019,9 +1015,7 @@ int arc_unwind(struct unwind_frame_info *frame) | |||
1019 | ptr = (const u8 *)(cie + 2); | 1015 | ptr = (const u8 *)(cie + 2); |
1020 | end = (const u8 *)(cie + 1) + *cie; | 1016 | end = (const u8 *)(cie + 1) + *cie; |
1021 | frame->call_frame = 1; | 1017 | frame->call_frame = 1; |
1022 | if ((state.version = *ptr) != 1) | 1018 | if (*++ptr) { |
1023 | cie = NULL; /* unsupported version */ | ||
1024 | else if (*++ptr) { | ||
1025 | /* check if augmentation size is first (thus present) */ | 1019 | /* check if augmentation size is first (thus present) */ |
1026 | if (*ptr == 'z') { | 1020 | if (*ptr == 'z') { |
1027 | while (++ptr < end && *ptr) { | 1021 | while (++ptr < end && *ptr) { |
diff --git a/arch/arc/mm/highmem.c b/arch/arc/mm/highmem.c index 065ee6bfa82a..92dd92cad7f9 100644 --- a/arch/arc/mm/highmem.c +++ b/arch/arc/mm/highmem.c | |||
@@ -111,7 +111,7 @@ void __kunmap_atomic(void *kv) | |||
111 | } | 111 | } |
112 | EXPORT_SYMBOL(__kunmap_atomic); | 112 | EXPORT_SYMBOL(__kunmap_atomic); |
113 | 113 | ||
114 | noinline pte_t *alloc_kmap_pgtable(unsigned long kvaddr) | 114 | static noinline pte_t * __init alloc_kmap_pgtable(unsigned long kvaddr) |
115 | { | 115 | { |
116 | pgd_t *pgd_k; | 116 | pgd_t *pgd_k; |
117 | pud_t *pud_k; | 117 | pud_t *pud_k; |
@@ -127,7 +127,7 @@ noinline pte_t *alloc_kmap_pgtable(unsigned long kvaddr) | |||
127 | return pte_k; | 127 | return pte_k; |
128 | } | 128 | } |
129 | 129 | ||
130 | void kmap_init(void) | 130 | void __init kmap_init(void) |
131 | { | 131 | { |
132 | /* Due to recursive include hell, we can't do this in processor.h */ | 132 | /* Due to recursive include hell, we can't do this in processor.h */ |
133 | BUILD_BUG_ON(PAGE_OFFSET < (VMALLOC_END + FIXMAP_SIZE + PKMAP_SIZE)); | 133 | BUILD_BUG_ON(PAGE_OFFSET < (VMALLOC_END + FIXMAP_SIZE + PKMAP_SIZE)); |