Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 115273
b: refs/heads/master
c: ea953ef
h: refs/heads/master
i:
  115271: ec2f524
v: v3
  • Loading branch information
Mohammed Gamal authored and Avi Kivity committed Oct 15, 2008
1 parent ef4ecf2 commit c1c4f93
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 04fa4d32117b1a7773290fd59a97cf90cfc2a0d4
refs/heads/master: ea953ef0ca84e778187905177e2a789a1974837b
37 changes: 37 additions & 0 deletions trunk/arch/x86/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2892,6 +2892,43 @@ static int handle_nmi_window(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
return 1;
}

static void handle_invalid_guest_state(struct kvm_vcpu *vcpu,
struct kvm_run *kvm_run)
{
struct vcpu_vmx *vmx = to_vmx(vcpu);
int err;

preempt_enable();
local_irq_enable();

while (!guest_state_valid(vcpu)) {
err = emulate_instruction(vcpu, kvm_run, 0, 0, 0);

switch (err) {
case EMULATE_DONE:
break;
case EMULATE_DO_MMIO:
kvm_report_emulation_failure(vcpu, "mmio");
/* TODO: Handle MMIO */
return;
default:
kvm_report_emulation_failure(vcpu, "emulation failure");
return;
}

if (signal_pending(current))
break;
if (need_resched())
schedule();
}

local_irq_disable();
preempt_disable();

/* Guest state should be valid now, no more emulation should be needed */
vmx->emulation_required = 0;
}

/*
* The exit handlers return 1 if the exit was handled fully and guest execution
* may resume. Otherwise they set the kvm_run parameter to indicate what needs
Expand Down

0 comments on commit c1c4f93

Please sign in to comment.