Skip to content
Commit c9acdae1 authored by Marc Zyngier's avatar Marc Zyngier Committed by Will Deacon
Browse files

arm64: Use default kernel offset when the image file can't be seeked



While introducing new code to extract the kernel offset from the
image, commit fd0a05bd ("arm64: Obtain text offset from kernel image")
introduced a regression where something such as:

  ./lkvm run -c 8 -p earlycon <(zcat /boot/vmlinuz-5.8.0-rc5-00172-ga161216e31ba)

now fails to load the kernel, as the file descriptor cannot be
seeked.

Let's assume the good old 0x80000 offset when the seek syscall fails,
with a warning for a good measure.

Fixes: fd0a05bd ("arm64: Obtain text offset from kernel image")
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20200716120801.2996-1-maz@kernel.org


Signed-off-by: default avatarWill Deacon <will@kernel.org>
parent 351d931f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment