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

Commit 07171da2 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm

Pull ARM updates from Russell King:
 "The main item in this pull request are the Spectre variant 1.1 fixes
  from Julien Thierry.

  A few other patches to improve various areas, and removal of some
  obsolete mcount bits and a redundant kbuild conditional"

* 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm:
  ARM: 8802/1: Call syscall_trace_exit even when system call skipped
  ARM: 8797/1: spectre-v1.1: harden __copy_to_user
  ARM: 8796/1: spectre-v1,v1.1: provide helpers for address sanitization
  ARM: 8795/1: spectre-v1.1: use put_user() for __put_user()
  ARM: 8794/1: uaccess: Prevent speculative use of the current addr_limit
  ARM: 8793/1: signal: replace __put_user_error with __put_user
  ARM: 8792/1: oabi-compat: copy oabi events using __copy_to_user()
  ARM: 8791/1: vfp: use __copy_to_user() when saving VFP state
  ARM: 8790/1: signal: always use __copy_to_user to save iwmmxt context
  ARM: 8789/1: signal: copy registers using __copy_to_user()
  ARM: 8801/1: makefile: use ARMv3M mode for RiscPC
  ARM: 8800/1: use choice for kernel unwinders
  ARM: 8798/1: remove unnecessary KBUILD_SRC ifeq conditional
  ARM: 8788/1: ftrace: remove old mcount support
  ARM: 8786/1: Debug kernel copy by printing
parents 034bda1c 3e98d240
Loading
Loading
Loading
Loading
+26 −19
Original line number Diff line number Diff line
@@ -45,35 +45,42 @@ config DEBUG_WX

		If in doubt, say "Y".

# RMK wants arm kernels compiled with frame pointers or stack unwinding.
# If you know what you are doing and are willing to live without stack
# traces, you can get a slightly smaller kernel by setting this option to
# n, but then RMK will have to kill you ;).
config FRAME_POINTER
	bool
	depends on !THUMB2_KERNEL
	default y if !ARM_UNWIND || FUNCTION_GRAPH_TRACER
choice
	prompt "Choose kernel unwinder"
	default UNWINDER_ARM if AEABI && !FUNCTION_GRAPH_TRACER
	default UNWINDER_FRAME_POINTER if !AEABI || FUNCTION_GRAPH_TRACER
	help
	  If you say N here, the resulting kernel will be slightly smaller and
	  faster. However, if neither FRAME_POINTER nor ARM_UNWIND are enabled,
	  when a problem occurs with the kernel, the information that is
	  reported is severely limited.
	  This determines which method will be used for unwinding kernel stack
	  traces for panics, oopses, bugs, warnings, perf, /proc/<pid>/stack,
	  livepatch, lockdep, and more.

config ARM_UNWIND
	bool "Enable stack unwinding support (EXPERIMENTAL)"
config UNWINDER_FRAME_POINTER
	bool "Frame pointer unwinder"
	depends on !THUMB2_KERNEL && !CC_IS_CLANG
	select ARCH_WANT_FRAME_POINTERS
	select FRAME_POINTER
	help
	  This option enables the frame pointer unwinder for unwinding
	  kernel stack traces.

config UNWINDER_ARM
	bool "ARM EABI stack unwinder"
	depends on AEABI
	default y
	select ARM_UNWIND
	help
	  This option enables stack unwinding support in the kernel
	  using the information automatically generated by the
	  compiler. The resulting kernel image is slightly bigger but
	  the performance is not affected. Currently, this feature
	  only works with EABI compilers. If unsure say Y.
	  only works with EABI compilers.

config OLD_MCOUNT
endchoice

config ARM_UNWIND
	bool

config FRAME_POINTER
	bool
	depends on FUNCTION_TRACER && FRAME_POINTER
	default y

config DEBUG_USER
	bool "Verbose user fault messages"
+1 −5
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ endif
arch-$(CONFIG_CPU_32v5)		=-D__LINUX_ARM_ARCH__=5 $(call cc-option,-march=armv5te,-march=armv4t)
arch-$(CONFIG_CPU_32v4T)	=-D__LINUX_ARM_ARCH__=4 -march=armv4t
arch-$(CONFIG_CPU_32v4)		=-D__LINUX_ARM_ARCH__=4 -march=armv4
arch-$(CONFIG_CPU_32v3)		=-D__LINUX_ARM_ARCH__=3 -march=armv3
arch-$(CONFIG_CPU_32v3)		=-D__LINUX_ARM_ARCH__=3 -march=armv3m

# Evaluate arch cc-option calls now
arch-y := $(arch-y)
@@ -264,13 +264,9 @@ platdirs := $(patsubst %,arch/arm/plat-%/,$(sort $(plat-y)))

ifneq ($(CONFIG_ARCH_MULTIPLATFORM),y)
ifneq ($(CONFIG_ARM_SINGLE_ARMV7M),y)
ifeq ($(KBUILD_SRC),)
KBUILD_CPPFLAGS += $(patsubst %,-I%include,$(machdirs) $(platdirs))
else
KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs) $(platdirs))
endif
endif
endif

export	TEXT_OFFSET GZFLAGS MMUEXT

+43 −0
Original line number Diff line number Diff line
@@ -114,6 +114,35 @@
#endif
		.endm

		/*
		 * Debug kernel copy by printing the memory addresses involved
		 */
		.macro dbgkc, begin, end, cbegin, cend
#ifdef DEBUG
		kputc   #'\n'
		kputc   #'C'
		kputc   #':'
		kputc   #'0'
		kputc   #'x'
		kphex   \begin, 8	/* Start of compressed kernel */
		kputc	#'-'
		kputc	#'0'
		kputc	#'x'
		kphex	\end, 8		/* End of compressed kernel */
		kputc	#'-'
		kputc	#'>'
		kputc   #'0'
		kputc   #'x'
		kphex   \cbegin, 8	/* Start of kernel copy */
		kputc	#'-'
		kputc	#'0'
		kputc	#'x'
		kphex	\cend, 8	/* End of kernel copy */
		kputc	#'\n'
		kputc	#'\r'
#endif
		.endm

		.section ".start", #alloc, #execinstr
/*
 * sort out different calling conventions
@@ -450,6 +479,20 @@ dtb_check_done:
		add	r6, r9, r5
		add	r9, r9, r10

#ifdef DEBUG
		sub     r10, r6, r5
		sub     r10, r9, r10
		/*
		 * We are about to copy the kernel to a new memory area.
		 * The boundaries of the new memory area can be found in
		 * r10 and r9, whilst r5 and r6 contain the boundaries
		 * of the memory we are going to copy.
		 * Calling dbgkc will help with the printing of this
		 * information.
		 */
		dbgkc	r5, r6, r10, r9
#endif

1:		ldmdb	r6!, {r0 - r3, r10 - r12, lr}
		cmp	r6, r5
		stmdb	r9!, {r0 - r3, r10 - r12, lr}
+11 −0
Original line number Diff line number Diff line
@@ -467,6 +467,17 @@ THUMB( orr \reg , \reg , #PSR_T_BIT )
#endif
	.endm

	.macro uaccess_mask_range_ptr, addr:req, size:req, limit:req, tmp:req
#ifdef CONFIG_CPU_SPECTRE
	sub	\tmp, \limit, #1
	subs	\tmp, \tmp, \addr	@ tmp = limit - 1 - addr
	addhs	\tmp, \tmp, #1		@ if (tmp >= 0) {
	subhss	\tmp, \tmp, \size	@ tmp = limit - (addr + size) }
	movlo	\addr, #0		@ if (tmp < 0) addr = NULL
	csdb
#endif
	.endm

	.macro	uaccess_disable, tmp, isb=1
#ifdef CONFIG_CPU_SW_DOMAIN_PAN
	/*
+0 −3
Original line number Diff line number Diff line
@@ -16,9 +16,6 @@ extern void __gnu_mcount_nc(void);

#ifdef CONFIG_DYNAMIC_FTRACE
struct dyn_arch_ftrace {
#ifdef CONFIG_OLD_MCOUNT
	bool	old_mcount;
#endif
};

static inline unsigned long ftrace_call_adjust(unsigned long addr)
Loading