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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Zyngier <[email protected]>
1 parent 3ce9f33 commit c4a6ed8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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)