KVM: VMX: Fix check guest state validity if a guest is in VM86 mode
authorGleb Natapov <gleb@redhat.com>
Sun, 14 Apr 2013 13:07:37 +0000 (16:07 +0300)
committerMarcelo Tosatti <mtosatti@redhat.com>
Tue, 16 Apr 2013 21:34:19 +0000 (18:34 -0300)
If guest vcpu is in VM86 mode the vcpu state should be checked as if in
real mode.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/kvm/vmx.c

index 8d52bcf371df587f09a0c48ae193ae1b7980e809..c84f0cb921f96371342fea546d7199bc63de598c 100644 (file)
@@ -3605,7 +3605,7 @@ static bool guest_state_valid(struct kvm_vcpu *vcpu)
                return true;
 
        /* real mode guest state checks */
-       if (!is_protmode(vcpu)) {
+       if (!is_protmode(vcpu) || (vmx_get_rflags(vcpu) & X86_EFLAGS_VM)) {
                if (!rmode_segment_valid(vcpu, VCPU_SREG_CS))
                        return false;
                if (!rmode_segment_valid(vcpu, VCPU_SREG_SS))