diff options
author | 2024-12-19 14:41:16 -0800 | |
---|---|---|
committer | 2024-12-20 09:04:19 +0000 | |
commit | c4a6ed85455979ef3fbadc2f1bdf18734b0ecea6 (patch) | |
tree | f98955bf0ea1f86f8956182ce42330354a2ae820 | |
parent | KVM: arm64: Fold DBGxVR/DBGxCR accessors into common set (diff) | |
download | wireguard-linux-c4a6ed85455979ef3fbadc2f1bdf18734b0ecea6.tar.xz wireguard-linux-c4a6ed85455979ef3fbadc2f1bdf18734b0ecea6.zip |
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>
Diffstat (limited to '')
-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; } |