From: Dou Liyang <douly.fnst@cn.fujitsu.com>
To: Yinghai Lu <yinghai@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@kernel.org>, "H. Peter Anvin" <hpa@zytor.com>,
"linux-tip-commits@vger.kernel.org"
<linux-tip-commits@vger.kernel.org>,
Tony Luck <tony.luck@intel.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
"lenb@kernel.org" <lenb@kernel.org>,
"Zheng, Lv" <lv.zheng@intel.com>,
robert.moore@intel.com, linux-acpi@vger.kernel.org
Subject: Re: [tip:x86/apic] x86/acpi: Introduce persistent storage for cpuid <-> apicid mapping
Date: Fri, 7 Oct 2016 12:35:36 +0800 [thread overview]
Message-ID: <e53a9807-2beb-0878-87dc-cc6f93b7c911@cn.fujitsu.com> (raw)
In-Reply-To: <CAE9FiQVEvoK=TvYyhU6iiLh5FiX3pXXyy53tr2F7BEnRxGk7HA@mail.gmail.com>
Hi Yinghai
At 10/07/2016 05:20 AM, Yinghai Lu wrote:
> On Thu, Oct 6, 2016 at 1:06 AM, Dou Liyang <douly.fnst@cn.fujitsu.com> wrote:
>
>> I seem to remember that in x2APIC Spec the x2APIC ID may be at 255 or
>> greater.
>
> Good to know. Maybe later when one package have more cores like 30 cores etc.
>
>> If we do that judgment, it may be affect x2APIC's work in some other places.
>>
>> I saw the MADT, the main reason may be that we define 0xff to acpi_id
>> in LAPIC mode.
>> As you said, it was like:
>> [ 42.107902] ACPI: LAPIC (acpi_id[0xff] lapic_id[0xff] disabled)
>> [ 42.120125] ACPI: LAPIC (acpi_id[0xff] lapic_id[0xff] disabled)
>> [ 42.132361] ACPI: LAPIC (acpi_id[0xff] lapic_id[0xff] disabled)
>> ...
>>
>> How about doing the acpi_id check when we parse it in
>> acpi_parse_lapic().
>>
>> 8<----------------
>>
>> --- a/arch/x86/kernel/acpi/boot.c
>> +++ b/arch/x86/kernel/acpi/boot.c
>> @@ -233,6 +233,11 @@ acpi_parse_lapic(struct acpi_subtable_header * header,
>> const unsigned long end)
>>
>> acpi_table_print_madt_entry(header);
>>
>> + if (processor->id >= 255) {
>> + ++disabled_cpus;
>> + return -EINVAL;
>> + }
>> +
>> /*
>> * We need to register disabled CPU as well to permit
>> * counting disabled CPUs. This allows us to size
>
> Yes, that should work. but should do the same thing for x2apic
>
> in acpi_parse_x2apic should have
>
>> + if (processor->local_apic_id == -1) {
>> + ++disabled_cpus;
>> + return -EINVAL;
>> + }
>
> that is the reason why i want to extend acpi_register_lapic()
> to take extra disabled_id (one is 0xff and another is 0xffffffff)
> so could save some lines.
>
Yes, I understood.
But I think adding an extra disabled_id is not a good way for
validating the apic_id. If the disabled_id is not just one id(-1 or
255), may be two or more, even be a range. what should we do for
extending our code?
Firstly, I am not sure that the "-1" could appear in the MADT, even if
the ACPI tables is unreasonable.
Seondly, I guess if we need the check, there are some reserved methods
in the kernel, such as "default_apic_id_valid", "x2apic_apic_id_valid"
and so on. we should extend all of them and use them for check.
CC'ed: Rafael and Lv
May I ask a question?
Is it possible that the "-1/oxffffffff" could appear in the MADT which
is one of the ACPI tables?
> Thanks
>
> Yinghai
>
>
next prev parent reply other threads:[~2016-10-07 4:36 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-25 8:35 [PATCH v12 0/7] Make cpuid <-> nodeid mapping persistent Dou Liyang
2016-08-25 8:35 ` [PATCH v12 1/7] x86, memhp, numa: Online memory-less nodes at boot time Dou Liyang
2016-08-25 8:35 ` [PATCH v12 2/7] x86, acpi, cpu-hotplug: Enable acpi to register all possible cpus " Dou Liyang
2016-08-25 8:57 ` Dou Liyang
2016-08-25 8:35 ` [PATCH v12 3/7] x86, acpi, cpu-hotplug: Introduce cpuid_to_apicid[] array to store persistent cpuid <-> apicid mapping Dou Liyang
[not found] ` <tip-8f54969dc8d6704632b42cbb5e47730cd75cc713@git.kernel.org>
[not found] ` <CAE9FiQVQx6FRXT-RdR7Crz4dg5LeUWHcUSy1KacjR+JgU_vGJg@mail.gmail.com>
[not found] ` <alpine.DEB.2.20.1610041258410.7712@nanos>
[not found] ` <CAE9FiQWigWvrZ8JzNDKtZ9FWARh2m0kGoF+VOZdwAdY9vnU3_w@mail.gmail.com>
[not found] ` <4608f474-c49e-550b-90e2-c5f4c25e00f5@cn.fujitsu.com>
[not found] ` <CAE9FiQVEvoK=TvYyhU6iiLh5FiX3pXXyy53tr2F7BEnRxGk7HA@mail.gmail.com>
2016-10-07 4:35 ` Dou Liyang [this message]
2016-10-07 12:50 ` [tip:x86/apic] x86/acpi: Introduce persistent storage for " Thomas Gleixner
2016-10-07 13:00 ` Thomas Gleixner
2016-10-07 18:55 ` Yinghai Lu
2016-10-08 5:22 ` Dou Liyang
2016-08-25 8:35 ` [PATCH v12 4/7] x86, acpi, cpu-hotplug: Enable MADT APIs to return disabled apicid Dou Liyang
2016-08-25 8:35 ` [PATCH v12 5/7] x86, acpi, cpu-hotplug: Set persistent cpuid <-> nodeid mapping when booting Dou Liyang
2016-08-25 8:35 ` [PATCH v12 6/7] acpi: Provide the mechanism to validate processors in the ACPI tables Dou Liyang
2016-08-25 8:35 ` [PATCH v12 7/7] acpi: Provide the interface to validate the proc_id Dou Liyang
2016-08-25 9:08 ` [PATCH v12 0/7] Make cpuid <-> nodeid mapping persistent Dou Liyang
2016-09-02 6:57 ` Dou Liyang
2016-09-13 11:33 ` Dou Liyang
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=e53a9807-2beb-0878-87dc-cc6f93b7c911@cn.fujitsu.com \
--to=douly.fnst@cn.fujitsu.com \
--cc=hpa@zytor.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=lv.zheng@intel.com \
--cc=mingo@kernel.org \
--cc=rjw@rjwysocki.net \
--cc=robert.moore@intel.com \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=yinghai@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