diff options
author | Avi Kivity <avi@redhat.com> | 2012-08-21 10:07:08 -0400 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2012-08-27 19:02:21 -0400 |
commit | 1390a28b274e2e45f89bac67c435cbcbc5cc0790 (patch) | |
tree | 622d33f371a22b1aa351cc81d7510f2415a7ab9b | |
parent | 726364202853f843a97a8ba4a7c3cd91e3aa84b7 (diff) |
KVM: VMX: Preserve segment limit and access rights in real mode
While this is undocumented, real processors do not reload the segment
limit and access rights when loading a segment register in real mode.
Real programs rely on it so we need to comply with this behaviour.
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
-rw-r--r-- | arch/x86/kvm/vmx.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 0d6872621ab5..6e6421aeca03 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -3113,6 +3113,9 @@ static void vmx_get_segment(struct kvm_vcpu *vcpu, | |||
3113 | if (seg == VCPU_SREG_TR | 3113 | if (seg == VCPU_SREG_TR |
3114 | || var->selector == vmx_read_guest_seg_selector(vmx, seg)) | 3114 | || var->selector == vmx_read_guest_seg_selector(vmx, seg)) |
3115 | return; | 3115 | return; |
3116 | var->base = vmx_read_guest_seg_base(vmx, seg); | ||
3117 | var->selector = vmx_read_guest_seg_selector(vmx, seg); | ||
3118 | return; | ||
3116 | } | 3119 | } |
3117 | var->base = vmx_read_guest_seg_base(vmx, seg); | 3120 | var->base = vmx_read_guest_seg_base(vmx, seg); |
3118 | var->limit = vmx_read_guest_seg_limit(vmx, seg); | 3121 | var->limit = vmx_read_guest_seg_limit(vmx, seg); |