Commit c03cef66 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Stefan Bader

x86/cpufeatures: Add FEATURE_ZEN

Add a ZEN feature bit so family-dependent static_cpu_has() optimizations
can be built for ZEN.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarBorislav Petkov <bp@suse.de>
Reviewed-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>

CVE-2018-3639 (x86)

(backported from commit d1035d97)
[smb: adapted to set feature in the right place]
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
parent 21e1e57b
...@@ -209,6 +209,7 @@ ...@@ -209,6 +209,7 @@
#define X86_FEATURE_IBRS ( 7*32+25) /* Indirect Branch Restricted Speculation */ #define X86_FEATURE_IBRS ( 7*32+25) /* Indirect Branch Restricted Speculation */
#define X86_FEATURE_IBPB ( 7*32+26) /* Indirect Branch Prediction Barrier */ #define X86_FEATURE_IBPB ( 7*32+26) /* Indirect Branch Prediction Barrier */
#define X86_FEATURE_STIBP ( 7*32+27) /* Single Thread Indirect Branch Predictors */ #define X86_FEATURE_STIBP ( 7*32+27) /* Single Thread Indirect Branch Predictors */
#define X86_FEATURE_ZEN ( 7*32+28) /* "" CPU is AMD family 0x17 (Zen) */
/* Because the ALTERNATIVE scheme is for members of the X86_FEATURE club... */ /* Because the ALTERNATIVE scheme is for members of the X86_FEATURE club... */
#define X86_FEATURE_KAISER ( 7*32+31) /* CONFIG_PAGE_TABLE_ISOLATION w/o nokaiser */ #define X86_FEATURE_KAISER ( 7*32+31) /* CONFIG_PAGE_TABLE_ISOLATION w/o nokaiser */
......
...@@ -806,6 +806,7 @@ static void init_amd(struct cpuinfo_x86 *c) ...@@ -806,6 +806,7 @@ static void init_amd(struct cpuinfo_x86 *c)
set_cpu_bug(c, X86_BUG_AMD_APIC_C1E); set_cpu_bug(c, X86_BUG_AMD_APIC_C1E);
if (c->x86 == 0x17) { if (c->x86 == 0x17) {
set_cpu_cap(c, X86_FEATURE_ZEN);
/* /*
* Fix erratum 1076: CPB feature bit not being set in CPUID. * Fix erratum 1076: CPB feature bit not being set in CPUID.
* It affects all up to and including B1. * It affects all up to and including B1.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment