From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Robert Richter <robert.richter@amd.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@elte.hu>,
Suresh Siddha <suresh.b.siddha@intel.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 00/10] x86, xsave: some code cleanups and reworks
Date: Wed, 21 Jul 2010 20:29:56 +0400 [thread overview]
Message-ID: <20100721162956.GC8009@lenovo> (raw)
In-Reply-To: <20100721161654.GR26154@erda.amd.com>
On Wed, Jul 21, 2010 at 06:16:54PM +0200, Robert Richter wrote:
> On 20.07.10 16:17:40, Cyrill Gorcunov wrote:
>
> > note the snippet
> >
> > if (cpu == boot_cpu_id)
> > switch_to_new_gdt(cpu);
> >
> > but cycle of assignment is done over all possible cpus so
> > smp_processor_id will be = 0 for BP but definitely it's
> > confusing and better to check for BP via explicit cpu == boot_cpu_id
> > I think. Though I might be missing something.
>
> This in smpboot.c makes it clear:
>
> void __cpuinit smp_store_cpu_info(int id)
> {
> struct cpuinfo_x86 *c = &cpu_data(id);
>
> copy_cpuinfo_x86(c, &boot_cpu_data);
> c->cpu_index = id;
> if (id != 0)
> identify_secondary_cpu(c);
> }
>
> So boot cpu id is always 0.
yeah, thanks!
>
> Also note, as Hans Peter already pointed out, this for CONFIG_SMP:
>
> &cpu_data(0) != &boot_cpu_data
>
> The data in boot_cpu_data is (partly) already available after
> early_cpu_init(). It is later copied to the &cpu_data() structures. So
> boot_cpu_data should be used for init code.
>
> Also, to make the test obviously, instead of testing (cpu ==
> boot_cpu_id) I rather tend to use an is_boot_cpu() macro as you
> suggested in your earlier mail.
>
> -Robert
>
> --
> Advanced Micro Devices, Inc.
> Operating System Research Center
>
ok, thanks Robert!
-- Cyrill
next prev parent reply other threads:[~2010-07-21 16:30 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-20 18:50 [PATCH 00/10] x86, xsave: some code cleanups and reworks Robert Richter
2010-07-20 18:50 ` [PATCH 01/10] x86, xsave: do not include asm/i387.h in asm/xsave.h Robert Richter
2010-07-20 21:46 ` Suresh Siddha
2010-07-20 18:50 ` [PATCH 02/10] x86, xsave: 32/64 bit boot cpu check unification in initialization Robert Richter
2010-07-20 21:47 ` Suresh Siddha
2010-07-21 0:40 ` [tip:x86/xsave] " tip-bot for Robert Richter
2010-07-20 18:50 ` [PATCH 03/10] x86: removing boot_cpu_id variable Robert Richter
2010-07-20 18:50 ` [PATCH 04/10] x86, xsave: moving boot cpu initialization to xsave_init() Robert Richter
2010-07-20 21:48 ` Suresh Siddha
2010-07-21 0:40 ` [tip:x86/xsave] x86, xsave: Move " tip-bot for Robert Richter
2010-07-20 18:50 ` [PATCH 05/10] x86, xsave: make xsave_cntxt_init() static Robert Richter
2010-07-20 22:20 ` Suresh Siddha
2010-07-21 13:48 ` Robert Richter
2010-07-21 16:15 ` H. Peter Anvin
2010-07-20 18:50 ` [PATCH 06/10] x86, xsave: do not initialize xsave in fpu_init() Robert Richter
2010-07-20 22:21 ` Suresh Siddha
2010-07-20 18:50 ` [PATCH 07/10] x86, xsave: reduce cpu_has_xsave checks Robert Richter
2010-07-20 22:22 ` Suresh Siddha
2010-07-20 18:50 ` [PATCH 08/10] x86, xsave: introduce xstate enable functions Robert Richter
2010-07-20 22:23 ` Suresh Siddha
2010-07-20 18:50 ` [PATCH 09/10] x86, xsave: check cpuid level for XSTATE_CPUID (0x0d) Robert Richter
2010-07-20 22:26 ` Suresh Siddha
2010-07-20 22:45 ` H. Peter Anvin
2010-07-20 22:51 ` H. Peter Anvin
2010-07-20 18:50 ` [PATCH 10/10] x86, xsave: make init_xstate_buf static Robert Richter
2010-07-20 22:26 ` Suresh Siddha
2010-07-20 19:27 ` [PATCH 00/10] x86, xsave: some code cleanups and reworks Cyrill Gorcunov
2010-07-20 19:46 ` Robert Richter
2010-07-20 20:05 ` Suresh Siddha
2010-07-20 20:07 ` Cyrill Gorcunov
2010-07-20 20:17 ` Cyrill Gorcunov
2010-07-21 16:16 ` Robert Richter
2010-07-21 16:29 ` Cyrill Gorcunov [this message]
2010-07-21 16:32 ` H. Peter Anvin
2010-07-21 16:52 ` Cyrill Gorcunov
2010-07-21 17:01 ` Cyrill Gorcunov
2010-07-21 17:11 ` H. Peter Anvin
2010-07-21 17:17 ` Cyrill Gorcunov
2010-07-21 17:24 ` Robert Richter
2010-07-21 17:37 ` Cyrill Gorcunov
2010-07-21 19:14 ` Cyrill Gorcunov
2010-07-20 20:22 ` H. Peter Anvin
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=20100721162956.GC8009@lenovo \
--to=gorcunov@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=robert.richter@amd.com \
--cc=suresh.b.siddha@intel.com \
/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 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.