From: Tomasz Nowicki <tn@semihalf.com>
To: "Anaczkowski, Lukasz" <lukasz.anaczkowski@intel.com>
Cc: Tomasz Nowicki <tomasz.nowicki@linaro.org>,
"marc.zyngier@arm.com" <marc.zyngier@arm.com>,
"lorenzo.pieralisi@arm.com" <lorenzo.pieralisi@arm.com>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"mingo@redhat.com" <mingo@redhat.com>,
"hpa@zytor.com" <hpa@zytor.com>,
"x86@kernel.org" <x86@kernel.org>,
"jason@lakedaemon.net" <jason@lakedaemon.net>,
"rjw@rjwysocki.net" <rjw@rjwysocki.net>,
"Brown, Len" <len.brown@intel.com>, "pavel@ucw.cz" <pavel@ucw.cz>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
Yinghai Lu <yinghai@kernel.org>
Subject: Re: [PATCH] x86, arm64, acpi: Handle lapic/x2apic entries in MADT
Date: Tue, 8 Sep 2015 16:44:48 +0200 [thread overview]
Message-ID: <55EEF460.2010104@semihalf.com> (raw)
In-Reply-To: <C1C2579D7BE026428F81F41198ADB172378A783A@irsmsx110.ger.corp.intel.com>
On 07.09.2015 16:04, Anaczkowski, Lukasz wrote:
>
> From: Tomasz Nowicki [mailto:tomasz.nowicki@linaro.org]
> Sent: Tuesday, September 1, 2015 3:37 PM
>> On 01.09.2015 14:07, Anaczkowski, Lukasz wrote:
>>> From: Tomasz Nowicki [mailto:tomasz.nowicki@linaro.org]
>>> Sent: Tuesday, September 1, 2015 10:03 AM
>>>>
>>>>> To fix this, each LAPIC/X2APIC entry from MADT table needs to be
>>>>> handled at the same time when processing it, thus adding
>>>>> acpi_subtable_proc structure which stores
>>>>> () ACPI table id
>>>>> () handler that processes table
>>>>> () counter how many items has been processed and passing it to
>>>>> acpi_table_parse_entries().
>>>
>>>> Why can't you leave the parsing code as is and create ApicId sorted list while parsing LAPIC/X2APIC? You could call acpi_register_lapic() after all... Do I miss something ?
>>>
>>> Just to make sure I understand correctly - you suggest to replace
>>> calls to acpi_register_lapic() with a code that builds an APIC ID list while parsing LAPIC/X2APIC, and after parsing is done, go thru the list and call acpi_register_lapic() on each APIC ID, correct?
>>>
>>
>> Yes, does it work for you?
>
> Hi Tomasz, sorry for late response, I was distracted by other things.
>
> So, I see two options to build the list:
>
> (a) use APIC ID as the table index
> (b) always append APIC ID to the end of table, in the order that BIOS lists them
>
> Also, my goal is to end up with enumeration like this (assuming there's 72 cores, 4 hyper threads each, total 288 logical CPUs):
>
> APIC ID -> Logical ID
> 0 -> 0
> 1 -> 72
> 2 -> 144
> 3 -> 216
> 4 -> 1
> 5 -> 73
> 6 -> 145
> 7 -> 217
> 8 -> 2
> ...
> 284 -> 71
> 285 -> 143
> 286 -> 215
> 287 -> 287
>
> Note that n,n+1,n+2,n+3 APIC IDs share same physical core, while being separated by core count in logical listing (e.g. 0,72,144,216 share same physical core).
>
> Now, ACPI spec specifies how APIC IDs should be listed:
> (1) Boot processor is listed first
> (2) For multi-threaded processors, BIOS should list the first logical processor of each of the individual multi-threaded processors in MADT before listing any of the second logical processors.
> (3) APIC IDs < 0xFF should be listed in APIC subtable, APIC IDs >= 0xFF should be listed in X2APIC subtable
>
> Keeping in mind above, BIOS lists APIC IDs as:
>
> APIC (0,4,8, .., 252)
> X2APIC (256,260,264, .. 284)
> APIC (1,5,9,...,253)
> X2API (257,261,265, 285)
> etc
OK got it, your patches make sense then.
Tomasz
next prev parent reply other threads:[~2015-09-08 14:44 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <alpine.DEB.2.11.1507211017590.18576 () nanos>
2015-07-30 17:43 ` [PATCH] x86, acpi: Handle xapic/x2apic entries in MADT Lukasz Anaczkowski
2015-07-30 17:43 ` [PATCH] x86, acpi: Handle lapic/x2apic " Lukasz Anaczkowski
2015-08-02 9:57 ` Thomas Gleixner
2015-08-02 12:40 ` Marc Zyngier
2015-08-03 18:26 ` Lukasz Anaczkowski
2015-08-03 18:26 ` Lukasz Anaczkowski
2015-08-26 7:04 ` Anaczkowski, Lukasz
2015-08-26 10:43 ` Marc Zyngier
2015-08-26 11:42 ` Lorenzo Pieralisi
2015-08-26 12:43 ` Marc Zyngier
2015-08-26 17:49 ` Lukasz Anaczkowski
2015-08-26 17:49 ` [PATCH] x86, arm64, " Lukasz Anaczkowski
2015-08-27 9:37 ` Lorenzo Pieralisi
2015-09-08 11:07 ` Lukasz Anaczkowski
2015-09-08 11:07 ` [PATCH 0/4] Fix how CPUs are enumerated when there's more than 255 CPUs Lukasz Anaczkowski
2015-09-08 11:07 ` [PATCH 1/4] acpi: rename acpi_table_parse_entries Lukasz Anaczkowski
2015-09-08 11:07 ` [PATCH 2/4] x86, arm64, acpi: Added acpi_subtable_proc Lukasz Anaczkowski
2015-09-08 11:07 ` [PATCH 3/4] acpi: multi proc support Lukasz Anaczkowski
2015-09-08 11:08 ` [PATCH 4/4] x86, acpi: Handle apic/x2apic entries in MADT in correct order Lukasz Anaczkowski
2015-09-08 15:22 ` Marc Zyngier
2015-09-08 16:27 ` [PATCH 0/4] Fix how CPUs are enumerated when there's more than 255 CPUs Marc Zyngier
2015-09-08 22:45 ` Al Stone
2015-09-09 7:01 ` Anaczkowski, Lukasz
2015-09-09 9:30 ` [PATCH 0/2] " Lukasz Anaczkowski
2015-09-09 9:30 ` [PATCH 1/2] acpi: Added acpi_subtable_proc to ACPI table parsers Lukasz Anaczkowski
2015-09-09 9:30 ` [PATCH 2/2] x86, acpi: Handle apic/x2apic entries in MADT in correct order Lukasz Anaczkowski
2015-09-09 13:56 ` Lorenzo Pieralisi
2015-09-09 14:27 ` Anaczkowski, Lukasz
2015-09-09 15:43 ` Lorenzo Pieralisi
2015-09-09 10:47 ` [PATCH 1/2] acpi: Added acpi_subtable_proc to ACPI table parsers Marc Zyngier
2015-09-09 13:47 ` Lukasz Anaczkowski
2015-09-09 13:47 ` [PATCH v4 0/2] Fix how CPUs are enumerated when there's more than 255 CPUs Lukasz Anaczkowski
2015-09-09 13:47 ` [PATCH v4 1/2] acpi: Added acpi_subtable_proc to ACPI table parsers Lukasz Anaczkowski
2015-09-09 13:47 ` [PATCH v4 2/2] x86, acpi: Handle apic/x2apic entries in MADT in correct order Lukasz Anaczkowski
2015-09-09 20:45 ` [PATCH v4 0/2] Fix how CPUs are enumerated when there's more than 255 CPUs Rafael J. Wysocki
2015-09-18 22:38 ` Rafael J. Wysocki
2015-08-28 8:30 ` [PATCH] x86, arm64, acpi: Handle lapic/x2apic entries in MADT Ingo Molnar
2015-09-01 8:02 ` Tomasz Nowicki
2015-09-01 12:07 ` Anaczkowski, Lukasz
2015-09-01 13:36 ` Tomasz Nowicki
2015-09-07 14:04 ` Anaczkowski, Lukasz
2015-09-08 14:44 ` Tomasz Nowicki [this message]
2015-08-26 11:03 ` [PATCH] x86, " Marc Zyngier
2015-08-26 12:56 ` Tomasz Nowicki
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=55EEF460.2010104@semihalf.com \
--to=tn@semihalf.com \
--cc=hpa@zytor.com \
--cc=jason@lakedaemon.net \
--cc=len.brown@intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=lukasz.anaczkowski@intel.com \
--cc=marc.zyngier@arm.com \
--cc=mingo@redhat.com \
--cc=pavel@ucw.cz \
--cc=rjw@rjwysocki.net \
--cc=tglx@linutronix.de \
--cc=tomasz.nowicki@linaro.org \
--cc=x86@kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).