mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-02 02:34:05 +08:00
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>
This commit is contained in:
parent
7263642028
commit
1390a28b27
@ -3113,6 +3113,9 @@ static void vmx_get_segment(struct kvm_vcpu *vcpu,
|
|||||||
if (seg == VCPU_SREG_TR
|
if (seg == VCPU_SREG_TR
|
||||||
|| var->selector == vmx_read_guest_seg_selector(vmx, seg))
|
|| var->selector == vmx_read_guest_seg_selector(vmx, seg))
|
||||||
return;
|
return;
|
||||||
|
var->base = vmx_read_guest_seg_base(vmx, seg);
|
||||||
|
var->selector = vmx_read_guest_seg_selector(vmx, seg);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
var->base = vmx_read_guest_seg_base(vmx, seg);
|
var->base = vmx_read_guest_seg_base(vmx, seg);
|
||||||
var->limit = vmx_read_guest_seg_limit(vmx, seg);
|
var->limit = vmx_read_guest_seg_limit(vmx, seg);
|
||||||
|
Loading…
Reference in New Issue
Block a user