[PATCH] KVM: arm64: Convert timer offset VA when accessed in HYP code

Oliver Upton oliver.upton at linux.dev
Wed Feb 12 13:01:11 PST 2025


On Wed, Feb 12, 2025 at 05:34:54PM +0000, Marc Zyngier 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>

Reviewed-by: Oliver Upton <oliver.upton at linux.dev>



More information about the linux-arm-kernel mailing list