Skip to content

Commit c435a4f

Browse files
committed
Merge tag 'riscv-for-linus-6.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux
Pull RISC-V fixes from Palmer Dabbelt: - kCFI is restricted to clang-17 or newer, as earlier versions have known bugs - sbi_hsm_hart_start is now staticly allocated, to avoid tripping up the SBI HSM page mapping on sparse systems. * tag 'riscv-for-linus-6.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: cpu_ops_sbi: Use static array for boot_data riscv: Require clang-17 or newer for kCFI
2 parents 4b02ed4 + 5903a74 commit c435a4f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

arch/riscv/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ config RISCV
6363
select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
6464
select ARCH_STACKWALK
6565
select ARCH_SUPPORTS_ATOMIC_RMW
66-
select ARCH_SUPPORTS_CFI_CLANG
66+
# clang >= 17: https://github.com/llvm/llvm-project/commit/62fa708ceb027713b386c7e0efda994f8bdc27e2
67+
select ARCH_SUPPORTS_CFI_CLANG if CLANG_VERSION >= 170000
6768
select ARCH_SUPPORTS_DEBUG_PAGEALLOC if MMU
6869
select ARCH_SUPPORTS_HUGE_PFNMAP if TRANSPARENT_HUGEPAGE
6970
select ARCH_SUPPORTS_HUGETLBFS if MMU

arch/riscv/kernel/cpu_ops_sbi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ const struct cpu_operations cpu_ops_sbi;
1818

1919
/*
2020
* Ordered booting via HSM brings one cpu at a time. However, cpu hotplug can
21-
* be invoked from multiple threads in parallel. Define a per cpu data
21+
* be invoked from multiple threads in parallel. Define an array of boot data
2222
* to handle that.
2323
*/
24-
static DEFINE_PER_CPU(struct sbi_hart_boot_data, boot_data);
24+
static struct sbi_hart_boot_data boot_data[NR_CPUS];
2525

2626
static int sbi_hsm_hart_start(unsigned long hartid, unsigned long saddr,
2727
unsigned long priv)
@@ -67,7 +67,7 @@ static int sbi_cpu_start(unsigned int cpuid, struct task_struct *tidle)
6767
unsigned long boot_addr = __pa_symbol(secondary_start_sbi);
6868
unsigned long hartid = cpuid_to_hartid_map(cpuid);
6969
unsigned long hsm_data;
70-
struct sbi_hart_boot_data *bdata = &per_cpu(boot_data, cpuid);
70+
struct sbi_hart_boot_data *bdata = &boot_data[cpuid];
7171

7272
/* Make sure tidle is updated */
7373
smp_mb();

0 commit comments

Comments
 (0)