KVM: arm64: Reject attempts to set invalid debug arch version
authorOliver Upton <oliver.upton@linux.dev>
Tue, 3 Oct 2023 23:04:00 +0000 (23:04 +0000)
committerOliver Upton <oliver.upton@linux.dev>
Wed, 4 Oct 2023 17:11:39 +0000 (17:11 +0000)
commita9bc4a1c1e0c206838bc2d0c8621ca6df9704a2f
tree4f4283106f8cce0cae324773ebbc7ee42e9c263a
parent5a23e5c7cb0d5b2b38c33417579cd628be7d14c5
KVM: arm64: Reject attempts to set invalid debug arch version

The debug architecture is mandatory in ARMv8, so KVM should not allow
userspace to configure a vCPU with less than that. Of course, this isn't
handled elegantly by the generic ID register plumbing, as the respective
ID register fields have a nonzero starting value.

Add an explicit check for debug versions less than v8 of the
architecture.

Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20231003230408.3405722-5-oliver.upton@linux.dev
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
arch/arm64/kvm/sys_regs.c