Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 197585
b: refs/heads/master
c: b8e88bc
h: refs/heads/master
i:
  197583: bc84ddf
v: v3
  • Loading branch information
Joerg Roedel authored and Avi Kivity committed Apr 25, 2010
1 parent f763172 commit 60eb6dc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 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: 7597f129d8b6799da7a264e6d6f7401668d3a36d
refs/heads/master: b8e88bc8ffba5fe53fb8d8a0a4be3bbcffeebe56
23 changes: 19 additions & 4 deletions trunk/arch/x86/kvm/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ static void svm_flush_tlb(struct kvm_vcpu *vcpu);
static void svm_complete_interrupts(struct vcpu_svm *svm);

static int nested_svm_exit_handled(struct vcpu_svm *svm);
static int nested_svm_intercept(struct vcpu_svm *svm);
static int nested_svm_vmexit(struct vcpu_svm *svm);
static int nested_svm_check_exception(struct vcpu_svm *svm, unsigned nr,
bool has_error_code, u32 error_code);
Expand Down Expand Up @@ -1384,6 +1385,8 @@ static int nested_svm_check_permissions(struct vcpu_svm *svm)
static int nested_svm_check_exception(struct vcpu_svm *svm, unsigned nr,
bool has_error_code, u32 error_code)
{
int vmexit;

if (!is_nested(svm))
return 0;

Expand All @@ -1392,7 +1395,11 @@ static int nested_svm_check_exception(struct vcpu_svm *svm, unsigned nr,
svm->vmcb->control.exit_info_1 = error_code;
svm->vmcb->control.exit_info_2 = svm->vcpu.arch.cr2;

return nested_svm_exit_handled(svm);
vmexit = nested_svm_intercept(svm);
if (vmexit == NESTED_EXIT_DONE)
svm->nested.exit_required = true;

return vmexit;
}

static inline int nested_svm_intr(struct vcpu_svm *svm)
Expand Down Expand Up @@ -1521,7 +1528,7 @@ static int nested_svm_exit_special(struct vcpu_svm *svm)
/*
* If this function returns true, this #vmexit was already handled
*/
static int nested_svm_exit_handled(struct vcpu_svm *svm)
static int nested_svm_intercept(struct vcpu_svm *svm)
{
u32 exit_code = svm->vmcb->control.exit_code;
int vmexit = NESTED_EXIT_HOST;
Expand Down Expand Up @@ -1567,9 +1574,17 @@ static int nested_svm_exit_handled(struct vcpu_svm *svm)
}
}

if (vmexit == NESTED_EXIT_DONE) {
return vmexit;
}

static int nested_svm_exit_handled(struct vcpu_svm *svm)
{
int vmexit;

vmexit = nested_svm_intercept(svm);

if (vmexit == NESTED_EXIT_DONE)
nested_svm_vmexit(svm);
}

return vmexit;
}
Expand Down

0 comments on commit 60eb6dc

Please sign in to comment.