From: Ingo Molnar <mingo@kernel.org>
To: Borislav Petkov <bp@suse.de>
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
linux-kernel@vger.kernel.org, x86@kernel.org, tglx@linutronix.de,
mingo@redhat.com, hpa@zytor.com, peterz@infradead.org,
Yazen.Ghannam@amd.com
Subject: Re: [PATCH] x86/amd: Fixup cpu_core_id for family17h downcore configuration
Date: Thu, 20 Jul 2017 10:47:47 +0200 [thread overview]
Message-ID: <20170720084747.iffsxvuvbtmf3vr4@gmail.com> (raw)
In-Reply-To: <20170720083523.GA18515@nazgul.tnic>
* Borislav Petkov <bp@suse.de> wrote:
> On Thu, Jul 20, 2017 at 03:29:28AM -0500, Suravee Suthikulpanit wrote:
> > For family17h, current cpu_core_id is directly taken from the value
> > CPUID_Fn8000001E_EBX[7:0] (CoreId), which is the physical ID of the
> > core within a die. However, on system with downcore configuration
> > (where not all physical cores within a die are available),
> > this could result in the case where cpu_core_id > (cores_per_node - 1).
> >
> > Fix up the cpu_core_id by breaking down the bitfields of CoreId,
> > and calculate relative ID using available topology information.
> >
> > Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> > ---
> > arch/x86/kernel/cpu/amd.c | 61 ++++++++++++++++++++++++++++++++++-------------
> > 1 file changed, 45 insertions(+), 16 deletions(-)
> >
> > diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
> > index bb5abe8..e7de105 100644
> > --- a/arch/x86/kernel/cpu/amd.c
> > +++ b/arch/x86/kernel/cpu/amd.c
> > @@ -310,38 +310,67 @@ static void amd_get_topology(struct cpuinfo_x86 *c)
> >
> > /* get information required for multi-node processors */
> > if (boot_cpu_has(X86_FEATURE_TOPOEXT)) {
>
> Please carve this whole TOPOEXT-specific logic out, into a separate
> function, say __get_topoext() or so, for better readability/easier
> review.
Also please do the factoring out in a separate preparatory cleanup patch, so that
we can see the two changes isolated.
Thanks,
Ingo
prev parent reply other threads:[~2017-07-20 8:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-20 8:29 Suravee Suthikulpanit
2017-07-20 8:35 ` Borislav Petkov
2017-07-20 8:47 ` Ingo Molnar [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=20170720084747.iffsxvuvbtmf3vr4@gmail.com \
--to=mingo@kernel.org \
--cc=Yazen.Ghannam@amd.com \
--cc=bp@suse.de \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=suravee.suthikulpanit@amd.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
Powered by JetHome