[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-206587a9fb764d71f035dc7f6d3b6488f5d5b304@git.kernel.org>
Date: Tue, 13 Feb 2018 00:59:15 -0800
From: tip-bot for KarimAllah Ahmed <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: rkrcmar@...hat.com, tglx@...utronix.de,
linux-kernel@...r.kernel.org, pbonzini@...hat.com,
peterz@...radead.org, arjan@...ux.intel.com, mingo@...nel.org,
dwmw2@...radead.org, luto@...nel.org, dan.j.williams@...el.com,
jmattson@...gle.com, karahmed@...zon.de, bp@...en8.de,
dave.hansen@...ux.intel.com, torvalds@...ux-foundation.org,
dwmw@...zon.co.uk, jpoimboe@...hat.com, hpa@...or.com,
gregkh@...uxfoundation.org
Subject: [tip:x86/pti] X86/nVMX: Properly set spec_ctrl and pred_cmd before
merging MSRs
Commit-ID: 206587a9fb764d71f035dc7f6d3b6488f5d5b304
Gitweb: https://git.kernel.org/tip/206587a9fb764d71f035dc7f6d3b6488f5d5b304
Author: KarimAllah Ahmed <karahmed@...zon.de>
AuthorDate: Sat, 10 Feb 2018 23:39:25 +0000
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Tue, 13 Feb 2018 09:00:06 +0100
X86/nVMX: Properly set spec_ctrl and pred_cmd before merging MSRs
These two variables should check whether SPEC_CTRL and PRED_CMD are
supposed to be passed through to L2 guests or not. While
msr_write_intercepted_l01 would return 'true' if it is not passed through.
So just invert the result of msr_write_intercepted_l01 to implement the
correct semantics.
Signed-off-by: KarimAllah Ahmed <karahmed@...zon.de>
Signed-off-by: David Woodhouse <dwmw@...zon.co.uk>
Reviewed-by: Jim Mattson <jmattson@...gle.com>
Acked-by: Paolo Bonzini <pbonzini@...hat.com>
Cc: Andy Lutomirski <luto@...nel.org>
Cc: Arjan van de Ven <arjan@...ux.intel.com>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Dan Williams <dan.j.williams@...el.com>
Cc: Dave Hansen <dave.hansen@...ux.intel.com>
Cc: David Woodhouse <dwmw2@...radead.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Josh Poimboeuf <jpoimboe@...hat.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Radim Krčmář <rkrcmar@...hat.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: arjan.van.de.ven@...el.com
Cc: dave.hansen@...el.com
Cc: kvm@...r.kernel.org
Cc: sironi@...zon.de
Fixes: 086e7d4118cc ("KVM: VMX: Allow direct access to MSR_IA32_SPEC_CTRL")
Link: http://lkml.kernel.org/r/1518305967-31356-5-git-send-email-dwmw@amazon.co.uk
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
arch/x86/kvm/vmx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index bee4c49..599179b 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -10219,8 +10219,8 @@ static inline bool nested_vmx_merge_msr_bitmap(struct kvm_vcpu *vcpu,
* updated to reflect this when L1 (or its L2s) actually write to
* the MSR.
*/
- bool pred_cmd = msr_write_intercepted_l01(vcpu, MSR_IA32_PRED_CMD);
- bool spec_ctrl = msr_write_intercepted_l01(vcpu, MSR_IA32_SPEC_CTRL);
+ bool pred_cmd = !msr_write_intercepted_l01(vcpu, MSR_IA32_PRED_CMD);
+ bool spec_ctrl = !msr_write_intercepted_l01(vcpu, MSR_IA32_SPEC_CTRL);
if (!nested_cpu_has_virt_x2apic_mode(vmcs12) &&
!pred_cmd && !spec_ctrl)
Powered by blists - more mailing lists