]> git.hungrycats.org Git - linux/commitdiff
KVM: SVM: Set the 'busy' flag of the TR selector
authorAmit Shah <amit.shah@redhat.com>
Mon, 23 Mar 2009 20:51:23 +0000 (17:51 -0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 2 May 2009 17:57:06 +0000 (10:57 -0700)
(cherry picked from c0d09828c870f90c6bc72070ada281568f89c63b)

The busy flag of the TR selector is not set by the hardware. This breaks
migration from amd hosts to intel hosts.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/kvm/svm.c

index 14ba6ff63cfc1a6ccd47e64c9153fb901aad64d5..cf5c7aaea2f92853d45de6bf964fb5ee340ffef0 100644 (file)
@@ -781,6 +781,13 @@ static void svm_get_segment(struct kvm_vcpu *vcpu,
        if (seg == VCPU_SREG_CS)
                var->g = s->limit > 0xfffff;
 
+       /*
+        * Work around a bug where the busy flag in the tr selector
+        * isn't exposed
+        */
+       if (seg == VCPU_SREG_TR)
+               var->type |= 0x2;
+
        var->unusable = !var->present;
 }