Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 315870
b: refs/heads/master
c: d881e6f
h: refs/heads/master
v: v3
  • Loading branch information
Avi Kivity committed Jul 9, 2012
1 parent af25086 commit 2c5753a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 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: e676505ac96813e8b93170b1f5e5ffe0cf6a2348
refs/heads/master: d881e6f6cffe3993245963143cab2528f918e071
15 changes: 13 additions & 2 deletions trunk/arch/x86/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -3175,11 +3175,22 @@ static int __vmx_get_cpl(struct kvm_vcpu *vcpu)

static int vmx_get_cpl(struct kvm_vcpu *vcpu)
{
struct vcpu_vmx *vmx = to_vmx(vcpu);

/*
* If we enter real mode with cs.sel & 3 != 0, the normal CPL calculations
* fail; use the cache instead.
*/
if (unlikely(vmx->emulation_required && emulate_invalid_guest_state)) {
return vmx->cpl;
}

if (!test_bit(VCPU_EXREG_CPL, (ulong *)&vcpu->arch.regs_avail)) {
__set_bit(VCPU_EXREG_CPL, (ulong *)&vcpu->arch.regs_avail);
to_vmx(vcpu)->cpl = __vmx_get_cpl(vcpu);
vmx->cpl = __vmx_get_cpl(vcpu);
}
return to_vmx(vcpu)->cpl;

return vmx->cpl;
}


Expand Down

0 comments on commit 2c5753a

Please sign in to comment.