提交 4aebd0e9 编写于 作者: L Ladi Prosek 提交者: Paolo Bonzini

KVM: SVM: introduce disable_nmi_singlestep helper

Just moving the code to a new helper in preparation for following
commits.
Signed-off-by: NLadi Prosek <lprosek@redhat.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 525df861
...@@ -963,6 +963,14 @@ static void svm_disable_lbrv(struct vcpu_svm *svm) ...@@ -963,6 +963,14 @@ static void svm_disable_lbrv(struct vcpu_svm *svm)
set_msr_interception(msrpm, MSR_IA32_LASTINTTOIP, 0, 0); set_msr_interception(msrpm, MSR_IA32_LASTINTTOIP, 0, 0);
} }
static void disable_nmi_singlestep(struct vcpu_svm *svm)
{
svm->nmi_singlestep = false;
if (!(svm->vcpu.guest_debug & KVM_GUESTDBG_SINGLESTEP))
svm->vmcb->save.rflags &=
~(X86_EFLAGS_TF | X86_EFLAGS_RF);
}
/* Note: /* Note:
* This hash table is used to map VM_ID to a struct kvm_arch, * This hash table is used to map VM_ID to a struct kvm_arch,
* when handling AMD IOMMU GALOG notification to schedule in * when handling AMD IOMMU GALOG notification to schedule in
...@@ -2111,10 +2119,7 @@ static int db_interception(struct vcpu_svm *svm) ...@@ -2111,10 +2119,7 @@ static int db_interception(struct vcpu_svm *svm)
} }
if (svm->nmi_singlestep) { if (svm->nmi_singlestep) {
svm->nmi_singlestep = false; disable_nmi_singlestep(svm);
if (!(svm->vcpu.guest_debug & KVM_GUESTDBG_SINGLESTEP))
svm->vmcb->save.rflags &=
~(X86_EFLAGS_TF | X86_EFLAGS_RF);
} }
if (svm->vcpu.guest_debug & if (svm->vcpu.guest_debug &
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册