]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86/KVM/VMX: Move the l1tf_flush_l1d test to vmx_l1d_flush()
authorNicolai Stange <nstange@suse.de>
Sat, 21 Jul 2018 20:35:28 +0000 (22:35 +0200)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Sat, 11 Aug 2018 00:44:49 +0000 (20:44 -0400)
commit1d79ffcd21f88dfa59257ad88b1dcf7f36f36e62
tree6014e924fc7588c2642c6a8a4ea95159b5585c2a
parent810580944c34a31905218c97ee8e15190ca53e3f
x86/KVM/VMX: Move the l1tf_flush_l1d test to vmx_l1d_flush()

Currently, vmx_vcpu_run() checks if l1tf_flush_l1d is set and invokes
vmx_l1d_flush() if so.

This test is unncessary for the "always flush L1D" mode.

Move the check to vmx_l1d_flush()'s conditional mode code path.

Notes:
- vmx_l1d_flush() is likely to get inlined anyway and thus, there's no
  extra function call.

- This inverts the (static) branch prediction, but there hadn't been any
  explicit likely()/unlikely() annotations before and so it stays as is.

Signed-off-by: Nicolai Stange <nstange@suse.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Orabug: 28220625
CVE: CVE-2018-3646

(cherry picked from commit 5b6ccc6c3b1a477fbac9ec97a0b4c1c48e765209)

Signed-off-by: Mihai Carabas <mihai.carabas@oracle.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Conflicts:
arch/x86/kvm/vmx.c
Contextual: different content caused by not having all static key features
arch/x86/kvm/vmx.c