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.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux

Pull RISC-V fixes from Palmer Dabbelt:

- A pair of XIP fixes: one to fix alternatives, and one to turn off the
rest of the features that require code modification

- A fix to a type that was causing some alternatives to break

- A build fix for BUILTIN_DTB

* tag 'riscv-for-linus-5.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
riscv: Fix BUILTIN_DTB for sifive and microchip soc
riscv: alternative: fix typo in macro name
riscv: code patching only works on !XIP_KERNEL
riscv: xip: support runtime trap patching

+36 -16
+9 -9
arch/riscv/Kconfig
··· 61 61 select GENERIC_TIME_VSYSCALL if MMU && 64BIT 62 62 select HANDLE_DOMAIN_IRQ 63 63 select HAVE_ARCH_AUDITSYSCALL 64 - select HAVE_ARCH_JUMP_LABEL 65 - select HAVE_ARCH_JUMP_LABEL_RELATIVE 64 + select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL 65 + select HAVE_ARCH_JUMP_LABEL_RELATIVE if !XIP_KERNEL 66 66 select HAVE_ARCH_KASAN if MMU && 64BIT 67 67 select HAVE_ARCH_KASAN_VMALLOC if MMU && 64BIT 68 - select HAVE_ARCH_KGDB 68 + select HAVE_ARCH_KGDB if !XIP_KERNEL 69 69 select HAVE_ARCH_KGDB_QXFER_PKT 70 70 select HAVE_ARCH_MMAP_RND_BITS if MMU 71 71 select HAVE_ARCH_SECCOMP_FILTER ··· 80 80 select HAVE_GCC_PLUGINS 81 81 select HAVE_GENERIC_VDSO if MMU && 64BIT 82 82 select HAVE_IRQ_TIME_ACCOUNTING 83 - select HAVE_KPROBES 84 - select HAVE_KPROBES_ON_FTRACE 85 - select HAVE_KRETPROBES 83 + select HAVE_KPROBES if !XIP_KERNEL 84 + select HAVE_KPROBES_ON_FTRACE if !XIP_KERNEL 85 + select HAVE_KRETPROBES if !XIP_KERNEL 86 86 select HAVE_PCI 87 87 select HAVE_PERF_EVENTS 88 88 select HAVE_PERF_REGS ··· 231 231 bool "RV64I" 232 232 select 64BIT 233 233 select ARCH_SUPPORTS_INT128 if CC_HAS_INT128 && GCC_VERSION >= 50000 234 - select HAVE_DYNAMIC_FTRACE if MMU && $(cc-option,-fpatchable-function-entry=8) 234 + select HAVE_DYNAMIC_FTRACE if !XIP_KERNEL && MMU && $(cc-option,-fpatchable-function-entry=8) 235 235 select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE 236 - select HAVE_FTRACE_MCOUNT_RECORD 236 + select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL 237 237 select HAVE_FUNCTION_GRAPH_TRACER 238 - select HAVE_FUNCTION_TRACER 238 + select HAVE_FUNCTION_TRACER if !XIP_KERNEL 239 239 select SWIOTLB if MMU 240 240 241 241 endchoice
+1
arch/riscv/boot/dts/microchip/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 dtb-$(CONFIG_SOC_MICROCHIP_POLARFIRE) += microchip-mpfs-icicle-kit.dtb 3 + obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y))
+1
arch/riscv/boot/dts/sifive/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 dtb-$(CONFIG_SOC_SIFIVE) += hifive-unleashed-a00.dtb \ 3 3 hifive-unmatched-a00.dtb 4 + obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y))
+2 -2
arch/riscv/include/asm/alternative-macros.h
··· 51 51 REG_ASM " " newlen "\n" \ 52 52 ".word " errata_id "\n" 53 53 54 - #define ALT_NEW_CONSTENT(vendor_id, errata_id, enable, new_c) \ 54 + #define ALT_NEW_CONTENT(vendor_id, errata_id, enable, new_c) \ 55 55 ".if " __stringify(enable) " == 1\n" \ 56 56 ".pushsection .alternative, \"a\"\n" \ 57 57 ALT_ENTRY("886b", "888f", __stringify(vendor_id), __stringify(errata_id), "889f - 888f") \ ··· 69 69 "886 :\n" \ 70 70 old_c "\n" \ 71 71 "887 :\n" \ 72 - ALT_NEW_CONSTENT(vendor_id, errata_id, enable, new_c) 72 + ALT_NEW_CONTENT(vendor_id, errata_id, enable, new_c) 73 73 74 74 #define _ALTERNATIVE_CFG(old_c, new_c, vendor_id, errata_id, CONFIG_k) \ 75 75 __ALTERNATIVE_CFG(old_c, new_c, vendor_id, errata_id, IS_ENABLED(CONFIG_k))
+9 -4
arch/riscv/kernel/traps.c
··· 86 86 } 87 87 } 88 88 89 + #if defined (CONFIG_XIP_KERNEL) && defined (CONFIG_RISCV_ERRATA_ALTERNATIVE) 90 + #define __trap_section __section(".xip.traps") 91 + #else 92 + #define __trap_section 93 + #endif 89 94 #define DO_ERROR_INFO(name, signo, code, str) \ 90 - asmlinkage __visible void name(struct pt_regs *regs) \ 95 + asmlinkage __visible __trap_section void name(struct pt_regs *regs) \ 91 96 { \ 92 97 do_trap_error(regs, signo, code, regs->epc, "Oops - " str); \ 93 98 } ··· 116 111 int handle_misaligned_load(struct pt_regs *regs); 117 112 int handle_misaligned_store(struct pt_regs *regs); 118 113 119 - asmlinkage void do_trap_load_misaligned(struct pt_regs *regs) 114 + asmlinkage void __trap_section do_trap_load_misaligned(struct pt_regs *regs) 120 115 { 121 116 if (!handle_misaligned_load(regs)) 122 117 return; ··· 124 119 "Oops - load address misaligned"); 125 120 } 126 121 127 - asmlinkage void do_trap_store_misaligned(struct pt_regs *regs) 122 + asmlinkage void __trap_section do_trap_store_misaligned(struct pt_regs *regs) 128 123 { 129 124 if (!handle_misaligned_store(regs)) 130 125 return; ··· 151 146 return GET_INSN_LENGTH(insn); 152 147 } 153 148 154 - asmlinkage __visible void do_trap_break(struct pt_regs *regs) 149 + asmlinkage __visible __trap_section void do_trap_break(struct pt_regs *regs) 155 150 { 156 151 #ifdef CONFIG_KPROBES 157 152 if (kprobe_single_step_handler(regs))
+14 -1
arch/riscv/kernel/vmlinux-xip.lds.S
··· 99 99 } 100 100 PERCPU_SECTION(L1_CACHE_BYTES) 101 101 102 - . = ALIGN(PAGE_SIZE); 102 + . = ALIGN(8); 103 + .alternative : { 104 + __alt_start = .; 105 + *(.alternative) 106 + __alt_end = .; 107 + } 103 108 __init_end = .; 104 109 110 + . = ALIGN(16); 111 + .xip.traps : { 112 + __xip_traps_start = .; 113 + *(.xip.traps) 114 + __xip_traps_end = .; 115 + } 116 + 117 + . = ALIGN(PAGE_SIZE); 105 118 .sdata : { 106 119 __global_pointer$ = . + 0x800; 107 120 *(.sdata*)