* Re: [tip:x86/urgent] x86/acpi: Prevent LAPIC id 0xff from being accounted
[not found] <tip-8237bded3959c6d038798b905485d3ba94b8ea10@git.kernel.org>
@ 2016-10-08 5:26 ` Yinghai Lu
2016-10-08 5:33 ` Yinghai Lu
0 siblings, 1 reply; 4+ messages in thread
From: Yinghai Lu @ 2016-10-08 5:26 UTC (permalink / raw)
To: Tang Chen, Ingo Molnar, H. Peter Anvin, Tony Luck,
Thomas Gleixner, Linux Kernel Mailing List, Rafael J. Wysocki,
Len Brown, Yinghai Lu
Cc: linux-tip-commits
On Fri, Oct 7, 2016 at 6:28 AM, tip-bot for Thomas Gleixner
<tipbot@zytor.com> wrote:
> Commit-ID: 8237bded3959c6d038798b905485d3ba94b8ea10
> Gitweb: http://git.kernel.org/tip/8237bded3959c6d038798b905485d3ba94b8ea10
> Author: Thomas Gleixner <tglx@linutronix.de>
> AuthorDate: Fri, 7 Oct 2016 14:02:12 +0200
> Committer: Thomas Gleixner <tglx@linutronix.de>
> CommitDate: Fri, 7 Oct 2016 15:22:15 +0200
>
> x86/acpi: Prevent LAPIC id 0xff from being accounted
>
> Yinghai reported that the recent changes to make the cpuid - nodeid
> relationship permanent causes a cpuid ordering regression on a system which
> has 2apic enabled..
>
> The reason is that the ACPI local APIC parser has no sanity check for
> apicid 0xff, which is an invalid id. So a CPU id for this invalid local
> APIC id is allocated and therefor breaks the cpuid ordering.
>
> Add a sanity check to acpi_parse_lapic() which ignores the invalid id.
>
> Fixes: 8f54969dc8d6 ("x86/acpi: Introduce persistent storage for cpuid <-> apicid mapping")
> Reported-by: Yinghai Lu <yinghai@kernel.org>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Cc: Gu Zheng <guz.fnst@cn.fujitsu.com>,
> Cc: Tang Chen <tangchen@cn.fujitsu.com>
> Cc: douly.fnst@cn.fujitsu.com,
> Cc: zhugh.fnst@cn.fujitsu.com
> Cc: Tony Luck <tony.luck@intel.com>
> Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
> Cc: Len Brown <lenb@kernel.org>
> Cc: Lv Zheng <lv.zheng@intel.com>,
> Cc: robert.moore@intel.com
> Cc: linux-acpi@vger.kernel.org
> Link: https://lkml.kernel.org/r/CAE9FiQVQx6FRXT-RdR7Crz4dg5LeUWHcUSy1KacjR+JgU_vGJg@mail.gmail.com
> ---
> arch/x86/kernel/acpi/boot.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
> index 32a7d70..6d35baf 100644
> --- a/arch/x86/kernel/acpi/boot.c
> +++ b/arch/x86/kernel/acpi/boot.c
> @@ -233,6 +233,9 @@ acpi_parse_lapic(struct acpi_subtable_header * header, const unsigned long end)
>
> acpi_table_print_madt_entry(header);
>
> + if (processor->id >= 0xff)
> + return -EINVAL;
> +
> /*
> * We need to register disabled CPU as well to permit
> * counting disabled CPUs. This allows us to size
some thing is wrong:
[ 71.787437] ACPI: LAPIC (acpi_id[0xff] lapic_id[0xff] disabled)
[ 71.799681] ACPI: Error parsing LAPIC/X2APIC entries
[ 71.809934] ACPI: Invalid BIOS MADT, disabling ACPI
looks like should change
return -EINVAL ;
==>
return 0;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [tip:x86/urgent] x86/acpi: Prevent LAPIC id 0xff from being accounted
2016-10-08 5:26 ` [tip:x86/urgent] x86/acpi: Prevent LAPIC id 0xff from being accounted Yinghai Lu
@ 2016-10-08 5:33 ` Yinghai Lu
2016-10-08 5:34 ` Yinghai Lu
0 siblings, 1 reply; 4+ messages in thread
From: Yinghai Lu @ 2016-10-08 5:33 UTC (permalink / raw)
To: Tang Chen, Ingo Molnar, H. Peter Anvin, Tony Luck,
Thomas Gleixner, Linux Kernel Mailing List, Rafael J. Wysocki,
Len Brown, Yinghai Lu
Cc: linux-tip-commits
On Fri, Oct 7, 2016 at 10:26 PM, Yinghai Lu <yinghai@kernel.org> wrote:
> On Fri, Oct 7, 2016 at 6:28 AM, tip-bot for Thomas Gleixner
>> diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
>> index 32a7d70..6d35baf 100644
>> --- a/arch/x86/kernel/acpi/boot.c
>> +++ b/arch/x86/kernel/acpi/boot.c
>> @@ -233,6 +233,9 @@ acpi_parse_lapic(struct acpi_subtable_header * header, const unsigned long end)
>>
>> acpi_table_print_madt_entry(header);
>>
>> + if (processor->id >= 0xff)
>> + return -EINVAL;
>> +
>> /*
>> * We need to register disabled CPU as well to permit
>> * counting disabled CPUs. This allows us to size
>
>
> some thing is wrong:
>
> [ 71.787437] ACPI: LAPIC (acpi_id[0xff] lapic_id[0xff] disabled)
> [ 71.799681] ACPI: Error parsing LAPIC/X2APIC entries
> [ 71.809934] ACPI: Invalid BIOS MADT, disabling ACPI
>
> looks like should change
> return -EINVAL ;
> ==>
> return 0;
also processor->id is u8,
so the patch should be:
>> + if (processor->id == 0xff)
>> + return -EINVAL;
>> +
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [tip:x86/urgent] x86/acpi: Prevent LAPIC id 0xff from being accounted
2016-10-08 5:33 ` Yinghai Lu
@ 2016-10-08 5:34 ` Yinghai Lu
2016-10-08 10:08 ` Thomas Gleixner
0 siblings, 1 reply; 4+ messages in thread
From: Yinghai Lu @ 2016-10-08 5:34 UTC (permalink / raw)
To: Tang Chen, Ingo Molnar, H. Peter Anvin, Tony Luck,
Thomas Gleixner, Linux Kernel Mailing List, Rafael J. Wysocki,
Len Brown, Yinghai Lu
Cc: linux-tip-commits
On Fri, Oct 7, 2016 at 10:33 PM, Yinghai Lu <yinghai@kernel.org> wrote:
> On Fri, Oct 7, 2016 at 10:26 PM, Yinghai Lu <yinghai@kernel.org> wrote:
>> On Fri, Oct 7, 2016 at 6:28 AM, tip-bot for Thomas Gleixner
>>> diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
>>> index 32a7d70..6d35baf 100644
>>> --- a/arch/x86/kernel/acpi/boot.c
>>> +++ b/arch/x86/kernel/acpi/boot.c
>>> @@ -233,6 +233,9 @@ acpi_parse_lapic(struct acpi_subtable_header * header, const unsigned long end)
>>>
>>> acpi_table_print_madt_entry(header);
>>>
>>> + if (processor->id >= 0xff)
>>> + return -EINVAL;
>>> +
>>> /*
>>> * We need to register disabled CPU as well to permit
>>> * counting disabled CPUs. This allows us to size
>>
>>
>> some thing is wrong:
>>
>> [ 71.787437] ACPI: LAPIC (acpi_id[0xff] lapic_id[0xff] disabled)
>> [ 71.799681] ACPI: Error parsing LAPIC/X2APIC entries
>> [ 71.809934] ACPI: Invalid BIOS MADT, disabling ACPI
>>
>> looks like should change
>> return -EINVAL ;
>> ==>
>> return 0;
>
> also processor->id is u8,
>
> so the patch should be:
+ if (processor->id == 0xff)
+ return 0;
+
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [tip:x86/urgent] x86/acpi: Prevent LAPIC id 0xff from being accounted
2016-10-08 5:34 ` Yinghai Lu
@ 2016-10-08 10:08 ` Thomas Gleixner
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Gleixner @ 2016-10-08 10:08 UTC (permalink / raw)
To: Yinghai Lu
Cc: Tang Chen, Ingo Molnar, H. Peter Anvin, Tony Luck,
Linux Kernel Mailing List, Rafael J. Wysocki, Len Brown,
linux-tip-commits
On Fri, 7 Oct 2016, Yinghai Lu wrote:
> On Fri, Oct 7, 2016 at 10:33 PM, Yinghai Lu <yinghai@kernel.org> wrote:
> > On Fri, Oct 7, 2016 at 10:26 PM, Yinghai Lu <yinghai@kernel.org> wrote:
> >> On Fri, Oct 7, 2016 at 6:28 AM, tip-bot for Thomas Gleixner
> >>> diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
> >>> index 32a7d70..6d35baf 100644
> >>> --- a/arch/x86/kernel/acpi/boot.c
> >>> +++ b/arch/x86/kernel/acpi/boot.c
> >>> @@ -233,6 +233,9 @@ acpi_parse_lapic(struct acpi_subtable_header * header, const unsigned long end)
> >>>
> >>> acpi_table_print_madt_entry(header);
> >>>
> >>> + if (processor->id >= 0xff)
> >>> + return -EINVAL;
> >>> +
> >>> /*
> >>> * We need to register disabled CPU as well to permit
> >>> * counting disabled CPUs. This allows us to size
> >>
> >>
> >> some thing is wrong:
> >>
> >> [ 71.787437] ACPI: LAPIC (acpi_id[0xff] lapic_id[0xff] disabled)
> >> [ 71.799681] ACPI: Error parsing LAPIC/X2APIC entries
> >> [ 71.809934] ACPI: Invalid BIOS MADT, disabling ACPI
> >>
> >> looks like should change
> >> return -EINVAL ;
> >> ==>
> >> return 0;
Indeed.
> >
> > also processor->id is u8,
> >
> > so the patch should be:
>
> + if (processor->id == 0xff)
> + return 0;
> +
Right. Amended the patch and pushed it out.
Thanks for pointing it out,
tglx
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-10-08 10:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <tip-8237bded3959c6d038798b905485d3ba94b8ea10@git.kernel.org>
2016-10-08 5:26 ` [tip:x86/urgent] x86/acpi: Prevent LAPIC id 0xff from being accounted Yinghai Lu
2016-10-08 5:33 ` Yinghai Lu
2016-10-08 5:34 ` Yinghai Lu
2016-10-08 10:08 ` Thomas Gleixner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).