Received: by 10.223.185.116 with SMTP id b49csp3369014wrg; Tue, 13 Feb 2018 01:16:51 -0800 (PST) X-Google-Smtp-Source: AH8x226+SmnHSkbPlfo3VTHO/OzBmVdvLptz+9sxSE6n4z1G9q9xncRWMMAaejk/GN8lPTkHOUrl X-Received: by 2002:a17:902:bb0b:: with SMTP id l11-v6mr503887pls.115.1518513411831; Tue, 13 Feb 2018 01:16:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518513411; cv=none; d=google.com; s=arc-20160816; b=vXJcAdkzJ+w4FlQjKkxp73MPrM6OLkcazYGmW5ZGIuBuSTkH9RlTS7iv2WAEC7y+Fj kYjW/IzHIGvZlmB6FrZD9gJ/S2f21Yu6K2Xen474hLKT3s+x0Yi/iwot+kwq0xq0E/wO 0VnHPuyj3+sGmKODUvPeXOxOfkw5gL9A5ndQVUfa7HjrNUhZLJiNlqYlulRj2ecY9mQ2 7cqC/0vAKWQ1w34ZICEADrKHYqeACG/yjwpVdl7ByNxOscCwyMshRJIJVuDLraMhrjmf U75J9xKPkkQu8qKdO3Q3Wnz4vEZ+4O6g3AYGDYyHUZeUZI9qgJE3GcaA6sUPv/3BspFU nXlg== 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=IIb71Q1McPs28Iljhx1WG1U9GB372io2UOHgnqU6ytg=; b=xELj/X/vgSMX3IyI1f/bv1Lt4eBeZeEDVdKv8Z7S94OGizL71+3jSOPBv5RuCsRKtx TfxPtexCbUqldPF0QA43SbTzS4oKz2oRLojGbxr9HSrYkq+vfsDyUkJzkgCW3LN6sY3z cCAsz2oNCo2ThlHtIOTE0KNuV4OZgzxcebFdAwIvfpmxmzvhpsT8JQ8ctC8U+gwSKQsK UW5njGNc6BFDbkp6nPdjrCGUSEAdEVljvyGOd56tMe2htEtqBFKGgs3Adj7qbDS0Q22n S3E79iHZHr1IEzxgGgraF+TQI2RfKAkeq/RJQMKvOXS/O3TBDMaiAiMddlerOC3/qsKz VlAA== 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 s65si859975pfe.45.2018.02.13.01.16.37; Tue, 13 Feb 2018 01:16:51 -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 S934463AbeBMJPc (ORCPT + 99 others); Tue, 13 Feb 2018 04:15:32 -0500 Received: from terminus.zytor.com ([198.137.202.136]:58399 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934024AbeBMJP3 (ORCPT ); Tue, 13 Feb 2018 04:15:29 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w1D8xhPs024070; Tue, 13 Feb 2018 00:59:43 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w1D8xhsN024066; Tue, 13 Feb 2018 00:59:43 -0800 Date: Tue, 13 Feb 2018 00:59:43 -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: torvalds@linux-foundation.org, bp@alien8.de, dan.j.williams@intel.com, dave.hansen@linux.intel.com, rkrcmar@redhat.com, pbonzini@redhat.com, mingo@kernel.org, luto@kernel.org, karahmed@amazon.de, peterz@infradead.org, arjan@linux.intel.com, hpa@zytor.com, linux-kernel@vger.kernel.org, dwmw2@infradead.org, dwmw@amazon.co.uk, gregkh@linuxfoundation.org, tglx@linutronix.de, jpoimboe@redhat.com Reply-To: dan.j.williams@intel.com, dave.hansen@linux.intel.com, rkrcmar@redhat.com, pbonzini@redhat.com, torvalds@linux-foundation.org, bp@alien8.de, peterz@infradead.org, arjan@linux.intel.com, hpa@zytor.com, mingo@kernel.org, karahmed@amazon.de, luto@kernel.org, linux-kernel@vger.kernel.org, dwmw2@infradead.org, dwmw@amazon.co.uk, tglx@linutronix.de, jpoimboe@redhat.com, gregkh@linuxfoundation.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: 3712caeb14dcb33fb4d5114f14c0beef10aca101 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: 3712caeb14dcb33fb4d5114f14c0beef10aca101 Gitweb: https://git.kernel.org/tip/3712caeb14dcb33fb4d5114f14c0beef10aca101 Author: KarimAllah Ahmed AuthorDate: Sat, 10 Feb 2018 23:39:26 +0000 Committer: Ingo Molnar CommitDate: Tue, 13 Feb 2018 09:00:17 +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 Acked-by: Paolo Bonzini 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: 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);