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

Pull RISC-V fixes from Palmer Dabbelt:

- A fix for a missing icache flush in uprobes, which manifests as at
least a BFF selftest failure on the Spacemit X1

- A workaround for build warnings in flush_icache_range()

* tag 'riscv-for-linus-6.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
riscv: uprobes: Add missing fence.i after building the XOL buffer
riscv: Replace function-like macro by static inline function

+12 -13
+10 -5
arch/riscv/include/asm/cacheflush.h
··· 34 34 flush_dcache_folio(page_folio(page)); 35 35 } 36 36 37 - /* 38 - * RISC-V doesn't have an instruction to flush parts of the instruction cache, 39 - * so instead we just flush the whole thing. 40 - */ 41 - #define flush_icache_range(start, end) flush_icache_all() 42 37 #define flush_icache_user_page(vma, pg, addr, len) \ 43 38 do { \ 44 39 if (vma->vm_flags & VM_EXEC) \ ··· 72 77 void flush_icache_mm(struct mm_struct *mm, bool local); 73 78 74 79 #endif /* CONFIG_SMP */ 80 + 81 + /* 82 + * RISC-V doesn't have an instruction to flush parts of the instruction cache, 83 + * so instead we just flush the whole thing. 84 + */ 85 + #define flush_icache_range flush_icache_range 86 + static inline void flush_icache_range(unsigned long start, unsigned long end) 87 + { 88 + flush_icache_all(); 89 + } 75 90 76 91 extern unsigned int riscv_cbom_block_size; 77 92 extern unsigned int riscv_cboz_block_size;
+2 -8
arch/riscv/kernel/probes/uprobes.c
··· 167 167 /* Initialize the slot */ 168 168 void *kaddr = kmap_atomic(page); 169 169 void *dst = kaddr + (vaddr & ~PAGE_MASK); 170 + unsigned long start = (unsigned long)dst; 170 171 171 172 memcpy(dst, src, len); 172 173 ··· 177 176 *(uprobe_opcode_t *)dst = __BUG_INSN_32; 178 177 } 179 178 179 + flush_icache_range(start, start + len); 180 180 kunmap_atomic(kaddr); 181 - 182 - /* 183 - * We probably need flush_icache_user_page() but it needs vma. 184 - * This should work on most of architectures by default. If 185 - * architecture needs to do something different it can define 186 - * its own version of the function. 187 - */ 188 - flush_dcache_page(page); 189 181 }