Commit 11779842 authored by Russell King (Oracle)'s avatar Russell King (Oracle)
Browse files

Merge branches 'devel-stable' and 'misc' into for-linus

Loading
Loading
Loading
Loading
+14 −5
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ config ARM
	select HAVE_FAST_GUP if ARM_LPAE
	select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL
	select HAVE_FUNCTION_GRAPH_TRACER if !THUMB2_KERNEL && !CC_IS_CLANG
	select HAVE_FUNCTION_TRACER if !XIP_KERNEL
	select HAVE_FUNCTION_TRACER if !XIP_KERNEL && !(THUMB2_KERNEL && CC_IS_CLANG)
	select HAVE_FUTEX_CMPXCHG if FUTEX
	select HAVE_GCC_PLUGINS
	select HAVE_HW_BREAKPOINT if PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7)
@@ -126,6 +126,7 @@ config ARM
	select PERF_USE_VMALLOC
	select RTC_LIB
	select SYS_SUPPORTS_APM_EMULATION
	select THREAD_INFO_IN_TASK if CURRENT_POINTER_IN_TPIDRURO
	select TRACE_IRQFLAGS_SUPPORT if !CPU_V7M
	# Above selects are sorted alphabetically; please add new ones
	# according to that.  Thanks.
@@ -265,10 +266,12 @@ config PHYS_OFFSET
	hex "Physical address of main memory" if MMU
	depends on !ARM_PATCH_PHYS_VIRT
	default DRAM_BASE if !MMU
	default 0x00000000 if ARCH_FOOTBRIDGE
	default 0x00000000 if ARCH_FOOTBRIDGE || ARCH_IXP4XX
	default 0x10000000 if ARCH_OMAP1 || ARCH_RPC
	default 0x20000000 if ARCH_S5PV210
	default 0xc0000000 if ARCH_SA1100
	default 0x30000000 if ARCH_S3C24XX
	default 0xa0000000 if ARCH_IOP32X || ARCH_PXA
	default 0xc0000000 if ARCH_EP93XX || ARCH_SA1100
	default 0
	help
	  Please provide the physical address corresponding to the
	  location of main memory in your system.
@@ -433,6 +436,7 @@ config ARCH_PXA
config ARCH_RPC
	bool "RiscPC"
	depends on MMU
	depends on !CC_IS_CLANG && GCC_VERSION < 90100 && GCC_VERSION >= 60000
	select ARCH_ACORN
	select ARCH_MAY_HAVE_PC_FDC
	select ARCH_SPARSEMEM_ENABLE
@@ -1158,6 +1162,11 @@ config SMP_ON_UP

	  If you don't know what to do here, say Y.


config CURRENT_POINTER_IN_TPIDRURO
	def_bool y
	depends on SMP && CPU_32v6K && !CPU_V6

config ARM_CPU_TOPOLOGY
	bool "Support cpu topology definition"
	depends on SMP && CPU_V7
@@ -1601,7 +1610,7 @@ config XEN

config STACKPROTECTOR_PER_TASK
	bool "Use a unique stack canary value for each task"
	depends on GCC_PLUGINS && STACKPROTECTOR && SMP && !XIP_DEFLATED_DATA
	depends on GCC_PLUGINS && STACKPROTECTOR && THREAD_INFO_IN_TASK && !XIP_DEFLATED_DATA
	select GCC_PLUGIN_ARM_SSP_PER_TASK
	default y
	help
+5 −4
Original line number Diff line number Diff line
@@ -113,6 +113,10 @@ ifeq ($(CONFIG_CC_IS_CLANG),y)
CFLAGS_ABI	+= -meabi gnu
endif

ifeq ($(CONFIG_CURRENT_POINTER_IN_TPIDRURO),y)
CFLAGS_ABI	+= -mtp=cp15
endif

# Accept old syntax despite ".syntax unified"
AFLAGS_NOWARN	:=$(call as-option,-Wa$(comma)-mno-warn-deprecated,-Wa$(comma)-W)

@@ -273,11 +277,8 @@ ifeq ($(CONFIG_STACKPROTECTOR_PER_TASK),y)
prepare: stack_protector_prepare
stack_protector_prepare: prepare0
	$(eval SSP_PLUGIN_CFLAGS := \
		-fplugin-arg-arm_ssp_per_task_plugin-tso=$(shell	\
			awk '{if ($$2 == "THREAD_SZ_ORDER") print $$3;}'\
				include/generated/asm-offsets.h)	\
		-fplugin-arg-arm_ssp_per_task_plugin-offset=$(shell	\
			awk '{if ($$2 == "TI_STACK_CANARY") print $$3;}'\
			awk '{if ($$2 == "TSK_STACK_CANARY") print $$3;}'\
				include/generated/asm-offsets.h))
	$(eval KBUILD_CFLAGS += $(SSP_PLUGIN_CFLAGS))
	$(eval GCC_PLUGINS_CFLAGS += $(SSP_PLUGIN_CFLAGS))
+42 −6
Original line number Diff line number Diff line
@@ -55,16 +55,17 @@ static uint64_t get_val(const fdt32_t *cells, uint32_t ncells)
 * DTB, and, if out-of-range, replace it by the real start address.
 * To preserve backwards compatibility (systems reserving a block of memory
 * at the start of physical memory, kdump, ...), the traditional method is
 * always used if it yields a valid address.
 * used if it yields a valid address, unless the "linux,usable-memory-range"
 * property is present.
 *
 * Return value: start address of physical memory to use
 */
uint32_t fdt_check_mem_start(uint32_t mem_start, const void *fdt)
{
	uint32_t addr_cells, size_cells, base;
	uint32_t addr_cells, size_cells, usable_base, base;
	uint32_t fdt_mem_start = 0xffffffff;
	const fdt32_t *reg, *endp;
	uint64_t size, end;
	const fdt32_t *usable, *reg, *endp;
	uint64_t size, usable_end, end;
	const char *type;
	int offset, len;

@@ -80,6 +81,27 @@ uint32_t fdt_check_mem_start(uint32_t mem_start, const void *fdt)
	if (addr_cells > 2 || size_cells > 2)
		return mem_start;

	/*
	 * Usable memory in case of a crash dump kernel
	 * This property describes a limitation: memory within this range is
	 * only valid when also described through another mechanism
	 */
	usable = get_prop(fdt, "/chosen", "linux,usable-memory-range",
			  (addr_cells + size_cells) * sizeof(fdt32_t));
	if (usable) {
		size = get_val(usable + addr_cells, size_cells);
		if (!size)
			return mem_start;

		if (addr_cells > 1 && fdt32_ld(usable)) {
			/* Outside 32-bit address space */
			return mem_start;
		}

		usable_base = fdt32_ld(usable + addr_cells - 1);
		usable_end = usable_base + size;
	}

	/* Walk all memory nodes and regions */
	for (offset = fdt_next_node(fdt, -1, NULL); offset >= 0;
	     offset = fdt_next_node(fdt, offset, NULL)) {
@@ -107,7 +129,20 @@ uint32_t fdt_check_mem_start(uint32_t mem_start, const void *fdt)

			base = fdt32_ld(reg + addr_cells - 1);
			end = base + size;
			if (mem_start >= base && mem_start < end) {
			if (usable) {
				/*
				 * Clip to usable range, which takes precedence
				 * over mem_start
				 */
				if (base < usable_base)
					base = usable_base;

				if (end > usable_end)
					end = usable_end;

				if (end <= base)
					continue;
			} else if (mem_start >= base && mem_start < end) {
				/* Calculated address is valid, use it */
				return mem_start;
			}
@@ -123,7 +158,8 @@ uint32_t fdt_check_mem_start(uint32_t mem_start, const void *fdt)
	}

	/*
	 * The calculated address is not usable.
	 * The calculated address is not usable, or was overridden by the
	 * "linux,usable-memory-range" property.
	 * Use the lowest usable physical memory address from the DTB instead,
	 * and make sure this is a multiple of 2 MiB for phys/virt patching.
	 */
+0 −3
Original line number Diff line number Diff line
@@ -240,9 +240,6 @@ static int scoop_remove(struct platform_device *pdev)
{
	struct scoop_dev *sdev = platform_get_drvdata(pdev);

	if (!sdev)
		return -EINVAL;

	if (sdev->gpio.base != -1)
		gpiochip_remove(&sdev->gpio);

+29 −0
Original line number Diff line number Diff line
@@ -199,14 +199,43 @@
	.endm
	.endr

	.macro	get_current, rd
#ifdef CONFIG_CURRENT_POINTER_IN_TPIDRURO
	mrc	p15, 0, \rd, c13, c0, 3		@ get TPIDRURO register
#else
	get_thread_info \rd
	ldr	\rd, [\rd, #TI_TASK]
#endif
	.endm

	.macro	set_current, rn
#ifdef CONFIG_CURRENT_POINTER_IN_TPIDRURO
	mcr	p15, 0, \rn, c13, c0, 3		@ set TPIDRURO register
#endif
	.endm

	.macro	reload_current, t1:req, t2:req
#ifdef CONFIG_CURRENT_POINTER_IN_TPIDRURO
	adr_l	\t1, __entry_task		@ get __entry_task base address
	mrc	p15, 0, \t2, c13, c0, 4		@ get per-CPU offset
	ldr	\t1, [\t1, \t2]			@ load variable
	mcr	p15, 0, \t1, c13, c0, 3		@ store in TPIDRURO
#endif
	.endm

/*
 * Get current thread_info.
 */
	.macro	get_thread_info, rd
#ifdef CONFIG_THREAD_INFO_IN_TASK
	/* thread_info is the first member of struct task_struct */
	get_current \rd
#else
 ARM(	mov	\rd, sp, lsr #THREAD_SIZE_ORDER + PAGE_SHIFT	)
 THUMB(	mov	\rd, sp			)
 THUMB(	lsr	\rd, \rd, #THREAD_SIZE_ORDER + PAGE_SHIFT	)
	mov	\rd, \rd, lsl #THREAD_SIZE_ORDER + PAGE_SHIFT
#endif
	.endm

/*
Loading