From patchwork Wed Nov 22 10:23:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arbel Moshe X-Patchwork-Id: 10070173 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AB10760353 for ; Wed, 22 Nov 2017 10:24:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9539729C5D for ; Wed, 22 Nov 2017 10:24:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A3D329C60; Wed, 22 Nov 2017 10:24:42 +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=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY 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 1684629C5D for ; Wed, 22 Nov 2017 10:24:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753663AbdKVKYj (ORCPT ); Wed, 22 Nov 2017 05:24:39 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:19298 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753670AbdKVKYi (ORCPT ); Wed, 22 Nov 2017 05:24:38 -0500 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id vAMAOXrO001180 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Nov 2017 10:24:33 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id vAMAOXW0003485 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Nov 2017 10:24:33 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id vAMAOWTF001574; Wed, 22 Nov 2017 10:24:32 GMT Received: from spark.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 22 Nov 2017 02:24:32 -0800 From: Arbel Moshe To: pbonzini@redhat.com, rkrcmar@redhat.com, kvm@vger.kernel.org Cc: jmattson@google.com, wanpeng.li@hotmail.com, idan.brown@oracle.com, liran.alon@oracle.com, Arbel Moshe , Krish Sadhukhan Subject: [PATCH v2 2/3] KVM: nVMX: Update nested MSRs in case APICv refreshing Date: Wed, 22 Nov 2017 12:23:39 +0200 Message-Id: <20171122102340.7110-3-arbel.moshe@oracle.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171122102340.7110-1-arbel.moshe@oracle.com> References: <20171122102340.7110-1-arbel.moshe@oracle.com> X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix bug of not updating nested MSRs regarding APICv, when refreshing apicv exec ctrl. Before this commit, enabling Hyper-V SynIC would disable APICv controls in VMCS but still expose APICv controls to nested guest. Signed-off-by: Arbel Moshe Reviewed-by: Liran Alon Reviewed-by: Krish Sadhukhan Signed-off-by: Krish Sadhukhan --- arch/x86/kvm/vmx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 84ccd3b2762c..0450fbdb97be 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -5253,6 +5253,8 @@ static void vmx_refresh_apicv_exec_ctrl(struct kvm_vcpu *vcpu) if (cpu_has_vmx_msr_bitmap()) vmx_set_msr_bitmap(vcpu); + + nested_vmx_setup_ctls_msrs(vmx); } static u32 vmx_exec_control(struct vcpu_vmx *vmx)