[PATCH] KVM: arm64: Convert timer offset VA when accessed in HYP code
Anders Roxell
anders.roxell at linaro.org
Thu Feb 13 01:59:36 PST 2025
On Wed, 12 Feb 2025 at 18:35, 'Marc Zyngier' via lkft <lkft at linaro.org> wrote:
>
> Now that EL2 has gained some early timer emulation, it accesses
> the offsets pointed to by the timer structure, both of which
> live in the KVM structure.
>
> Of course, these are *kernel* pointers, so the dereferencing
> of these pointers in non-kernel code must be itself be offset.
>
> Given switch.h its own version of timer_get_offset() and use that
> instead.
>
> Fixes: b86fc215dc26d ("KVM: arm64: Handle counter access early in non-HYP context")
> Reported-by: Linux Kernel Functional Testing <lkft at linaro.org>
> Signed-off-by: Marc Zyngier <maz at kernel.org>
Tested-by: Anders Roxell <anders.roxell at linaro.org>
Build this patch ontop of next-20250212 and ran kvm-unit-tests on a rockpi4.
And it ran fine without any kernel panic.
Cheers,
Anders
More information about the linux-arm-kernel
mailing list