public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
To: linux-kernel@vger.kernel.org, x86@kernel.org
Cc: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, bp@suse.de
Subject: Re: [PATCH 2/2] x86/CPU/AMD: Derive CPU topology from CPUID Fn0xB
Date: Tue, 27 Mar 2018 19:04:45 +0700	[thread overview]
Message-ID: <a314c050-2c35-91bf-1e96-0c7cda0ae403@amd.com> (raw)
In-Reply-To: <1522051559-23415-3-git-send-email-suravee.suthikulpanit@amd.com>

Hi All,

On 3/26/18 3:05 PM, Suravee Suthikulpanit wrote:
> Derive topology information from Extended Topology Enumeration
> (CPUID Fn0x0000000B) when the information is available.
> 
> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> ---
>   arch/x86/kernel/cpu/amd.c | 16 ++++++++++++----
>   1 file changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
> index 2c1a9f2..2b40144 100644
> --- a/arch/x86/kernel/cpu/amd.c
> +++ b/arch/x86/kernel/cpu/amd.c
> @@ -338,10 +338,18 @@ static void amd_get_topology(struct cpuinfo_x86 *c)
>   			c->cu_id = ebx & 0xff;
>   
>   		if (c->x86 >= 0x17) {
> -			c->cpu_core_id = ebx & 0xff;
> +			int err = detect_extended_topology(c);
>   
> -			if (smp_num_siblings > 1)
> -				c->x86_max_cores /= smp_num_siblings;
> +			if (err) {
> +				c->cpu_core_id = ebx & 0xff;
> +
> +				if (smp_num_siblings > 1)
> +					c->x86_max_cores /= smp_num_siblings;
> +			} else {
> +				int bits = get_count_order(c->x86_max_cores);
> +
> +				c->x86_coreid_bits = get_count_order(bits);
> +			}
>   		}

I made a mistake here in the attempt to clean up the code. I'll send out V2 to fix this.

Thanks,
Suravee

  reply	other threads:[~2018-03-27 12:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-26  8:05 [PATCH 0/2] x86/CPU/AMD: Add support for Extended Topology Enumeration Suravee Suthikulpanit
2018-03-26  8:05 ` [PATCH 1/2] x86/CPU: Modify detect_extended_topology() to return result Suravee Suthikulpanit
2018-03-26  8:05 ` [PATCH 2/2] x86/CPU/AMD: Derive CPU topology from CPUID Fn0xB Suravee Suthikulpanit
2018-03-27 12:04   ` Suravee Suthikulpanit [this message]
2018-03-27  6:48 ` [PATCH 0/2] x86/CPU/AMD: Add support for Extended Topology Enumeration Ingo Molnar
2018-03-27  6:52   ` David Rientjes
2018-03-27 11:34     ` Suravee Suthikulpanit

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=a314c050-2c35-91bf-1e96-0c7cda0ae403@amd.com \
    --to=suravee.suthikulpanit@amd.com \
    --cc=bp@suse.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@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