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

Pull RISC-V fixes from Paul Walmsley:
"Several minor fixes and cleanups for v5.4-rc5:

- Three build fixes for various SPARSEMEM-related kernel
configurations

- Two cleanup patches for the kernel bug and breakpoint trap handler
code"

* tag 'riscv/for-v5.4-rc5-b' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
riscv: cleanup do_trap_break
riscv: cleanup <asm/bug.h>
riscv: Fix undefined reference to vmemmap_populate_basepages
riscv: Fix implicit declaration of 'page_to_section'
riscv: fix fs/proc/kcore.c compilation with sparsemem enabled

+11 -40
+3 -13
arch/riscv/include/asm/bug.h
··· 12 12 13 13 #include <asm/asm.h> 14 14 15 - #ifdef CONFIG_GENERIC_BUG 16 15 #define __INSN_LENGTH_MASK _UL(0x3) 17 16 #define __INSN_LENGTH_32 _UL(0x3) 18 17 #define __COMPRESSED_INSN_MASK _UL(0xffff) ··· 19 20 #define __BUG_INSN_32 _UL(0x00100073) /* ebreak */ 20 21 #define __BUG_INSN_16 _UL(0x9002) /* c.ebreak */ 21 22 22 - #ifndef __ASSEMBLY__ 23 23 typedef u32 bug_insn_t; 24 24 25 25 #ifdef CONFIG_GENERIC_BUG_RELATIVE_POINTERS ··· 41 43 RISCV_SHORT " %2" 42 44 #endif 43 45 46 + #ifdef CONFIG_GENERIC_BUG 44 47 #define __BUG_FLAGS(flags) \ 45 48 do { \ 46 49 __asm__ __volatile__ ( \ ··· 57 58 "i" (flags), \ 58 59 "i" (sizeof(struct bug_entry))); \ 59 60 } while (0) 60 - 61 - #endif /* !__ASSEMBLY__ */ 62 61 #else /* CONFIG_GENERIC_BUG */ 63 - #ifndef __ASSEMBLY__ 64 62 #define __BUG_FLAGS(flags) do { \ 65 63 __asm__ __volatile__ ("ebreak\n"); \ 66 64 } while (0) 67 - #endif /* !__ASSEMBLY__ */ 68 65 #endif /* CONFIG_GENERIC_BUG */ 69 66 70 67 #define BUG() do { \ ··· 74 79 75 80 #include <asm-generic/bug.h> 76 81 77 - #ifndef __ASSEMBLY__ 78 - 79 82 struct pt_regs; 80 83 struct task_struct; 81 84 82 - extern void die(struct pt_regs *regs, const char *str); 83 - extern void do_trap(struct pt_regs *regs, int signo, int code, 84 - unsigned long addr); 85 - 86 - #endif /* !__ASSEMBLY__ */ 85 + void die(struct pt_regs *regs, const char *str); 86 + void do_trap(struct pt_regs *regs, int signo, int code, unsigned long addr); 87 87 88 88 #endif /* _ASM_RISCV_BUG_H */
+1 -6
arch/riscv/include/asm/pgtable.h
··· 184 184 return __pte((pfn << _PAGE_PFN_SHIFT) | pgprot_val(prot)); 185 185 } 186 186 187 - static inline pte_t mk_pte(struct page *page, pgprot_t prot) 188 - { 189 - return pfn_pte(page_to_pfn(page), prot); 190 - } 187 + #define mk_pte(page, prot) pfn_pte(page_to_pfn(page), prot) 191 188 192 189 #define pte_index(addr) (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) 193 190 ··· 425 428 #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) 426 429 #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) 427 430 428 - #ifdef CONFIG_FLATMEM 429 431 #define kern_addr_valid(addr) (1) /* FIXME */ 430 - #endif 431 432 432 433 extern void *dtb_early_va; 433 434 extern void setup_bootmem(void);
+6 -20
arch/riscv/kernel/traps.c
··· 111 111 DO_ERROR_INFO(do_trap_ecall_m, 112 112 SIGILL, ILL_ILLTRP, "environment call from M-mode"); 113 113 114 - #ifdef CONFIG_GENERIC_BUG 115 114 static inline unsigned long get_break_insn_length(unsigned long pc) 116 115 { 117 116 bug_insn_t insn; ··· 119 120 return 0; 120 121 return (((insn & __INSN_LENGTH_MASK) == __INSN_LENGTH_32) ? 4UL : 2UL); 121 122 } 122 - #endif /* CONFIG_GENERIC_BUG */ 123 123 124 124 asmlinkage void do_trap_break(struct pt_regs *regs) 125 125 { 126 - if (user_mode(regs)) { 127 - force_sig_fault(SIGTRAP, TRAP_BRKPT, 128 - (void __user *)(regs->sepc)); 129 - return; 130 - } 131 - #ifdef CONFIG_GENERIC_BUG 132 - { 133 - enum bug_trap_type type; 134 - 135 - type = report_bug(regs->sepc, regs); 136 - if (type == BUG_TRAP_TYPE_WARN) { 137 - regs->sepc += get_break_insn_length(regs->sepc); 138 - return; 139 - } 140 - } 141 - #endif /* CONFIG_GENERIC_BUG */ 142 - 143 - die(regs, "Kernel BUG"); 126 + if (user_mode(regs)) 127 + force_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)regs->sepc); 128 + else if (report_bug(regs->sepc, regs) == BUG_TRAP_TYPE_WARN) 129 + regs->sepc += get_break_insn_length(regs->sepc); 130 + else 131 + die(regs, "Kernel BUG"); 144 132 } 145 133 146 134 #ifdef CONFIG_GENERIC_BUG
+1 -1
arch/riscv/mm/init.c
··· 458 458 zone_sizes_init(); 459 459 } 460 460 461 - #ifdef CONFIG_SPARSEMEM 461 + #ifdef CONFIG_SPARSEMEM_VMEMMAP 462 462 int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node, 463 463 struct vmem_altmap *altmap) 464 464 {