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

Pull RISC-V fixes from Palmer Dabbelt:
"I dropped the ball a bit here: these patches should all probably have
been part of rc2, but I wanted to get around to properly testing them
in the various configurations (qemu32, qeum64, unleashed) first.

Unfortunately I've been traveling and didn't have time to actually do
that, but since these fix concrete bugs and pass my old set of tests I
don't want to delay the fixes any longer.

There are four independent fixes here:

- A fix for the rv32 port that corrects the 64-bit user accesor's
fixup label address.

- A fix for a regression introduced during the merge window that
broke medlow configurations at run time. This patch also includes a
fix that disables ftrace for the same set of functions, which was
found by inspection at the same time.

- A modification of the memory map to avoid overlapping the FIXMAP
and VMALLOC regions on systems with small memory maps.

- A fix to the module handling code to use the correct syntax for
probing Kconfig entries.

These have passed my standard test flow, but I didn't have time to
expand that testing like I said I would"

* tag 'riscv-for-linus-5.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux:
RISC-V: Use IS_ENABLED(CONFIG_CMODEL_MEDLOW)
RISC-V: Fix FIXMAP_TOP to avoid overlap with VMALLOC area
RISC-V: Always compile mm/init.c with cmodel=medany and notrace
riscv: fix accessing 8-byte variable from RV32

+37 -14
+1 -1
arch/riscv/include/asm/fixmap.h
··· 26 26 }; 27 27 28 28 #define FIXADDR_SIZE (__end_of_fixed_addresses * PAGE_SIZE) 29 - #define FIXADDR_TOP (PAGE_OFFSET) 29 + #define FIXADDR_TOP (VMALLOC_START) 30 30 #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) 31 31 32 32 #define FIXMAP_PAGE_IO PAGE_KERNEL
+1 -1
arch/riscv/include/asm/uaccess.h
··· 300 300 " .balign 4\n" \ 301 301 "4:\n" \ 302 302 " li %0, %6\n" \ 303 - " jump 2b, %1\n" \ 303 + " jump 3b, %1\n" \ 304 304 " .previous\n" \ 305 305 " .section __ex_table,\"a\"\n" \ 306 306 " .balign " RISCV_SZPTR "\n" \
-3
arch/riscv/kernel/Makefile
··· 4 4 5 5 ifdef CONFIG_FTRACE 6 6 CFLAGS_REMOVE_ftrace.o = -pg 7 - CFLAGS_REMOVE_setup.o = -pg 8 7 endif 9 8 10 9 extra-y += head.o ··· 27 28 obj-y += vdso.o 28 29 obj-y += cacheinfo.o 29 30 obj-y += vdso/ 30 - 31 - CFLAGS_setup.o := -mcmodel=medany 32 31 33 32 obj-$(CONFIG_FPU) += fpu.o 34 33 obj-$(CONFIG_SMP) += smpboot.o
+1 -1
arch/riscv/kernel/module.c
··· 141 141 { 142 142 s32 hi20; 143 143 144 - if (IS_ENABLED(CMODEL_MEDLOW)) { 144 + if (IS_ENABLED(CONFIG_CMODEL_MEDLOW)) { 145 145 pr_err( 146 146 "%s: target %016llx can not be addressed by the 32-bit offset from PC = %p\n", 147 147 me->name, (long long)v, location);
-8
arch/riscv/kernel/setup.c
··· 48 48 }; 49 49 #endif 50 50 51 - unsigned long va_pa_offset; 52 - EXPORT_SYMBOL(va_pa_offset); 53 - unsigned long pfn_base; 54 - EXPORT_SYMBOL(pfn_base); 55 - 56 - unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)] __page_aligned_bss; 57 - EXPORT_SYMBOL(empty_zero_page); 58 - 59 51 /* The lucky hart to first increment this variable will boot the other cores */ 60 52 atomic_t hart_lottery; 61 53 unsigned long boot_cpu_hartid;
+6
arch/riscv/mm/Makefile
··· 1 + 2 + CFLAGS_init.o := -mcmodel=medany 3 + ifdef CONFIG_FTRACE 4 + CFLAGS_REMOVE_init.o = -pg 5 + endif 6 + 1 7 obj-y += init.o 2 8 obj-y += fault.o 3 9 obj-y += extable.o
+28
arch/riscv/mm/init.c
··· 25 25 #include <asm/pgtable.h> 26 26 #include <asm/io.h> 27 27 28 + unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)] 29 + __page_aligned_bss; 30 + EXPORT_SYMBOL(empty_zero_page); 31 + 28 32 static void __init zone_sizes_init(void) 29 33 { 30 34 unsigned long max_zone_pfns[MAX_NR_ZONES] = { 0, }; ··· 147 143 } 148 144 } 149 145 146 + unsigned long va_pa_offset; 147 + EXPORT_SYMBOL(va_pa_offset); 148 + unsigned long pfn_base; 149 + EXPORT_SYMBOL(pfn_base); 150 + 150 151 pgd_t swapper_pg_dir[PTRS_PER_PGD] __page_aligned_bss; 151 152 pgd_t trampoline_pg_dir[PTRS_PER_PGD] __initdata __aligned(PAGE_SIZE); 152 153 ··· 180 171 local_flush_tlb_page(addr); 181 172 } 182 173 } 174 + 175 + /* 176 + * setup_vm() is called from head.S with MMU-off. 177 + * 178 + * Following requirements should be honoured for setup_vm() to work 179 + * correctly: 180 + * 1) It should use PC-relative addressing for accessing kernel symbols. 181 + * To achieve this we always use GCC cmodel=medany. 182 + * 2) The compiler instrumentation for FTRACE will not work for setup_vm() 183 + * so disable compiler instrumentation when FTRACE is enabled. 184 + * 185 + * Currently, the above requirements are honoured by using custom CFLAGS 186 + * for init.o in mm/Makefile. 187 + */ 188 + 189 + #ifndef __riscv_cmodel_medany 190 + #error "setup_vm() is called from head.S before relocate so it should " 191 + "not use absolute addressing." 192 + #endif 183 193 184 194 asmlinkage void __init setup_vm(void) 185 195 {