Skip to content

Commit c4a6ed8

Browse files
ouptonMarc Zyngier
authored andcommitted
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>
1 parent 3ce9f33 commit c4a6ed8

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

arch/arm64/kvm/sys_regs.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -643,8 +643,6 @@ static void reg_to_dbg(struct kvm_vcpu *vcpu,
643643
val &= ~mask;
644644
val |= (p->regval & (mask >> shift)) << shift;
645645
*dbg_reg = val;
646-
647-
kvm_debug_set_guest_ownership(vcpu);
648646
}
649647

650648
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,
690688
else
691689
dbg_to_reg(vcpu, p, rd, reg);
692690

691+
kvm_debug_set_guest_ownership(vcpu);
693692
return true;
694693
}
695694

0 commit comments

Comments
 (0)