Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 12261f4e authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents 8db7b3c5 6b538db7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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)
+0 −2
Original line number Diff line number Diff line
@@ -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 */
+11 −17
Original line number Diff line number Diff line
@@ -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,
@@ -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;
@@ -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) +
@@ -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
@@ -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;
}
@@ -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;
@@ -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) {
+2 −2
Original line number Diff line number Diff line
@@ -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;
@@ -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));