Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARM64 kimage_offset can be calculated if kaslr voffset is known. Add #7

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions arm64.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
static struct machine_specific arm64_machine_specific = { 0 };
static int arm64_verify_symbol(const char *, ulong, char);
static void arm64_parse_cmdline_args(void);
static void arm64_calc_kimage_voffset(void);
static void arm64_calc_phys_offset(void);
static void arm64_calc_virtual_memory_ranges(void);
static int arm64_kdump_phys_base(ulong *);
Expand Down Expand Up @@ -323,6 +324,9 @@ arm64_init(int when)
machdep->verify_line_number = NULL;
machdep->init_kernel_pgd = arm64_init_kernel_pgd;

/* use machdep parameters */
arm64_calc_kimage_voffset();

/* use machdep parameters */
arm64_calc_phys_offset();

Expand Down Expand Up @@ -735,6 +739,21 @@ arm64_parse_cmdline_args(void)
}
}

static void
arm64_calc_kimage_voffset(void)
{
struct machine_specific *ms = machdep->machspec;
ulong phys_offset;

if (ms->kimage_voffset) /* vmcoreinfo/--machdep override */
return;

if ((kt->flags2 & KASLR) && (kt->flags & RELOC_SET)){
arm_kdump_phys_base(&phys_offset);
ms->kimage_voffset = ms->vmalloc_start_addr + (kt->relocate * -1) - phys_offset;
}

}

static void
arm64_calc_phys_offset(void)
Expand Down