aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/vmx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/kvm/vmx.c')
-rw-r--r--drivers/kvm/vmx.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index 027a9625ef90..578dff5424e3 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -864,7 +864,14 @@ static void vmx_set_segment(struct kvm_vcpu *vcpu,
864 vmcs_writel(sf->base, var->base); 864 vmcs_writel(sf->base, var->base);
865 vmcs_write32(sf->limit, var->limit); 865 vmcs_write32(sf->limit, var->limit);
866 vmcs_write16(sf->selector, var->selector); 866 vmcs_write16(sf->selector, var->selector);
867 if (var->unusable) 867 if (vcpu->rmode.active && var->s) {
868 /*
869 * Hack real-mode segments into vm86 compatibility.
870 */
871 if (var->base == 0xffff0000 && var->selector == 0xf000)
872 vmcs_writel(sf->base, 0xf0000);
873 ar = 0xf3;
874 } else if (var->unusable)
868 ar = 1 << 16; 875 ar = 1 << 16;
869 else { 876 else {
870 ar = var->type & 15; 877 ar = var->type & 15;