[PATCH] ppc64: set/clear SMT capable bit at boot

Anton Blanchard anton at samba.org
Mon May 30 09:41:54 EST 2005


Paul/Nathan, does this look OK to you?

Anton

--

Allow the SMT bit to be set/reset at boot, like the ALTIVEC bit. This
means we will enable SMT on unknown cpus that support it.

Signed-off-by: Anton Blanchard <anton at samba.org>

Index: linux-2.6.12-rc2/arch/ppc64/kernel/prom.c
===================================================================
--- linux-2.6.12-rc2.orig/arch/ppc64/kernel/prom.c	2005-04-26 19:32:20.834218097 +1000
+++ linux-2.6.12-rc2/arch/ppc64/kernel/prom.c	2005-04-26 19:32:23.974192213 +1000
@@ -880,6 +880,7 @@
 {
 	char *type = get_flat_dt_prop(node, "device_type", NULL);
 	u32 *prop;
+	unsigned long size;
 
 	/* We are scanning "cpu" nodes only */
 	if (type == NULL || strcmp(type, "cpu") != 0)
@@ -925,6 +926,17 @@
 		cur_cpu_spec->cpu_user_features |= PPC_FEATURE_HAS_ALTIVEC;
 	}
 
+	/* 
+	 * Check for an SMT capable CPU and set the CPU feature. We do
+	 * this by looking at the size of the ibm,ppc-interrupt-server#s
+	 * property
+	 */
+	prop = (u32 *)get_flat_dt_prop(node, "ibm,ppc-interrupt-server#s",
+				       &size);
+	cur_cpu_spec->cpu_features &= ~CPU_FTR_SMT;
+	if (prop && ((size / sizeof(u32)) > 1))
+		cur_cpu_spec->cpu_features |= CPU_FTR_SMT;
+
 	return 0;
 }
 



More information about the Linuxppc64-dev mailing list