All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm@vger.kernel.org
Subject: [PATCH 05/13] KVM: VMX: Allow real mode emulation using vm86 with dpl=0
Date: Tue, 21 Aug 2012 17:07:02 +0300	[thread overview]
Message-ID: <1345558030-29370-6-git-send-email-avi@redhat.com> (raw)
In-Reply-To: <1345558030-29370-1-git-send-email-avi@redhat.com>

Real mode is always entered from protected mode with dpl=0.  Since
the dpl doesn't affect execution, and we already override it to 3
in the vmcs (as vmx requires), we can allow execution in that state.

Signed-off-by: Avi Kivity <avi@redhat.com>
---
 arch/x86/kvm/vmx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index e94b90b..4f3d6ac 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -3318,7 +3318,7 @@ static bool rmode_segment_valid(struct kvm_vcpu *vcpu, int seg)
 		return false;
 	if (var.limit != 0xffff)
 		return false;
-	if (ar != 0xf3)
+	if ((ar | (3 << AR_DPL_SHIFT)) != 0xf3)
 		return false;
 
 	return true;
-- 
1.7.11.3


  parent reply	other threads:[~2012-08-21 14:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-21 14:06 [PATCH 00/13] Big real mode fixes Avi Kivity
2012-08-21 14:06 ` [PATCH 01/13] KVM: VMX: Separate saving pre-realmode state from setting segments Avi Kivity
2012-08-21 14:06 ` [PATCH 02/13] KVM: VMX: Fix incorrect lookup of segment S flag in fix_pmode_dataseg() Avi Kivity
2012-08-21 14:07 ` [PATCH 03/13] KVM: VMX: Use kvm_segment to save protected-mode segments when entering realmode Avi Kivity
2012-08-21 14:07 ` [PATCH 04/13] KVM: VMX: Retain limit and attributes when entering protected mode Avi Kivity
2012-08-21 14:07 ` Avi Kivity [this message]
2012-08-21 14:07 ` [PATCH 06/13] KVM: VMX: Allow vm86 virtualization of big real mode Avi Kivity
2012-08-21 14:07 ` [PATCH 07/13] KVM: x86 emulator: Leave segment limit and attributs alone in " Avi Kivity
2012-08-21 14:07 ` [PATCH 08/13] KVM: x86 emulator: Check segment limits in real mode too Avi Kivity
2012-08-21 14:07 ` [PATCH 09/13] KVM: x86 emulator: Fix #GP error code during linearization Avi Kivity
2012-08-21 14:07 ` [PATCH 10/13] KVM: VMX: Return real real-mode segment data even if emulate_invalid_guest_state=1 Avi Kivity
2012-08-21 14:07 ` [PATCH 11/13] KVM: VMX: Preserve segment limit and access rights in real mode Avi Kivity
2012-08-21 14:07 ` [PATCH 12/13] KVM: VMX: Save all segment data " Avi Kivity
2012-08-21 14:07 ` [PATCH 13/13] KVM: VMX: Ignore segment G and D bits when considering whether we can virtualize Avi Kivity
2012-08-28  0:08 ` [PATCH 00/13] Big real mode fixes Marcelo Tosatti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1345558030-29370-6-git-send-email-avi@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.