diff options
author | Pingfan Liu <piliu@redhat.com> | 2022-01-18 15:48:10 +0800 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2022-01-24 10:02:08 +0100 |
commit | bde864387a104137ff3bd5f0871709846d5c7943 (patch) | |
tree | 48b64c8df67d04cc9bcaf329e92f30da4b75fa47 /kexec/arch/arm64/crashdump-arm64.c | |
parent | 67ea2d99e1356352034dc9d9c7b5ec6dd6b722eb (diff) |
arm64/crashdump: unify routine to get page_offset
There are two funcs to get page_offset:
get_kernel_page_offset()
get_page_offset()
Since get_kernel_page_offset() does not observe the kernel formula, and
remove it. Unify them in order to introduce 52-bits VA kernel more
easily in the coming patch.
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 'kexec/arch/arm64/crashdump-arm64.c')
-rw-r--r-- | kexec/arch/arm64/crashdump-arm64.c | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/kexec/arch/arm64/crashdump-arm64.c b/kexec/arch/arm64/crashdump-arm64.c index d0f2253..7beb1fb 100644 --- a/kexec/arch/arm64/crashdump-arm64.c +++ b/kexec/arch/arm64/crashdump-arm64.c @@ -47,27 +47,6 @@ static struct crash_elf_info elf_info = { }; /* - * Note: The returned value is correct only if !CONFIG_RANDOMIZE_BASE. - */ -static uint64_t get_kernel_page_offset(void) -{ - int i; - - if (elf_info.kern_vaddr_start == UINT64_MAX) - return UINT64_MAX; - - /* Current max virtual memory range is 48-bits. */ - for (i = 48; i > 0; i--) - if (!(elf_info.kern_vaddr_start & (1UL << i))) - break; - - if (i <= 0) - return UINT64_MAX; - else - return UINT64_MAX << i; -} - -/* * iomem_range_callback() - callback called for each iomem region * @data: not used * @nr: not used @@ -203,7 +182,7 @@ int load_crashdump_segments(struct kexec_info *info) if (err) return EFAILED; - elf_info.page_offset = get_kernel_page_offset(); + get_page_offset(&elf_info.page_offset); dbgprintf("%s: page_offset: %016llx\n", __func__, elf_info.page_offset); |