[PATCH v2 4/8] KVM: arm64: Generate hyp relocation data

Marc Zyngier maz at kernel.org
Sat Jan 30 13:10:14 EST 2021


On Sat, 30 Jan 2021 16:11:04 +0000,
Guenter Roeck <linux at roeck-us.net> wrote:
> 
> On Sat, Jan 30, 2021 at 01:44:15PM +0000, Marc Zyngier wrote:
> > From d80ca05b2ed90fc30d328041692fa80f525c8d12 Mon Sep 17 00:00:00 2001
> > From: Marc Zyngier <maz at kernel.org>
> > Date: Sat, 30 Jan 2021 13:07:51 +0000
> > Subject: [PATCH] KVM: arm64: Make gen-hyprel endianness agnostic
> > 
> > gen-hyprel is, for better or worse, a native-endian program:
> > it assumes that the ELF data structures are in the host's
> > endianness, and even assumes that the compiled kernel is
> > little-endian in one particular case.
> > 
> > None of these assumptions hold true though: people actually build
> > (use?) BE arm64 kernels, and seem to avoid doing so on BE hosts.
> > Madness!
> > 
> > In order to solve this, wrap each access to the ELF data structures
> > with the required byte-swapping magic. This requires to obtain
> > the kernel data structure, and provide per-endianess wrappers.
> > 
> > This result in a kernel that links and even boots in a model.
> > 
> > Fixes: 8c49b5d43d4c ("KVM: arm64: Generate hyp relocation data")
> > Reported-by: Guenter Roeck <linux at roeck-us.net>
> > Signed-off-by: Marc Zyngier <maz at kernel.org>
> 
> Tested-by: Guenter Roeck <linux at roeck-us.net>
> 
> Compiles and boots both big- and little-endian systems in qemu.

Great, thanks for confirming that it fixed this issue. Now applied to
kvm-arm64/hyp-reloc, and pushed out to kvmarm/next.

	M.

-- 
Without deviation from the norm, progress is not possible.



More information about the linux-arm-kernel mailing list