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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'riscv-for-linus-6.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux

Pull RISC-V fixes from Paul Walmsley:
"Notable changes include a fix to close one common microarchitectural
attack vector for out-of-order cores. Another patch exposed an
omission in my boot test coverage, which is currently missing
relocatable kernels. Otherwise, the fixes seem to be settling down for
us.

- Fix CONFIG_RELOCATABLE=y boots by building Image files from
vmlinux, rather than vmlinux.unstripped, now that the .modinfo
section is included in vmlinux.unstripped

- Prevent branch predictor poisoning microarchitectural attacks that
use the syscall index as a vector by using array_index_nospec() to
clamp the index after the bounds check (as x86 and ARM64 already
do)

- Fix a crash in test_kprobes when building with Clang

- Fix a deadlock possible when tracing is enabled for SBI ecalls

- Fix the definition of the Zk standard RISC-V ISA extension bundle,
which was missing the Zknh extension

- A few other miscellaneous non-functional cleanups, removing unused
macros, fixing an out-of-date path in code comments, resolving a
compile-time warning for a type mismatch in a pr_crit(), and
removing an unnecessary header file inclusion"

* tag 'riscv-for-linus-6.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
riscv: trace: fix snapshot deadlock with sbi ecall
riscv: remove irqflags.h inclusion in asm/bitops.h
riscv: cpu_ops_sbi: smp_processor_id() returns int, not unsigned int
riscv: configs: Clean up references to non-existing configs
riscv: kexec_image: Fix dead link to boot-image-header.rst
riscv: pgtable: Cleanup useless VA_USER_XXX definitions
riscv: cpufeature: Fix Zk bundled extension missing Zknh
riscv: fix KUnit test_kprobes crash when building with Clang
riscv: Sanitize syscall table indexing under speculation
riscv: boot: Always make Image from vmlinux, not vmlinux.unstripped

+26 -35
-4
arch/riscv/boot/Makefile
··· 31 31 32 32 endif 33 33 34 - ifdef CONFIG_RELOCATABLE 35 - $(obj)/Image: vmlinux.unstripped FORCE 36 - else 37 34 $(obj)/Image: vmlinux FORCE 38 - endif 39 35 $(call if_changed,objcopy) 40 36 41 37 $(obj)/Image.gz: $(obj)/Image FORCE
-2
arch/riscv/configs/nommu_k210_defconfig
··· 55 55 # CONFIG_HW_RANDOM is not set 56 56 # CONFIG_DEVMEM is not set 57 57 CONFIG_I2C=y 58 - # CONFIG_I2C_COMPAT is not set 59 58 CONFIG_I2C_CHARDEV=y 60 59 # CONFIG_I2C_HELPER_AUTO is not set 61 60 CONFIG_I2C_DESIGNWARE_CORE=y ··· 88 89 # CONFIG_FRAME_POINTER is not set 89 90 # CONFIG_DEBUG_MISC is not set 90 91 CONFIG_PANIC_ON_OOPS=y 91 - # CONFIG_SCHED_DEBUG is not set 92 92 # CONFIG_RCU_TRACE is not set 93 93 # CONFIG_FTRACE is not set 94 94 # CONFIG_RUNTIME_TESTING_MENU is not set
-1
arch/riscv/configs/nommu_k210_sdcard_defconfig
··· 86 86 # CONFIG_FRAME_POINTER is not set 87 87 # CONFIG_DEBUG_MISC is not set 88 88 CONFIG_PANIC_ON_OOPS=y 89 - # CONFIG_SCHED_DEBUG is not set 90 89 # CONFIG_RCU_TRACE is not set 91 90 # CONFIG_FTRACE is not set 92 91 # CONFIG_RUNTIME_TESTING_MENU is not set
-1
arch/riscv/configs/nommu_virt_defconfig
··· 66 66 # CONFIG_MISC_FILESYSTEMS is not set 67 67 CONFIG_LSM="[]" 68 68 CONFIG_PRINTK_TIME=y 69 - # CONFIG_SCHED_DEBUG is not set 70 69 # CONFIG_RCU_TRACE is not set 71 70 # CONFIG_FTRACE is not set 72 71 # CONFIG_RUNTIME_TESTING_MENU is not set
-1
arch/riscv/include/asm/bitops.h
··· 11 11 #endif /* _LINUX_BITOPS_H */ 12 12 13 13 #include <linux/compiler.h> 14 - #include <linux/irqflags.h> 15 14 #include <asm/barrier.h> 16 15 #include <asm/bitsperlong.h> 17 16
-4
arch/riscv/include/asm/pgtable.h
··· 124 124 #ifdef CONFIG_64BIT 125 125 #include <asm/pgtable-64.h> 126 126 127 - #define VA_USER_SV39 (UL(1) << (VA_BITS_SV39 - 1)) 128 - #define VA_USER_SV48 (UL(1) << (VA_BITS_SV48 - 1)) 129 - #define VA_USER_SV57 (UL(1) << (VA_BITS_SV57 - 1)) 130 - 131 127 #define MMAP_VA_BITS_64 ((VA_BITS >= VA_BITS_SV48) ? VA_BITS_SV48 : VA_BITS) 132 128 #define MMAP_MIN_VA_BITS_64 (VA_BITS_SV39) 133 129 #define MMAP_VA_BITS (is_compat_task() ? VA_BITS_SV32 : MMAP_VA_BITS_64)
+8 -7
arch/riscv/kernel/Makefile
··· 3 3 # Makefile for the RISC-V Linux kernel 4 4 # 5 5 6 - ifdef CONFIG_FTRACE 7 - CFLAGS_REMOVE_ftrace.o = $(CC_FLAGS_FTRACE) 8 - CFLAGS_REMOVE_patch.o = $(CC_FLAGS_FTRACE) 9 - CFLAGS_REMOVE_sbi.o = $(CC_FLAGS_FTRACE) 10 - CFLAGS_REMOVE_return_address.o = $(CC_FLAGS_FTRACE) 11 - endif 12 6 CFLAGS_syscall_table.o += $(call cc-disable-warning, override-init) 13 7 CFLAGS_compat_syscall_table.o += $(call cc-disable-warning, override-init) 14 8 ··· 18 24 ifdef CONFIG_FTRACE 19 25 CFLAGS_REMOVE_alternative.o = $(CC_FLAGS_FTRACE) 20 26 CFLAGS_REMOVE_cpufeature.o = $(CC_FLAGS_FTRACE) 21 - CFLAGS_REMOVE_sbi_ecall.o = $(CC_FLAGS_FTRACE) 22 27 endif 23 28 ifdef CONFIG_RELOCATABLE 24 29 CFLAGS_alternative.o += -fno-pie ··· 34 41 CFLAGS_cpufeature.o += -D__NO_FORTIFY 35 42 CFLAGS_sbi_ecall.o += -D__NO_FORTIFY 36 43 endif 44 + endif 45 + 46 + ifdef CONFIG_FTRACE 47 + CFLAGS_REMOVE_ftrace.o = $(CC_FLAGS_FTRACE) 48 + CFLAGS_REMOVE_patch.o = $(CC_FLAGS_FTRACE) 49 + CFLAGS_REMOVE_sbi.o = $(CC_FLAGS_FTRACE) 50 + CFLAGS_REMOVE_return_address.o = $(CC_FLAGS_FTRACE) 51 + CFLAGS_REMOVE_sbi_ecall.o = $(CC_FLAGS_FTRACE) 37 52 endif 38 53 39 54 always-$(KBUILD_BUILTIN) += vmlinux.lds
+1 -1
arch/riscv/kernel/cpu_ops_sbi.c
··· 85 85 int ret; 86 86 87 87 ret = sbi_hsm_hart_stop(); 88 - pr_crit("Unable to stop the cpu %u (%d)\n", smp_processor_id(), ret); 88 + pr_crit("Unable to stop the cpu %d (%d)\n", smp_processor_id(), ret); 89 89 } 90 90 91 91 static int sbi_cpu_is_stopped(unsigned int cpuid)
+11 -12
arch/riscv/kernel/cpufeature.c
··· 301 301 RISCV_ISA_EXT_ZALRSC, 302 302 }; 303 303 304 + #define RISCV_ISA_EXT_ZKN \ 305 + RISCV_ISA_EXT_ZBKB, \ 306 + RISCV_ISA_EXT_ZBKC, \ 307 + RISCV_ISA_EXT_ZBKX, \ 308 + RISCV_ISA_EXT_ZKND, \ 309 + RISCV_ISA_EXT_ZKNE, \ 310 + RISCV_ISA_EXT_ZKNH 311 + 304 312 static const unsigned int riscv_zk_bundled_exts[] = { 305 - RISCV_ISA_EXT_ZBKB, 306 - RISCV_ISA_EXT_ZBKC, 307 - RISCV_ISA_EXT_ZBKX, 308 - RISCV_ISA_EXT_ZKND, 309 - RISCV_ISA_EXT_ZKNE, 313 + RISCV_ISA_EXT_ZKN, 310 314 RISCV_ISA_EXT_ZKR, 311 - RISCV_ISA_EXT_ZKT, 315 + RISCV_ISA_EXT_ZKT 312 316 }; 313 317 314 318 static const unsigned int riscv_zkn_bundled_exts[] = { 315 - RISCV_ISA_EXT_ZBKB, 316 - RISCV_ISA_EXT_ZBKC, 317 - RISCV_ISA_EXT_ZBKX, 318 - RISCV_ISA_EXT_ZKND, 319 - RISCV_ISA_EXT_ZKNE, 320 - RISCV_ISA_EXT_ZKNH, 319 + RISCV_ISA_EXT_ZKN 321 320 }; 322 321 323 322 static const unsigned int riscv_zks_bundled_exts[] = {
+1 -1
arch/riscv/kernel/kexec_image.c
··· 22 22 if (!h || kernel_len < sizeof(*h)) 23 23 return -EINVAL; 24 24 25 - /* According to Documentation/riscv/boot-image-header.rst, 25 + /* According to Documentation/arch/riscv/boot-image-header.rst, 26 26 * use "magic2" field to check when version >= 0.2. 27 27 */ 28 28
+2
arch/riscv/kernel/tests/kprobes/test-kprobes-asm.S
··· 181 181 182 182 #endif /* CONFIG_RISCV_ISA_C */ 183 183 184 + .section .rodata 184 185 SYM_DATA_START(test_kprobes_addresses) 185 186 RISCV_PTR test_kprobes_add_addr1 186 187 RISCV_PTR test_kprobes_add_addr2 ··· 213 212 RISCV_PTR 0 214 213 SYM_DATA_END(test_kprobes_addresses) 215 214 215 + .section .rodata 216 216 SYM_DATA_START(test_kprobes_functions) 217 217 RISCV_PTR test_kprobes_add 218 218 RISCV_PTR test_kprobes_jal
+3 -1
arch/riscv/kernel/traps.c
··· 339 339 340 340 add_random_kstack_offset(); 341 341 342 - if (syscall >= 0 && syscall < NR_syscalls) 342 + if (syscall >= 0 && syscall < NR_syscalls) { 343 + syscall = array_index_nospec(syscall, NR_syscalls); 343 344 syscall_handler(regs, syscall); 345 + } 344 346 345 347 /* 346 348 * Ultimately, this value will get limited by KSTACK_OFFSET_MAX(),