Skip to content

Commit 283f13d

Browse files
committed
Merge tag 'riscv-for-linus-6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux
Pull RISC-V fixes from Palmer Dabbelt: - A fix for a build warning in the jump_label code - One of the git://github -> https://github cleanups, for the SiFive drivers - A fix for the kasan initialization code, this still likely warrants some cleanups but that's a bigger problem and at least this fixes the crashes in the short term - A pair of fixes for extension support detection on mixed LLVM/GNU toolchains - A fix for a runtime warning in the /proc/cpuinfo code * tag 'riscv-for-linus-6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: RISC-V: Fix /proc/cpuinfo cpumask warning riscv: fix detection of toolchain Zihintpause support riscv: fix detection of toolchain Zicbom support riscv: mm: add missing memcpy in kasan_init MAINTAINERS: git://github.com -> https://github.com for sifive riscv: jump_label: mark arguments as const to satisfy asm constraints
2 parents 13f05fb + d14e99b commit 283f13d

File tree

7 files changed

+30
-15
lines changed

7 files changed

+30
-15
lines changed

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18787,7 +18787,7 @@ M: Palmer Dabbelt <[email protected]>
1878718787
M: Paul Walmsley <[email protected]>
1878818788
1878918789
S: Supported
18790-
T: git git://github.com/sifive/riscv-linux.git
18790+
T: git https://github.com/sifive/riscv-linux.git
1879118791
N: sifive
1879218792
K: [^@]sifive
1879318793

arch/riscv/Kconfig

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -411,14 +411,16 @@ config RISCV_ISA_SVPBMT
411411

412412
If you don't know what to do here, say Y.
413413

414-
config CC_HAS_ZICBOM
414+
config TOOLCHAIN_HAS_ZICBOM
415415
bool
416-
default y if 64BIT && $(cc-option,-mabi=lp64 -march=rv64ima_zicbom)
417-
default y if 32BIT && $(cc-option,-mabi=ilp32 -march=rv32ima_zicbom)
416+
default y
417+
depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zicbom)
418+
depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zicbom)
419+
depends on LLD_VERSION >= 150000 || LD_VERSION >= 23800
418420

419421
config RISCV_ISA_ZICBOM
420422
bool "Zicbom extension support for non-coherent DMA operation"
421-
depends on CC_HAS_ZICBOM
423+
depends on TOOLCHAIN_HAS_ZICBOM
422424
depends on !XIP_KERNEL && MMU
423425
select RISCV_DMA_NONCOHERENT
424426
select RISCV_ALTERNATIVE
@@ -433,6 +435,13 @@ config RISCV_ISA_ZICBOM
433435

434436
If you don't know what to do here, say Y.
435437

438+
config TOOLCHAIN_HAS_ZIHINTPAUSE
439+
bool
440+
default y
441+
depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zihintpause)
442+
depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zihintpause)
443+
depends on LLD_VERSION >= 150000 || LD_VERSION >= 23600
444+
436445
config FPU
437446
bool "FPU support"
438447
default y

arch/riscv/Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,10 @@ toolchain-need-zicsr-zifencei := $(call cc-option-yn, -march=$(riscv-march-y)_zi
5959
riscv-march-$(toolchain-need-zicsr-zifencei) := $(riscv-march-y)_zicsr_zifencei
6060

6161
# Check if the toolchain supports Zicbom extension
62-
toolchain-supports-zicbom := $(call cc-option-yn, -march=$(riscv-march-y)_zicbom)
63-
riscv-march-$(toolchain-supports-zicbom) := $(riscv-march-y)_zicbom
62+
riscv-march-$(CONFIG_TOOLCHAIN_HAS_ZICBOM) := $(riscv-march-y)_zicbom
6463

6564
# Check if the toolchain supports Zihintpause extension
66-
toolchain-supports-zihintpause := $(call cc-option-yn, -march=$(riscv-march-y)_zihintpause)
67-
riscv-march-$(toolchain-supports-zihintpause) := $(riscv-march-y)_zihintpause
65+
riscv-march-$(CONFIG_TOOLCHAIN_HAS_ZIHINTPAUSE) := $(riscv-march-y)_zihintpause
6866

6967
KBUILD_CFLAGS += -march=$(subst fd,,$(riscv-march-y))
7068
KBUILD_AFLAGS += -march=$(riscv-march-y)

arch/riscv/include/asm/jump_label.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
#define JUMP_LABEL_NOP_SIZE 4
1616

17-
static __always_inline bool arch_static_branch(struct static_key *key,
18-
bool branch)
17+
static __always_inline bool arch_static_branch(struct static_key * const key,
18+
const bool branch)
1919
{
2020
asm_volatile_goto(
2121
" .option push \n\t"
@@ -35,8 +35,8 @@ static __always_inline bool arch_static_branch(struct static_key *key,
3535
return true;
3636
}
3737

38-
static __always_inline bool arch_static_branch_jump(struct static_key *key,
39-
bool branch)
38+
static __always_inline bool arch_static_branch_jump(struct static_key * const key,
39+
const bool branch)
4040
{
4141
asm_volatile_goto(
4242
" .option push \n\t"

arch/riscv/include/asm/vdso/processor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ static inline void cpu_relax(void)
2121
* Reduce instruction retirement.
2222
* This assumes the PC changes.
2323
*/
24-
#ifdef __riscv_zihintpause
24+
#ifdef CONFIG_TOOLCHAIN_HAS_ZIHINTPAUSE
2525
__asm__ __volatile__ ("pause");
2626
#else
2727
/* Encoding of the pause instruction */

arch/riscv/kernel/cpu.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,9 @@ static void print_mmu(struct seq_file *f)
213213

214214
static void *c_start(struct seq_file *m, loff_t *pos)
215215
{
216+
if (*pos == nr_cpu_ids)
217+
return NULL;
218+
216219
*pos = cpumask_next(*pos - 1, cpu_online_mask);
217220
if ((*pos) < nr_cpu_ids)
218221
return (void *)(uintptr_t)(1 + *pos);

arch/riscv/mm/kasan_init.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ static void __init kasan_populate_pud(pgd_t *pgd,
113113
base_pud = pt_ops.get_pud_virt(pfn_to_phys(_pgd_pfn(*pgd)));
114114
} else if (pgd_none(*pgd)) {
115115
base_pud = memblock_alloc(PTRS_PER_PUD * sizeof(pud_t), PAGE_SIZE);
116+
memcpy(base_pud, (void *)kasan_early_shadow_pud,
117+
sizeof(pud_t) * PTRS_PER_PUD);
116118
} else {
117119
base_pud = (pud_t *)pgd_page_vaddr(*pgd);
118120
if (base_pud == lm_alias(kasan_early_shadow_pud)) {
@@ -173,8 +175,11 @@ static void __init kasan_populate_p4d(pgd_t *pgd,
173175
base_p4d = pt_ops.get_p4d_virt(pfn_to_phys(_pgd_pfn(*pgd)));
174176
} else {
175177
base_p4d = (p4d_t *)pgd_page_vaddr(*pgd);
176-
if (base_p4d == lm_alias(kasan_early_shadow_p4d))
178+
if (base_p4d == lm_alias(kasan_early_shadow_p4d)) {
177179
base_p4d = memblock_alloc(PTRS_PER_PUD * sizeof(p4d_t), PAGE_SIZE);
180+
memcpy(base_p4d, (void *)kasan_early_shadow_p4d,
181+
sizeof(p4d_t) * PTRS_PER_P4D);
182+
}
178183
}
179184

180185
p4dp = base_p4d + p4d_index(vaddr);

0 commit comments

Comments
 (0)