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

Pull RISC-V fixes from Palmer Dabbelt:

- A build warning fix for BUILTIN_DTB=y

- Hibernation support is hidden behind NONPORTABLE, as it depends on
some undocumented early boot behavior and breaks on most platforms

- A fix for relocatable kernels on systems with early boot errata

- A fix to properly handle perf callchains for kernel tracepoints

- A pair of fixes for NAPOT to avoid inconsistencies between PTEs and
handle hardware that sets arbitrary A/D bits

* tag 'riscv-for-linus-6.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
riscv: Implement missing huge_ptep_get
riscv: Fix huge_ptep_set_wrprotect when PTE is a NAPOT
riscv: perf: Fix callchain parse error with kernel tracepoint events
riscv: Fix relocatable kernels with early alternatives using -fno-pie
RISC-V: mark hibernation as nonportable
riscv: Fix unused variable warning when BUILTIN_DTB is set

+52 -3
+4 -1
arch/riscv/Kconfig
··· 799 799 800 800 source "kernel/power/Kconfig" 801 801 802 + # Hibernation is only possible on systems where the SBI implementation has 803 + # marked its reserved memory as not accessible from, or does not run 804 + # from the same memory as, Linux 802 805 config ARCH_HIBERNATION_POSSIBLE 803 - def_bool y 806 + def_bool NONPORTABLE 804 807 805 808 config ARCH_HIBERNATION_HEADER 806 809 def_bool HIBERNATION
+4
arch/riscv/errata/Makefile
··· 1 + ifdef CONFIG_RELOCATABLE 2 + KBUILD_CFLAGS += -fno-pie 3 + endif 4 + 1 5 obj-$(CONFIG_ERRATA_SIFIVE) += sifive/ 2 6 obj-$(CONFIG_ERRATA_THEAD) += thead/
+3
arch/riscv/include/asm/hugetlb.h
··· 36 36 unsigned long addr, pte_t *ptep, 37 37 pte_t pte, int dirty); 38 38 39 + #define __HAVE_ARCH_HUGE_PTEP_GET 40 + pte_t huge_ptep_get(pte_t *ptep); 41 + 39 42 pte_t arch_make_huge_pte(pte_t entry, unsigned int shift, vm_flags_t flags); 40 43 #define arch_make_huge_pte arch_make_huge_pte 41 44
+7
arch/riscv/include/asm/perf_event.h
··· 10 10 11 11 #include <linux/perf_event.h> 12 12 #define perf_arch_bpf_user_pt_regs(regs) (struct user_regs_struct *)regs 13 + 14 + #define perf_arch_fetch_caller_regs(regs, __ip) { \ 15 + (regs)->epc = (__ip); \ 16 + (regs)->s0 = (unsigned long) __builtin_frame_address(0); \ 17 + (regs)->sp = current_stack_pointer; \ 18 + (regs)->status = SR_PP; \ 19 + } 13 20 #endif /* _ASM_RISCV_PERF_EVENT_H */
+4
arch/riscv/kernel/Makefile
··· 23 23 CFLAGS_REMOVE_alternative.o = $(CC_FLAGS_FTRACE) 24 24 CFLAGS_REMOVE_cpufeature.o = $(CC_FLAGS_FTRACE) 25 25 endif 26 + ifdef CONFIG_RELOCATABLE 27 + CFLAGS_alternative.o += -fno-pie 28 + CFLAGS_cpufeature.o += -fno-pie 29 + endif 26 30 ifdef CONFIG_KASAN 27 31 KASAN_SANITIZE_alternative.o := n 28 32 KASAN_SANITIZE_cpufeature.o := n
+29 -1
arch/riscv/mm/hugetlbpage.c
··· 3 3 #include <linux/err.h> 4 4 5 5 #ifdef CONFIG_RISCV_ISA_SVNAPOT 6 + pte_t huge_ptep_get(pte_t *ptep) 7 + { 8 + unsigned long pte_num; 9 + int i; 10 + pte_t orig_pte = ptep_get(ptep); 11 + 12 + if (!pte_present(orig_pte) || !pte_napot(orig_pte)) 13 + return orig_pte; 14 + 15 + pte_num = napot_pte_num(napot_cont_order(orig_pte)); 16 + 17 + for (i = 0; i < pte_num; i++, ptep++) { 18 + pte_t pte = ptep_get(ptep); 19 + 20 + if (pte_dirty(pte)) 21 + orig_pte = pte_mkdirty(orig_pte); 22 + 23 + if (pte_young(pte)) 24 + orig_pte = pte_mkyoung(orig_pte); 25 + } 26 + 27 + return orig_pte; 28 + } 29 + 6 30 pte_t *huge_pte_alloc(struct mm_struct *mm, 7 31 struct vm_area_struct *vma, 8 32 unsigned long addr, ··· 242 218 { 243 219 pte_t pte = ptep_get(ptep); 244 220 unsigned long order; 221 + pte_t orig_pte; 245 222 int i, pte_num; 246 223 247 224 if (!pte_napot(pte)) { ··· 253 228 order = napot_cont_order(pte); 254 229 pte_num = napot_pte_num(order); 255 230 ptep = huge_pte_offset(mm, addr, napot_cont_size(order)); 231 + orig_pte = get_clear_contig_flush(mm, addr, ptep, pte_num); 232 + 233 + orig_pte = pte_wrprotect(orig_pte); 256 234 257 235 for (i = 0; i < pte_num; i++, addr += PAGE_SIZE, ptep++) 258 - ptep_set_wrprotect(mm, addr, ptep); 236 + set_pte_at(mm, addr, ptep, orig_pte); 259 237 } 260 238 261 239 pte_t huge_ptep_clear_flush(struct vm_area_struct *vma,
+1 -1
arch/riscv/mm/init.c
··· 922 922 static void __init create_fdt_early_page_table(uintptr_t fix_fdt_va, 923 923 uintptr_t dtb_pa) 924 924 { 925 + #ifndef CONFIG_BUILTIN_DTB 925 926 uintptr_t pa = dtb_pa & ~(PMD_SIZE - 1); 926 927 927 - #ifndef CONFIG_BUILTIN_DTB 928 928 /* Make sure the fdt fixmap address is always aligned on PMD size */ 929 929 BUILD_BUG_ON(FIX_FDT % (PMD_SIZE / PAGE_SIZE)); 930 930