Commit 4fde8d57 authored by Paolo Bonzini's avatar Paolo Bonzini

KVM: vmx: unify adjacent #ifdefs

vmx_save_host_state has multiple ifdefs for CONFIG_X86_64 that have
no other code between them.  Simplify by reducing them to a single
conditional.
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 51e8a8cc
...@@ -2392,20 +2392,16 @@ static void vmx_save_host_state(struct kvm_vcpu *vcpu) ...@@ -2392,20 +2392,16 @@ static void vmx_save_host_state(struct kvm_vcpu *vcpu)
#ifdef CONFIG_X86_64 #ifdef CONFIG_X86_64
savesegment(ds, vmx->host_state.ds_sel); savesegment(ds, vmx->host_state.ds_sel);
savesegment(es, vmx->host_state.es_sel); savesegment(es, vmx->host_state.es_sel);
#endif
#ifdef CONFIG_X86_64
vmcs_writel(HOST_FS_BASE, current->thread.fsbase); vmcs_writel(HOST_FS_BASE, current->thread.fsbase);
vmcs_writel(HOST_GS_BASE, cpu_kernelmode_gs_base(cpu)); vmcs_writel(HOST_GS_BASE, cpu_kernelmode_gs_base(cpu));
#else
vmcs_writel(HOST_FS_BASE, segment_base(vmx->host_state.fs_sel));
vmcs_writel(HOST_GS_BASE, segment_base(vmx->host_state.gs_sel));
#endif
#ifdef CONFIG_X86_64
vmx->msr_host_kernel_gs_base = current->thread.gsbase; vmx->msr_host_kernel_gs_base = current->thread.gsbase;
if (is_long_mode(&vmx->vcpu)) if (is_long_mode(&vmx->vcpu))
wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_guest_kernel_gs_base); wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_guest_kernel_gs_base);
#else
vmcs_writel(HOST_FS_BASE, segment_base(vmx->host_state.fs_sel));
vmcs_writel(HOST_GS_BASE, segment_base(vmx->host_state.gs_sel));
#endif #endif
if (boot_cpu_has(X86_FEATURE_MPX)) if (boot_cpu_has(X86_FEATURE_MPX))
rdmsrl(MSR_IA32_BNDCFGS, vmx->host_state.msr_host_bndcfgs); rdmsrl(MSR_IA32_BNDCFGS, vmx->host_state.msr_host_bndcfgs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment