Received: by 10.223.185.116 with SMTP id b49csp1700811wrg; Sun, 11 Feb 2018 19:04:26 -0800 (PST) X-Google-Smtp-Source: AH8x224mmA497c01jW55AfH1L1IGxdG2jWZiGTQnI3ORQc10OGKehbB16JBZE+eakvrLo910CjsE X-Received: by 2002:a17:902:34f:: with SMTP id 73-v6mr242872pld.55.1518404666084; Sun, 11 Feb 2018 19:04:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518404666; cv=none; d=google.com; s=arc-20160816; b=BGDNKbX1Ww1xa7xLyU8sOk6s10qce2kWdsYAglvZDE6g4+7BYbMNjw3FmvRX4B3ChK fe7u5yOlBZUdZUYMfkw3jkmwdF0V/Jf5ysNYqjRKbbD7s23d34gvDMCX8aISQS3qb6x8 QLCuwBfgWaE0fX+g7K6FXSkVZY4qvDjSFtX6bKK1TOdMnj2dNxaQmcDzxuWCQfiO4wtE 7CKdb198RZ7iOMirwbq+nG7RoZJdOInRxFrUiViutygyCLlQYnmCiB+Y6yop0hrTlnXE gaRsbMiwk5R2d2oEttkPHkEaBenDl1vRbcV4suFZdpxfYDGRjY7QpB1DyIH+TaxktINb TBDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=OXSBy5YZ4ugk6tb8UanmKZR9HmNq63QrZpqhlHNUWkU=; b=dKQao0ufEkWBhJZeUHFbiU0mVc91xdGFsXwIR0Au79056tqt8ZcPNmIUQ4/uJe0Spn ExPqm+2wnZk7Eapty8u8ZOkn3eO9AfWkNgDzPltiKf4TW2TEnoOcS3sMYj4qpOReLh9r v1bnhl+xNbmLrQkbfNhZgw4FZvnlPHW8Yd99htfAd+ZiOG1wUdO4w+HPZLaWFa3xLy36 rmUTm8ertoPFSx/963wuXC1RR1FV95oGECj58Q5EX7ysCDIE2FB7iTdKnw/aEo1ViNbM 8scNz76zNKQhI9ADvWmkNOamhtCLaaRzUiyboqjy1J/r5NTvTpr60pxtW8xtDoHhSVn8 uUAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i67si3667483pfj.212.2018.02.11.19.04.11; Sun, 11 Feb 2018 19:04:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932604AbeBLCoP (ORCPT + 99 others); Sun, 11 Feb 2018 21:44:15 -0500 Received: from [198.137.202.136] ([198.137.202.136]:38281 "EHLO mail.zytor.com" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S932584AbeBLCoN (ORCPT ); Sun, 11 Feb 2018 21:44:13 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w1BCAnxF031829; Sun, 11 Feb 2018 04:10:49 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w1BCAmhS031826; Sun, 11 Feb 2018 04:10:48 -0800 Date: Sun, 11 Feb 2018 04:10:48 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for KarimAllah Ahmed Message-ID: Cc: luto@kernel.org, arjan@linux.intel.com, dave.hansen@linux.intel.com, linux-kernel@vger.kernel.org, peterz@infradead.org, dwmw@amazon.co.uk, rkrcmar@redhat.com, torvalds@linux-foundation.org, gregkh@linuxfoundation.org, mingo@kernel.org, hpa@zytor.com, jpoimboe@redhat.com, tglx@linutronix.de, dan.j.williams@intel.com, bp@alien8.de, dwmw2@infradead.org, karahmed@amazon.de, pbonzini@redhat.com Reply-To: hpa@zytor.com, tglx@linutronix.de, jpoimboe@redhat.com, dan.j.williams@intel.com, bp@alien8.de, pbonzini@redhat.com, dwmw2@infradead.org, karahmed@amazon.de, arjan@linux.intel.com, luto@kernel.org, linux-kernel@vger.kernel.org, dave.hansen@linux.intel.com, peterz@infradead.org, dwmw@amazon.co.uk, rkrcmar@redhat.com, gregkh@linuxfoundation.org, mingo@kernel.org, torvalds@linux-foundation.org In-Reply-To: <1518305967-31356-6-git-send-email-dwmw@amazon.co.uk> References: <1518305967-31356-6-git-send-email-dwmw@amazon.co.uk> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/pti] KVM/nVMX: Set the CPU_BASED_USE_MSR_BITMAPS if we have a valid L02 MSR bitmap Git-Commit-ID: ff37dc0cd96c266c7700386b7ba48abc32a91b1f X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: ff37dc0cd96c266c7700386b7ba48abc32a91b1f Gitweb: https://git.kernel.org/tip/ff37dc0cd96c266c7700386b7ba48abc32a91b1f Author: KarimAllah Ahmed AuthorDate: Sat, 10 Feb 2018 23:39:26 +0000 Committer: Ingo Molnar CommitDate: Sun, 11 Feb 2018 11:24:16 +0100 KVM/nVMX: Set the CPU_BASED_USE_MSR_BITMAPS if we have a valid L02 MSR bitmap We either clear the CPU_BASED_USE_MSR_BITMAPS and end up intercepting all MSR accesses or create a valid L02 MSR bitmap and use that. This decision has to be made every time we evaluate whether we are going to generate the L02 MSR bitmap. Before commit: d28b387fb74d ("KVM/VMX: Allow direct access to MSR_IA32_SPEC_CTRL") ... this was probably OK since the decision was always identical. This is no longer the case now since the MSR bitmap might actually change once we decide to not intercept SPEC_CTRL and PRED_CMD. Signed-off-by: KarimAllah Ahmed Signed-off-by: David Woodhouse Cc: Andy Lutomirski Cc: Arjan van de Ven Cc: Borislav Petkov Cc: Dan Williams Cc: Dave Hansen Cc: David Woodhouse Cc: Greg Kroah-Hartman Cc: Josh Poimboeuf Cc: Linus Torvalds Cc: Paolo Bonzini Cc: Peter Zijlstra Cc: Radim Krčmář Cc: Thomas Gleixner Cc: arjan.van.de.ven@intel.com Cc: dave.hansen@intel.com Cc: jmattson@google.com Cc: kvm@vger.kernel.org Cc: sironi@amazon.de Link: http://lkml.kernel.org/r/1518305967-31356-6-git-send-email-dwmw@amazon.co.uk Signed-off-by: Ingo Molnar --- arch/x86/kvm/vmx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 599179b..91e3539 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -10130,7 +10130,8 @@ static void nested_get_vmcs12_pages(struct kvm_vcpu *vcpu, if (cpu_has_vmx_msr_bitmap() && nested_cpu_has(vmcs12, CPU_BASED_USE_MSR_BITMAPS) && nested_vmx_merge_msr_bitmap(vcpu, vmcs12)) - ; + vmcs_set_bits(CPU_BASED_VM_EXEC_CONTROL, + CPU_BASED_USE_MSR_BITMAPS); else vmcs_clear_bits(CPU_BASED_VM_EXEC_CONTROL, CPU_BASED_USE_MSR_BITMAPS);