Skip to content

Commit 5903a74

Browse files
Merge tag 'riscv-fixes-6.16-rc4' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/alexghiti/linux into fixes
riscv fixes for 6.16-rc4 - A fix for a percpu variable that may lie in the vmalloc region and on which we used __pa() - A fix to require at least clang-17 to prevent build issues with previous versions on kCFI * tag 'riscv-fixes-6.16-rc4' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/alexghiti/linux: riscv: cpu_ops_sbi: Use static array for boot_data riscv: Require clang-17 or newer for kCFI
2 parents d0b3b7b + 2b29be9 commit 5903a74

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)