public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] KVM: VMX: write new TR selector value into vmcs immediately if it changes during vm86 mode.
@ 2011-02-21 10:07 Gleb Natapov
  2011-02-21 10:07 ` [PATCH 2/2] KVM: VMX: Initialize vm86 TSS only once Gleb Natapov
  2011-02-27 15:38 ` [PATCH 1/2] KVM: VMX: write new TR selector value into vmcs immediately if it changes during vm86 mode Avi Kivity
  0 siblings, 2 replies; 12+ messages in thread
From: Gleb Natapov @ 2011-02-21 10:07 UTC (permalink / raw)
  To: avi, mtosatti; +Cc: kvm

When vm86 is active TR descriptor is updated with vm86 task values,
but selector is left intact. vmx_set_segment() makes sure that if TR
register is written into while vm86 is active the new values are saved
for use after vm86 is deactivated, but since selector is not updated on
vm86 activation/deactivation new value is lost. Fix this by writing new
selector into vmcs immediately.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
---
 arch/x86/kvm/vmx.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index a61ed93..dafb67e 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -2138,6 +2138,7 @@ static void vmx_set_segment(struct kvm_vcpu *vcpu,
 	u32 ar;
 
 	if (vmx->rmode.vm86_active && seg == VCPU_SREG_TR) {
+		vmcs_write16(sf->selector, var->selector);
 		vmx->rmode.tr.selector = var->selector;
 		vmx->rmode.tr.base = var->base;
 		vmx->rmode.tr.limit = var->limit;
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-02-27 16:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-21 10:07 [PATCH 1/2] KVM: VMX: write new TR selector value into vmcs immediately if it changes during vm86 mode Gleb Natapov
2011-02-21 10:07 ` [PATCH 2/2] KVM: VMX: Initialize vm86 TSS only once Gleb Natapov
2011-02-27 15:43   ` Avi Kivity
2011-02-27 15:52     ` Gleb Natapov
2011-02-27 15:58       ` Avi Kivity
2011-02-27 16:04         ` Avi Kivity
2011-02-27 16:27           ` Gleb Natapov
2011-02-27 16:31             ` Avi Kivity
2011-02-27 16:58               ` Gleb Natapov
2011-02-27 16:12         ` Gleb Natapov
2011-02-27 16:18           ` Avi Kivity
2011-02-27 15:38 ` [PATCH 1/2] KVM: VMX: write new TR selector value into vmcs immediately if it changes during vm86 mode Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox