Skip to content

Commit 755bc13

Browse files
committed
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
2 parents 0fa2789 + b0d7f5f commit 755bc13

12 files changed

Lines changed: 26 additions & 35 deletions

File tree

arch/riscv/boot/Makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,7 @@ $(obj)/xipImage: vmlinux FORCE
3131

3232
endif
3333

34-
ifdef CONFIG_RELOCATABLE
35-
$(obj)/Image: vmlinux.unstripped FORCE
36-
else
3734
$(obj)/Image: vmlinux FORCE
38-
endif
3935
$(call if_changed,objcopy)
4036

4137
$(obj)/Image.gz: $(obj)/Image FORCE

arch/riscv/configs/nommu_k210_defconfig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ CONFIG_DEVTMPFS_MOUNT=y
5555
# CONFIG_HW_RANDOM is not set
5656
# CONFIG_DEVMEM is not set
5757
CONFIG_I2C=y
58-
# CONFIG_I2C_COMPAT is not set
5958
CONFIG_I2C_CHARDEV=y
6059
# CONFIG_I2C_HELPER_AUTO is not set
6160
CONFIG_I2C_DESIGNWARE_CORE=y
@@ -89,7 +88,6 @@ CONFIG_PRINTK_TIME=y
8988
# CONFIG_FRAME_POINTER is not set
9089
# CONFIG_DEBUG_MISC is not set
9190
CONFIG_PANIC_ON_OOPS=y
92-
# CONFIG_SCHED_DEBUG is not set
9391
# CONFIG_RCU_TRACE is not set
9492
# CONFIG_FTRACE is not set
9593
# CONFIG_RUNTIME_TESTING_MENU is not set

arch/riscv/configs/nommu_k210_sdcard_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ CONFIG_PRINTK_TIME=y
8686
# CONFIG_FRAME_POINTER is not set
8787
# CONFIG_DEBUG_MISC is not set
8888
CONFIG_PANIC_ON_OOPS=y
89-
# CONFIG_SCHED_DEBUG is not set
9089
# CONFIG_RCU_TRACE is not set
9190
# CONFIG_FTRACE is not set
9291
# CONFIG_RUNTIME_TESTING_MENU is not set

arch/riscv/configs/nommu_virt_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ CONFIG_EXT2_FS=y
6666
# CONFIG_MISC_FILESYSTEMS is not set
6767
CONFIG_LSM="[]"
6868
CONFIG_PRINTK_TIME=y
69-
# CONFIG_SCHED_DEBUG is not set
7069
# CONFIG_RCU_TRACE is not set
7170
# CONFIG_FTRACE is not set
7271
# CONFIG_RUNTIME_TESTING_MENU is not set

arch/riscv/include/asm/bitops.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#endif /* _LINUX_BITOPS_H */
1212

1313
#include <linux/compiler.h>
14-
#include <linux/irqflags.h>
1514
#include <asm/barrier.h>
1615
#include <asm/bitsperlong.h>
1716

arch/riscv/include/asm/pgtable.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,6 @@
124124
#ifdef CONFIG_64BIT
125125
#include <asm/pgtable-64.h>
126126

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-
131127
#define MMAP_VA_BITS_64 ((VA_BITS >= VA_BITS_SV48) ? VA_BITS_SV48 : VA_BITS)
132128
#define MMAP_MIN_VA_BITS_64 (VA_BITS_SV39)
133129
#define MMAP_VA_BITS (is_compat_task() ? VA_BITS_SV32 : MMAP_VA_BITS_64)

arch/riscv/kernel/Makefile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@
33
# Makefile for the RISC-V Linux kernel
44
#
55

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
126
CFLAGS_syscall_table.o += $(call cc-disable-warning, override-init)
137
CFLAGS_compat_syscall_table.o += $(call cc-disable-warning, override-init)
148

@@ -24,7 +18,6 @@ CFLAGS_sbi_ecall.o := -mcmodel=medany
2418
ifdef CONFIG_FTRACE
2519
CFLAGS_REMOVE_alternative.o = $(CC_FLAGS_FTRACE)
2620
CFLAGS_REMOVE_cpufeature.o = $(CC_FLAGS_FTRACE)
27-
CFLAGS_REMOVE_sbi_ecall.o = $(CC_FLAGS_FTRACE)
2821
endif
2922
ifdef CONFIG_RELOCATABLE
3023
CFLAGS_alternative.o += -fno-pie
@@ -43,6 +36,14 @@ CFLAGS_sbi_ecall.o += -D__NO_FORTIFY
4336
endif
4437
endif
4538

39+
ifdef CONFIG_FTRACE
40+
CFLAGS_REMOVE_ftrace.o = $(CC_FLAGS_FTRACE)
41+
CFLAGS_REMOVE_patch.o = $(CC_FLAGS_FTRACE)
42+
CFLAGS_REMOVE_sbi.o = $(CC_FLAGS_FTRACE)
43+
CFLAGS_REMOVE_return_address.o = $(CC_FLAGS_FTRACE)
44+
CFLAGS_REMOVE_sbi_ecall.o = $(CC_FLAGS_FTRACE)
45+
endif
46+
4647
always-$(KBUILD_BUILTIN) += vmlinux.lds
4748

4849
obj-y += head.o

arch/riscv/kernel/cpu_ops_sbi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ static void sbi_cpu_stop(void)
8585
int ret;
8686

8787
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);
8989
}
9090

9191
static int sbi_cpu_is_stopped(unsigned int cpuid)

arch/riscv/kernel/cpufeature.c

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -301,23 +301,22 @@ static const unsigned int riscv_a_exts[] = {
301301
RISCV_ISA_EXT_ZALRSC,
302302
};
303303

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+
304312
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,
310314
RISCV_ISA_EXT_ZKR,
311-
RISCV_ISA_EXT_ZKT,
315+
RISCV_ISA_EXT_ZKT
312316
};
313317

314318
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
321320
};
322321

323322
static const unsigned int riscv_zks_bundled_exts[] = {

arch/riscv/kernel/kexec_image.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ static int image_probe(const char *kernel_buf, unsigned long kernel_len)
2222
if (!h || kernel_len < sizeof(*h))
2323
return -EINVAL;
2424

25-
/* According to Documentation/riscv/boot-image-header.rst,
25+
/* According to Documentation/arch/riscv/boot-image-header.rst,
2626
* use "magic2" field to check when version >= 0.2.
2727
*/
2828

0 commit comments

Comments
 (0)