Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 68427
b: refs/heads/master
c: 29bd8a7
h: refs/heads/master
i:
  68425: 36e4556
  68423: ce0e965
v: v3
  • Loading branch information
Avi Kivity committed Oct 13, 2007
1 parent e04d681 commit 32a3ef7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 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: 2e3e5882dca3ab409aa8c9c96f47610b576719f8
refs/heads/master: 29bd8a78082f2d7e2165a735f50b5c716ef3213b
19 changes: 10 additions & 9 deletions trunk/drivers/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ struct vmcs {
struct vcpu_vmx {
struct kvm_vcpu vcpu;
int launched;
u8 fail;
struct kvm_msr_entry *guest_msrs;
struct kvm_msr_entry *host_msrs;
int nmsrs;
Expand Down Expand Up @@ -2099,6 +2100,14 @@ static int kvm_handle_exit(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)
{
u32 vectoring_info = vmcs_read32(IDT_VECTORING_INFO_FIELD);
u32 exit_reason = vmcs_read32(VM_EXIT_REASON);
struct vcpu_vmx *vmx = to_vmx(vcpu);

if (unlikely(vmx->fail)) {
kvm_run->exit_reason = KVM_EXIT_FAIL_ENTRY;
kvm_run->fail_entry.hardware_entry_failure_reason
= vmcs_read32(VM_INSTRUCTION_ERROR);
return 0;
}

if ( (vectoring_info & VECTORING_INFO_VALID_MASK) &&
exit_reason != EXIT_REASON_EXCEPTION_NMI )
Expand Down Expand Up @@ -2208,7 +2217,6 @@ static void vmx_intr_assist(struct kvm_vcpu *vcpu)
static int vmx_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
{
struct vcpu_vmx *vmx = to_vmx(vcpu);
u8 fail;
int r;

if (unlikely(vcpu->mp_state == VCPU_MP_STATE_SIPI_RECEIVED)) {
Expand Down Expand Up @@ -2352,7 +2360,7 @@ static int vmx_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
"pop %%ecx; popa \n\t"
#endif
"setbe %0 \n\t"
: "=q" (fail)
: "=q" (vmx->fail)
: "r"(vmx->launched), "d"((unsigned long)HOST_RSP),
"c"(vcpu),
[rax]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_RAX])),
Expand Down Expand Up @@ -2387,13 +2395,6 @@ static int vmx_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)

preempt_enable();

if (unlikely(fail)) {
kvm_run->exit_reason = KVM_EXIT_FAIL_ENTRY;
kvm_run->fail_entry.hardware_entry_failure_reason
= vmcs_read32(VM_INSTRUCTION_ERROR);
r = 0;
goto out;
}
/*
* Profile KVM exit RIPs:
*/
Expand Down

0 comments on commit 32a3ef7

Please sign in to comment.