public inbox for kexec@lists.infradead.org
 help / color / mirror / Atom feed
From: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
To: Petr Tesarik <ptesarik@suse.cz>, kexec@lists.infradead.org
Subject: Re: [PATCH v4 0/3] x86, apic, kexec: Add disable_cpu_apic kernel parameter
Date: Tue, 29 Oct 2013 09:53:57 +0900	[thread overview]
Message-ID: <526F0725.2000906@jp.fujitsu.com> (raw)
In-Reply-To: <20131025130514.64a47214@hananiah.suse.cz>

(2013/10/25 20:05), Petr Tesarik wrote:
> On Thu, 24 Oct 2013 10:42:12 +0900
> HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com> wrote:
>
>> (2013/10/24 0:51), Vivek Goyal wrote:
>>> On Wed, Oct 23, 2013 at 09:05:06AM +0900, HATAYAMA Daisuke wrote:
>>>
>>> [..]
>>>>> Do you literally mean a human at each boot will have to configure
>>>>> the kdump configuration files for passing disable_cpu_apic?
>>>>> Or do you envision the setting of disable_cpu_apic being put into
>>>>> the kdump initialization scripts?
>>>>>
>>>>> thanks
>>>>>
>>>>> Jerry
>>>>
>>>> Nearer to the former case, but this is not what a human should do. It's
>>>> a cumbersome task. I think, on fedora/RHEL system for example, kdump
>>>> service should check at each boot automatically.
>>>
>>> Hi Hatayama,
>>>
>>> So what information should I look for to prepare disable_cpu_apic=X in
>>> kdump script?
>>>
>>> Is BSP processor info exported to user space somewhere? Or assuming that
>>> processor 0 is BSP and corresponding apicid should be disabled in kdump
>>> kernel is good enough?
>>>
>>
>> Yes, this patch set assumes that the processor 0 is BSP and there's no
>> other BSP. Because this patch cares about only one BSP processor,
>> the disabled_cpu_apicid variable has unsigned int, not mask.
>>
>> I think this assumption is reasonable since doing it rigorously requires
>> additional processing between 1st and 2nd kernels just as I explained in
>> previous mail.
>>
>>> I am looking at /proc/cpuinfo and following 3 fields seem interesting.
>>>
>>> processor: 0
>>> apicid		: 0
>>> initial apicid	: 0
>>>
>>> What's the difference between apicid and "initial apicid". I guess
>>> initial apicid reflects the apicid number as set by firmware and then
>>> kernel can overwrite it and new number would be reflected in "apicid"?
>>>
>>> If that's the case, then I guess we should be looking at "apicid" of
>>> processor "0" and set that in disable_cpu_apic? Because that's the
>>> number kdump kernel  boot should see in apic upon boot.
>>>
>>
>> Yes, that's fully correct, and please see 10.4.6 Local APIC ID in Intel SPG
>> for details.
>>
>> BTW, we can use cpuid instruction in user-space, too. It might be more
>> flexible to use cpuid than looking up /proc/cpuinfo.
>>
>> Also, there's one corner case that if we hot-remove cpu0, we cannot
>> look up /proc/cpuinfo to get cpu0 information since /proc/cpunifo displays
>> *online* cpus only. We cannot use even cpuid instruction for offline cpu.
>> So, to address this corner case, we need to prepare new interface to see
>> cpu0 initial apicid which is always available.
>>
>> My idea is for example to introduce the following file in sysfs:
>>
>>     /sys/devices/system/cpu/cpu0/initial_apicid
>
> I'm confused. So, should I look at the "initial apicid" line, or the
> "apicid" line in /proc/cpuinfo? Your previous mail suggested the
> "apicid" line, but then it's confusing to call the sysfs file
> "initial_apicid".
>

You should look at initial apicid. Initial apicid is the value assigned
during MP initialization and their values are unique while the values on
local APIC ID registers vary at runtime.

If you say "apicid" line about ones in ACPI MADT or MP table, they are
initial ones, although there's explicit "initial".

> Unfortunately, all my systems list the same value under "apicid" and
> "initial apicid", so I don't know how to test.

You don't need to compare two kind of values at all. You have only to use
initial apicid to identify target cpu beyond different component: BIOS,
1st kernel and 2nd kernel.

-- 
Thanks.
HATAYAMA, Daisuke


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2013-10-29  0:57 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-22 15:01 [PATCH v4 0/3] x86, apic, kexec: Add disable_cpu_apic kernel parameter HATAYAMA Daisuke
2013-10-22 15:01 ` [PATCH v4 1/3] x86, apic: Don't count the CPU with BP flag from MP table as booting-up CPU HATAYAMA Daisuke
2013-11-08 16:08   ` Vivek Goyal
2013-11-11  2:52     ` HATAYAMA Daisuke
2013-11-11 16:52       ` Vivek Goyal
2013-11-12  0:40         ` HATAYAMA Daisuke
2013-11-12  9:58           ` HATAYAMA Daisuke
2013-10-22 15:01 ` [PATCH v4 2/3] x86, apic: Add disable_cpu_apicid kernel parameter HATAYAMA Daisuke
2013-10-22 15:01 ` [PATCH v4 3/3] Documentation, x86, apic, kexec: " HATAYAMA Daisuke
     [not found] ` <20131022220803.GA32387@anatevka.fc.hp.com>
2013-10-23  0:05   ` [PATCH v4 0/3] x86, apic, kexec: Add disable_cpu_apic " HATAYAMA Daisuke
2013-10-23 15:51     ` Vivek Goyal
2013-10-24  1:42       ` HATAYAMA Daisuke
2013-10-25 11:05         ` Petr Tesarik
2013-10-29  0:53           ` HATAYAMA Daisuke [this message]
2013-10-29  7:39             ` Petr Tesarik
2013-10-24  5:50       ` Eric W. Biederman
     [not found]     ` <20131031005812.GA15459@anatevka.fc.hp.com>
2013-10-31  4:43       ` HATAYAMA Daisuke
2013-10-31 13:27       ` Vivek Goyal
2013-11-01  0:31         ` Simon Horman
2013-11-04  7:08         ` HATAYAMA Daisuke
2013-10-29 14:21 ` Baoquan He
2013-10-30  0:44   ` HATAYAMA Daisuke
2013-10-30  6:06     ` Baoquan He
2013-10-30  9:48       ` HATAYAMA Daisuke
2013-10-30 15:27   ` Baoquan He
2013-11-08  3:30 ` Baoquan He
2013-11-08  4:13   ` HATAYAMA Daisuke
     [not found] ` <20131106190232.GA28119@anatevka.fc.hp.com>
2013-11-11  4:49   ` HATAYAMA Daisuke

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=526F0725.2000906@jp.fujitsu.com \
    --to=d.hatayama@jp.fujitsu.com \
    --cc=kexec@lists.infradead.org \
    --cc=ptesarik@suse.cz \
    /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