]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: arm64: Hide CNTHV_*_EL2 from userspace for nVHE guests
authorMarc Zyngier <maz@kernel.org>
Mon, 29 Sep 2025 16:04:45 +0000 (17:04 +0100)
committerMarc Zyngier <maz@kernel.org>
Mon, 13 Oct 2025 13:42:40 +0000 (14:42 +0100)
commit4cab5c857d1f92b4b322e30349fdc5e2e38e7a2f
tree521621584c2316e8ed14244b074415c8c813fd3b
parent164ecbf73c3ea61455e07eefdad8050a7b569558
KVM: arm64: Hide CNTHV_*_EL2 from userspace for nVHE guests

Although we correctly UNDEF any CNTHV_*_EL2 access from the guest
when E2H==0, we still expose these registers to userspace, which
is a bad idea.

Drop the ad-hoc UNDEF injection and switch to a .visibility()
callback which will also hide the register from userspace.

Fixes: 0e45981028550 ("KVM: arm64: timer: Don't adjust the EL2 virtual timer offset")
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/sys_regs.c