mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andreas Herrmann <andreas.herrmann3@amd.com>
To: Vlad Zolotarov <vlad@scalemp.com>
Cc: <linux-kernel@vger.kernel.org>, <tglx@linutronix.de>,
	<mingo@redhat.com>, <hpa@zytor.com>, <borislav.petkov@amd.com>,
	<Ravikiran.Thirumalai@amd.com>,
	"Shai Fultheim (Shai@ScaleMP.com)" <Shai@scalemp.com>
Subject: Re: [PATCH] x86, amd: Probe CPUs by APICID instead of initial APICID
Date: Tue, 17 Apr 2012 19:26:02 +0200	[thread overview]
Message-ID: <20120417172602.GE19517@alberich.amd.com> (raw)
In-Reply-To: <201204171306.37426.vlad@scalemp.com>

On Tue, Apr 17, 2012 at 01:06:36PM +0300, Vlad Zolotarov wrote:
> From: Shai Fultheim <shai@scalemp.com>
> 
> Make AMD identify processors using APICID (32 bit) rather than the initial 
> APICID (8 bit).  This is critical to make sure the last level cache (llc), 
> which is used for sibling detection, will be different between boards - on 
> aggregated systems with more than 8 processors.
> 
> 
> Signed-off-by: Shai Fultheim <shai@scalemp.com>
> Signed-off-by: Vlad Zolotarov <vlad@scalemp.com>

I think instead of fiddling with the generic code you rather should do
what was implemented for numascale support. See apic_numachip.c

Especially changing node_id will break other stuff.


> ---
>  arch/x86/kernel/cpu/amd.c |   10 +++++-----
>  1 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
> index 0bab2b1..33d9502 100644
> --- a/arch/x86/kernel/cpu/amd.c
> +++ b/arch/x86/kernel/cpu/amd.c
> @@ -277,7 +277,7 @@ static void __cpuinit amd_get_topology(struct cpuinfo_x86 *c)
>  
>  		cpuid(0x8000001e, &eax, &ebx, &ecx, &edx);
>  		nodes = ((ecx >> 8) & 7) + 1;
> -		node_id = ecx & 7;
> +		node_id = (ecx & 7) + (c->phys_proc_id << 3);
>  
>  		/* get compute unit information */
>  		smp_num_siblings = ((ebx >> 8) & 3) + 1;
> @@ -288,7 +288,7 @@ static void __cpuinit amd_get_topology(struct cpuinfo_x86 *c)
>  
>  		rdmsrl(MSR_FAM10H_NODE_ID, value);
>  		nodes = ((value >> 3) & 7) + 1;
> -		node_id = value & 7;
> +		node_id = (value & 7) + (c->phys_proc_id << 3);
>  	} else
>  		return;
>  
> @@ -323,9 +323,9 @@ static void __cpuinit amd_detect_cmp(struct cpuinfo_x86 *c)
>  
>  	bits = c->x86_coreid_bits;
>  	/* Low order bits define the core id (index of core in socket) */
> -	c->cpu_core_id = c->initial_apicid & ((1 << bits)-1);
> -	/* Convert the initial APIC ID into the socket ID */
> -	c->phys_proc_id = c->initial_apicid >> bits;
> +	c->cpu_core_id = c->apicid & ((1 << bits)-1);
> +	/* Convert the APIC ID into the socket ID */
> +	c->phys_proc_id = c->apicid >> bits;

Extracting phys_proc_id from apicid will result in wrong socket
enumeration on several systems. E.g. they would start with package_id
1 instead of 0.


Thanks,

Andreas



      reply	other threads:[~2012-04-17 17:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-17 10:06 Vlad Zolotarov
2012-04-17 17:26 ` Andreas Herrmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120417172602.GE19517@alberich.amd.com \
    --to=andreas.herrmann3@amd.com \
    --cc=Ravikiran.Thirumalai@amd.com \
    --cc=Shai@scalemp.com \
    --cc=borislav.petkov@amd.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=vlad@scalemp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®