Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+55 -19
+1 -1
arch/csky/kernel/probes/ftrace.c
··· 9 9 return 0; 10 10 } 11 11 12 - /* Ftrace callback handler for kprobes -- called under preepmt disabed */ 12 + /* Ftrace callback handler for kprobes -- called under preepmt disabled */ 13 13 void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip, 14 14 struct ftrace_ops *ops, struct ftrace_regs *fregs) 15 15 {
+2 -2
arch/riscv/Kconfig
··· 93 93 select PCI_MSI if PCI 94 94 select RISCV_INTC 95 95 select RISCV_TIMER if RISCV_SBI 96 - select SPARSEMEM_STATIC if 32BIT 97 96 select SPARSE_IRQ 98 97 select SYSCTL_EXCEPTION_TRACE 99 98 select THREAD_INFO_IN_TASK ··· 153 154 config ARCH_SPARSEMEM_ENABLE 154 155 def_bool y 155 156 depends on MMU 156 - select SPARSEMEM_VMEMMAP_ENABLE 157 + select SPARSEMEM_STATIC if 32BIT && SPARSMEM 158 + select SPARSEMEM_VMEMMAP_ENABLE if 64BIT 157 159 158 160 config ARCH_SELECT_MEMORY_MODEL 159 161 def_bool ARCH_SPARSEMEM_ENABLE
+2
arch/riscv/Kconfig.socs
··· 31 31 select SIFIVE_PLIC 32 32 select ARCH_HAS_RESET_CONTROLLER 33 33 select PINCTRL 34 + select COMMON_CLK 35 + select COMMON_CLK_K210 34 36 help 35 37 This enables support for Canaan Kendryte K210 SoC platform hardware. 36 38
+16
arch/riscv/include/asm/asm-prototypes.h
··· 9 9 long long __ashrti3(long long a, int b); 10 10 long long __ashlti3(long long a, int b); 11 11 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 + 12 28 #endif /* _ASM_RISCV_PROTOTYPES_H */
+2
arch/riscv/include/asm/irq.h
··· 12 12 13 13 #include <asm-generic/irq.h> 14 14 15 + extern void __init init_IRQ(void); 16 + 15 17 #endif /* _ASM_RISCV_IRQ_H */
+1
arch/riscv/include/asm/processor.h
··· 71 71 int riscv_of_parent_hartid(struct device_node *node); 72 72 73 73 extern void riscv_fill_hwcap(void); 74 + extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src); 74 75 75 76 #endif /* __ASSEMBLY__ */ 76 77
+5
arch/riscv/include/asm/ptrace.h
··· 119 119 extern unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs, 120 120 unsigned int n); 121 121 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 + 122 127 /** 123 128 * regs_get_register() - get register value from its offset 124 129 * @regs: pt_regs from which register value is gotten
+2 -2
arch/riscv/include/asm/sbi.h
··· 51 51 SBI_EXT_RFENCE_REMOTE_FENCE_I = 0, 52 52 SBI_EXT_RFENCE_REMOTE_SFENCE_VMA, 53 53 SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID, 54 - SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA, 55 54 SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA_VMID, 56 - SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA, 55 + SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA, 57 56 SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA_ASID, 57 + SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA, 58 58 }; 59 59 60 60 enum sbi_ext_hsm_fid {
+2
arch/riscv/include/asm/timex.h
··· 88 88 return 0; 89 89 } 90 90 91 + extern void time_init(void); 92 + 91 93 #endif /* _ASM_RISCV_TIMEX_H */
+1
arch/riscv/kernel/Makefile
··· 8 8 CFLAGS_REMOVE_patch.o = $(CC_FLAGS_FTRACE) 9 9 CFLAGS_REMOVE_sbi.o = $(CC_FLAGS_FTRACE) 10 10 endif 11 + CFLAGS_syscall_table.o += $(call cc-option,-Wno-override-init,) 11 12 12 13 extra-y += head.o 13 14 extra-y += vmlinux.lds
+10 -8
arch/riscv/kernel/probes/ftrace.c
··· 2 2 3 3 #include <linux/kprobes.h> 4 4 5 - /* Ftrace callback handler for kprobes -- called under preepmt disabed */ 5 + /* Ftrace callback handler for kprobes -- called under preepmt disabled */ 6 6 void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip, 7 - struct ftrace_ops *ops, struct ftrace_regs *regs) 7 + struct ftrace_ops *ops, struct ftrace_regs *fregs) 8 8 { 9 9 struct kprobe *p; 10 + struct pt_regs *regs; 10 11 struct kprobe_ctlblk *kcb; 11 12 12 13 p = get_kprobe((kprobe_opcode_t *)ip); 13 14 if (unlikely(!p) || kprobe_disabled(p)) 14 15 return; 15 16 17 + regs = ftrace_get_regs(fregs); 16 18 kcb = get_kprobe_ctlblk(); 17 19 if (kprobe_running()) { 18 20 kprobes_inc_nmissed_count(p); 19 21 } else { 20 - unsigned long orig_ip = instruction_pointer(&(regs->regs)); 22 + unsigned long orig_ip = instruction_pointer(regs); 21 23 22 - instruction_pointer_set(&(regs->regs), ip); 24 + instruction_pointer_set(regs, ip); 23 25 24 26 __this_cpu_write(current_kprobe, p); 25 27 kcb->kprobe_status = KPROBE_HIT_ACTIVE; 26 - if (!p->pre_handler || !p->pre_handler(p, &(regs->regs))) { 28 + if (!p->pre_handler || !p->pre_handler(p, regs)) { 27 29 /* 28 30 * Emulate singlestep (and also recover regs->pc) 29 31 * as if there is a nop 30 32 */ 31 - instruction_pointer_set(&(regs->regs), 33 + instruction_pointer_set(regs, 32 34 (unsigned long)p->addr + MCOUNT_INSN_SIZE); 33 35 if (unlikely(p->post_handler)) { 34 36 kcb->kprobe_status = KPROBE_HIT_SSDONE; 35 - p->post_handler(p, &(regs->regs), 0); 37 + p->post_handler(p, regs, 0); 36 38 } 37 - instruction_pointer_set(&(regs->regs), orig_ip); 39 + instruction_pointer_set(regs, orig_ip); 38 40 } 39 41 40 42 /*
+1 -2
arch/riscv/kernel/probes/kprobes.c
··· 256 256 * normal page fault. 257 257 */ 258 258 regs->epc = (unsigned long) cur->addr; 259 - if (!instruction_pointer(regs)) 260 - BUG(); 259 + BUG_ON(!instruction_pointer(regs)); 261 260 262 261 if (kcb->kprobe_status == KPROBE_REENTER) 263 262 restore_previous_kprobe(kcb);
+1
arch/riscv/kernel/process.c
··· 10 10 #include <linux/cpu.h> 11 11 #include <linux/kernel.h> 12 12 #include <linux/sched.h> 13 + #include <linux/sched/debug.h> 13 14 #include <linux/sched/task_stack.h> 14 15 #include <linux/tick.h> 15 16 #include <linux/ptrace.h>
+1 -1
arch/riscv/kernel/sbi.c
··· 116 116 EXPORT_SYMBOL(sbi_clear_ipi); 117 117 118 118 /** 119 - * sbi_set_timer_v01() - Program the timer for next timer event. 119 + * __sbi_set_timer_v01() - Program the timer for next timer event. 120 120 * @stime_value: The value after which next timer event should fire. 121 121 * 122 122 * Return: None
+2 -1
arch/riscv/kernel/setup.c
··· 147 147 bss_res.end = __pa_symbol(__bss_stop) - 1; 148 148 bss_res.flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY; 149 149 150 - mem_res_sz = (memblock.memory.cnt + memblock.reserved.cnt) * sizeof(*mem_res); 150 + /* + 1 as memblock_alloc() might increase memblock.reserved.cnt */ 151 + mem_res_sz = (memblock.memory.cnt + memblock.reserved.cnt + 1) * sizeof(*mem_res); 151 152 mem_res = memblock_alloc(mem_res_sz, SMP_CACHE_BYTES); 152 153 if (!mem_res) 153 154 panic("%s: Failed to allocate %zu bytes\n", __func__, mem_res_sz);
+1
arch/riscv/kernel/time.c
··· 9 9 #include <linux/delay.h> 10 10 #include <asm/sbi.h> 11 11 #include <asm/processor.h> 12 + #include <asm/timex.h> 12 13 13 14 unsigned long riscv_timebase; 14 15 EXPORT_SYMBOL_GPL(riscv_timebase);
+1
arch/riscv/kernel/traps.c
··· 17 17 #include <linux/module.h> 18 18 #include <linux/irq.h> 19 19 20 + #include <asm/asm-prototypes.h> 20 21 #include <asm/bug.h> 21 22 #include <asm/processor.h> 22 23 #include <asm/ptrace.h>
+3 -1
arch/riscv/mm/kasan_init.c
··· 155 155 memset(start, KASAN_SHADOW_INIT, end - start); 156 156 } 157 157 158 - void __init kasan_shallow_populate(void *start, void *end) 158 + static void __init kasan_shallow_populate(void *start, void *end) 159 159 { 160 160 unsigned long vaddr = (unsigned long)start & PAGE_MASK; 161 161 unsigned long vend = PAGE_ALIGN((unsigned long)end); ··· 187 187 } 188 188 vaddr += PAGE_SIZE; 189 189 } 190 + 191 + local_flush_tlb_all(); 190 192 } 191 193 192 194 void __init kasan_init(void)
+1 -1
arch/x86/kernel/kprobes/ftrace.c
··· 12 12 13 13 #include "common.h" 14 14 15 - /* Ftrace callback handler for kprobes -- called under preepmt disabed */ 15 + /* Ftrace callback handler for kprobes -- called under preepmt disabled */ 16 16 void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip, 17 17 struct ftrace_ops *ops, struct ftrace_regs *fregs) 18 18 {