Attention is currently required from: Arthur Heymans, Cliff Huang, David Milosevic, Lance Zhao, Martin L Roth, Maximilian Brune, Patrick Rudolph, Tim Wawrzynczak.
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/78071?usp=email )
Change subject: acpi: Add PPTT support ......................................................................
Patch Set 9:
(3 comments)
File src/acpi/acpi_pptt.c:
https://review.coreboot.org/c/coreboot/+/78071/comment/f91f16eb_ffecdf03 : PS8, Line 13: * Disclaimer: : * : * The generated PPTT table might not be optimized for space, since this : * implementation creates unique resources (caches) for each CPU provided by : * the topology tree. Going by the ACPI 6.4 spec, this is fine. We do this to : * avoid further edge cases and keep the logic as simple as possible. : * : * "though less space efficient, it is also acceptable to declare a node : * for each instance of a resource. In the example above, it would be legal to : * declare an L1 for each processor." : * : * "Compaction of identical resources must be avoided if an implementation requires : * any resource instance to be referenced uniquely. For example, in the above example, : * the L1 resource of each processor must be declared using a dedicated structure to : * permit unique references to it." : *
With this comment I wanted to explain, that there is still room for optimizations regarding the table size, since the current approach creates unique structures instead of compacting them, in order to reduce code complexity.
And that's fine. I only find the incomplete quotes irritating, as...
The quotes simply serve as proof, that this is, nevertheless, still valid ACPI.
...they can't prove anything on their own. If one has to read the spec anyway to make sure that the quotes were used correctly and the reasoning is sound, a simple reference might be better.
I'm struggling a bit to put my general concern into words. It's somewhat like this: Describing what your code does and why is good. But when you start to justify why this is correct, you also risk to sway the reader that your own interpretation is correct. If they think "oh, these quotes explain everything already", it's like you did your own review. So, IMO, any justification should be complete and a reviewer should make sure that it really is.
We may want to revisit this when the code is ready.
https://review.coreboot.org/c/coreboot/+/78071/comment/264ac2dd_afb511e8 : PS8, Line 56: u32
Although we don't populate the PPTT table directly with the return value of "count_resources", it is […]
I understand and I think it should be your call. And it's really no big deal for this piece of code. In general, though, it's often best to leave decisions to the compiler (so it can optimize best) and to have overall portable code.
https://review.coreboot.org/c/coreboot/+/78071/comment/a2c156f6_065a8434 : PS8, Line 127: setup_topology(node->sibling, parent_ref, current);
You are right. […]
Thanks! please test, though. It will at least change the order of things in the table.