public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
To: Borislav Petkov <bp@suse.de>
Cc: <tglx@linutronix.de>, <mingo@redhat.com>, <hpa@zytor.com>,
	<x86@kernel.org>, <riel@redhat.com>, <mgorman@suse.de>,
	<jolsa@kernel.org>, <pbonzini@redhat.com>,
	<jacob.w.shin@gmail.com>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86, cpu, amd: Use 8-bit extractor for NodeId field
Date: Tue, 20 Jan 2015 15:50:40 -0600	[thread overview]
Message-ID: <54BECDB0.9060709@amd.com> (raw)
In-Reply-To: <20150119182142.GF4486@pd.tnic>

On 1/19/2015 12:21 PM, Borislav Petkov wrote:
> On Mon, Jan 19, 2015 at 12:18:58PM -0600, Aravind Gopalakrishnan wrote:
>> 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;
> That's {00000b,D18F0x60[NodeId]} and NodeId is 3 bits for enumerating
> 8 nodes so checking the 3 bits is actually correct as it says that the
> other 5 are 0b.

Right. Just a concern that if the definition of those 5 bits changes 
then it would be a problem.

> Regardless, is this something hypothetical you've noticed from code
> inspection or are we really going to have more than 8 nodes? If the
> former, then patch is unnecessary churn.
>

Just something from code inspection. So not an immediate issue.

Thanks,
-Aravind.

      reply	other threads:[~2015-01-20 21:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 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=54BECDB0.9060709@amd.com \
    --to=aravind.gopalakrishnan@amd.com \
    --cc=bp@suse.de \
    --cc=hpa@zytor.com \
    --cc=jacob.w.shin@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=riel@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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