From: Luo Haiyang <[email protected]>
On RISC-V, due to the kernel image being additionally exported
in /proc/iomem, the kernel memory range is not correctly handled
by to_be_excluded.
Signed-off-by: Luo Haiyang <[email protected]>
---
kexec/arch/riscv/iomem.h | 2 --
kexec/arch/riscv/kexec-riscv.c | 8 +++-----
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/kexec/arch/riscv/iomem.h b/kexec/arch/riscv/iomem.h
index 86da971..1ab704c 100644
--- a/kexec/arch/riscv/iomem.h
+++ b/kexec/arch/riscv/iomem.h
@@ -2,8 +2,6 @@
#define IOMEM_H
#define SYSTEM_RAM "System RAM\n"
-#define KERNEL_CODE "Kernel code\n"
-#define KERNEL_DATA "Kernel data\n"
#define KERNEL_IMAGE "Kernel image\n"
#define CRASH_KERNEL "Crash kernel\n"
#define IOMEM_RESERVED "Reserved\n"
diff --git a/kexec/arch/riscv/kexec-riscv.c b/kexec/arch/riscv/kexec-riscv.c
index a5a12a0..72fde08 100644
--- a/kexec/arch/riscv/kexec-riscv.c
+++ b/kexec/arch/riscv/kexec-riscv.c
@@ -417,12 +417,10 @@ static bool to_be_excluded(char *str, unsigned long long start, unsigned long lo
return true;
}
- if (!strncmp(str, SYSTEM_RAM, strlen(SYSTEM_RAM)) ||
- !strncmp(str, KERNEL_CODE, strlen(KERNEL_CODE)) ||
- !strncmp(str, KERNEL_DATA, strlen(KERNEL_DATA)))
- return false;
- else
+ if (!strncmp(str, IOMEM_RESERVED, strlen(IOMEM_RESERVED)))
return true;
+
+ return false;
}
int get_memory_ranges(struct memory_range **range, int *num_ranges,
--
2.27.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.