diff options
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r-- | arch/x86/kvm/vmx.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 32e6d2031ba2..0ba706e87c50 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -1773,16 +1773,13 @@ static void vmx_get_segment(struct kvm_vcpu *vcpu, | |||
1773 | 1773 | ||
1774 | static int vmx_get_cpl(struct kvm_vcpu *vcpu) | 1774 | static int vmx_get_cpl(struct kvm_vcpu *vcpu) |
1775 | { | 1775 | { |
1776 | struct kvm_segment kvm_seg; | ||
1777 | |||
1778 | if (!(vcpu->arch.cr0 & X86_CR0_PE)) /* if real mode */ | 1776 | if (!(vcpu->arch.cr0 & X86_CR0_PE)) /* if real mode */ |
1779 | return 0; | 1777 | return 0; |
1780 | 1778 | ||
1781 | if (vmx_get_rflags(vcpu) & X86_EFLAGS_VM) /* if virtual 8086 */ | 1779 | if (vmx_get_rflags(vcpu) & X86_EFLAGS_VM) /* if virtual 8086 */ |
1782 | return 3; | 1780 | return 3; |
1783 | 1781 | ||
1784 | vmx_get_segment(vcpu, &kvm_seg, VCPU_SREG_CS); | 1782 | return vmcs_read16(GUEST_CS_SELECTOR) & 3; |
1785 | return kvm_seg.selector & 3; | ||
1786 | } | 1783 | } |
1787 | 1784 | ||
1788 | static u32 vmx_segment_access_rights(struct kvm_segment *var) | 1785 | static u32 vmx_segment_access_rights(struct kvm_segment *var) |