Re: [PATCH] ACPI/PPTT: fix off-by-one error

Sudeep Holla
2025-05-07T15:12:27Z

On Wed, May 07, 2025 at 02:29:17PM +0000, Heyne, Maximilian wrote:
> On Wed, May 07, 2025 at 01:56:53PM +0100, Sudeep Holla wrote:
> >
> > That is fine but you must have reference to those caches in the processor
> > node and the length of the node won't be 0x14 in that case and you shouldn't
> > hit this issue. So if this is real platform, then yes I am must say you
> > PPTT is wrong especially if there are caches in the table as you say just
> > that processor nodes are not pointing to them correctly then ?
>
> The ACPI tables in our case describe a core first which references the
> cache as private resource and then a thread whose parent is the core but
> this doesn't have a private resource. This is how it looks like:
>

Ah, right I clearly missed considering multithreaded systems in my mind.
I think SMTs processor nodes might have no private resource which I didn't
consider before. However, your example made me open the spec and read about
SMT and PPTT. There are couple of things I still don't follow below.

> [C8Eh 3214 1] Subtable Type : 00 [Processor Hierarchy Node]
> [C8Fh 3215 1] Length : 1C
> [C90h 3216 2] Reserved : 0000
> [C92h 3218 4] Flags (decoded below) : 00000002
> Physical package : 0
> ACPI Processor ID valid : 1
> Processor is a thread : 0
> Node is a leaf : 0
> Identical Implementation : 0
> [C96h 3222 4] Parent : 000000A2
> [C9Ah 3226 4] ACPI Processor ID : 0000003F
> [C9Eh 3230 4] Private Resource Number : 00000002
> [CA2h 3234 4] Private Resource : 00000072
> [CA6h 3238 4] Private Resource : 0000008A
>

Does the above node represent the container node for the threads within
the core ? I assumes so.

> [CAAh 3242 1] Subtable Type : 00 [Processor Hierarchy Node]
> [CABh 3243 1] Length : 14
> [CACh 3244 2] Reserved : 0000
> [CAEh 3246 4] Flags (decoded below) : 0000000E
> Physical package : 0
> ACPI Processor ID valid : 1
> Processor is a thread : 1
> Node is a leaf : 1
> Identical Implementation : 0
> [CB2h 3250 4] Parent : 00000C8E
> [CB6h 3254 4] ACPI Processor ID : 0000003F
> [CBAh 3258 4] Private Resource Number : 00000000
>

Is this the only thread as you mentioned the table ends here ? So it
is single threaded core ? Just working what is the point in representing
it in this way ? Also the ACPI Processor ID is unique, so I hope you have
same number of container nodes as the threads. IOW, they ACPI Processor ID
for the thread and the container node match only because it is single
threaded core.

--
Regards,
Sudeep