All of lore.kernel.org
 help / color / mirror / Atom feed
* SBB V10 Bundle
@ 2018-05-01 22:53 Thomas Gleixner
  2018-05-02 11:04 ` [MODERATED] " Ingo Molnar
  2018-05-02 12:07 ` Ingo Molnar
  0 siblings, 2 replies; 9+ messages in thread
From: Thomas Gleixner @ 2018-05-01 22:53 UTC (permalink / raw)
  To: speck

[-- Attachment #1: Type: text/plain, Size: 2794 bytes --]

Hi!

Find attached the V10 bundle.

Changes from V9:

   - Fix the AMD CPU hotplug fallout

   - Add non vulnerable AMD models to the whitelist (Borislav)

I've update all three branches in the repository as well.

Delta patch to V9 below.

Thanks,

	tglx

8<------------------
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 6cd982709daf..50c6ba6d031b 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -555,6 +555,26 @@ static void bsp_init_amd(struct cpuinfo_x86 *c)
 		rdmsrl(MSR_FAM10H_NODE_ID, value);
 		nodes_per_socket = ((value >> 3) & 7) + 1;
 	}
+
+	if (c->x86 >= 0x15 && c->x86 <= 0x17) {
+		unsigned int bit;
+
+		switch (c->x86) {
+		case 0x15: bit = 54; break;
+		case 0x16: bit = 33; break;
+		case 0x17: bit = 10; break;
+		default: return;
+		}
+		/*
+		 * Try to cache the base value so further operations can
+		 * avoid RMW. If that faults, do not enable RDS.
+		 */
+		if (!rdmsrl_safe(MSR_AMD64_LS_CFG, &x86_amd_ls_cfg_base)) {
+			setup_force_cpu_cap(X86_FEATURE_RDS);
+			setup_force_cpu_cap(X86_FEATURE_AMD_RDS);
+			x86_amd_ls_cfg_rds_mask = (1ULL << bit);
+		}
+	}
 }
 
 static void early_detect_mem_encrypt(struct cpuinfo_x86 *c)
@@ -674,26 +694,6 @@ static void early_init_amd(struct cpuinfo_x86 *c)
 		set_cpu_bug(c, X86_BUG_AMD_E400);
 
 	early_detect_mem_encrypt(c);
-
-	if (c->x86 >= 0x15 && c->x86 <= 0x17) {
-		unsigned int bit;
-
-		switch (c->x86) {
-		case 0x15: bit = 54; break;
-		case 0x16: bit = 33; break;
-		case 0x17: bit = 10; break;
-		default: return;
-		}
-		/*
-		 * Try to cache the base value so further operations can
-		 * avoid RMW. If that faults, do not enable RDS.
-		 */
-		if (!rdmsrl_safe(MSR_AMD64_LS_CFG, &x86_amd_ls_cfg_base)) {
-			set_cpu_cap(c, X86_FEATURE_RDS);
-			set_cpu_cap(c, X86_FEATURE_AMD_RDS);
-			x86_amd_ls_cfg_rds_mask = (1ULL << bit);
-		}
-	}
 }
 
 static void init_amd_k8(struct cpuinfo_x86 *c)
@@ -919,6 +919,11 @@ static void init_amd(struct cpuinfo_x86 *c)
 	/* AMD CPUs don't reset SS attributes on SYSRET, Xen does. */
 	if (!cpu_has(c, X86_FEATURE_XENPV))
 		set_cpu_bug(c, X86_BUG_SYSRET_SS_ATTRS);
+
+	if (boot_cpu_has(X86_FEATURE_AMD_RDS)) {
+		set_cpu_cap(c, X86_FEATURE_RDS);
+		set_cpu_cap(c, X86_FEATURE_AMD_RDS);
+	}
 }
 
 #ifdef CONFIG_X86_32
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 6101e3dba2f6..f3dbdde978a4 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -939,6 +939,10 @@ static const __initconst struct x86_cpu_id cpu_no_spec_store_bypass[] = {
 	{ X86_VENDOR_CENTAUR,	5 },
 	{ X86_VENDOR_INTEL,	5 },
 	{ X86_VENDOR_NSC,	5 },
+	{ X86_VENDOR_AMD,	0xf },
+	{ X86_VENDOR_AMD,	0x10 },
+	{ X86_VENDOR_AMD,	0x11 },
+	{ X86_VENDOR_AMD,	0x12 },
 	{ X86_VENDOR_ANY,	4 },
 	{}
 };

[-- Attachment #2: Type: application/octet-stream, Size: 27800 bytes --]

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-05-03  6:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-01 22:53 SBB V10 Bundle Thomas Gleixner
2018-05-02 11:04 ` [MODERATED] " Ingo Molnar
2018-05-02 12:07 ` Ingo Molnar
2018-05-02 13:23   ` Thomas Gleixner
2018-05-03  5:58     ` [MODERATED] " Ingo Molnar
2018-05-03  6:07     ` Ingo Molnar
2018-05-03  6:18       ` Thomas Gleixner
2018-05-03  6:27       ` Thomas Gleixner
2018-05-03  6:31         ` Thomas Gleixner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.