From 4b6bd1eda6a0bff919a31e12d8c24f1641bd8ef9 Mon Sep 17 00:00:00 2001 From: Elena Reshetova Date: Wed, 3 Jan 2018 23:43:33 -0800 Subject: [PATCH] x86/cpu/AMD: Remove now unused definition of MFENCE_RDTSC feature With the switch to using LFENCE_RDTSC on AMD platforms there is no longer a need for the MFENCE_RDTSC feature. Remove its usage and definition. Signed-off-by: Tom Lendacky Orabug: 27340445 CVE: CVE-2017-5753 Signed-off-by: Chuck Anderson Conflicts: Patch refers to arch/x86/include/asm/cpufeatures.h Code base has arch/x86/include/asm/cpufeature.h Patch references X86_FEATURE_MFENCE_RDTSC in arch/x86/include/asm/msr.h Code base references it in: arch/x86/include/asm/barrier.h arch/x86/um/asm/barrier.h Reviewed-by: John Haxby Signed-off-by: Kirtikar Kashyap --- arch/x86/include/asm/barrier.h | 3 +-- arch/x86/include/asm/cpufeature.h | 2 +- arch/x86/um/asm/barrier.h | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/x86/include/asm/barrier.h b/arch/x86/include/asm/barrier.h index 5c9b03b681a9..9a186bf55e26 100644 --- a/arch/x86/include/asm/barrier.h +++ b/arch/x86/include/asm/barrier.h @@ -93,8 +93,7 @@ do { \ */ static __always_inline void rdtsc_barrier(void) { - alternative_2("", "mfence", X86_FEATURE_MFENCE_RDTSC, - "lfence", X86_FEATURE_LFENCE_RDTSC); + alternative("", "lfence", X86_FEATURE_LFENCE_RDTSC); } #include diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h index e42510d0bb18..edf4c963f26e 100644 --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h @@ -97,7 +97,7 @@ #define X86_FEATURE_SYSCALL32 ( 3*32+14) /* "" syscall in ia32 userspace */ #define X86_FEATURE_SYSENTER32 ( 3*32+15) /* "" sysenter in ia32 userspace */ #define X86_FEATURE_REP_GOOD ( 3*32+16) /* rep microcode works well */ -#define X86_FEATURE_MFENCE_RDTSC ( 3*32+17) /* "" Mfence synchronizes RDTSC */ + #define X86_FEATURE_LFENCE_RDTSC ( 3*32+18) /* "" Lfence synchronizes RDTSC */ /* free, was #define X86_FEATURE_11AP ( 3*32+19) * "" Bad local APIC aka 11AP */ #define X86_FEATURE_NOPL ( 3*32+20) /* The NOPL (0F 1F) instructions */ diff --git a/arch/x86/um/asm/barrier.h b/arch/x86/um/asm/barrier.h index 7e8a1a650435..1f8fa123a043 100644 --- a/arch/x86/um/asm/barrier.h +++ b/arch/x86/um/asm/barrier.h @@ -53,8 +53,7 @@ */ static inline void rdtsc_barrier(void) { - alternative_2("", "mfence", X86_FEATURE_MFENCE_RDTSC, - "lfence", X86_FEATURE_LFENCE_RDTSC); + alternative("", "lfence", X86_FEATURE_LFENCE_RDTSC); } #endif -- 2.50.1