Skip to content

Commit 8808cf8

Browse files
committed
Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm
Pull ARM updates from Russell King: - fix various clang build and cppcheck issues - switch ARM to use new common outgoing-CPU-notification code - add some additional explanation about the boot code - kbuild "make clean" fixes - get rid of another "(____ptrval____)", this time for the VDSO code - avoid treating cache maintenance faults as a write - add a frame pointer unwinder implementation for clang - add EDAC support for Aurora L2 cache - improve robustness of adjust_lowmem_bounds() finding the bounds of lowmem. - add reset control for AMBA primecell devices * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: (24 commits) ARM: 8906/1: drivers/amba: add reset control to amba bus probe ARM: 8905/1: Emit __gnu_mcount_nc when using Clang 10.0.0 or newer ARM: 8904/1: skip nomap memblocks while finding the lowmem/highmem boundary ARM: 8903/1: ensure that usable memory in bank 0 starts from a PMD-aligned address ARM: 8891/1: EDAC: armada_xp: Add support for more SoCs ARM: 8888/1: EDAC: Add driver for the Marvell Armada XP SDRAM and L2 cache ECC ARM: 8892/1: EDAC: Add missing debugfs_create_x32 wrapper ARM: 8890/1: l2x0: add marvell,ecc-enable property for aurora ARM: 8889/1: dt-bindings: document marvell,ecc-enable binding ARM: 8886/1: l2x0: support parity-enable/disable on aurora ARM: 8885/1: aurora-l2: add defines for parity and ECC registers ARM: 8887/1: aurora-l2: add prefix to MAX_RANGE_SIZE ARM: 8902/1: l2c: move cache-aurora-l2.h to asm/hardware ARM: 8900/1: UNWINDER_FRAME_POINTER implementation for Clang ARM: 8898/1: mm: Don't treat faults reported from cache maintenance as writes ARM: 8896/1: VDSO: Don't leak kernel addresses ARM: 8895/1: visit mach-* and plat-* directories when cleaning ARM: 8894/1: boot: Replace open-coded nop with macro ARM: 8893/1: boot: Explain the 8 nops ARM: 8876/1: fix O= building with CONFIG_FPE_FASTFPE ...
2 parents 5c6bd5d + 79bdcb2 commit 8808cf8

21 files changed

Lines changed: 1027 additions & 24 deletions

File tree

‎Documentation/devicetree/bindings/arm/l2c2x0.yaml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,10 @@ properties:
176176
description: disable parity checking on the L2 cache (L220 or PL310).
177177
type: boolean
178178

179+
marvell,ecc-enable:
180+
description: enable ECC protection on the L2 cache
181+
type: boolean
182+
179183
arm,outer-sync-disable:
180184
description: disable the outer sync operation on the L2 cache.
181185
Some core tiles, especially ARM PB11MPCore have a faulty L220 cache that

‎MAINTAINERS‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5802,6 +5802,12 @@ L: linux-edac@vger.kernel.org
58025802
S: Maintained
58035803
F: drivers/edac/amd64_edac*
58045804

5805+
EDAC-ARMADA
5806+
M: Jan Luebbe <jlu@pengutronix.de>
5807+
L: linux-edac@vger.kernel.org
5808+
S: Maintained
5809+
F: drivers/edac/armada_xp_*
5810+
58055811
EDAC-AST2500
58065812
M: Stefan Schaeckeler <sschaeck@cisco.com>
58075813
S: Supported

‎arch/arm/Kconfig‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ config ARM
8282
select HAVE_FAST_GUP if ARM_LPAE
8383
select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL
8484
select HAVE_FUNCTION_GRAPH_TRACER if !THUMB2_KERNEL && !CC_IS_CLANG
85-
select HAVE_FUNCTION_TRACER if !XIP_KERNEL
85+
select HAVE_FUNCTION_TRACER if !XIP_KERNEL && (CC_IS_GCC || CLANG_VERSION >= 100000)
8686
select HAVE_GCC_PLUGINS
8787
select HAVE_HW_BREAKPOINT if PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7)
8888
select HAVE_IDE if PCI || ISA || PCMCIA
@@ -1476,8 +1476,9 @@ config ARM_PATCH_IDIV
14761476
code to do integer division.
14771477

14781478
config AEABI
1479-
bool "Use the ARM EABI to compile the kernel" if !CPU_V7 && !CPU_V7M && !CPU_V6 && !CPU_V6K
1480-
default CPU_V7 || CPU_V7M || CPU_V6 || CPU_V6K
1479+
bool "Use the ARM EABI to compile the kernel" if !CPU_V7 && \
1480+
!CPU_V7M && !CPU_V6 && !CPU_V6K && !CC_IS_CLANG
1481+
default CPU_V7 || CPU_V7M || CPU_V6 || CPU_V6K || CC_IS_CLANG
14811482
help
14821483
This option allows for the kernel to be compiled using the latest
14831484
ARM ABI (aka EABI). This is only useful if you are using a user

‎arch/arm/Kconfig.debug‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ choice
5656

5757
config UNWINDER_FRAME_POINTER
5858
bool "Frame pointer unwinder"
59-
depends on !THUMB2_KERNEL && !CC_IS_CLANG
59+
depends on !THUMB2_KERNEL
6060
select ARCH_WANT_FRAME_POINTERS
6161
select FRAME_POINTER
6262
help

‎arch/arm/Makefile‎

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ KBUILD_CFLAGS += $(call cc-option,-mno-unaligned-access)
3636
endif
3737

3838
ifeq ($(CONFIG_FRAME_POINTER),y)
39-
KBUILD_CFLAGS +=-fno-omit-frame-pointer -mapcs -mno-sched-prolog
39+
KBUILD_CFLAGS +=-fno-omit-frame-pointer
40+
ifeq ($(CONFIG_CC_IS_GCC),y)
41+
KBUILD_CFLAGS += -mapcs -mno-sched-prolog
42+
endif
4043
endif
4144

4245
ifeq ($(CONFIG_CPU_BIG_ENDIAN),y)
@@ -112,6 +115,10 @@ ifeq ($(CONFIG_ARM_UNWIND),y)
112115
CFLAGS_ABI +=-funwind-tables
113116
endif
114117

118+
ifeq ($(CONFIG_CC_IS_CLANG),y)
119+
CFLAGS_ABI += -meabi gnu
120+
endif
121+
115122
# Accept old syntax despite ".syntax unified"
116123
AFLAGS_NOWARN :=$(call as-option,-Wa$(comma)-mno-warn-deprecated,-Wa$(comma)-W)
117124

@@ -266,14 +273,9 @@ endif
266273

267274
export TEXT_OFFSET GZFLAGS MMUEXT
268275

269-
# Do we have FASTFPE?
270-
FASTFPE :=arch/arm/fastfpe
271-
ifeq ($(FASTFPE),$(wildcard $(FASTFPE)))
272-
FASTFPE_OBJ :=$(FASTFPE)/
273-
endif
274-
275276
core-$(CONFIG_FPE_NWFPE) += arch/arm/nwfpe/
276-
core-$(CONFIG_FPE_FASTFPE) += $(FASTFPE_OBJ)
277+
# Put arch/arm/fastfpe/ to use this.
278+
core-$(CONFIG_FPE_FASTFPE) += $(patsubst $(srctree)/%,%,$(wildcard $(srctree)/arch/arm/fastfpe/))
277279
core-$(CONFIG_VFP) += arch/arm/vfp/
278280
core-$(CONFIG_XEN) += arch/arm/xen/
279281
core-$(CONFIG_KVM_ARM_HOST) += arch/arm/kvm/
@@ -286,6 +288,10 @@ core-y += arch/arm/net/
286288
core-y += arch/arm/crypto/
287289
core-y += $(machdirs) $(platdirs)
288290

291+
# For cleaning
292+
core- += $(patsubst %,arch/arm/mach-%/, $(machine-))
293+
core- += $(patsubst %,arch/arm/plat-%/, $(plat-))
294+
289295
drivers-$(CONFIG_OPROFILE) += arch/arm/oprofile/
290296

291297
libs-y := arch/arm/lib/ $(libs-y)

‎arch/arm/boot/compressed/head.S‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,23 @@
153153
AR_CLASS( .arm )
154154
start:
155155
.type start,#function
156+
/*
157+
* These 7 nops along with the 1 nop immediately below for
158+
* !THUMB2 form 8 nops that make the compressed kernel bootable
159+
* on legacy ARM systems that were assuming the kernel in a.out
160+
* binary format. The boot loaders on these systems would
161+
* jump 32 bytes into the image to skip the a.out header.
162+
* with these 8 nops filling exactly 32 bytes, things still
163+
* work as expected on these legacy systems. Thumb2 mode keeps
164+
* 7 of the nops as it turns out that some boot loaders
165+
* were patching the initial instructions of the kernel, i.e
166+
* had started to exploit this "patch area".
167+
*/
156168
.rept 7
157169
__nop
158170
.endr
159171
#ifndef CONFIG_THUMB2_KERNEL
160-
mov r0, r0
172+
__nop
161173
#else
162174
AR_CLASS( sub pc, pc, #3 ) @ A/R: switch to Thumb2 mode
163175
M_CLASS( nop.w ) @ M: already in Thumb2 mode

arch/arm/mm/cache-aurora-l2.h renamed to arch/arm/include/asm/hardware/cache-aurora-l2.h

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
#define AURORA_ACR_REPLACEMENT_TYPE_SEMIPLRU \
3232
(3 << AURORA_ACR_REPLACEMENT_OFFSET)
3333

34+
#define AURORA_ACR_PARITY_EN (1 << 21)
35+
#define AURORA_ACR_ECC_EN (1 << 20)
36+
3437
#define AURORA_ACR_FORCE_WRITE_POLICY_OFFSET 0
3538
#define AURORA_ACR_FORCE_WRITE_POLICY_MASK \
3639
(0x3 << AURORA_ACR_FORCE_WRITE_POLICY_OFFSET)
@@ -41,7 +44,52 @@
4144
#define AURORA_ACR_FORCE_WRITE_THRO_POLICY \
4245
(2 << AURORA_ACR_FORCE_WRITE_POLICY_OFFSET)
4346

44-
#define MAX_RANGE_SIZE 1024
47+
#define AURORA_ERR_CNT_REG 0x600
48+
#define AURORA_ERR_ATTR_CAP_REG 0x608
49+
#define AURORA_ERR_ADDR_CAP_REG 0x60c
50+
#define AURORA_ERR_WAY_CAP_REG 0x610
51+
#define AURORA_ERR_INJECT_CTL_REG 0x614
52+
#define AURORA_ERR_INJECT_MASK_REG 0x618
53+
54+
#define AURORA_ERR_CNT_CLR_OFFSET 31
55+
#define AURORA_ERR_CNT_CLR \
56+
(0x1 << AURORA_ERR_CNT_CLR_OFFSET)
57+
#define AURORA_ERR_CNT_UE_OFFSET 16
58+
#define AURORA_ERR_CNT_UE_MASK \
59+
(0x7fff << AURORA_ERR_CNT_UE_OFFSET)
60+
#define AURORA_ERR_CNT_CE_OFFSET 0
61+
#define AURORA_ERR_CNT_CE_MASK \
62+
(0xffff << AURORA_ERR_CNT_CE_OFFSET)
63+
64+
#define AURORA_ERR_ATTR_SRC_OFF 16
65+
#define AURORA_ERR_ATTR_SRC_MSK \
66+
(0x7 << AURORA_ERR_ATTR_SRC_OFF)
67+
#define AURORA_ERR_ATTR_TXN_OFF 12
68+
#define AURORA_ERR_ATTR_TXN_MSK \
69+
(0xf << AURORA_ERR_ATTR_TXN_OFF)
70+
#define AURORA_ERR_ATTR_ERR_OFF 8
71+
#define AURORA_ERR_ATTR_ERR_MSK \
72+
(0x3 << AURORA_ERR_ATTR_ERR_OFF)
73+
#define AURORA_ERR_ATTR_CAP_VALID_OFF 0
74+
#define AURORA_ERR_ATTR_CAP_VALID \
75+
(0x1 << AURORA_ERR_ATTR_CAP_VALID_OFF)
76+
77+
#define AURORA_ERR_ADDR_CAP_ADDR_MASK 0xffffffe0
78+
79+
#define AURORA_ERR_WAY_IDX_OFF 8
80+
#define AURORA_ERR_WAY_IDX_MSK \
81+
(0xfff << AURORA_ERR_WAY_IDX_OFF)
82+
#define AURORA_ERR_WAY_CAP_WAY_OFFSET 1
83+
#define AURORA_ERR_WAY_CAP_WAY_MASK \
84+
(0xf << AURORA_ERR_WAY_CAP_WAY_OFFSET)
85+
86+
#define AURORA_ERR_INJECT_CTL_ADDR_MASK 0xfffffff0
87+
#define AURORA_ERR_ATTR_TXN_OFF 12
88+
#define AURORA_ERR_INJECT_CTL_EN_MASK 0x3
89+
#define AURORA_ERR_INJECT_CTL_EN_PARITY 0x2
90+
#define AURORA_ERR_INJECT_CTL_EN_ECC 0x1
91+
92+
#define AURORA_MAX_RANGE_SIZE 1024
4593

4694
#define AURORA_WAY_SIZE_SHIFT 2
4795

‎arch/arm/kernel/perf_event_v7.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -697,9 +697,9 @@ static struct attribute_group armv7_pmuv2_events_attr_group = {
697697
/*
698698
* Event filters for PMUv2
699699
*/
700-
#define ARMV7_EXCLUDE_PL1 (1 << 31)
701-
#define ARMV7_EXCLUDE_USER (1 << 30)
702-
#define ARMV7_INCLUDE_HYP (1 << 27)
700+
#define ARMV7_EXCLUDE_PL1 BIT(31)
701+
#define ARMV7_EXCLUDE_USER BIT(30)
702+
#define ARMV7_INCLUDE_HYP BIT(27)
703703

704704
/*
705705
* Secure debug enable reg

‎arch/arm/kernel/vdso.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ static int __init vdso_init(void)
194194
}
195195

196196
text_pages = (vdso_end - vdso_start) >> PAGE_SHIFT;
197-
pr_debug("vdso: %i text pages at base %p\n", text_pages, vdso_start);
198197

199198
/* Allocate the VDSO text pagelist */
200199
vdso_text_pagelist = kcalloc(text_pages, sizeof(struct page *),

‎arch/arm/lib/Makefile‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Copyright (C) 1995-2000 Russell King
66
#
77

8-
lib-y := backtrace.o changebit.o csumipv6.o csumpartial.o \
8+
lib-y := changebit.o csumipv6.o csumpartial.o \
99
csumpartialcopy.o csumpartialcopyuser.o clearbit.o \
1010
delay.o delay-loop.o findbit.o memchr.o memcpy.o \
1111
memmove.o memset.o setbit.o \
@@ -19,6 +19,12 @@ lib-y := backtrace.o changebit.o csumipv6.o csumpartial.o \
1919
mmu-y := clear_user.o copy_page.o getuser.o putuser.o \
2020
copy_from_user.o copy_to_user.o
2121

22+
ifdef CONFIG_CC_IS_CLANG
23+
lib-y += backtrace-clang.o
24+
else
25+
lib-y += backtrace.o
26+
endif
27+
2228
# using lib_ here won't override already available weak symbols
2329
obj-$(CONFIG_UACCESS_WITH_MEMCPY) += uaccess_with_memcpy.o
2430

0 commit comments

Comments
 (0)