]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86/speculation: Add basic IBPB (Indirect Branch Prediction Barrier) support
authorDavid Woodhouse <dwmw@amazon.co.uk>
Thu, 25 Jan 2018 16:14:15 +0000 (16:14 +0000)
committerJack Vogel <jack.vogel@oracle.com>
Thu, 8 Feb 2018 18:16:35 +0000 (10:16 -0800)
commit565b0bd86e905ba3333ddb13a8e8ae63010bbad6
treed9b9f0ac8db8be80aecef8bfc94250a7296307ca
parent352293dd697dc1b8127e0cdf5fda94f0bf79723c
x86/speculation: Add basic IBPB (Indirect Branch Prediction Barrier) support

Expose indirect_branch_prediction_barrier() for use in subsequent patches.

[ tglx: Add IBPB status to spectre_v2 sysfs file ]

Co-developed-by: KarimAllah Ahmed <karahmed@amazon.de>
Signed-off-by: KarimAllah Ahmed <karahmed@amazon.de>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Cc: gnomes@lxorguk.ukuu.org.uk
Cc: ak@linux.intel.com
Cc: ashok.raj@intel.com
Cc: dave.hansen@intel.com
Cc: arjan@linux.intel.com
Cc: torvalds@linux-foundation.org
Cc: peterz@infradead.org
Cc: bp@alien8.de
Cc: pbonzini@redhat.com
Cc: tim.c.chen@linux.intel.com
Cc: gregkh@linux-foundation.org
Link: https://lkml.kernel.org/r/1516896855-7642-8-git-send-email-dwmw@amazon.co.uk
(cherry picked from commit 20ffa1caecca4db8f79fe665acdeaa5af815a24d)
Orabug: 27477743
CVE: CVE-2017-5715

 Conflicts:
arch/x86/include/asm/cpufeatures.h
arch/x86/kernel/cpu/bugs.c
[The original version of this patch doesn't set X86_FEATURE_IBPB, so do
it ourselves.  Given X86_FEATURE_SPEC_CTRL (i.e. CPUID.07.[EDX.26])[*],
always set X86_FEATURE_IBPB in scattered.c.  This omission did not
impact the actual IBPB functionality as the code uses 'ibpb_inuse': the
only thing missing was the 'ibpb' string in /proc/cpuinfo.

Since we already have code to enable IBPB (e.g. switch_mm_irqs_off),
there is no point in backporting indirect_branch_prediction_barrier from
this patch.]

[*] 336996-Speculative-Execution-Side-Channel-Mitigations.pdf

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Pavel Tatashin <pasha.tatashin@oracle.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Daniel Jordan <daniel.m.jordan@oracle.com>
arch/x86/kernel/cpu/bugs_64.c
arch/x86/kernel/cpu/scattered.c