diff options
author | Oliver Upton <oliver.upton@linux.dev> | 2024-12-20 01:41:16 +0300 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2024-12-20 12:04:19 +0300 |
commit | c4a6ed85455979ef3fbadc2f1bdf18734b0ecea6 (patch) | |
tree | f98955bf0ea1f86f8956182ce42330354a2ae820 | |
parent | 3ce9f3357e9e099f02feaa002769eb99ef1138cd (diff) | |
download | linux-c4a6ed85455979ef3fbadc2f1bdf18734b0ecea6.tar.xz |
KVM: arm64: Promote guest ownership for DBGxVR/DBGxCR reads
Only yielding control of the debug registers for writes is a bit silly,
unless of course you're a fan of pointless traps. Give control of the
debug registers to the guest upon the first access, regardless of
direction.
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Link: https://lore.kernel.org/r/20241219224116.3941496-20-oliver.upton@linux.dev
Signed-off-by: Marc Zyngier <maz@kernel.org>
-rw-r--r-- | arch/arm64/kvm/sys_regs.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c index d9c7911ec58a..aac79e34cd50 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -643,8 +643,6 @@ static void reg_to_dbg(struct kvm_vcpu *vcpu, val &= ~mask; val |= (p->regval & (mask >> shift)) << shift; *dbg_reg = val; - - kvm_debug_set_guest_ownership(vcpu); } static void dbg_to_reg(struct kvm_vcpu *vcpu, @@ -690,6 +688,7 @@ static bool trap_dbg_wb_reg(struct kvm_vcpu *vcpu, struct sys_reg_params *p, else dbg_to_reg(vcpu, p, rd, reg); + kvm_debug_set_guest_ownership(vcpu); return true; } |