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

Pull RISC-V fixes from Palmer Dabbelt:

- Build with '-mno-relax' when using LLVM's linker, which doesn't
support linker relaxation.

- A fix to build without SiFive's errata.

- A fix to use PAs during init_resources()

- A fix to avoid W+X mappings during boot.

* tag 'riscv-for-linus-5.13-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
RISC-V: Fix memblock_free() usages in init_resources()
riscv: skip errata_cip_453.o if CONFIG_ERRATA_SIFIVE_CIP_453 is disabled
riscv: mm: Fix W+X mappings at boot
riscv: Use -mno-relax when using lld linker

+18 -5
+9
arch/riscv/Makefile
··· 38 38 KBUILD_LDFLAGS += -melf32lriscv 39 39 endif 40 40 41 + ifeq ($(CONFIG_LD_IS_LLD),y) 42 + KBUILD_CFLAGS += -mno-relax 43 + KBUILD_AFLAGS += -mno-relax 44 + ifneq ($(LLVM_IAS),1) 45 + KBUILD_CFLAGS += -Wa,-mno-relax 46 + KBUILD_AFLAGS += -Wa,-mno-relax 47 + endif 48 + endif 49 + 41 50 # ISA string setting 42 51 riscv-march-$(CONFIG_ARCH_RV32I) := rv32ima 43 52 riscv-march-$(CONFIG_ARCH_RV64I) := rv64ima
+1 -1
arch/riscv/errata/sifive/Makefile
··· 1 - obj-y += errata_cip_453.o 1 + obj-$(CONFIG_ERRATA_SIFIVE_CIP_453) += errata_cip_453.o 2 2 obj-y += errata.o
+2 -2
arch/riscv/kernel/setup.c
··· 231 231 232 232 /* Clean-up any unused pre-allocated resources */ 233 233 mem_res_sz = (num_resources - res_idx + 1) * sizeof(*mem_res); 234 - memblock_free((phys_addr_t) mem_res, mem_res_sz); 234 + memblock_free(__pa(mem_res), mem_res_sz); 235 235 return; 236 236 237 237 error: 238 238 /* Better an empty resource tree than an inconsistent one */ 239 239 release_child_resources(&iomem_resource); 240 - memblock_free((phys_addr_t) mem_res, mem_res_sz); 240 + memblock_free(__pa(mem_res), mem_res_sz); 241 241 } 242 242 243 243
+6 -2
arch/riscv/mm/init.c
··· 746 746 unsigned long init_data_start = (unsigned long)__init_data_begin; 747 747 unsigned long rodata_start = (unsigned long)__start_rodata; 748 748 unsigned long data_start = (unsigned long)_data; 749 - unsigned long max_low = (unsigned long)(__va(PFN_PHYS(max_low_pfn))); 749 + #if defined(CONFIG_64BIT) && defined(CONFIG_MMU) 750 + unsigned long end_va = kernel_virt_addr + load_sz; 751 + #else 752 + unsigned long end_va = (unsigned long)(__va(PFN_PHYS(max_low_pfn))); 753 + #endif 750 754 751 755 set_memory_ro(text_start, (init_text_start - text_start) >> PAGE_SHIFT); 752 756 set_memory_ro(init_text_start, (init_data_start - init_text_start) >> PAGE_SHIFT); 753 757 set_memory_nx(init_data_start, (rodata_start - init_data_start) >> PAGE_SHIFT); 754 758 /* rodata section is marked readonly in mark_rodata_ro */ 755 759 set_memory_nx(rodata_start, (data_start - rodata_start) >> PAGE_SHIFT); 756 - set_memory_nx(data_start, (max_low - data_start) >> PAGE_SHIFT); 760 + set_memory_nx(data_start, (end_va - data_start) >> PAGE_SHIFT); 757 761 } 758 762 759 763 void mark_rodata_ro(void)