aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2011-02-21 05:07:58 -0500
committerMarcelo Tosatti <mtosatti@redhat.com>2011-03-17 12:08:31 -0400
commita8ba6c2622036101d0c6a195f97546bcb1a056ab (patch)
tree11979981ad9f49b379cadfe02c9718b9deec1f27 /arch/x86
parenta3b5ba49a8c58d9a578e016523b047467a41e047 (diff)
KVM: VMX: update live TR selector if it changes in real mode
When rmode.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> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kvm/vmx.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index a61ed93a1f25..dafb67eddd60 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,
2138 u32 ar; 2138 u32 ar;
2139 2139
2140 if (vmx->rmode.vm86_active && seg == VCPU_SREG_TR) { 2140 if (vmx->rmode.vm86_active && seg == VCPU_SREG_TR) {
2141 vmcs_write16(sf->selector, var->selector);
2141 vmx->rmode.tr.selector = var->selector; 2142 vmx->rmode.tr.selector = var->selector;
2142 vmx->rmode.tr.base = var->base; 2143 vmx->rmode.tr.base = var->base;
2143 vmx->rmode.tr.limit = var->limit; 2144 vmx->rmode.tr.limit = var->limit;