public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86, cpu, amd: Use 8-bit extractor for NodeId field
@ 2015-01-19 18:18 Aravind Gopalakrishnan
  2015-01-19 18:21 ` Borislav Petkov
  0 siblings, 1 reply; 3+ messages in thread
From: Aravind Gopalakrishnan @ 2015-01-19 18:18 UTC (permalink / raw)
  To: tglx, mingo, hpa, x86, bp, riel, mgorman, jolsa, pbonzini,
	jacob.w.shin, linux-kernel
  Cc: Aravind Gopalakrishnan

The NodeId field in cpuid_ecx(0x8000001e) is a 8 bit field.
Although current extractor works fine, it will break if/when
the most significant 5 bits ever get used.

So, lets honor the field as architected in the BKDG

Reference: BKDG for AMD Fam15h Models 00h-0fh,
CPUID Fn8000_001E_ECX Node Identifiers

Signed-off-by: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@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 a220239..9942b83 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -300,7 +300,7 @@ static void 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 & 0xff;
 
 		/* get compute unit information */
 		smp_num_siblings = ((ebx >> 8) & 3) + 1;
-- 
1.9.1


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

end of thread, other threads:[~2015-01-20 21:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-19 18:18 [PATCH] x86, cpu, amd: Use 8-bit extractor for NodeId field Aravind Gopalakrishnan
2015-01-19 18:21 ` Borislav Petkov
2015-01-20 21:50   ` Aravind Gopalakrishnan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox