Skip to content

Commit d9403d3

Browse files
committed
Merge tag 'riscv-for-linus-5.13-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux
Pull RISC-V fixes from Palmer Dabbelt: - A build fix to always build modules with the 'medany' code model, as the module loader doesn't support 'medlow'. - A Kconfig warning fix for the SiFive errata. - A pair of fixes that for regressions to the recent memory layout changes. - A fix for the FU740 device tree. * tag 'riscv-for-linus-5.13-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: dts: fu740: fix cache-controller interrupts riscv: Ensure BPF_JIT_REGION_START aligned with PMD size riscv: kasan: Fix MODULES_VADDR evaluation due to local variables' name riscv: sifive: fix Kconfig errata warning riscv32: Use medany C model for modules
2 parents e14c779 + 7ede12b commit d9403d3

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

Documentation/riscv/vm-layout.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ RISC-V Linux Kernel SV39
5858
|
5959
____________________________________________________________|____________________________________________________________
6060
| | | |
61-
ffffffff00000000 | -4 GB | ffffffff7fffffff | 2 GB | modules
62-
ffffffff80000000 | -2 GB | ffffffffffffffff | 2 GB | kernel, BPF
61+
ffffffff00000000 | -4 GB | ffffffff7fffffff | 2 GB | modules, BPF
62+
ffffffff80000000 | -2 GB | ffffffffffffffff | 2 GB | kernel
6363
__________________|____________|__________________|_________|____________________________________________________________

arch/riscv/Kconfig.socs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ config SOC_SIFIVE
1414
select CLK_SIFIVE
1515
select CLK_SIFIVE_PRCI
1616
select SIFIVE_PLIC
17+
select RISCV_ERRATA_ALTERNATIVE
1718
select ERRATA_SIFIVE
1819
help
1920
This enables support for SiFive SoC platform hardware.

arch/riscv/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ifeq ($(CONFIG_DYNAMIC_FTRACE),y)
1616
CC_FLAGS_FTRACE := -fpatchable-function-entry=8
1717
endif
1818

19-
ifeq ($(CONFIG_64BIT)$(CONFIG_CMODEL_MEDLOW),yy)
19+
ifeq ($(CONFIG_CMODEL_MEDLOW),y)
2020
KBUILD_CFLAGS_MODULE += -mcmodel=medany
2121
endif
2222

arch/riscv/boot/dts/sifive/fu740-c000.dtsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@
273273
cache-size = <2097152>;
274274
cache-unified;
275275
interrupt-parent = <&plic0>;
276-
interrupts = <19 20 21 22>;
276+
interrupts = <19 21 22 20>;
277277
reg = <0x0 0x2010000 0x0 0x1000>;
278278
};
279279
gpio: gpio@10060000 {

arch/riscv/include/asm/pgtable.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@
3030

3131
#define BPF_JIT_REGION_SIZE (SZ_128M)
3232
#ifdef CONFIG_64BIT
33-
/* KASLR should leave at least 128MB for BPF after the kernel */
34-
#define BPF_JIT_REGION_START PFN_ALIGN((unsigned long)&_end)
35-
#define BPF_JIT_REGION_END (BPF_JIT_REGION_START + BPF_JIT_REGION_SIZE)
33+
#define BPF_JIT_REGION_START (BPF_JIT_REGION_END - BPF_JIT_REGION_SIZE)
34+
#define BPF_JIT_REGION_END (MODULES_END)
3635
#else
3736
#define BPF_JIT_REGION_START (PAGE_OFFSET - BPF_JIT_REGION_SIZE)
3837
#define BPF_JIT_REGION_END (VMALLOC_END)

arch/riscv/mm/kasan_init.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ static void __init kasan_shallow_populate(void *start, void *end)
169169

170170
void __init kasan_init(void)
171171
{
172-
phys_addr_t _start, _end;
172+
phys_addr_t p_start, p_end;
173173
u64 i;
174174

175175
/*
@@ -189,9 +189,9 @@ void __init kasan_init(void)
189189
(void *)kasan_mem_to_shadow((void *)VMALLOC_END));
190190

191191
/* Populate the linear mapping */
192-
for_each_mem_range(i, &_start, &_end) {
193-
void *start = (void *)__va(_start);
194-
void *end = (void *)__va(_end);
192+
for_each_mem_range(i, &p_start, &p_end) {
193+
void *start = (void *)__va(p_start);
194+
void *end = (void *)__va(p_end);
195195

196196
if (start >= end)
197197
break;
@@ -201,7 +201,7 @@ void __init kasan_init(void)
201201

202202
/* Populate kernel, BPF, modules mapping */
203203
kasan_populate(kasan_mem_to_shadow((const void *)MODULES_VADDR),
204-
kasan_mem_to_shadow((const void *)BPF_JIT_REGION_END));
204+
kasan_mem_to_shadow((const void *)MODULES_VADDR + SZ_2G));
205205

206206
for (i = 0; i < PTRS_PER_PTE; i++)
207207
set_pte(&kasan_early_shadow_pte[i],

0 commit comments

Comments
 (0)