#endif
#ifdef CONFIG_X86_64
- if (is_long_mode(&vmx->vcpu))
- save_msrs(vmx->host_msrs +
- vmx->msr_offset_kernel_gs_base, 1);
-
+ save_msrs(vmx->host_msrs + vmx->msr_offset_kernel_gs_base, 1);
#endif
load_msrs(vmx->guest_msrs, vmx->save_nmsrs);
load_transition_efer(vmx);
vmx->host_state.loaded = 0;
if (vmx->host_state.fs_reload_needed)
loadsegment(fs, vmx->host_state.fs_sel);
+#ifdef CONFIG_X86_64
+ if (is_long_mode(&vmx->vcpu))
+ save_msrs(vmx->guest_msrs + vmx->msr_offset_kernel_gs_base, 1);
+#endif
if (vmx->host_state.gs_ldt_reload_needed) {
kvm_load_ldt(vmx->host_state.ldt_sel);
#ifdef CONFIG_X86_64
load_gs_index(vmx->host_state.gs_sel);
- wrmsrl(MSR_KERNEL_GS_BASE, current->thread.gs);
#else
loadsegment(gs, vmx->host_state.gs_sel);
#endif
}
reload_tss();
+#ifdef CONFIG_X86_64
+ save_msrs(vmx->guest_msrs, vmx->msr_offset_kernel_gs_base);
+ save_msrs(vmx->guest_msrs + vmx->msr_offset_kernel_gs_base + 1,
+ vmx->save_nmsrs - vmx->msr_offset_kernel_gs_base - 1);
+#else
save_msrs(vmx->guest_msrs, vmx->save_nmsrs);
+#endif
load_msrs(vmx->host_msrs, vmx->save_nmsrs);
reload_host_efer(vmx);
load_gdt(&__get_cpu_var(host_gdt));