linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Garry <john.garry@huawei.com>
To: Jeremy Linton <jeremy.linton@arm.com>,
	Sudeep Holla <sudeep.holla@arm.com>
Cc: "Guohanjun (Hanjun Guo)" <guohanjun@huawei.com>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	"liuqi (BA)" <liuqi115@huawei.com>,
	wanghuiqiang <wanghuiqiang@huawei.com>,
	"wangxiongfeng (C)" <wangxiongfeng2@huawei.com>
Subject: Re: About PPTT find_acpi_cpu_topology_package()
Date: Thu, 13 Feb 2020 11:52:09 +0000	[thread overview]
Message-ID: <b9ca7718-3834-b42d-a36e-63c81f677a78@huawei.com> (raw)
In-Reply-To: <eedbafc2-019c-517f-4623-4b6ad80f5438@arm.com>

On 11/02/2020 21:12, Jeremy Linton wrote:
> Hi,
> 
> On 2/12/20 10:41 AM, John Garry wrote:
>>>>
>>>> How about something like this:
>>>>
>>>> --- a/drivers/acpi/pptt.c
>>>> +++ b/drivers/acpi/pptt.c
>>>> @@ -515,6 +515,8 @@ static int topology_get_acpi_cpu_tag(struct 
>>>> acpi_table_header *table,
>>>>    if (level == 0 || cpu_node->flags & 
>>>> ACPI_PPTT_ACPI_PROCESSOR_ID_VALID)
>>>>      return cpu_node->acpi_processor_id;
>>>> +   if (level == PPTT_ABORT_PACKAGE)
>>>> +    pr_warn_once("ACPI Processor ID valid not set for physical 
>>>> package node, will use node table offset as substitute for UID\n");
>>>
>>
>> Hi Jeremy,
>>
>>> To clarify my other email there, since I can't seem to type clearly..
>>>
>>> Just note that find_acpi_cpu_topology_hetero_id() is also using a 
>>> PPTT_ABORT_PACKAGE termination.
>>
>> OK, so I may need to check the flag == ACPI_PPTT_PHYSICAL_PACKAGE also.
> 
> Without a lot of thought, it probably sufficient to only check the flag. 
> The level is mostly noise, the ==0 check in there was to work around the 
> verbiage in the first PPTT revision.
> 
>>
>> BTW, Is the value returned by find_acpi_cpu_topology_hetero_id() also  
>> > exposed to userspace some way? Or any other PPTT offsets?
> 
> Not yet :)
> 
>>
>>>
>>>
>>>>                  return ACPI_PTR_DIFF(cpu_node, table);
>>>>          }
>>>>          pr_warn_once("PPTT table found, but unable to locate core 
>>>> %d (%d)\n",
>>>>
>>
>> I'll validate Sudeep's suggestion to set the Processor ID valid flag 
>> and appropriate processor id for the physical package cpu node with an 
>> experimental firmware before sending any patch. There seems to be a 
>> bit of doubt on your part regarding that.
> 
> Just pay attention to the definition of _UID/Acpi Processor UID, etc. 
> The MADT says that ACPI processor UID is matched with a processor 
> container with a matching numeric _UID. The processor container 
> definition says that the _UID must be unique in the processor container 
> hierarchy.
> 
> To me, this says that processor containers/ACPI processors UIDs must all 
> be unique. AKA, you can't have both a processor with _UID=1 and a socket 
> with _UID=1. Given that linux isn't matching the socket _UID, you can 
> create a PPTT+DSDT that does what you want but likely violates the spec.

I've spoken to our FW guys, and they say that they do not set the ACPI 
Processor ID valid flag for non-leaf nodes as we have "no Socket, DIE, 
class information". I think that this means that there is no associated 
processor container.

So the spec reads "ACPI Processor ID entry can relate to a Processor 
container in the namespace" and "The processor container will have a 
matching ID value returned through the _UID method"; followed by "As not 
every processor hierarchy node structure in PPTT may have a matching 
processor container, this flag indicates whether the ACPI processor ID 
points to valid entry".

So I take this to mean that if the valid flag is set for a non-leaf 
cell, then the ACPI processor ID will match the UID of the associated 
processor container.

As for when it's not set, it's unclear. My understanding is that the 
ACPI processor id should still be used as the non-leaf node identifier, 
but it would not match a UID for a processor container (as it may not 
exist).

The kernel does have behave according to this.

So how I am misinterpreting this?

Thanks,
John

  reply	other threads:[~2020-02-13 11:52 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-12 11:20 About PPTT find_acpi_cpu_topology_package() John Garry
2020-02-12 11:59 ` Sudeep Holla
2020-02-12 12:48   ` John Garry
2020-02-12 13:55     ` Sudeep Holla
2020-02-11 18:49       ` Jeremy Linton
2020-02-12 15:36         ` Sudeep Holla
2020-02-12 14:41       ` John Garry
2020-02-11 19:01         ` Jeremy Linton
2020-03-25 11:43           ` John Garry
2020-02-11 19:31         ` Jeremy Linton
2020-02-12 16:41           ` John Garry
2020-02-11 21:12             ` Jeremy Linton
2020-02-13 11:52               ` John Garry [this message]
2020-02-13 14:00                 ` Sudeep Holla
2020-02-13 14:33                   ` John Garry
2020-02-13 16:52                     ` Jeremy Linton
2020-02-14 10:35                       ` John Garry
2020-02-14 11:22                         ` Sudeep Holla
2020-02-12 15:32         ` Sudeep Holla

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=b9ca7718-3834-b42d-a36e-63c81f677a78@huawei.com \
    --to=john.garry@huawei.com \
    --cc=guohanjun@huawei.com \
    --cc=jeremy.linton@arm.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=liuqi115@huawei.com \
    --cc=sudeep.holla@arm.com \
    --cc=wanghuiqiang@huawei.com \
    --cc=wangxiongfeng2@huawei.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 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).