summaryrefslogtreecommitdiffstats
path: root/util_lib
diff options
context:
space:
mode:
authorPingfan Liu <piliu@redhat.com>2022-01-18 15:48:11 +0800
committerSimon Horman <horms@verge.net.au>2022-01-24 10:05:20 +0100
commit454395e18ff12d2728ee458695160e9ab4899e33 (patch)
tree64b6b8e91d8974c7bcb2a526daad913685e75c16 /util_lib
parentbde864387a104137ff3bd5f0871709846d5c7943 (diff)
downloadkexec-tools-454395e18ff12d2728ee458695160e9ab4899e33.tar.gz
arm64: read VA_BITS from kcore for 52-bits VA kernel
phys_to_virt() calculates virtual address. As a important factor, page_offset is excepted to be accurate. Since arm64 kernel exposes va_bits through vmcore, using it. Signed-off-by: Pingfan Liu <piliu@redhat.com> Reviewed-by: Philipp Rudo <prudo@redhat.com> Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'util_lib')
-rw-r--r--util_lib/elf_info.c5
-rw-r--r--util_lib/include/elf_info.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/util_lib/elf_info.c b/util_lib/elf_info.c
index 5574c7f6..d252eff5 100644
--- a/util_lib/elf_info.c
+++ b/util_lib/elf_info.c
@@ -310,6 +310,8 @@ int get_pt_load(int idx,
#define NOT_FOUND_LONG_VALUE (-1)
+void (*arch_scan_vmcoreinfo)(char *pos);
+
void scan_vmcoreinfo(char *start, size_t size)
{
char *last = start + size - 1;
@@ -551,6 +553,9 @@ void scan_vmcoreinfo(char *start, size_t size)
}
}
+ if (arch_scan_vmcoreinfo != NULL)
+ (*arch_scan_vmcoreinfo)(pos);
+
if (last_line)
break;
}
diff --git a/util_lib/include/elf_info.h b/util_lib/include/elf_info.h
index f550d864..fdf4c3d0 100644
--- a/util_lib/include/elf_info.h
+++ b/util_lib/include/elf_info.h
@@ -31,5 +31,6 @@ int get_pt_load(int idx,
int read_phys_offset_elf_kcore(int fd, long *phys_off);
int read_elf(int fd);
void dump_dmesg(int fd, void (*handler)(char*, unsigned int));
+extern void (*arch_scan_vmcoreinfo)(char *pos);
#endif /* ELF_INFO_H */