From patchwork Mon Jul 23 19:32:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Christopherson X-Patchwork-Id: 10540787 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DB3AC90E3 for ; Mon, 23 Jul 2018 19:33:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CAC2A283C9 for ; Mon, 23 Jul 2018 19:33:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF3AA2832D; Mon, 23 Jul 2018 19:33:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A527283C9 for ; Mon, 23 Jul 2018 19:33:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388085AbeGWUgJ (ORCPT ); Mon, 23 Jul 2018 16:36:09 -0400 Received: from mga02.intel.com ([134.134.136.20]:3729 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388039AbeGWUgI (ORCPT ); Mon, 23 Jul 2018 16:36:08 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Jul 2018 12:33:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,394,1526367600"; d="scan'208";a="247679504" Received: from sjchrist-coffee.jf.intel.com ([10.54.74.132]) by fmsmga005.fm.intel.com with ESMTP; 23 Jul 2018 12:32:53 -0700 From: Sean Christopherson To: kvm@vger.kernel.org, pbonzini@redhat.com, rkrcmar@redhat.com Cc: sean.j.christopherson@intel.com Subject: [PATCH 01/11] KVM: vmx: move msr_host_bndcfgs out of struct host_state Date: Mon, 23 Jul 2018 12:32:40 -0700 Message-Id: <20180723193250.13555-2-sean.j.christopherson@intel.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180723193250.13555-1-sean.j.christopherson@intel.com> References: <20180723193250.13555-1-sean.j.christopherson@intel.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Peter Shier Tested-by: Peter Shier --- arch/x86/kvm/vmx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 1689f433f3a0..553bf26af831 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -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()); }