RISC-V Fixes for 6.15-rc6

* 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.
 -----BEGIN PGP SIGNATURE-----
 
 iQJNBAABCAA3FiEEKzw3R0RoQ7JKlDp6LhMZ81+7GIkFAmhn9noZHHBhbG1lcmRh
 YmJlbHRAZ29vZ2xlLmNvbQAKCRAuExnzX7sYiU0tD/0QC2u5+AWn1ssYTCb6CM3e
 5Py55NuuB8N+WthZiUYS4KPSftdWNIPqarRJZDQaL7Vdemep4m2SglqTqiUc+G4V
 35LuU70jweKrYsx3DzrhLfuESg7hLHB4CkywMUgHSSLUcYWSVy7KpplTqZgOYH0P
 Ah0ThtLGZViTBrXn0kQIIKVKP//7s7F9++X5uUHXoFjv4p6LtpIPjSc59SGzayTu
 iPeUiQw5Az1SN1nbMfa7KiDnF0h/Wgps7B4FbX08DR84ivaevpLLmc+DBeUzeYPs
 CeSGINBth5Iju6yHibcNzo5oBQNLEmnyu+Sqm8HU1EmhOgLtPu4GuRTfF7kz0w3/
 TQtT+CXIm00E/AvSI0z+3AVtPog9dTCzFBz8d9NG2Hc6Qa9mqJqO3a1h5c696VpF
 t0iBXUrAaFswdOnUF7k/Wov5sAqFKdOn3jaFZAA/n+lGiPvf42igQrNgSNCijF+2
 zqqK7NiX3h/ofTujjcsNJUTMWWkzQmPTTrqWx73uJ1JR+RynDLAv52n31CLvmjNT
 7xrC4RSjI1vcfEHKwom2agz8N097LcXHQqlx/C+dd+GdR5fwLUErqvIwQLuDGIvu
 MS+1I22Ht0/2crOdOBIl4NRzz138MavE7opllzkYt2FxmjQ+TGxU5/8uj1D6R2hb
 wAeonGICYDFjikP7qhvqEA==
 =KCl+
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2025-07-04 10:23:29 -07:00
commit c435a4f487
2 changed files with 5 additions and 4 deletions

View File

@ -63,7 +63,8 @@ config RISCV
select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
select ARCH_STACKWALK
select ARCH_SUPPORTS_ATOMIC_RMW
select ARCH_SUPPORTS_CFI_CLANG
# clang >= 17: https://github.com/llvm/llvm-project/commit/62fa708ceb027713b386c7e0efda994f8bdc27e2
select ARCH_SUPPORTS_CFI_CLANG if CLANG_VERSION >= 170000
select ARCH_SUPPORTS_DEBUG_PAGEALLOC if MMU
select ARCH_SUPPORTS_HUGE_PFNMAP if TRANSPARENT_HUGEPAGE
select ARCH_SUPPORTS_HUGETLBFS if MMU

View File

@ -18,10 +18,10 @@ const struct cpu_operations cpu_ops_sbi;
/*
* Ordered booting via HSM brings one cpu at a time. However, cpu hotplug can
* be invoked from multiple threads in parallel. Define a per cpu data
* be invoked from multiple threads in parallel. Define an array of boot data
* to handle that.
*/
static DEFINE_PER_CPU(struct sbi_hart_boot_data, boot_data);
static struct sbi_hart_boot_data boot_data[NR_CPUS];
static int sbi_hsm_hart_start(unsigned long hartid, unsigned long saddr,
unsigned long priv)
@ -67,7 +67,7 @@ static int sbi_cpu_start(unsigned int cpuid, struct task_struct *tidle)
unsigned long boot_addr = __pa_symbol(secondary_start_sbi);
unsigned long hartid = cpuid_to_hartid_map(cpuid);
unsigned long hsm_data;
struct sbi_hart_boot_data *bdata = &per_cpu(boot_data, cpuid);
struct sbi_hart_boot_data *bdata = &boot_data[cpuid];
/* Make sure tidle is updated */
smp_mb();