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

Benjamin Herrenschmidt benh at kernel.crashing.org
Mon May 30 14:56:08 EST 2005


> +	/* 
> +	 * 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;

The above will always invalidate the bit that is present in the
cputable, thus if you don't have the "ibm,ppc-interrupt-server#s"
property, there will be no SMT at all, is that what you want ?

I would have rather done something like

   if (prop) {
	clear_bit
	if (check-content-of-property)
            set_bit
   }

I need to "fix" the altivec one too so that the firmware can
"invalidate" the altivec by setting this property with a value of "0".

Ben.





More information about the Linuxppc64-dev mailing list