diff mbox

KVM: VMX: Fix check guest state validity if a guest is in VM86 mode

Message ID 20130414130737.GP17919@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Gleb Natapov April 14, 2013, 1:07 p.m. UTC
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>
--
			Gleb.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Marcelo Tosatti April 16, 2013, 9:34 p.m. UTC | #1
On Sun, Apr 14, 2013 at 04:07:37PM +0300, Gleb Natapov wrote:
> 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>

Applied, thanks.

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index d268677..fec7c48 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -3554,7 +3554,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))