KVM: arm64: Evaluate debug owner at vcpu_load()
authorOliver Upton <oliver.upton@linux.dev>
Thu, 19 Dec 2024 22:41:03 +0000 (14:41 -0800)
committerMarc Zyngier <maz@kernel.org>
Fri, 20 Dec 2024 09:01:25 +0000 (09:01 +0000)
commitcd9b10102ae38bf0e10b13dbb98c3ead42cf8e1b
tree5956f120d46804a80ff68324addcb51cc860048a
parentb47ffd13fda8275733d573e5799e63e66b5f5361
KVM: arm64: Evaluate debug owner at vcpu_load()

In preparation for tossing the debug_ptr mess, introduce an enumeration
to track the ownership of the debug registers while in the guest. Update
the owner at vcpu_load() based on whether the host needs to steal the
guest's debug context or if breakpoints/watchpoints are actively in use.

Tested-by: James Clark <james.clark@linaro.org>
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Link: https://lore.kernel.org/r/20241219224116.3941496-7-oliver.upton@linux.dev
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/include/asm/kvm_host.h
arch/arm64/kvm/arm.c
arch/arm64/kvm/debug.c
arch/arm64/kvm/sys_regs.c