提交 39dcfb95 编写于 作者: G Gleb Natapov

KVM: VMX: remove redundant code from vmx_set_segment()

Segment descriptor's base is fixed by call to fix_rmode_seg(). Not need
to do it twice.
Reviewed-by: NMarcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: NGleb Natapov <gleb@redhat.com>
上级 beb853ff
...@@ -3268,7 +3268,7 @@ static void vmx_set_segment(struct kvm_vcpu *vcpu, ...@@ -3268,7 +3268,7 @@ static void vmx_set_segment(struct kvm_vcpu *vcpu,
{ {
struct vcpu_vmx *vmx = to_vmx(vcpu); struct vcpu_vmx *vmx = to_vmx(vcpu);
const struct kvm_vmx_segment_field *sf = &kvm_vmx_segment_fields[seg]; const struct kvm_vmx_segment_field *sf = &kvm_vmx_segment_fields[seg];
u32 ar; u32 ar = 0;
vmx_segment_cache_clear(vmx); vmx_segment_cache_clear(vmx);
...@@ -3280,15 +3280,9 @@ static void vmx_set_segment(struct kvm_vcpu *vcpu, ...@@ -3280,15 +3280,9 @@ static void vmx_set_segment(struct kvm_vcpu *vcpu,
vmcs_writel(sf->base, var->base); vmcs_writel(sf->base, var->base);
vmcs_write32(sf->limit, var->limit); vmcs_write32(sf->limit, var->limit);
vmcs_write16(sf->selector, var->selector); vmcs_write16(sf->selector, var->selector);
if (vmx->rmode.vm86_active && var->s) { if (vmx->rmode.vm86_active && var->s)
vmx->rmode.segs[seg] = *var; vmx->rmode.segs[seg] = *var;
/* else
* Hack real-mode segments into vm86 compatibility.
*/
if (var->base == 0xffff0000 && var->selector == 0xf000)
vmcs_writel(sf->base, 0xf0000);
ar = 0xf3;
} else
ar = vmx_segment_access_rights(var); ar = vmx_segment_access_rights(var);
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册