summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRhythm Mahajan <rhythm.m.mahajan@oracle.com>2023-03-15 13:40:15 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-17 10:30:38 +0300
commit9e1f4df32ee8738b6781464a706c16f57ce0d68f (patch)
tree308fb0f89e9d841f04abf539a3ac57ce35d4a726
parent7f973ce9835454b99481c9547e010ecc80228b41 (diff)
downloadlinux-9e1f4df32ee8738b6781464a706c16f57ce0d68f.tar.xz
x86/cpu: Fix LFENCE serialization check in init_amd()
The commit: 3f235279828c ("x86/cpu: Restore AMD's DE_CFG MSR after resume") which was backported from the upstream commit: 2632daebafd0 renamed the MSR_F10H_DECFG_LFENCE_SERIALIZE macro to MSR_AMD64_DE_CFG_LFENCE_SERIALIZE. The fix for 4.14 and 4.9 changed MSR_F10H_DECFG_LFENCE_SERIALIZE to MSR_AMD64_DE_CFG_LFENCE_SERIALIZE_BIT in the init_amd() function, but should have used MSR_AMD64_DE_CFG_LFENCE_SERIALIZE. This causes a discrepency in the LFENCE serialization check in the init_amd() function. This causes a ~16% sysbench memory regression, when running: sysbench --test=memory run Fixes: 3f235279828c ("x86/cpu: Restore AMD's DE_CFG MSR after resume") Signed-off-by: Rhythm Mahajan <rhythm.m.mahajan@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--arch/x86/kernel/cpu/amd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 265d9c05bb32..e0c9ede0196a 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -950,7 +950,7 @@ static void init_amd(struct cpuinfo_x86 *c)
* serializing.
*/
ret = rdmsrl_safe(MSR_AMD64_DE_CFG, &val);
- if (!ret && (val & MSR_AMD64_DE_CFG_LFENCE_SERIALIZE_BIT)) {
+ if (!ret && (val & MSR_AMD64_DE_CFG_LFENCE_SERIALIZE)) {
/* A serializing LFENCE stops RDTSC speculation */
set_cpu_cap(c, X86_FEATURE_LFENCE_RDTSC);
} else {