Skip to content

Commit e8b4712

Browse files
committed
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rmk/linux
Pull ARM and clkdev updates from Russell King: - Simplify ARM_MMU_KEEP usage - Add Rust support for ARM architecture version 7 - Align IPIs reported in /proc/interrupts - require linker to support KEEP within OVERLAY - add KEEP() for ARM vectors - add __printf() attribute for clkdev functions * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rmk/linux: ARM: 9445/1: clkdev: Mark some functions with __printf() attribute ARM: 9444/1: add KEEP() keyword to ARM_VECTORS ARM: 9443/1: Require linker to support KEEP within OVERLAY for DCE ARM: 9442/1: smp: Fix IPI alignment in /proc/interrupts ARM: 9441/1: rust: Enable Rust support for ARMv7 ARM: 9439/1: arm32: simplify ARM_MMU_KEEP usage
2 parents aa18761 + 623c301 commit e8b4712

File tree

12 files changed

+62
-14
lines changed

12 files changed

+62
-14
lines changed

Documentation/rust/arch-support.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ support corresponds to ``S`` values in the ``MAINTAINERS`` file.
1515
============= ================ ==============================================
1616
Architecture Level of support Constraints
1717
============= ================ ==============================================
18+
``arm`` Maintained ARMv7 Little Endian only.
1819
``arm64`` Maintained Little Endian only.
1920
``loongarch`` Maintained \-
2021
``riscv`` Maintained ``riscv64`` and LLVM/Clang only.

arch/arm/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ config ARM
121121
select HAVE_KERNEL_XZ
122122
select HAVE_KPROBES if !XIP_KERNEL && !CPU_ENDIAN_BE32 && !CPU_V7M
123123
select HAVE_KRETPROBES if HAVE_KPROBES
124-
select HAVE_LD_DEAD_CODE_DATA_ELIMINATION if (LD_VERSION >= 23600 || LD_IS_LLD)
124+
select HAVE_LD_DEAD_CODE_DATA_ELIMINATION if (LD_VERSION >= 23600 || LD_CAN_USE_KEEP_IN_OVERLAY)
125125
select HAVE_MOD_ARCH_SPECIFIC
126126
select HAVE_NMI
127127
select HAVE_OPTPROBES if !THUMB2_KERNEL
@@ -133,6 +133,7 @@ config ARM
133133
select MMU_GATHER_RCU_TABLE_FREE if SMP && ARM_LPAE
134134
select HAVE_REGS_AND_STACK_ACCESS_API
135135
select HAVE_RSEQ
136+
select HAVE_RUST if CPU_LITTLE_ENDIAN && CPU_32v7
136137
select HAVE_STACKPROTECTOR
137138
select HAVE_SYSCALL_TRACEPOINTS
138139
select HAVE_UID16

arch/arm/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ endif
150150
KBUILD_CPPFLAGS +=$(cpp-y)
151151
KBUILD_CFLAGS +=$(CFLAGS_ABI) $(CFLAGS_ISA) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm
152152
KBUILD_AFLAGS +=$(CFLAGS_ABI) $(AFLAGS_ISA) -Wa,$(arch-y) $(tune-y) -include asm/unified.h -msoft-float
153+
KBUILD_RUSTFLAGS += --target=arm-unknown-linux-gnueabi
153154

154155
CHECKFLAGS += -D__arm__
155156

arch/arm/include/asm/vmlinux.lds.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#endif
2020

2121
#ifdef CONFIG_MMU
22-
#define ARM_MMU_KEEP(x) x
22+
#define ARM_MMU_KEEP(x) KEEP(x)
2323
#define ARM_MMU_DISCARD(x)
2424
#else
2525
#define ARM_MMU_KEEP(x)
@@ -34,6 +34,12 @@
3434
#define NOCROSSREFS
3535
#endif
3636

37+
#ifdef CONFIG_LD_CAN_USE_KEEP_IN_OVERLAY
38+
#define OVERLAY_KEEP(x) KEEP(x)
39+
#else
40+
#define OVERLAY_KEEP(x) x
41+
#endif
42+
3743
/* Set start/end symbol names to the LMA for the section */
3844
#define ARM_LMA(sym, section) \
3945
sym##_start = LOADADDR(section); \
@@ -125,13 +131,13 @@
125131
__vectors_lma = .; \
126132
OVERLAY 0xffff0000 : NOCROSSREFS AT(__vectors_lma) { \
127133
.vectors { \
128-
*(.vectors) \
134+
OVERLAY_KEEP(*(.vectors)) \
129135
} \
130136
.vectors.bhb.loop8 { \
131-
*(.vectors.bhb.loop8) \
137+
OVERLAY_KEEP(*(.vectors.bhb.loop8)) \
132138
} \
133139
.vectors.bhb.bpiall { \
134-
*(.vectors.bhb.bpiall) \
140+
OVERLAY_KEEP(*(.vectors.bhb.bpiall)) \
135141
} \
136142
} \
137143
ARM_LMA(__vectors, .vectors); \

arch/arm/kernel/smp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,8 @@ void show_ipi_list(struct seq_file *p, int prec)
551551
if (!ipi_desc[i])
552552
continue;
553553

554-
seq_printf(p, "%*s%u: ", prec - 1, "IPI", i);
554+
seq_printf(p, "%*s%u:%s", prec - 1, "IPI", i,
555+
prec >= 4 ? " " : "");
555556

556557
for_each_online_cpu(cpu)
557558
seq_printf(p, "%10u ", irq_desc_kstat_cpu(ipi_desc[i], cpu));

arch/arm/kernel/vmlinux-xip.lds.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ SECTIONS
6363
. = ALIGN(4);
6464
__ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
6565
__start___ex_table = .;
66-
ARM_MMU_KEEP(KEEP(*(__ex_table)))
66+
ARM_MMU_KEEP(*(__ex_table))
6767
__stop___ex_table = .;
6868
}
6969

arch/arm/kernel/vmlinux.lds.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ SECTIONS
7474
. = ALIGN(4);
7575
__ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
7676
__start___ex_table = .;
77-
ARM_MMU_KEEP(KEEP(*(__ex_table)))
77+
ARM_MMU_KEEP(*(__ex_table))
7878
__stop___ex_table = .;
7979
}
8080

drivers/clk/clkdev.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ struct clk_lookup_alloc {
153153
char con_id[MAX_CON_ID];
154154
};
155155

156-
static struct clk_lookup * __ref
156+
static __printf(3, 0) struct clk_lookup * __ref
157157
vclkdev_alloc(struct clk_hw *hw, const char *con_id, const char *dev_fmt,
158158
va_list ap)
159159
{
@@ -215,7 +215,7 @@ vclkdev_alloc(struct clk_hw *hw, const char *con_id, const char *dev_fmt,
215215
return &cla->cl;
216216
}
217217

218-
static struct clk_lookup *
218+
static __printf(3, 0) struct clk_lookup *
219219
vclkdev_create(struct clk_hw *hw, const char *con_id, const char *dev_fmt,
220220
va_list ap)
221221
{
@@ -303,9 +303,8 @@ void clkdev_drop(struct clk_lookup *cl)
303303
}
304304
EXPORT_SYMBOL(clkdev_drop);
305305

306-
static struct clk_lookup *__clk_register_clkdev(struct clk_hw *hw,
307-
const char *con_id,
308-
const char *dev_id, ...)
306+
static __printf(3, 4) struct clk_lookup *
307+
__clk_register_clkdev(struct clk_hw *hw, const char *con_id, const char *dev_id, ...)
309308
{
310309
struct clk_lookup *cl;
311310
va_list ap;

init/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ config CC_HAS_COUNTED_BY
132132
config CC_HAS_MULTIDIMENSIONAL_NONSTRING
133133
def_bool $(success,echo 'char tag[][4] __attribute__((__nonstring__)) = { };' | $(CC) $(CLANG_FLAGS) -x c - -c -o /dev/null -Werror)
134134

135+
config LD_CAN_USE_KEEP_IN_OVERLAY
136+
# ld.lld prior to 21.0.0 did not support KEEP within an overlay description
137+
# https://github.com/llvm/llvm-project/pull/130661
138+
def_bool LD_IS_BFD || LLD_VERSION >= 210000
139+
135140
config RUSTC_HAS_COERCE_POINTEE
136141
def_bool RUSTC_VERSION >= 108400
137142

rust/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ bindgen_skip_c_flags := -mno-fp-ret-in-387 -mpreferred-stack-boundary=% \
275275
# Derived from `scripts/Makefile.clang`.
276276
BINDGEN_TARGET_x86 := x86_64-linux-gnu
277277
BINDGEN_TARGET_arm64 := aarch64-linux-gnu
278+
BINDGEN_TARGET_arm := arm-linux-gnueabi
278279
BINDGEN_TARGET_loongarch := loongarch64-linux-gnusf
279280
BINDGEN_TARGET_um := $(BINDGEN_TARGET_$(SUBARCH))
280281
BINDGEN_TARGET := $(BINDGEN_TARGET_$(SRCARCH))
@@ -433,6 +434,13 @@ redirect-intrinsics = \
433434
__muloti4 __multi3 \
434435
__udivmodti4 __udivti3 __umodti3
435436

437+
ifdef CONFIG_ARM
438+
# Add eabi initrinsics for ARM 32-bit
439+
redirect-intrinsics += \
440+
__aeabi_fadd __aeabi_fmul __aeabi_fcmpeq __aeabi_fcmple __aeabi_fcmplt __aeabi_fcmpun \
441+
__aeabi_dadd __aeabi_dmul __aeabi_dcmple __aeabi_dcmplt __aeabi_dcmpun \
442+
__aeabi_uldivmod
443+
endif
436444
ifneq ($(or $(CONFIG_ARM64),$(and $(CONFIG_RISCV),$(CONFIG_64BIT))),)
437445
# These intrinsics are defined for ARM64 and RISCV64
438446
redirect-intrinsics += \

0 commit comments

Comments
 (0)