KVM: Hack real-mode segments on vmx from KVM_SET_SREGS
[deliverable/linux.git] / drivers / kvm / vmx.c
index 027a9625ef90160551b0eaf7b70b2adec2ca3ef6..578dff5424e3f5c4eaa9faab1c8adf12d2ee67ee 100644 (file)
@@ -864,7 +864,14 @@ static void vmx_set_segment(struct kvm_vcpu *vcpu,
        vmcs_writel(sf->base, var->base);
        vmcs_write32(sf->limit, var->limit);
        vmcs_write16(sf->selector, var->selector);
-       if (var->unusable)
+       if (vcpu->rmode.active && var->s) {
+               /*
+                * Hack real-mode segments into vm86 compatibility.
+                */
+               if (var->base == 0xffff0000 && var->selector == 0xf000)
+                       vmcs_writel(sf->base, 0xf0000);
+               ar = 0xf3;
+       } else if (var->unusable)
                ar = 1 << 16;
        else {
                ar = var->type & 15;
This page took 0.026489 seconds and 5 git commands to generate.