]> err.no Git - linux-2.6/commitdiff
KVM: Move some more msr mangling into vmx_save_host_state()
authorAvi Kivity <avi@qumranet.com>
Wed, 2 May 2007 14:33:43 +0000 (17:33 +0300)
committerAvi Kivity <avi@qumranet.com>
Mon, 16 Jul 2007 09:05:39 +0000 (12:05 +0300)
Signed-off-by: Avi Kivity <avi@qumranet.com>
drivers/kvm/vmx.c

index 677b38c4444a26902fbacd77e4bd24758faf6112..93c3abfc1e0a8ac446f200f69201f1fdb83fb50b 100644 (file)
@@ -290,6 +290,13 @@ static void vmx_save_host_state(struct kvm_vcpu *vcpu)
        vmcs_writel(HOST_FS_BASE, segment_base(hs->fs_sel));
        vmcs_writel(HOST_GS_BASE, segment_base(hs->gs_sel));
 #endif
+
+#ifdef CONFIG_X86_64
+       if (is_long_mode(vcpu)) {
+               save_msrs(vcpu->host_msrs + msr_offset_kernel_gs_base, 1);
+               load_msrs(vcpu->guest_msrs, NR_BAD_MSRS);
+       }
+#endif
 }
 
 static void vmx_load_host_state(struct kvm_vcpu *vcpu)
@@ -1903,13 +1910,6 @@ preempted:
        if (vcpu->guest_debug.enabled)
                kvm_guest_debug_pre(vcpu);
 
-#ifdef CONFIG_X86_64
-       if (is_long_mode(vcpu)) {
-               save_msrs(vcpu->host_msrs + msr_offset_kernel_gs_base, 1);
-               load_msrs(vcpu->guest_msrs, NR_BAD_MSRS);
-       }
-#endif
-
 again:
        vmx_save_host_state(vcpu);
        kvm_load_guest_fpu(vcpu);