Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 197630
b: refs/heads/master
c: 887f500
h: refs/heads/master
v: v3
  • Loading branch information
Joerg Roedel authored and Avi Kivity committed Apr 25, 2010
1 parent 9699479 commit 5450217
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0e5cbe368b366f02cf3fe707aea2c0efac1bf70e
refs/heads/master: 887f500ca1a721cac237ba56374b9c0f578251ec
23 changes: 20 additions & 3 deletions trunk/arch/x86/kvm/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1486,6 +1486,21 @@ static inline bool nested_svm_intr(struct vcpu_svm *svm)
return true;
}

/* This function returns true if it is save to enable the nmi window */
static inline bool nested_svm_nmi(struct vcpu_svm *svm)
{
if (!is_nested(svm))
return true;

if (!(svm->nested.intercept & (1ULL << INTERCEPT_NMI)))
return true;

svm->vmcb->control.exit_code = SVM_EXIT_NMI;
svm->nested.exit_required = true;

return false;
}

static void *nested_svm_map(struct vcpu_svm *svm, u64 gpa, struct page **_page)
{
struct page *page;
Expand Down Expand Up @@ -2687,9 +2702,11 @@ static void enable_nmi_window(struct kvm_vcpu *vcpu)
* Something prevents NMI from been injected. Single step over possible
* problem (IRET or exception injection or interrupt shadow)
*/
svm->nmi_singlestep = true;
svm->vmcb->save.rflags |= (X86_EFLAGS_TF | X86_EFLAGS_RF);
update_db_intercept(vcpu);
if (gif_set(svm) && nested_svm_nmi(svm)) {
svm->nmi_singlestep = true;
svm->vmcb->save.rflags |= (X86_EFLAGS_TF | X86_EFLAGS_RF);
update_db_intercept(vcpu);
}
}

static int svm_set_tss_addr(struct kvm *kvm, unsigned int addr)
Expand Down

0 comments on commit 5450217

Please sign in to comment.