lkml.org 
[lkml]   [2018]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4.18 61/79] x86/KVM/VMX: Dont set l1tf_flush_l1d to true from vmx_l1d_flush()
Date
4.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Nicolai Stange <nstange@suse.de>

vmx_l1d_flush() gets invoked only if l1tf_flush_l1d is true. There's no
point in setting l1tf_flush_l1d to true from there again.

Signed-off-by: Nicolai Stange <nstange@suse.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/kvm/vmx.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -9727,15 +9727,15 @@ static void vmx_l1d_flush(struct kvm_vcp
/*
* This code is only executed when the the flush mode is 'cond' or
* 'always'
- *
- * If 'flush always', keep the flush bit set, otherwise clear
- * it. The flush bit gets set again either from vcpu_run() or from
- * one of the unsafe VMEXIT handlers.
*/
- if (static_branch_unlikely(&vmx_l1d_flush_always))
- vcpu->arch.l1tf_flush_l1d = true;
- else
+ if (!static_branch_unlikely(&vmx_l1d_flush_always)) {
+ /*
+ * Clear the flush bit, it gets set again either from
+ * vcpu_run() or from one of the unsafe VMEXIT
+ * handlers.
+ */
vcpu->arch.l1tf_flush_l1d = false;
+ }

vcpu->stat.l1d_flush++;


\
 
 \ /
  Last update: 2018-08-14 20:11    [W:0.242 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site