Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+62 -14
+1
Documentation/rust/arch-support.rst
··· 15 15 ============= ================ ============================================== 16 16 Architecture Level of support Constraints 17 17 ============= ================ ============================================== 18 + ``arm`` Maintained ARMv7 Little Endian only. 18 19 ``arm64`` Maintained Little Endian only. 19 20 ``loongarch`` Maintained \- 20 21 ``riscv`` Maintained ``riscv64`` and LLVM/Clang only.
+2 -1
arch/arm/Kconfig
··· 121 121 select HAVE_KERNEL_XZ 122 122 select HAVE_KPROBES if !XIP_KERNEL && !CPU_ENDIAN_BE32 && !CPU_V7M 123 123 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) 125 125 select HAVE_MOD_ARCH_SPECIFIC 126 126 select HAVE_NMI 127 127 select HAVE_OPTPROBES if !THUMB2_KERNEL ··· 133 133 select MMU_GATHER_RCU_TABLE_FREE if SMP && ARM_LPAE 134 134 select HAVE_REGS_AND_STACK_ACCESS_API 135 135 select HAVE_RSEQ 136 + select HAVE_RUST if CPU_LITTLE_ENDIAN && CPU_32v7 136 137 select HAVE_STACKPROTECTOR 137 138 select HAVE_SYSCALL_TRACEPOINTS 138 139 select HAVE_UID16
+1
arch/arm/Makefile
··· 150 150 KBUILD_CPPFLAGS +=$(cpp-y) 151 151 KBUILD_CFLAGS +=$(CFLAGS_ABI) $(CFLAGS_ISA) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm 152 152 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 153 154 154 155 CHECKFLAGS += -D__arm__ 155 156
+10 -4
arch/arm/include/asm/vmlinux.lds.h
··· 19 19 #endif 20 20 21 21 #ifdef CONFIG_MMU 22 - #define ARM_MMU_KEEP(x) x 22 + #define ARM_MMU_KEEP(x) KEEP(x) 23 23 #define ARM_MMU_DISCARD(x) 24 24 #else 25 25 #define ARM_MMU_KEEP(x) ··· 32 32 */ 33 33 #ifdef CONFIG_LD_IS_LLD 34 34 #define NOCROSSREFS 35 + #endif 36 + 37 + #ifdef CONFIG_LD_CAN_USE_KEEP_IN_OVERLAY 38 + #define OVERLAY_KEEP(x) KEEP(x) 39 + #else 40 + #define OVERLAY_KEEP(x) x 35 41 #endif 36 42 37 43 /* Set start/end symbol names to the LMA for the section */ ··· 131 125 __vectors_lma = .; \ 132 126 OVERLAY 0xffff0000 : NOCROSSREFS AT(__vectors_lma) { \ 133 127 .vectors { \ 134 - *(.vectors) \ 128 + OVERLAY_KEEP(*(.vectors)) \ 135 129 } \ 136 130 .vectors.bhb.loop8 { \ 137 - *(.vectors.bhb.loop8) \ 131 + OVERLAY_KEEP(*(.vectors.bhb.loop8)) \ 138 132 } \ 139 133 .vectors.bhb.bpiall { \ 140 - *(.vectors.bhb.bpiall) \ 134 + OVERLAY_KEEP(*(.vectors.bhb.bpiall)) \ 141 135 } \ 142 136 } \ 143 137 ARM_LMA(__vectors, .vectors); \
+2 -1
arch/arm/kernel/smp.c
··· 551 551 if (!ipi_desc[i]) 552 552 continue; 553 553 554 - seq_printf(p, "%*s%u: ", prec - 1, "IPI", i); 554 + seq_printf(p, "%*s%u:%s", prec - 1, "IPI", i, 555 + prec >= 4 ? " " : ""); 555 556 556 557 for_each_online_cpu(cpu) 557 558 seq_printf(p, "%10u ", irq_desc_kstat_cpu(ipi_desc[i], cpu));
+1 -1
arch/arm/kernel/vmlinux-xip.lds.S
··· 63 63 . = ALIGN(4); 64 64 __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) { 65 65 __start___ex_table = .; 66 - ARM_MMU_KEEP(KEEP(*(__ex_table))) 66 + ARM_MMU_KEEP(*(__ex_table)) 67 67 __stop___ex_table = .; 68 68 } 69 69
+1 -1
arch/arm/kernel/vmlinux.lds.S
··· 74 74 . = ALIGN(4); 75 75 __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) { 76 76 __start___ex_table = .; 77 - ARM_MMU_KEEP(KEEP(*(__ex_table))) 77 + ARM_MMU_KEEP(*(__ex_table)) 78 78 __stop___ex_table = .; 79 79 } 80 80
+4 -5
drivers/clk/clkdev.c
··· 153 153 char con_id[MAX_CON_ID]; 154 154 }; 155 155 156 - static struct clk_lookup * __ref 156 + static __printf(3, 0) struct clk_lookup * __ref 157 157 vclkdev_alloc(struct clk_hw *hw, const char *con_id, const char *dev_fmt, 158 158 va_list ap) 159 159 { ··· 215 215 return &cla->cl; 216 216 } 217 217 218 - static struct clk_lookup * 218 + static __printf(3, 0) struct clk_lookup * 219 219 vclkdev_create(struct clk_hw *hw, const char *con_id, const char *dev_fmt, 220 220 va_list ap) 221 221 { ··· 303 303 } 304 304 EXPORT_SYMBOL(clkdev_drop); 305 305 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, ...) 309 308 { 310 309 struct clk_lookup *cl; 311 310 va_list ap;
+5
init/Kconfig
··· 132 132 config CC_HAS_MULTIDIMENSIONAL_NONSTRING 133 133 def_bool $(success,echo 'char tag[][4] __attribute__((__nonstring__)) = { };' | $(CC) $(CLANG_FLAGS) -x c - -c -o /dev/null -Werror) 134 134 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 + 135 140 config RUSTC_HAS_COERCE_POINTEE 136 141 def_bool RUSTC_VERSION >= 108400 137 142
+8
rust/Makefile
··· 275 275 # Derived from `scripts/Makefile.clang`. 276 276 BINDGEN_TARGET_x86 := x86_64-linux-gnu 277 277 BINDGEN_TARGET_arm64 := aarch64-linux-gnu 278 + BINDGEN_TARGET_arm := arm-linux-gnueabi 278 279 BINDGEN_TARGET_loongarch := loongarch64-linux-gnusf 279 280 BINDGEN_TARGET_um := $(BINDGEN_TARGET_$(SUBARCH)) 280 281 BINDGEN_TARGET := $(BINDGEN_TARGET_$(SRCARCH)) ··· 434 433 __muloti4 __multi3 \ 435 434 __udivmodti4 __udivti3 __umodti3 436 435 436 + ifdef CONFIG_ARM 437 + # Add eabi initrinsics for ARM 32-bit 438 + redirect-intrinsics += \ 439 + __aeabi_fadd __aeabi_fmul __aeabi_fcmpeq __aeabi_fcmple __aeabi_fcmplt __aeabi_fcmpun \ 440 + __aeabi_dadd __aeabi_dmul __aeabi_dcmple __aeabi_dcmplt __aeabi_dcmpun \ 441 + __aeabi_uldivmod 442 + endif 437 443 ifneq ($(or $(CONFIG_ARM64),$(and $(CONFIG_RISCV),$(CONFIG_64BIT))),) 438 444 # These intrinsics are defined for ARM64 and RISCV64 439 445 redirect-intrinsics += \
+24
rust/compiler_builtins.rs
··· 73 73 __umodti3, 74 74 }); 75 75 76 + #[cfg(target_arch = "arm")] 77 + define_panicking_intrinsics!("`f32` should not be used", { 78 + __aeabi_fadd, 79 + __aeabi_fmul, 80 + __aeabi_fcmpeq, 81 + __aeabi_fcmple, 82 + __aeabi_fcmplt, 83 + __aeabi_fcmpun, 84 + }); 85 + 86 + #[cfg(target_arch = "arm")] 87 + define_panicking_intrinsics!("`f64` should not be used", { 88 + __aeabi_dadd, 89 + __aeabi_dmul, 90 + __aeabi_dcmple, 91 + __aeabi_dcmplt, 92 + __aeabi_dcmpun, 93 + }); 94 + 95 + #[cfg(target_arch = "arm")] 96 + define_panicking_intrinsics!("`u64` division/modulo should not be used", { 97 + __aeabi_uldivmod, 98 + }); 99 + 76 100 // NOTE: if you are adding a new intrinsic here, you should also add it to 77 101 // `redirect-intrinsics` in `rust/Makefile`.
+3 -1
scripts/generate_rust_target.rs
··· 184 184 let mut ts = TargetSpec::new(); 185 185 186 186 // `llvm-target`s are taken from `scripts/Makefile.clang`. 187 - if cfg.has("ARM64") { 187 + if cfg.has("ARM") { 188 + panic!("arm uses the builtin rustc target"); 189 + } else if cfg.has("ARM64") { 188 190 panic!("arm64 uses the builtin rustc aarch64-unknown-none target"); 189 191 } else if cfg.has("RISCV") { 190 192 if cfg.has("64BIT") {