riscv: Fix range looking for kernel image memblock
Subsystems (2)
Alexandre Ghiti
reviewerPATCH 1/1 riscv: Fix range looking for kernel image memblock
When looking for the memblock where the kernel lives, we should check that the memory range associated to the memblock entirely comprises the kernel image and not only intersects with it.
--- arch/riscv/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/mm/init.c +1 -1
@@ -131,7 +131,7 @@ void __init setup_bootmem(void)for_each_memblock (memory, reg) {phys_addr_t end = reg->base + reg->size; -if (reg->base <= vmlinux_end && vmlinux_end <= end) { +if (reg->base <= vmlinux_start && vmlinux_end <= end) { mem_size =min (reg->size, (phys_addr_t)-PAGE_OFFSET );/*
Signature · 1 line
2.20.1
Quoted 24 lines · Alexandre Ghiti
When looking for the memblock where the kernel lives, we should check that the memory range associated to the memblock entirely comprises the kernel image and not only intersects with it.
Signed-off-by Alexandre Ghiti <[email protected]>--- arch/riscv/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/riscv/mm/init.c +1
-2@@ -131,7 +131,7 @@ void __init setup_bootmem(void)for_each_memblock (memory, reg) {phys_addr_t end = reg->base + reg->size; -if (reg->base <= vmlinux_end && vmlinux_end <= end) { +if (reg->base <= vmlinux_start && vmlinux_end <= end) { mem_size =min (reg->size, (phys_addr_t)-PAGE_OFFSET );/* --
Quoted 2 lines
2.20.1
Looks good to me.
Regards,
Anup
Quoted 14 lines · On Sun, 16 Feb 2020 21:28:47 PST (-0800), [email protected] wrote:
When looking for the memblock where the kernel lives, we should check that the memory range associated to the memblock entirely comprises the kernel image and not only intersects with it.
Signed-off-by Alexandre Ghiti <[email protected]>--- arch/riscv/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/riscv/mm/init.c +0
-0
arch/riscv/mm/init.c void __init setup_bootmem(void) · line 137
Quoted 8 lines
arch/riscv/mm/init.c +1
-1@@ -131,7 +131,7 @@ void __init setup_bootmem(void)for_each_memblock (memory, reg) {phys_addr_t end = reg->base + reg->size; -if (reg->base <= vmlinux_end && vmlinux_end <= end) { +if (reg->base <= vmlinux_start && vmlinux_end <= end) { mem_size =min (reg->size, (phys_addr_t)-PAGE_OFFSET );/*
Thanks. I'm going to target this for the next RC.