Skip to content

Commit 812da4d

Browse files
committed
Merge tag 'riscv-for-linus-5.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux
Pull RISC-V fixes from Palmer Dabbelt: "A handful of fixes for 5.12: - fix the SBI remote fence numbers for hypervisor fences, which had been transcribed in the wrong order in Linux. These fences are only used with the KVM patches applied. - fix a whole host of build warnings, these should have no functional change. - fix init_resources() to prevent an off-by-one error from causing an out-of-bounds array reference. This was manifesting during boot on vexriscv. - ensure the KASAN mappings are visible before proceeding to use them" * tag 'riscv-for-linus-5.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: Correct SPARSEMEM configuration RISC-V: kasan: Declare kasan_shallow_populate() static riscv: Ensure page table writes are flushed when initializing KASAN vmalloc RISC-V: Fix out-of-bounds accesses in init_resources() riscv: Fix compilation error with Canaan SoC ftrace: Fix spelling mistake "disabed" -> "disabled" riscv: fix bugon.cocci warnings riscv: process: Fix no prototype for arch_dup_task_struct riscv: ftrace: Use ftrace_get_regs helper riscv: process: Fix no prototype for show_regs riscv: syscall_table: Reduce W=1 compilation warnings noise riscv: time: Fix no prototype for time_init riscv: ptrace: Fix no prototype warnings riscv: sbi: Fix comment of __sbi_set_timer_v01 riscv: irq: Fix no prototype warning riscv: traps: Fix no prototype warnings RISC-V: correct enum sbi_ext_rfence_fid
2 parents bfdc4aa + a5406a7 commit 812da4d

File tree

19 files changed

+55
-19
lines changed

19 files changed

+55
-19
lines changed

arch/csky/kernel/probes/ftrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ int arch_check_ftrace_location(struct kprobe *p)
99
return 0;
1010
}
1111

12-
/* Ftrace callback handler for kprobes -- called under preepmt disabed */
12+
/* Ftrace callback handler for kprobes -- called under preepmt disabled */
1313
void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip,
1414
struct ftrace_ops *ops, struct ftrace_regs *fregs)
1515
{

arch/riscv/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ config RISCV
9393
select PCI_MSI if PCI
9494
select RISCV_INTC
9595
select RISCV_TIMER if RISCV_SBI
96-
select SPARSEMEM_STATIC if 32BIT
9796
select SPARSE_IRQ
9897
select SYSCTL_EXCEPTION_TRACE
9998
select THREAD_INFO_IN_TASK
@@ -154,7 +153,8 @@ config ARCH_FLATMEM_ENABLE
154153
config ARCH_SPARSEMEM_ENABLE
155154
def_bool y
156155
depends on MMU
157-
select SPARSEMEM_VMEMMAP_ENABLE
156+
select SPARSEMEM_STATIC if 32BIT && SPARSMEM
157+
select SPARSEMEM_VMEMMAP_ENABLE if 64BIT
158158

159159
config ARCH_SELECT_MEMORY_MODEL
160160
def_bool ARCH_SPARSEMEM_ENABLE

arch/riscv/Kconfig.socs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ config SOC_CANAAN
3131
select SIFIVE_PLIC
3232
select ARCH_HAS_RESET_CONTROLLER
3333
select PINCTRL
34+
select COMMON_CLK
35+
select COMMON_CLK_K210
3436
help
3537
This enables support for Canaan Kendryte K210 SoC platform hardware.
3638

arch/riscv/include/asm/asm-prototypes.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,20 @@ long long __lshrti3(long long a, int b);
99
long long __ashrti3(long long a, int b);
1010
long long __ashlti3(long long a, int b);
1111

12+
13+
#define DECLARE_DO_ERROR_INFO(name) asmlinkage void name(struct pt_regs *regs)
14+
15+
DECLARE_DO_ERROR_INFO(do_trap_unknown);
16+
DECLARE_DO_ERROR_INFO(do_trap_insn_misaligned);
17+
DECLARE_DO_ERROR_INFO(do_trap_insn_fault);
18+
DECLARE_DO_ERROR_INFO(do_trap_insn_illegal);
19+
DECLARE_DO_ERROR_INFO(do_trap_load_fault);
20+
DECLARE_DO_ERROR_INFO(do_trap_load_misaligned);
21+
DECLARE_DO_ERROR_INFO(do_trap_store_misaligned);
22+
DECLARE_DO_ERROR_INFO(do_trap_store_fault);
23+
DECLARE_DO_ERROR_INFO(do_trap_ecall_u);
24+
DECLARE_DO_ERROR_INFO(do_trap_ecall_s);
25+
DECLARE_DO_ERROR_INFO(do_trap_ecall_m);
26+
DECLARE_DO_ERROR_INFO(do_trap_break);
27+
1228
#endif /* _ASM_RISCV_PROTOTYPES_H */

arch/riscv/include/asm/irq.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@
1212

1313
#include <asm-generic/irq.h>
1414

15+
extern void __init init_IRQ(void);
16+
1517
#endif /* _ASM_RISCV_IRQ_H */

arch/riscv/include/asm/processor.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ int riscv_of_processor_hartid(struct device_node *node);
7171
int riscv_of_parent_hartid(struct device_node *node);
7272

7373
extern void riscv_fill_hwcap(void);
74+
extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src);
7475

7576
#endif /* __ASSEMBLY__ */
7677

arch/riscv/include/asm/ptrace.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ extern int regs_query_register_offset(const char *name);
119119
extern unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs,
120120
unsigned int n);
121121

122+
void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr,
123+
unsigned long frame_pointer);
124+
int do_syscall_trace_enter(struct pt_regs *regs);
125+
void do_syscall_trace_exit(struct pt_regs *regs);
126+
122127
/**
123128
* regs_get_register() - get register value from its offset
124129
* @regs: pt_regs from which register value is gotten

arch/riscv/include/asm/sbi.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ enum sbi_ext_rfence_fid {
5151
SBI_EXT_RFENCE_REMOTE_FENCE_I = 0,
5252
SBI_EXT_RFENCE_REMOTE_SFENCE_VMA,
5353
SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID,
54-
SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA,
5554
SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA_VMID,
56-
SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA,
55+
SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA,
5756
SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA_ASID,
57+
SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA,
5858
};
5959

6060
enum sbi_ext_hsm_fid {

arch/riscv/include/asm/timex.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,6 @@ static inline int read_current_timer(unsigned long *timer_val)
8888
return 0;
8989
}
9090

91+
extern void time_init(void);
92+
9193
#endif /* _ASM_RISCV_TIMEX_H */

arch/riscv/kernel/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ CFLAGS_REMOVE_ftrace.o = $(CC_FLAGS_FTRACE)
88
CFLAGS_REMOVE_patch.o = $(CC_FLAGS_FTRACE)
99
CFLAGS_REMOVE_sbi.o = $(CC_FLAGS_FTRACE)
1010
endif
11+
CFLAGS_syscall_table.o += $(call cc-option,-Wno-override-init,)
1112

1213
extra-y += head.o
1314
extra-y += vmlinux.lds

0 commit comments

Comments
 (0)