x86/spectre: Favor IBRS on Skylake over retpoline
Couple of rules around this. If the user has choosen:
spectre_v2=retpoline
spectre_v2=retpoline,generic
That we will respect their wishes.
If the customer has:
spectre_v2=auto (by default)
spectre_v2=force
Then we will figure out if this is a machine with Skylake
affected CPUS. If so, we will pick IBRS over retpoline
if IBRS is available.
And lastly, if the kernel is compiled without retpoline
support we will pick IBRS over minimal retpoline support
(if IBRS is available).
In other words the priority for non-Skylake is:
retpoline
IBRS
minimal asm
On Skylake:
IBRS
retpoline
minimal asm
Orabug:
27477743
CVE: CVE-2017-5715
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>