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

Pull RISC-V fixes from Paul Walmsley:

- Disable CFI with Rust for any platform other than x86 and ARM64

- Keep task mm_cpumasks up-to-date to avoid triggering M-mode firmware
warnings if the kernel tries to send an IPI to an offline CPU

- Improve kprobe address validation performance and avoid desyncs
(following x86)

- Avoid duplicate device probes by avoiding DT hardware probing when
ACPI is enabled in early boot

- Use the correct set of dependencies for
CONFIG_ARCH_HAS_ELF_CORE_EFLAGS, avoiding an allnoconfig warning

- Fix a few other minor issues

* tag 'riscv-for-linux-6.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
riscv: kprobes: convert one final __ASSEMBLY__ to __ASSEMBLER__
riscv: Respect dependencies of ARCH_HAS_ELF_CORE_EFLAGS
riscv: acpi: avoid errors caused by probing DT devices when ACPI is used
riscv: kprobes: Fix probe address validation
riscv: entry: fix typo in comment 'instruciton' -> 'instruction'
RISC-V: clear hot-unplugged cores from all task mm_cpumasks to avoid rfence errors
riscv: kgdb: Ensure that BUFMAX > NUMREGBYTES
rust: cfi: only 64-bit arm and x86 support CFI_CLANG

+27 -12
+1
arch/Kconfig
··· 965 965 def_bool y 966 966 depends on HAVE_CFI_ICALL_NORMALIZE_INTEGERS 967 967 depends on RUSTC_VERSION >= 107900 968 + depends on ARM64 || X86_64 968 969 # With GCOV/KASAN we need this fix: https://github.com/rust-lang/rust/pull/129373 969 970 depends on (RUSTC_LLVM_VERSION >= 190103 && RUSTC_VERSION >= 108200) || \ 970 971 (!GCOV_KERNEL && !KASAN_GENERIC && !KASAN_SW_TAGS)
+1 -1
arch/riscv/Kconfig
··· 29 29 select ARCH_HAS_DEBUG_VIRTUAL if MMU 30 30 select ARCH_HAS_DEBUG_VM_PGTABLE 31 31 select ARCH_HAS_DEBUG_WX 32 - select ARCH_HAS_ELF_CORE_EFLAGS 32 + select ARCH_HAS_ELF_CORE_EFLAGS if BINFMT_ELF && ELF_CORE 33 33 select ARCH_HAS_FAST_MULTIPLIER 34 34 select ARCH_HAS_FORTIFY_SOURCE 35 35 select ARCH_HAS_GCOV_PROFILE_ALL
+7 -2
arch/riscv/include/asm/kgdb.h
··· 3 3 #ifndef __ASM_KGDB_H_ 4 4 #define __ASM_KGDB_H_ 5 5 6 + #include <linux/build_bug.h> 7 + 6 8 #ifdef __KERNEL__ 7 9 8 10 #define GDB_SIZEOF_REG sizeof(unsigned long) 9 11 10 - #define DBG_MAX_REG_NUM (36) 11 - #define NUMREGBYTES ((DBG_MAX_REG_NUM) * GDB_SIZEOF_REG) 12 + #define DBG_MAX_REG_NUM 36 13 + #define NUMREGBYTES (DBG_MAX_REG_NUM * GDB_SIZEOF_REG) 12 14 #define CACHE_FLUSH_IS_SAFE 1 13 15 #define BUFMAX 2048 16 + static_assert(BUFMAX > NUMREGBYTES, 17 + "As per KGDB documentation, BUFMAX must be larger than NUMREGBYTES"); 14 18 #ifdef CONFIG_RISCV_ISA_C 15 19 #define BREAK_INSTR_SIZE 2 16 20 #else ··· 101 97 #define DBG_REG_STATUS_OFF 33 102 98 #define DBG_REG_BADADDR_OFF 34 103 99 #define DBG_REG_CAUSE_OFF 35 100 + /* NOTE: increase DBG_MAX_REG_NUM if you add more values here. */ 104 101 105 102 extern const char riscv_gdb_stub_feature[64]; 106 103
+1
arch/riscv/kernel/cpu-hotplug.c
··· 54 54 55 55 pr_notice("CPU%u: off\n", cpu); 56 56 57 + clear_tasks_mm_cpumask(cpu); 57 58 /* Verify from the firmware if the cpu is really stopped*/ 58 59 if (cpu_ops->cpu_is_stopped) 59 60 ret = cpu_ops->cpu_is_stopped(cpu);
+1 -1
arch/riscv/kernel/entry.S
··· 455 455 RISCV_PTR do_trap_ecall_s 456 456 RISCV_PTR do_trap_unknown 457 457 RISCV_PTR do_trap_ecall_m 458 - /* instruciton page fault */ 458 + /* instruction page fault */ 459 459 ALT_PAGE_FAULT(RISCV_PTR do_page_fault) 460 460 RISCV_PTR do_page_fault /* load page fault */ 461 461 RISCV_PTR do_trap_unknown
+9 -4
arch/riscv/kernel/probes/kprobes.c
··· 49 49 post_kprobe_handler(p, kcb, regs); 50 50 } 51 51 52 - static bool __kprobes arch_check_kprobe(struct kprobe *p) 52 + static bool __kprobes arch_check_kprobe(unsigned long addr) 53 53 { 54 - unsigned long tmp = (unsigned long)p->addr - p->offset; 55 - unsigned long addr = (unsigned long)p->addr; 54 + unsigned long tmp, offset; 55 + 56 + /* start iterating at the closest preceding symbol */ 57 + if (!kallsyms_lookup_size_offset(addr, NULL, &offset)) 58 + return false; 59 + 60 + tmp = addr - offset; 56 61 57 62 while (tmp <= addr) { 58 63 if (tmp == addr) ··· 76 71 if ((unsigned long)insn & 0x1) 77 72 return -EILSEQ; 78 73 79 - if (!arch_check_kprobe(p)) 74 + if (!arch_check_kprobe((unsigned long)p->addr)) 80 75 return -EILSEQ; 81 76 82 77 /* copy instruction */
+5 -2
arch/riscv/kernel/setup.c
··· 331 331 /* Parse the ACPI tables for possible boot-time configuration */ 332 332 acpi_boot_table_init(); 333 333 334 + if (acpi_disabled) { 334 335 #if IS_ENABLED(CONFIG_BUILTIN_DTB) 335 - unflatten_and_copy_device_tree(); 336 + unflatten_and_copy_device_tree(); 336 337 #else 337 - unflatten_device_tree(); 338 + unflatten_device_tree(); 338 339 #endif 340 + } 341 + 339 342 misc_mem_init(); 340 343 341 344 init_resources();
+2 -2
arch/riscv/kernel/tests/kprobes/test-kprobes.h
··· 11 11 #define KPROBE_TEST_MAGIC_LOWER 0x0000babe 12 12 #define KPROBE_TEST_MAGIC_UPPER 0xcafe0000 13 13 14 - #ifndef __ASSEMBLY__ 14 + #ifndef __ASSEMBLER__ 15 15 16 16 /* array of addresses to install kprobes */ 17 17 extern void *test_kprobes_addresses[]; ··· 19 19 /* array of functions that return KPROBE_TEST_MAGIC */ 20 20 extern long (*test_kprobes_functions[])(void); 21 21 22 - #endif /* __ASSEMBLY__ */ 22 + #endif /* __ASSEMBLER__ */ 23 23 24 24 #endif /* TEST_KPROBES_H */