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

Pull RISC-V fixes from Palmer Dabbelt:

- Fixes for a handful of KASAN-related crashes.

- A fix to avoid a crash during boot for SPARSEMEM &&
!SPARSEMEM_VMEMMAP configurations.

- A fix to stop reporting some incorrect errors under DEBUG_VIRTUAL.

- A fix for the K210's device tree to properly populate the interrupt
map, so hart1 will get interrupts again.

* tag 'riscv-for-linus-5.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
riscv: dts: k210: fix broken IRQs on hart1
riscv: Fix kasan pud population
riscv: Move high_memory initialization to setup_bootmem
riscv: Fix config KASAN && DEBUG_VIRTUAL
riscv: Fix DEBUG_VIRTUAL false warnings
riscv: Fix config KASAN && SPARSEMEM && !SPARSE_VMEMMAP
riscv: Fix is_linear_mapping with recent move of KASAN region

+14 -9
+2 -1
arch/riscv/boot/dts/canaan/k210.dtsi
··· 113 113 compatible = "canaan,k210-plic", "sifive,plic-1.0.0"; 114 114 reg = <0xC000000 0x4000000>; 115 115 interrupt-controller; 116 - interrupts-extended = <&cpu0_intc 11>, <&cpu1_intc 11>; 116 + interrupts-extended = <&cpu0_intc 11>, <&cpu0_intc 9>, 117 + <&cpu1_intc 11>, <&cpu1_intc 9>; 117 118 riscv,ndev = <65>; 118 119 }; 119 120
+1 -1
arch/riscv/include/asm/page.h
··· 119 119 ((x) >= kernel_map.virt_addr && (x) < (kernel_map.virt_addr + kernel_map.size)) 120 120 121 121 #define is_linear_mapping(x) \ 122 - ((x) >= PAGE_OFFSET && (!IS_ENABLED(CONFIG_64BIT) || (x) < kernel_map.virt_addr)) 122 + ((x) >= PAGE_OFFSET && (!IS_ENABLED(CONFIG_64BIT) || (x) < PAGE_OFFSET + KERN_VIRT_SIZE)) 123 123 124 124 #define linear_mapping_pa_to_va(x) ((void *)((unsigned long)(x) + kernel_map.va_pa_offset)) 125 125 #define kernel_mapping_pa_to_va(y) ({ \
+1
arch/riscv/include/asm/pgtable.h
··· 13 13 14 14 #ifndef CONFIG_MMU 15 15 #define KERNEL_LINK_ADDR PAGE_OFFSET 16 + #define KERN_VIRT_SIZE (UL(-1)) 16 17 #else 17 18 18 19 #define ADDRESS_SPACE_END (UL(-1))
+3
arch/riscv/mm/Makefile
··· 24 24 ifdef CONFIG_KASAN 25 25 KASAN_SANITIZE_kasan_init.o := n 26 26 KASAN_SANITIZE_init.o := n 27 + ifdef CONFIG_DEBUG_VIRTUAL 28 + KASAN_SANITIZE_physaddr.o := n 29 + endif 27 30 endif 28 31 29 32 obj-$(CONFIG_DEBUG_VIRTUAL) += physaddr.o
+1 -1
arch/riscv/mm/init.c
··· 125 125 else 126 126 swiotlb_force = SWIOTLB_NO_FORCE; 127 127 #endif 128 - high_memory = (void *)(__va(PFN_PHYS(max_low_pfn))); 129 128 memblock_free_all(); 130 129 131 130 print_vm_layout(); ··· 194 195 195 196 min_low_pfn = PFN_UP(phys_ram_base); 196 197 max_low_pfn = max_pfn = PFN_DOWN(phys_ram_end); 198 + high_memory = (void *)(__va(PFN_PHYS(max_low_pfn))); 197 199 198 200 dma32_phys_limit = min(4UL * SZ_1G, (unsigned long)PFN_PHYS(max_low_pfn)); 199 201 set_max_mapnr(max_low_pfn - ARCH_PFN_OFFSET);
+5 -3
arch/riscv/mm/kasan_init.c
··· 113 113 base_pud = pt_ops.get_pud_virt(pfn_to_phys(_pgd_pfn(*pgd))); 114 114 } else { 115 115 base_pud = (pud_t *)pgd_page_vaddr(*pgd); 116 - if (base_pud == lm_alias(kasan_early_shadow_pud)) 116 + if (base_pud == lm_alias(kasan_early_shadow_pud)) { 117 117 base_pud = memblock_alloc(PTRS_PER_PUD * sizeof(pud_t), PAGE_SIZE); 118 + memcpy(base_pud, (void *)kasan_early_shadow_pud, 119 + sizeof(pud_t) * PTRS_PER_PUD); 120 + } 118 121 } 119 122 120 123 pudp = base_pud + pud_index(vaddr); ··· 205 202 206 203 for (i = 0; i < PTRS_PER_PTE; ++i) 207 204 set_pte(kasan_early_shadow_pte + i, 208 - mk_pte(virt_to_page(kasan_early_shadow_page), 209 - PAGE_KERNEL)); 205 + pfn_pte(virt_to_pfn(kasan_early_shadow_page), PAGE_KERNEL)); 210 206 211 207 for (i = 0; i < PTRS_PER_PMD; ++i) 212 208 set_pmd(kasan_early_shadow_pmd + i,
+1 -3
arch/riscv/mm/physaddr.c
··· 8 8 9 9 phys_addr_t __virt_to_phys(unsigned long x) 10 10 { 11 - phys_addr_t y = x - PAGE_OFFSET; 12 - 13 11 /* 14 12 * Boundary checking aginst the kernel linear mapping space. 15 13 */ 16 - WARN(y >= KERN_VIRT_SIZE, 14 + WARN(!is_linear_mapping(x) && !is_kernel_mapping(x), 17 15 "virt_to_phys used for non-linear address: %pK (%pS)\n", 18 16 (void *)x, (void *)x); 19 17