summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSheng Yang <sheng@linux.intel.com>2010-12-08 10:49:43 +0800
committerAvi Kivity <avi@redhat.com>2010-12-08 17:28:31 +0200
commit3ea3aa8cf67d3bbe00a19b6a4013d19efa7d0f41 (patch)
treec4184c1706a85fa14db668b80ee8114d408fd0df /arch
parent6313e3c21743cc88bb5bd8aa72948ee1e83937b6 (diff)
downloadlinux-3ea3aa8cf67d3bbe00a19b6a4013d19efa7d0f41.tar.gz
linux-3ea3aa8cf67d3bbe00a19b6a4013d19efa7d0f41.tar.bz2
linux-3ea3aa8cf67d3bbe00a19b6a4013d19efa7d0f41.zip
KVM: Fix OSXSAVE after migration
CPUID's OSXSAVE is a mirror of CR4.OSXSAVE bit. We need to update the CPUID after migration. KVM-Stable-Tag. Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/x86.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index cdac9e592aa5..eb5c83479d89 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5522,6 +5522,8 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
mmu_reset_needed |= kvm_read_cr4(vcpu) != sregs->cr4;
kvm_x86_ops->set_cr4(vcpu, sregs->cr4);
+ if (sregs->cr4 & X86_CR4_OSXSAVE)
+ update_cpuid(vcpu);
if (!is_long_mode(vcpu) && is_pae(vcpu)) {
load_pdptrs(vcpu, vcpu->arch.walk_mmu, vcpu->arch.cr3);
mmu_reset_needed = 1;