From patchwork Fri Jul 31 02:42:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Hoo X-Patchwork-Id: 11693915 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E4C956C1 for ; Fri, 31 Jul 2020 02:42:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CC9D921744 for ; Fri, 31 Jul 2020 02:42:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731261AbgGaCmq (ORCPT ); Thu, 30 Jul 2020 22:42:46 -0400 Received: from mga12.intel.com ([192.55.52.136]:47518 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731145AbgGaCmp (ORCPT ); Thu, 30 Jul 2020 22:42:45 -0400 IronPort-SDR: Dhw/l8FOl1mM4+imSdunFd078rU5cJ0fyB0nnhPfg92P1QJt2V6NvZPVVKrmMFi/kbXwHz0JL2 wxrhn+HILHCg== X-IronPort-AV: E=McAfee;i="6000,8403,9698"; a="131290120" X-IronPort-AV: E=Sophos;i="5.75,416,1589266800"; d="scan'208";a="131290120" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jul 2020 19:42:45 -0700 IronPort-SDR: WtN5lIgcMkr7z4YAZDLp11Y/F6Rh0Rz+X09BPXZvf6CCTg7zzOjlhRZ6UuCCC48XEUKSqQUXAD o3VZEs+h01oQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,416,1589266800"; d="scan'208";a="304805996" Received: from sqa-gate.sh.intel.com (HELO robert-ivt.tsp.org) ([10.239.48.212]) by orsmga002.jf.intel.com with ESMTP; 30 Jul 2020 19:42:42 -0700 From: Robert Hoo To: kvm@vger.kernel.org, pbonzini@redhat.com, sean.j.christopherson@intel.com, xiaoyao.li@intel.com, vkuznets@redhat.com, wanpengli@tencent.com, jmattson@google.com, joro@8bytes.org Cc: robert.hu@intel.com, Robert Hoo Subject: [RFC PATCH 5/9] KVM:x86: Substitute kvm_update_cpuid_runtime() with kvm_mwait_update_cpuid() in kvm_set_msr_common() Date: Fri, 31 Jul 2020 10:42:23 +0800 Message-Id: <1596163347-18574-6-git-send-email-robert.hu@linux.intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1596163347-18574-1-git-send-email-robert.hu@linux.intel.com> References: <1596163347-18574-1-git-send-email-robert.hu@linux.intel.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Signed-off-by: Robert Hoo --- arch/x86/kvm/x86.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index e31dba2..d269670 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -2934,8 +2934,9 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) ((vcpu->arch.ia32_misc_enable_msr ^ data) & MSR_IA32_MISC_ENABLE_MWAIT)) { if (!guest_cpuid_has(vcpu, X86_FEATURE_XMM3)) return 1; + kvm_mwait_update_cpuid(vcpu, !!(data & MSR_IA32_MISC_ENABLE_MWAIT)); + vcpu->arch.ia32_misc_enable_msr = data; - kvm_update_cpuid_runtime(vcpu); } else { vcpu->arch.ia32_misc_enable_msr = data; }