Skip to content

Commit 1d2cc5a

Browse files
committed
Merge tag 'riscv-for-linus-5.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux
Pull RISC-V fixes from Palmer Dabbelt: "A handful of fixes. Specifically: - fix linker argument to allow linking with lld - build fix for configurations without a frame pointer - a handful of build fixes related the SBI 0.1 vs 0.2 split - remove STRICT_KERNEL_RWX for !MMU, which isn't useful" * tag 'riscv-for-linus-5.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: select ARCH_HAS_STRICT_KERNEL_RWX only if MMU riscv: sbi: Fix undefined reference to sbi_shutdown tty: riscv: Using RISCV_SBI_V01 instead of RISCV_SBI riscv: sbi: Correct sbi_shutdown() and sbi_clear_ipi() export riscv: fix vdso build with lld RISC-V: stacktrace: Declare sp_in_global outside ifdef
2 parents 6c3efdc + a5fe13c commit 1d2cc5a

File tree

6 files changed

+18
-15
lines changed

6 files changed

+18
-15
lines changed

arch/riscv/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ config RISCV
6060
select ARCH_HAS_GIGANTIC_PAGE
6161
select ARCH_HAS_SET_DIRECT_MAP
6262
select ARCH_HAS_SET_MEMORY
63-
select ARCH_HAS_STRICT_KERNEL_RWX
63+
select ARCH_HAS_STRICT_KERNEL_RWX if MMU
6464
select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
6565
select SPARSEMEM_STATIC if 32BIT
6666
select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU

arch/riscv/kernel/sbi.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ void sbi_shutdown(void)
102102
{
103103
sbi_ecall(SBI_EXT_0_1_SHUTDOWN, 0, 0, 0, 0, 0, 0, 0);
104104
}
105-
EXPORT_SYMBOL(sbi_set_timer);
105+
EXPORT_SYMBOL(sbi_shutdown);
106106

107107
/**
108108
* sbi_clear_ipi() - Clear any pending IPIs for the calling hart.
@@ -113,7 +113,7 @@ void sbi_clear_ipi(void)
113113
{
114114
sbi_ecall(SBI_EXT_0_1_CLEAR_IPI, 0, 0, 0, 0, 0, 0, 0);
115115
}
116-
EXPORT_SYMBOL(sbi_shutdown);
116+
EXPORT_SYMBOL(sbi_clear_ipi);
117117

118118
/**
119119
* sbi_set_timer_v01() - Program the timer for next timer event.
@@ -167,6 +167,11 @@ static int __sbi_rfence_v01(int fid, const unsigned long *hart_mask,
167167

168168
return result;
169169
}
170+
171+
static void sbi_set_power_off(void)
172+
{
173+
pm_power_off = sbi_shutdown;
174+
}
170175
#else
171176
static void __sbi_set_timer_v01(uint64_t stime_value)
172177
{
@@ -191,6 +196,8 @@ static int __sbi_rfence_v01(int fid, const unsigned long *hart_mask,
191196

192197
return 0;
193198
}
199+
200+
static void sbi_set_power_off(void) {}
194201
#endif /* CONFIG_RISCV_SBI_V01 */
195202

196203
static void __sbi_set_timer_v02(uint64_t stime_value)
@@ -540,16 +547,12 @@ static inline long sbi_get_firmware_version(void)
540547
return __sbi_base_ecall(SBI_EXT_BASE_GET_IMP_VERSION);
541548
}
542549

543-
static void sbi_power_off(void)
544-
{
545-
sbi_shutdown();
546-
}
547550

548551
int __init sbi_init(void)
549552
{
550553
int ret;
551554

552-
pm_power_off = sbi_power_off;
555+
sbi_set_power_off();
553556
ret = sbi_get_spec_version();
554557
if (ret > 0)
555558
sbi_spec_version = ret;

arch/riscv/kernel/stacktrace.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
#include <linux/stacktrace.h>
1313
#include <linux/ftrace.h>
1414

15+
register unsigned long sp_in_global __asm__("sp");
16+
1517
#ifdef CONFIG_FRAME_POINTER
1618

1719
struct stackframe {
1820
unsigned long fp;
1921
unsigned long ra;
2022
};
2123

22-
register unsigned long sp_in_global __asm__("sp");
23-
2424
void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
2525
bool (*fn)(unsigned long, void *), void *arg)
2626
{

arch/riscv/kernel/vdso/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ $(obj)/vdso.so.dbg: $(src)/vdso.lds $(obj-vdso) FORCE
3333
$(call if_changed,vdsold)
3434

3535
# We also create a special relocatable object that should mirror the symbol
36-
# table and layout of the linked DSO. With ld -R we can then refer to
37-
# these symbols in the kernel code rather than hand-coded addresses.
36+
# table and layout of the linked DSO. With ld --just-symbols we can then
37+
# refer to these symbols in the kernel code rather than hand-coded addresses.
3838

3939
SYSCFLAGS_vdso.so.dbg = -shared -s -Wl,-soname=linux-vdso.so.1 \
4040
-Wl,--build-id -Wl,--hash-style=both
4141
$(obj)/vdso-dummy.o: $(src)/vdso.lds $(obj)/rt_sigreturn.o FORCE
4242
$(call if_changed,vdsold)
4343

44-
LDFLAGS_vdso-syms.o := -r -R
44+
LDFLAGS_vdso-syms.o := -r --just-symbols
4545
$(obj)/vdso-syms.o: $(obj)/vdso-dummy.o FORCE
4646
$(call if_changed,ld)
4747

drivers/tty/hvc/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ config HVC_DCC
8888

8989
config HVC_RISCV_SBI
9090
bool "RISC-V SBI console support"
91-
depends on RISCV_SBI
91+
depends on RISCV_SBI_V01
9292
select HVC_DRIVER
9393
help
9494
This enables support for console output via RISC-V SBI calls, which

drivers/tty/serial/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ config SERIAL_EARLYCON_ARM_SEMIHOST
8686

8787
config SERIAL_EARLYCON_RISCV_SBI
8888
bool "Early console using RISC-V SBI"
89-
depends on RISCV_SBI
89+
depends on RISCV_SBI_V01
9090
select SERIAL_CORE
9191
select SERIAL_CORE_CONSOLE
9292
select SERIAL_EARLYCON

0 commit comments

Comments
 (0)