@@ -802,7 +802,6 @@ struct vcpu_vmx {
#endif
int gs_ldt_reload_needed;
int fs_reload_needed;
- u64 msr_host_bndcfgs;
} host_state;
struct {
int vm86_active;
@@ -845,6 +844,7 @@ struct vcpu_vmx {
u32 host_pkru;
unsigned long host_debugctlmsr;
+ u64 msr_host_bndcfgs;
/*
* Only bits masked by msr_ia32_feature_control_valid_bits can be set in
@@ -2622,7 +2622,7 @@ static void vmx_save_host_state(struct kvm_vcpu *vcpu)
vmcs_writel(HOST_GS_BASE, segment_base(vmx->host_state.gs_sel));
#endif
if (boot_cpu_has(X86_FEATURE_MPX))
- rdmsrl(MSR_IA32_BNDCFGS, vmx->host_state.msr_host_bndcfgs);
+ rdmsrl(MSR_IA32_BNDCFGS, vmx->msr_host_bndcfgs);
for (i = 0; i < vmx->save_nmsrs; ++i)
kvm_set_shared_msr(vmx->guest_msrs[i].index,
vmx->guest_msrs[i].data,
@@ -2660,8 +2660,8 @@ static void __vmx_load_host_state(struct vcpu_vmx *vmx)
#ifdef CONFIG_X86_64
wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_host_kernel_gs_base);
#endif
- if (vmx->host_state.msr_host_bndcfgs)
- wrmsrl(MSR_IA32_BNDCFGS, vmx->host_state.msr_host_bndcfgs);
+ if (vmx->msr_host_bndcfgs)
+ wrmsrl(MSR_IA32_BNDCFGS, vmx->msr_host_bndcfgs);
load_fixmap_gdt(raw_smp_processor_id());
}
Future patches will change the semantics of 'struct host_state' from a straightforward tracker to a means of optimizing away unnecessary VMWRITEs. Move msr_host_bndcfgs out of host_state as it won't mesh with the new semantics, to allow for more proper naming of host_state and to constrain a likely conflict with another in-flight patch[1] to this non-functional change. [1] https://www.spinics.net/lists/kvm/msg171645.html Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> --- arch/x86/kvm/vmx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)