Skip to content

Commit

Permalink
x86/KVM/VMX: Don't set l1tf_flush_l1d to true from vmx_l1d_flush()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nicolai Stange authored and Thomas Gleixner committed Aug 5, 2018
1 parent 73d5e2b commit 379fd0c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions arch/x86/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -9691,15 +9691,15 @@ static void vmx_l1d_flush(struct kvm_vcpu *vcpu)
/*
* 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++;

Expand Down

0 comments on commit 379fd0c

Please sign in to comment.