Skip to content

Commit

Permalink
KVM: SVM: Use svm_get_lbr_vmcb() helper to handle writes to DEBUGCTL
Browse files Browse the repository at this point in the history
Use the recently introduced svm_get_lbr_vmcb() instead an open coded
equivalent to retrieve the target VMCB when emulating writes to
MSR_IA32_DEBUGCTLMSR.

No functional change intended.

Link: https://lore.kernel.org/r/20230607203519.1570167-4-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
  • Loading branch information
sean-jc committed Aug 2, 2023
1 parent 41dfb5f commit a85cd52
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions arch/x86/kvm/svm/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -3052,13 +3052,8 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr)
if (data & DEBUGCTL_RESERVED_BITS)
return 1;

if (svm->vmcb->control.virt_ext & LBR_CTL_ENABLE_MASK)
svm->vmcb->save.dbgctl = data;
else
svm->vmcb01.ptr->save.dbgctl = data;

svm_get_lbr_vmcb(svm)->save.dbgctl = data;
svm_update_lbrv(vcpu);

break;
case MSR_VM_HSAVE_PA:
/*
Expand Down

0 comments on commit a85cd52

Please sign in to comment.