Commit b84eeed0 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull ARM fixes from Russell King:

 - Fix kernel mapping for XIP kernels

 - Fix SMP support for XIP kernels

 - Fix complication corner case with CFI

 - Fix a typo in nommu code

 - Fix cacheflush syscall when PAN is enabled on LPAE platforms

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rmk/linux:
  ARM: fix cacheflush with PAN
  ARM: 9435/1: ARM/nommu: Fix typo "absence"
  ARM: 9434/1: cfi: Fix compilation corner case
  ARM: 9420/1: smp: Fix SMP for xip kernels
  ARM: 9419/1: mm: Fix kernel memory mapping for xip kernels
parents e06bc45b ca29cfcc
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -252,11 +252,15 @@ __create_page_tables:
	 */
	add	r0, r4, #KERNEL_OFFSET >> (SECTION_SHIFT - PMD_ENTRY_ORDER)
	ldr	r6, =(_end - 1)

	/* For XIP, kernel_sec_start/kernel_sec_end are currently in RO memory */
#ifndef CONFIG_XIP_KERNEL
	adr_l	r5, kernel_sec_start		@ _pa(kernel_sec_start)
#if defined CONFIG_CPU_ENDIAN_BE8 || defined CONFIG_CPU_ENDIAN_BE32
	str	r8, [r5, #4]			@ Save physical start of kernel (BE)
#else
	str	r8, [r5]			@ Save physical start of kernel (LE)
#endif
#endif
	orr	r3, r8, r7			@ Add the MMU flags
	add	r6, r4, r6, lsr #(SECTION_SHIFT - PMD_ENTRY_ORDER)
@@ -264,6 +268,7 @@ __create_page_tables:
	add	r3, r3, #1 << SECTION_SHIFT
	cmp	r0, r6
	bls	1b
#ifndef CONFIG_XIP_KERNEL
	eor	r3, r3, r7			@ Remove the MMU flags
	adr_l	r5, kernel_sec_end		@ _pa(kernel_sec_end)
#if defined CONFIG_CPU_ENDIAN_BE8 || defined CONFIG_CPU_ENDIAN_BE32
@@ -271,8 +276,7 @@ __create_page_tables:
#else
	str	r3, [r5]			@ Save physical end of kernel (LE)
#endif

#ifdef CONFIG_XIP_KERNEL
#else
	/*
	 * Map the kernel image separately as it is not located in RAM.
	 */
@@ -407,7 +411,11 @@ ENTRY(secondary_startup)
	/*
	 * Use the page tables supplied from  __cpu_up.
	 */
#ifdef CONFIG_XIP_KERNEL
	ldr	r3, =(secondary_data + PLAT_PHYS_OFFSET - PAGE_OFFSET)
#else
	adr_l	r3, secondary_data
#endif
	mov_l	r12, __secondary_switched
	ldrd	r4, r5, [r3, #0]		@ get secondary_data.pgdir
ARM_BE8(eor	r4, r4, r5)			@ Swap r5 and r4 in BE:
+7 −0
Original line number Diff line number Diff line
@@ -45,8 +45,15 @@ extern void secondary_startup(void);
static int psci_boot_secondary(unsigned int cpu, struct task_struct *idle)
{
	if (psci_ops.cpu_on)
#ifdef CONFIG_XIP_KERNEL
		return psci_ops.cpu_on(cpu_logical_map(cpu),
			((phys_addr_t)(&secondary_startup)
			- XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR)
			+ CONFIG_XIP_PHYS_ADDR));
#else
		return psci_ops.cpu_on(cpu_logical_map(cpu),
					virt_to_idmap(&secondary_startup));
#endif
	return -ENODEV;
}

+3 −0
Original line number Diff line number Diff line
@@ -570,6 +570,7 @@ static int bad_syscall(int n, struct pt_regs *regs)
static inline int
__do_cache_op(unsigned long start, unsigned long end)
{
	unsigned int ua_flags;
	int ret;

	do {
@@ -578,7 +579,9 @@ __do_cache_op(unsigned long start, unsigned long end)
		if (fatal_signal_pending(current))
			return 0;

		ua_flags = uaccess_save_and_enable();
		ret = flush_icache_user_range(start, start + chunk);
		uaccess_restore(ua_flags);
		if (ret)
			return ret;

+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ void arch_setup_dma_ops(struct device *dev, bool coherent)
		/*
		 * Cache support for v7m is optional, so can be treated as
		 * coherent if no cache has been detected. Note that it is not
		 * enough to check if MPU is in use or not since in absense of
		 * enough to check if MPU is in use or not since in absence of
		 * MPU system memory map is used.
		 */
		dev->dma_coherent = cacheid ? coherent : true;
+7 −0
Original line number Diff line number Diff line
@@ -84,8 +84,15 @@ static void identity_mapping_add(pgd_t *pgd, const char *text_start,
	unsigned long addr, end;
	unsigned long next;

#ifdef CONFIG_XIP_KERNEL
	addr = (phys_addr_t)(text_start) - XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR)
		+ CONFIG_XIP_PHYS_ADDR;
	end = (phys_addr_t)(text_end) - XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR)
		+ CONFIG_XIP_PHYS_ADDR;
#else
	addr = virt_to_idmap(text_start);
	end = virt_to_idmap(text_end);
#endif
	pr_info("Setting up static identity map for 0x%lx - 0x%lx\n", addr, end);

	prot |= PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_SECT_AF;
Loading