]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit - arch/x86/kernel/cpu/amd.c
x86/cpu/AMD: Make LFENCE a serializing instruction
authorTom Lendacky <thomas.lendacky@amd.com>
Mon, 8 Jan 2018 22:09:21 +0000 (16:09 -0600)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Thu, 11 Jan 2018 18:49:41 +0000 (19:49 +0100)
commitbde943193168fe9a3814badaa0cae3422029dce5
tree388b517f30a2a749f63b6c9bc4200cbb0830da25
parentde8ab6bea570e70d1478af2c1667714bc900ae70
x86/cpu/AMD: Make LFENCE a serializing instruction

CVE-2017-5754

To aid in speculation control, make LFENCE a serializing instruction
since it has less overhead than MFENCE.  This is done by setting bit 1
of MSR 0xc0011029 (DE_CFG).  Some families that support LFENCE do not
have this MSR.  For these families, the LFENCE instruction is already
serializing.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Reviewed-by: Borislav Petkov <bp@suse.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Tim Chen <tim.c.chen@linux.intel.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@linux-foundation.org>
Cc: David Woodhouse <dwmw@amazon.co.uk>
Cc: Paul Turner <pjt@google.com>
Link: https://lkml.kernel.org/r/20180108220921.12580.71694.stgit@tlendack-t1.amdoffice.net
(cherry picked from commit e4d0e84e490790798691aaa0f2e598637f1867ec)
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
arch/x86/include/asm/msr-index.h
arch/x86/kernel/cpu/amd.c