Skip to content

Commit 4cb1fc6

Browse files
committed
Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm
Pull ARM updates from Russell King: - update unwinder to cope with module PLTs - enable UBSAN on ARM - improve kernel fault message - update UEFI runtime page tables dump - avoid clang's __aeabi_uldivmod generated in NWFPE code - disable FIQs on CPU shutdown paths - update XOR register usage - a number of build updates (using .arch, thread pointer, removal of lazy evaluation in Makefile) - conversion of stacktrace code to stackwalk - findbit assembly updates - hwcap feature updates for ARMv8 CPUs - instruction dump updates for big-endian platforms - support for function error injection * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: (31 commits) ARM: 9279/1: support function error injection ARM: 9277/1: Make the dumped instructions are consistent with the disassembled ones ARM: 9276/1: Refactor dump_instr() ARM: 9275/1: Drop '-mthumb' from AFLAGS_ISA ARM: 9274/1: Add hwcap for Speculative Store Bypassing Safe ARM: 9273/1: Add hwcap for Speculation Barrier(SB) ARM: 9272/1: vfp: Add hwcap for FEAT_AA32I8MM ARM: 9271/1: vfp: Add hwcap for FEAT_AA32BF16 ARM: 9270/1: vfp: Add hwcap for FEAT_FHM ARM: 9269/1: vfp: Add hwcap for FEAT_DotProd ARM: 9268/1: vfp: Add hwcap FPHP and ASIMDHP for FEAT_FP16 ARM: 9267/1: Define Armv8 registers in AArch32 state ARM: findbit: add unwinder information ARM: findbit: operate by words ARM: findbit: convert to macros ARM: findbit: provide more efficient ARMv7 implementation ARM: findbit: document ARMv5 bit offset calculation ARM: 9259/1: stacktrace: Convert stacktrace to generic ARCH_STACKWALK ARM: 9258/1: stacktrace: Make stack walk callback consistent with generic code ARM: 9265/1: pass -march= only to compiler ...
2 parents 740afa4 + aaa4dd1 commit 4cb1fc6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+393
-340
lines changed

arch/arm/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ config ARM
1717
select ARCH_HAS_PTE_SPECIAL if ARM_LPAE
1818
select ARCH_HAS_SETUP_DMA_OPS
1919
select ARCH_HAS_SET_MEMORY
20+
select ARCH_STACKWALK
2021
select ARCH_HAS_STRICT_KERNEL_RWX if MMU && !XIP_KERNEL
2122
select ARCH_HAS_STRICT_MODULE_RWX if MMU
2223
select ARCH_HAS_SYNC_DMA_FOR_DEVICE
@@ -27,6 +28,7 @@ config ARM
2728
select ARCH_HAVE_NMI_SAFE_CMPXCHG if CPU_V7 || CPU_V7M || CPU_V6K
2829
select ARCH_HAS_GCOV_PROFILE_ALL
2930
select ARCH_KEEP_MEMBLOCK
31+
select ARCH_HAS_UBSAN_SANITIZE_ALL
3032
select ARCH_MIGHT_HAVE_PC_PARPORT
3133
select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
3234
select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT if CPU_V7
@@ -95,6 +97,7 @@ config ARM
9597
select HAVE_EXIT_THREAD
9698
select HAVE_FAST_GUP if ARM_LPAE
9799
select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL
100+
select HAVE_FUNCTION_ERROR_INJECTION
98101
select HAVE_FUNCTION_GRAPH_TRACER
99102
select HAVE_FUNCTION_TRACER if !XIP_KERNEL
100103
select HAVE_GCC_PLUGINS

arch/arm/Makefile

Lines changed: 45 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -60,47 +60,54 @@ endif
6060
KBUILD_CFLAGS += $(call cc-option,-fno-ipa-sra)
6161

6262
# This selects which instruction set is used.
63+
arch-$(CONFIG_CPU_32v7M) :=-march=armv7-m
64+
arch-$(CONFIG_CPU_32v7) :=-march=armv7-a
65+
arch-$(CONFIG_CPU_32v6) :=-march=armv6
66+
# Only override the compiler option if ARMv6. The ARMv6K extensions are
67+
# always available in ARMv7
68+
ifeq ($(CONFIG_CPU_32v6),y)
69+
arch-$(CONFIG_CPU_32v6K) :=-march=armv6k
70+
endif
71+
arch-$(CONFIG_CPU_32v5) :=-march=armv5te
72+
arch-$(CONFIG_CPU_32v4T) :=-march=armv4t
73+
arch-$(CONFIG_CPU_32v4) :=-march=armv4
74+
arch-$(CONFIG_CPU_32v3) :=-march=armv3m
75+
6376
# Note that GCC does not numerically define an architecture version
6477
# macro, but instead defines a whole series of macros which makes
6578
# testing for a specific architecture or later rather impossible.
66-
arch-$(CONFIG_CPU_32v7M) =-D__LINUX_ARM_ARCH__=7 -march=armv7-m
67-
arch-$(CONFIG_CPU_32v7) =-D__LINUX_ARM_ARCH__=7 -march=armv7-a
68-
arch-$(CONFIG_CPU_32v6) =-D__LINUX_ARM_ARCH__=6 -march=armv6
79+
cpp-$(CONFIG_CPU_32v7M) :=-D__LINUX_ARM_ARCH__=7
80+
cpp-$(CONFIG_CPU_32v7) :=-D__LINUX_ARM_ARCH__=7
81+
cpp-$(CONFIG_CPU_32v6) :=-D__LINUX_ARM_ARCH__=6
6982
# Only override the compiler option if ARMv6. The ARMv6K extensions are
7083
# always available in ARMv7
7184
ifeq ($(CONFIG_CPU_32v6),y)
72-
arch-$(CONFIG_CPU_32v6K) =-D__LINUX_ARM_ARCH__=6 -march=armv6k
85+
cpp-$(CONFIG_CPU_32v6K) :=-D__LINUX_ARM_ARCH__=6
7386
endif
74-
arch-$(CONFIG_CPU_32v5) =-D__LINUX_ARM_ARCH__=5 -march=armv5te
75-
arch-$(CONFIG_CPU_32v4T) =-D__LINUX_ARM_ARCH__=4 -march=armv4t
76-
arch-$(CONFIG_CPU_32v4) =-D__LINUX_ARM_ARCH__=4 -march=armv4
77-
arch-$(CONFIG_CPU_32v3) =-D__LINUX_ARM_ARCH__=3 -march=armv3m
78-
79-
# Evaluate arch cc-option calls now
80-
arch-y := $(arch-y)
87+
cpp-$(CONFIG_CPU_32v5) :=-D__LINUX_ARM_ARCH__=5
88+
cpp-$(CONFIG_CPU_32v4T) :=-D__LINUX_ARM_ARCH__=4
89+
cpp-$(CONFIG_CPU_32v4) :=-D__LINUX_ARM_ARCH__=4
90+
cpp-$(CONFIG_CPU_32v3) :=-D__LINUX_ARM_ARCH__=3
8191

8292
# This selects how we optimise for the processor.
83-
tune-$(CONFIG_CPU_ARM7TDMI) =-mtune=arm7tdmi
84-
tune-$(CONFIG_CPU_ARM720T) =-mtune=arm7tdmi
85-
tune-$(CONFIG_CPU_ARM740T) =-mtune=arm7tdmi
86-
tune-$(CONFIG_CPU_ARM9TDMI) =-mtune=arm9tdmi
87-
tune-$(CONFIG_CPU_ARM940T) =-mtune=arm9tdmi
88-
tune-$(CONFIG_CPU_ARM946E) =-mtune=arm9e
89-
tune-$(CONFIG_CPU_ARM920T) =-mtune=arm9tdmi
90-
tune-$(CONFIG_CPU_ARM922T) =-mtune=arm9tdmi
91-
tune-$(CONFIG_CPU_ARM925T) =-mtune=arm9tdmi
92-
tune-$(CONFIG_CPU_ARM926T) =-mtune=arm9tdmi
93-
tune-$(CONFIG_CPU_FA526) =-mtune=arm9tdmi
94-
tune-$(CONFIG_CPU_SA110) =-mtune=strongarm110
95-
tune-$(CONFIG_CPU_SA1100) =-mtune=strongarm1100
96-
tune-$(CONFIG_CPU_XSCALE) =-mtune=xscale
97-
tune-$(CONFIG_CPU_XSC3) =-mtune=xscale
98-
tune-$(CONFIG_CPU_FEROCEON) =-mtune=xscale
99-
tune-$(CONFIG_CPU_V6) =-mtune=arm1136j-s
100-
tune-$(CONFIG_CPU_V6K) =-mtune=arm1136j-s
101-
102-
# Evaluate tune cc-option calls now
103-
tune-y := $(tune-y)
93+
tune-$(CONFIG_CPU_ARM7TDMI) :=-mtune=arm7tdmi
94+
tune-$(CONFIG_CPU_ARM720T) :=-mtune=arm7tdmi
95+
tune-$(CONFIG_CPU_ARM740T) :=-mtune=arm7tdmi
96+
tune-$(CONFIG_CPU_ARM9TDMI) :=-mtune=arm9tdmi
97+
tune-$(CONFIG_CPU_ARM940T) :=-mtune=arm9tdmi
98+
tune-$(CONFIG_CPU_ARM946E) :=-mtune=arm9e
99+
tune-$(CONFIG_CPU_ARM920T) :=-mtune=arm9tdmi
100+
tune-$(CONFIG_CPU_ARM922T) :=-mtune=arm9tdmi
101+
tune-$(CONFIG_CPU_ARM925T) :=-mtune=arm9tdmi
102+
tune-$(CONFIG_CPU_ARM926T) :=-mtune=arm9tdmi
103+
tune-$(CONFIG_CPU_FA526) :=-mtune=arm9tdmi
104+
tune-$(CONFIG_CPU_SA110) :=-mtune=strongarm110
105+
tune-$(CONFIG_CPU_SA1100) :=-mtune=strongarm1100
106+
tune-$(CONFIG_CPU_XSCALE) :=-mtune=xscale
107+
tune-$(CONFIG_CPU_XSC3) :=-mtune=xscale
108+
tune-$(CONFIG_CPU_FEROCEON) :=-mtune=xscale
109+
tune-$(CONFIG_CPU_V6) :=-mtune=arm1136j-s
110+
tune-$(CONFIG_CPU_V6K) :=-mtune=arm1136j-s
104111

105112
ifeq ($(CONFIG_AEABI),y)
106113
CFLAGS_ABI :=-mabi=aapcs-linux -mfpu=vfp
@@ -117,23 +124,25 @@ CFLAGS_ABI += -meabi gnu
117124
endif
118125

119126
ifeq ($(CONFIG_CURRENT_POINTER_IN_TPIDRURO),y)
120-
CFLAGS_ABI += -mtp=cp15
127+
KBUILD_CFLAGS += -mtp=cp15
121128
endif
122129

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

126133
ifeq ($(CONFIG_THUMB2_KERNEL),y)
127-
CFLAGS_ISA :=-mthumb -Wa,-mimplicit-it=always $(AFLAGS_NOWARN)
128-
AFLAGS_ISA :=$(CFLAGS_ISA) -Wa$(comma)-mthumb
134+
CFLAGS_ISA :=-Wa,-mimplicit-it=always $(AFLAGS_NOWARN)
135+
AFLAGS_ISA :=$(CFLAGS_ISA) -Wa$(comma)-mthumb -D__thumb2__=2
136+
CFLAGS_ISA +=-mthumb
129137
else
130138
CFLAGS_ISA :=$(call cc-option,-marm,) $(AFLAGS_NOWARN)
131139
AFLAGS_ISA :=$(CFLAGS_ISA)
132140
endif
133141

134142
# Need -Uarm for gcc < 3.x
143+
KBUILD_CPPFLAGS +=$(cpp-y)
135144
KBUILD_CFLAGS +=$(CFLAGS_ABI) $(CFLAGS_ISA) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm
136-
KBUILD_AFLAGS +=$(CFLAGS_ABI) $(AFLAGS_ISA) $(arch-y) $(tune-y) -include asm/unified.h -msoft-float
145+
KBUILD_AFLAGS +=$(CFLAGS_ABI) $(AFLAGS_ISA) -Wa,$(arch-y) $(tune-y) -include asm/unified.h -msoft-float
137146

138147
CHECKFLAGS += -D__arm__
139148

arch/arm/boot/compressed/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ KASAN_SANITIZE := n
2727

2828
# Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
2929
KCOV_INSTRUMENT := n
30+
UBSAN_SANITIZE := n
3031

3132
#
3233
# Architecture dependencies
@@ -163,4 +164,3 @@ $(obj)/piggy_data: $(obj)/../Image FORCE
163164
$(obj)/piggy.o: $(obj)/piggy_data
164165

165166
CFLAGS_font.o := -Dstatic=
166-
AFLAGS_hyp-stub.o := -Wa,-march=armv7-a

arch/arm/common/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,5 @@ obj-$(CONFIG_SHARP_SCOOP) += scoop.o
1313
obj-$(CONFIG_CPU_V7) += secure_cntvoff.o
1414
obj-$(CONFIG_MCPM) += mcpm_head.o mcpm_entry.o mcpm_platsmp.o vlock.o
1515
CFLAGS_REMOVE_mcpm_entry.o = -pg
16-
AFLAGS_mcpm_head.o := -march=armv7-a
17-
AFLAGS_vlock.o := -march=armv7-a
1816
obj-$(CONFIG_BL_SWITCHER) += bL_switcher.o
1917
obj-$(CONFIG_BL_SWITCHER_DUMMY_IF) += bL_switcher_dummy_if.o

arch/arm/common/mcpm_head.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
#include "vlock.h"
1717

18+
.arch armv7-a
19+
1820
.if MCPM_SYNC_CLUSTER_CPUS
1921
.error "cpus must be the first member of struct mcpm_sync_struct"
2022
.endif

arch/arm/common/vlock.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#include <linux/linkage.h>
1313
#include "vlock.h"
1414

15+
.arch armv7-a
16+
1517
/* Select different code if voting flags can fit in a single word. */
1618
#if VLOCK_VOTING_SIZE > 4
1719
#define FEW(x...)

arch/arm/include/asm/assembler.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,12 @@ THUMB( orr \reg , \reg , #PSR_T_BIT )
761761
.endif
762762
.endm
763763

764+
.if __LINUX_ARM_ARCH__ < 6
765+
.set .Lrev_l_uses_tmp, 1
766+
.else
767+
.set .Lrev_l_uses_tmp, 0
768+
.endif
769+
764770
/*
765771
* bl_r - branch and link to register
766772
*

arch/arm/include/asm/cputype.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
#define CPUID_EXT_ISAR3 0x6c
2626
#define CPUID_EXT_ISAR4 0x70
2727
#define CPUID_EXT_ISAR5 0x74
28+
#define CPUID_EXT_ISAR6 0x7c
29+
#define CPUID_EXT_PFR2 0x90
2830
#else
2931
#define CPUID_EXT_PFR0 "c1, 0"
3032
#define CPUID_EXT_PFR1 "c1, 1"
@@ -40,6 +42,8 @@
4042
#define CPUID_EXT_ISAR3 "c2, 3"
4143
#define CPUID_EXT_ISAR4 "c2, 4"
4244
#define CPUID_EXT_ISAR5 "c2, 5"
45+
#define CPUID_EXT_ISAR6 "c2, 7"
46+
#define CPUID_EXT_PFR2 "c3, 4"
4347
#endif
4448

4549
#define MPIDR_SMP_BITMASK (0x3 << 30)

arch/arm/include/asm/module.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ struct mod_arch_specific {
3737

3838
struct module;
3939
u32 get_module_plt(struct module *mod, unsigned long loc, Elf32_Addr val);
40+
#ifdef CONFIG_ARM_MODULE_PLTS
41+
bool in_module_plt(unsigned long loc);
42+
#else
43+
static inline bool in_module_plt(unsigned long loc) { return false; }
44+
#endif
4045

4146
#ifdef CONFIG_THUMB2_KERNEL
4247
#define HAVE_ARCH_KALLSYMS_SYMBOL_VALUE

arch/arm/include/asm/ptdump.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ struct ptdump_info {
2121

2222
void ptdump_walk_pgd(struct seq_file *s, struct ptdump_info *info);
2323
#ifdef CONFIG_ARM_PTDUMP_DEBUGFS
24+
#define EFI_RUNTIME_MAP_END SZ_1G
2425
void ptdump_debugfs_register(struct ptdump_info *info, const char *name);
2526
#else
2627
static inline void ptdump_debugfs_register(struct ptdump_info *info,

0 commit comments

Comments
 (0)