]> www.infradead.org Git - users/hch/misc.git/commit
KVM: arm64: Use debug_owner to track if debug regs need save/restore
authorOliver Upton <oliver.upton@linux.dev>
Thu, 19 Dec 2024 22:41:08 +0000 (14:41 -0800)
committerMarc Zyngier <maz@kernel.org>
Fri, 20 Dec 2024 09:01:25 +0000 (09:01 +0000)
commitbeb470d96cec8dd8f4e05b2135c74d828f7b114b
treee1dabfe9e953a03706295ce0d95426647f704539
parent803602b0d94168bd25f5ff6eafdfd9388a6dd2ec
KVM: arm64: Use debug_owner to track if debug regs need save/restore

Use the debug owner to determine if the debug regs are in use instead of
keeping around the DEBUG_DIRTY flag. Debug registers are now
saved/restored after the first trap, regardless of whether it was a read
or a write. This also shifts the point at which KVM becomes lazy to
vcpu_put() rather than the next exception taken from the guest.

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-12-oliver.upton@linux.dev
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/include/asm/kvm_host.h
arch/arm64/kvm/debug.c
arch/arm64/kvm/hyp/include/hyp/debug-sr.h
arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h
arch/arm64/kvm/sys_regs.c