Loading arch/arm/Kconfig.debug +26 −19 Original line number Diff line number Diff line Loading @@ -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" Loading arch/arm/Makefile +1 −5 Original line number Diff line number Diff line Loading @@ -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) Loading Loading @@ -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 Loading arch/arm/boot/compressed/head.S +43 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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} Loading arch/arm/include/asm/assembler.h +11 −0 Original line number Diff line number Diff line Loading @@ -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 /* Loading arch/arm/include/asm/ftrace.h +0 −3 Original line number Diff line number Diff line Loading @@ -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 Loading
arch/arm/Kconfig.debug +26 −19 Original line number Diff line number Diff line Loading @@ -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" Loading
arch/arm/Makefile +1 −5 Original line number Diff line number Diff line Loading @@ -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) Loading Loading @@ -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 Loading
arch/arm/boot/compressed/head.S +43 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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} Loading
arch/arm/include/asm/assembler.h +11 −0 Original line number Diff line number Diff line Loading @@ -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 /* Loading
arch/arm/include/asm/ftrace.h +0 −3 Original line number Diff line number Diff line Loading @@ -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