riscv: Fix range looking for kernel image memblock
[ Upstream commit a160eed4b7
]
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 <alex@ghiti.fr>
Reviewed-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
1c2106d2d9
commit
b557b2f006
|
@ -98,7 +98,7 @@ void __init setup_bootmem(void)
|
||||||
for_each_memblock(memory, reg) {
|
for_each_memblock(memory, reg) {
|
||||||
phys_addr_t end = reg->base + reg->size;
|
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);
|
mem_size = min(reg->size, (phys_addr_t)-PAGE_OFFSET);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue