All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/AMD: Fix Socket ID for LLC topology for AMD Fam17h systems
@ 2016-08-31 20:21 Yazen Ghannam
  2016-09-02  8:41 ` Thomas Gleixner
  0 siblings, 1 reply; 5+ messages in thread
From: Yazen Ghannam @ 2016-08-31 20:21 UTC (permalink / raw)
  To: tglx, mingo, hpa, x86; +Cc: linux-kernel, Yazen Ghannam

The Socket ID is ApicId[bits] on Fam17h systems.

Change substraction to logical AND when extracting socket_id
from c->apicid.

Signed-off-by: Yazen Ghannam <Yazen.Ghannam@amd.com>
---
 arch/x86/kernel/cpu/amd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index f5c69d8..479555f 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -365,7 +365,7 @@ static void amd_detect_cmp(struct cpuinfo_x86 *c)
 	 if (c->x86 != 0x17 || !cpuid_edx(0x80000006))
 		return;
 
-	socket_id	= (c->apicid >> bits) - 1;
+	socket_id	= (c->apicid >> bits) & 1;
 	core_complex_id	= (c->apicid & ((1 << bits) - 1)) >> 3;
 
 	per_cpu(cpu_llc_id, cpu) = (socket_id << 3) | core_complex_id;
-- 
1.9.1

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

* Re: [PATCH] x86/AMD: Fix Socket ID for LLC topology for AMD Fam17h systems
  2016-08-31 20:21 [PATCH] x86/AMD: Fix Socket ID for LLC topology for AMD Fam17h systems Yazen Ghannam
@ 2016-09-02  8:41 ` Thomas Gleixner
  2016-09-02 12:57   ` Ghannam, Yazen
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Gleixner @ 2016-09-02  8:41 UTC (permalink / raw)
  To: Yazen Ghannam; +Cc: mingo, hpa, x86, linux-kernel

On Wed, 31 Aug 2016, Yazen Ghannam wrote:

> The Socket ID is ApicId[bits] on Fam17h systems.
> 
> Change substraction to logical AND when extracting socket_id
> from c->apicid.

So Fam17h will only ever have 2 sockets, right?

Thanks,

	tglx

> Signed-off-by: Yazen Ghannam <Yazen.Ghannam@amd.com>
> ---
>  arch/x86/kernel/cpu/amd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
> index f5c69d8..479555f 100644
> --- a/arch/x86/kernel/cpu/amd.c
> +++ b/arch/x86/kernel/cpu/amd.c
> @@ -365,7 +365,7 @@ static void amd_detect_cmp(struct cpuinfo_x86 *c)
>  	 if (c->x86 != 0x17 || !cpuid_edx(0x80000006))
>  		return;
>  
> -	socket_id	= (c->apicid >> bits) - 1;
> +	socket_id	= (c->apicid >> bits) & 1;
>  	core_complex_id	= (c->apicid & ((1 << bits) - 1)) >> 3;
>  
>  	per_cpu(cpu_llc_id, cpu) = (socket_id << 3) | core_complex_id;
> -- 
> 1.9.1
> 
> 

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

* RE: [PATCH] x86/AMD: Fix Socket ID for LLC topology for AMD Fam17h systems
  2016-09-02  8:41 ` Thomas Gleixner
@ 2016-09-02 12:57   ` Ghannam, Yazen
  2016-09-02 13:13     ` Thomas Gleixner
  0 siblings, 1 reply; 5+ messages in thread
From: Ghannam, Yazen @ 2016-09-02 12:57 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: mingo, hpa, x86, linux-kernel

> 
> > The Socket ID is ApicId[bits] on Fam17h systems.
> >
> > Change substraction to logical AND when extracting socket_id
> > from c->apicid.
> 
> So Fam17h will only ever have 2 sockets, right?
> 

This is the decoding of the ApicId shown in our latest Programming
Reference. However, I can remove the "& 1" if you think it'll be better.

Thanks,
Yazen

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

* RE: [PATCH] x86/AMD: Fix Socket ID for LLC topology for AMD Fam17h systems
  2016-09-02 12:57   ` Ghannam, Yazen
@ 2016-09-02 13:13     ` Thomas Gleixner
  2016-09-02 16:28       ` Ghannam, Yazen
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Gleixner @ 2016-09-02 13:13 UTC (permalink / raw)
  To: Ghannam, Yazen; +Cc: mingo, hpa, x86, linux-kernel, Borislav Petkov

On Fri, 2 Sep 2016, Ghannam, Yazen wrote:
> > > The Socket ID is ApicId[bits] on Fam17h systems.
> > >
> > > Change substraction to logical AND when extracting socket_id
> > > from c->apicid.
> > 
> > So Fam17h will only ever have 2 sockets, right?
> > 
> 
> This is the decoding of the ApicId shown in our latest Programming
> Reference.

I have no idea what your latest reference manual says as it seems to be not
yet public.

> However, I can remove the "& 1" if you think it'll be better.

I's not about what I think is better.

I asked the obvious question whether Fam17h will only ever have two sockets,
because your patch limits it hard to that.

Care to answer that very question instead of handwaving about your
interpretation of a secret manual?

Thanks,

	tglx

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

* RE: [PATCH] x86/AMD: Fix Socket ID for LLC topology for AMD Fam17h systems
  2016-09-02 13:13     ` Thomas Gleixner
@ 2016-09-02 16:28       ` Ghannam, Yazen
  0 siblings, 0 replies; 5+ messages in thread
From: Ghannam, Yazen @ 2016-09-02 16:28 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: mingo, hpa, x86, linux-kernel, Borislav Petkov

> I asked the obvious question whether Fam17h will only ever have two
> sockets,
> because your patch limits it hard to that.
> 

I don't know if Fam17h will only ever have two sockets, so I'll send a V2
removing the hard limit.

Thanks,
Yazen

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

end of thread, other threads:[~2016-09-02 18:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-31 20:21 [PATCH] x86/AMD: Fix Socket ID for LLC topology for AMD Fam17h systems Yazen Ghannam
2016-09-02  8:41 ` Thomas Gleixner
2016-09-02 12:57   ` Ghannam, Yazen
2016-09-02 13:13     ` Thomas Gleixner
2016-09-02 16:28       ` Ghannam, Yazen

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.