Skip to content

Commit

Permalink
Merge tag 'arc-4.4-rc7-fixes' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/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
  • Loading branch information
Linus Torvalds committed Dec 26, 2015
2 parents 8db7b3c + 6b538db commit 12261f4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 22 deletions.
2 changes: 1 addition & 1 deletion arch/arc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ endif
LIBGCC := $(shell $(CC) $(cflags-y) --print-libgcc-file-name)

# Modules with short calls might break for calls into builtin-kernel
KBUILD_CFLAGS_MODULE += -mlong-calls
KBUILD_CFLAGS_MODULE += -mlong-calls -mno-millicode

# Finally dump eveything into kernel build system
KBUILD_CFLAGS += $(cflags-y)
Expand Down
2 changes: 0 additions & 2 deletions arch/arc/include/asm/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ extern int ioc_exists;
#define ARC_REG_IC_IVIC 0x10
#define ARC_REG_IC_CTRL 0x11
#define ARC_REG_IC_IVIL 0x19
#if defined(CONFIG_ARC_MMU_V3) || defined(CONFIG_ARC_MMU_V4)
#define ARC_REG_IC_PTAG 0x1E
#endif
#define ARC_REG_IC_PTAG_HI 0x1F

/* Bit val in IC_CTRL */
Expand Down
28 changes: 11 additions & 17 deletions arch/arc/kernel/unwind.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,13 +293,13 @@ static void init_unwind_hdr(struct unwind_table *table,
const u32 *cie = cie_for_fde(fde, table);
signed ptrType;

if (cie == &not_fde) /* only process FDE here */
if (cie == &not_fde)
continue;
if (cie == NULL || cie == &bad_cie)
continue; /* say FDE->CIE.version != 1 */
goto ret_err;
ptrType = fde_pointer_type(cie);
if (ptrType < 0)
continue;
goto ret_err;

ptr = (const u8 *)(fde + 2);
if (!read_pointer(&ptr, (const u8 *)(fde + 1) + *fde,
Expand All @@ -315,14 +315,14 @@ static void init_unwind_hdr(struct unwind_table *table,
}

if (tableSize || !n)
return;
goto ret_err;

hdrSize = 4 + sizeof(unsigned long) + sizeof(unsigned int)
+ 2 * n * sizeof(unsigned long);

header = alloc(hdrSize);
if (!header)
return;
goto ret_err;

header->version = 1;
header->eh_frame_ptr_enc = DW_EH_PE_abs | DW_EH_PE_native;
Expand All @@ -343,10 +343,6 @@ static void init_unwind_hdr(struct unwind_table *table,

if (fde[1] == 0xffffffff)
continue; /* this is a CIE */

if (*(u8 *)(cie + 2) != 1)
continue; /* FDE->CIE.version not supported */

ptr = (const u8 *)(fde + 2);
header->table[n].start = read_pointer(&ptr,
(const u8 *)(fde + 1) +
Expand All @@ -365,6 +361,10 @@ static void init_unwind_hdr(struct unwind_table *table,
table->hdrsz = hdrSize;
smp_wmb();
table->header = (const void *)header;
return;

ret_err:
panic("Attention !!! Dwarf FDE parsing errors\n");;
}

#ifdef CONFIG_MODULES
Expand Down Expand Up @@ -523,8 +523,7 @@ static const u32 *cie_for_fde(const u32 *fde, const struct unwind_table *table)

if (*cie <= sizeof(*cie) + 4 || *cie >= fde[1] - sizeof(*fde)
|| (*cie & (sizeof(*cie) - 1))
|| (cie[1] != 0xffffffff)
|| ( *(u8 *)(cie + 2) != 1)) /* version 1 supported */
|| (cie[1] != 0xffffffff))
return NULL; /* this is not a (valid) CIE */
return cie;
}
Expand Down Expand Up @@ -605,9 +604,6 @@ static signed fde_pointer_type(const u32 *cie)
const u8 *ptr = (const u8 *)(cie + 2);
unsigned version = *ptr;

if (version != 1)
return -1; /* unsupported */

if (*++ptr) {
const char *aug;
const u8 *end = (const u8 *)(cie + 1) + *cie;
Expand Down Expand Up @@ -1019,9 +1015,7 @@ int arc_unwind(struct unwind_frame_info *frame)
ptr = (const u8 *)(cie + 2);
end = (const u8 *)(cie + 1) + *cie;
frame->call_frame = 1;
if ((state.version = *ptr) != 1)
cie = NULL; /* unsupported version */
else if (*++ptr) {
if (*++ptr) {
/* check if augmentation size is first (thus present) */
if (*ptr == 'z') {
while (++ptr < end && *ptr) {
Expand Down
4 changes: 2 additions & 2 deletions arch/arc/mm/highmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void __kunmap_atomic(void *kv)
}
EXPORT_SYMBOL(__kunmap_atomic);

noinline pte_t *alloc_kmap_pgtable(unsigned long kvaddr)
static noinline pte_t * __init alloc_kmap_pgtable(unsigned long kvaddr)
{
pgd_t *pgd_k;
pud_t *pud_k;
Expand All @@ -127,7 +127,7 @@ noinline pte_t *alloc_kmap_pgtable(unsigned long kvaddr)
return pte_k;
}

void kmap_init(void)
void __init kmap_init(void)
{
/* Due to recursive include hell, we can't do this in processor.h */
BUILD_BUG_ON(PAGE_OFFSET < (VMALLOC_END + FIXMAP_SIZE + PKMAP_SIZE));
Expand Down

0 comments on commit 12261f4

Please sign in to comment.