From: Avi Kivity Date: Wed, 2 May 2007 14:33:43 +0000 (+0300) Subject: KVM: Move some more msr mangling into vmx_save_host_state() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=707c08743060b6721b08df68f4fd546b106e7510;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git KVM: Move some more msr mangling into vmx_save_host_state() Signed-off-by: Avi Kivity --- diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index 677b38c4444a..93c3abfc1e0a 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c @@ -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);