-
Notifications
You must be signed in to change notification settings - Fork 84
dt-bindings: chosen: Add "smbios3-entrypoint" property #177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
dt-bindings: chosen: Add "smbios3-entrypoint" property #177
Conversation
d1612c9 to
0ea83a8
Compare
dtschema/schemas/chosen.yaml
Outdated
| smbios3-entrypoint: | ||
| $ref: /schemas/types.yaml#/definitions/uint64 | ||
| description: | ||
| The 64-bit physical address of the SMBIOSv3 entry point structure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not fluent in dt-schema, so I am not sure this matters, but I'll raise it just in case: the address doesn't really need to be 64-bits. The SMBIOS3 entrypoint structure (which supersedes the SMBIOS entrypoint structure) was introduced to raise the max address of the SMBIOS table array beyond 4 GiB, but here we just need to capture the address of the entry point itself. IOW, maybe this should just be types.yaml#/definitions/address like the other fields?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for noticing this, since it is similar to linux,initrd-start/end the address definition is better. I've updated that and also added maxItems: 1.
34148a0 to
2b91bab
Compare
| will assign devices in its usual manner, otherwise it will not try to | ||
| assign devices and instead use them as they are configured already. | ||
|
|
||
| smbios3-entrypoint: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about smbios3-start or -base? This the start of the tables and 'entry point' sounds more like you have jump to it. Do we care about the size of the tables? I suppose people can decode the header when they want to find out, but it is common to include both an address and a size for properties which refer to memory (e.g. 'reg').
I assume that v3 is the only valid version at present and v2 is not really used anymore.
In a devicetree environment it would be better to include the information from the SMBIOS tables in a full devicetree schema, but that's a problem for another year :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about smbios3-start or -base? This the start of the tables and 'entry point' sounds more like you have jump to it.
It is not the start of the tables. It is the address of a separate structure in memory that contains the version information and the actual address of the tables, and those could be somewhere else in memory entirely (for x86 legacy reasons). This structure is what the DMTF SMBIOS spec calls entrypoint and so I don't think we should be inventing our own terminology here.
Note that there is existing tooling such as dmidecode that expects to be able to access the entrypoint structure directly, and so omitting things or re-inventing them is going to be problematic for compatibility.
Do we care about the size of the tables? I suppose people can decode the header when they want to find out, but it is common to include both an address and a size for properties which refer to memory (e.g. 'reg').
The entrypoint structure has a fixed size.
I assume that v3 is the only valid version at present and v2 is not really used anymore.
There is no v2. It is called SMBIOS3 because SMBIOS 3.x was the first version to describe a variant of the entrypoint that can accommodate a 64-bit address for the table array.
In a devicetree environment it would be better to include the information from the SMBIOS tables in a full devicetree schema, but that's a problem for another year :-)
I don't see how that would be useful. There is already spec outside of DT that describes all of this - what would be the added value of duplicating this elsewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I understand this is a header and the tables could be elsewhere. So what are the semantics of that? Should we require that the tables be immediately after this 'entry header'? If the tables are elsewhere, does that mean we have a reserved-memory section?
Re the SMBIOS spec, having written a generator and parsers for it, it is pretty a pretty ugly and old-fashioned format which could be implemented nicely in devicetree.
2b91bab to
034adf7
Compare
sjg20
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| will assign devices in its usual manner, otherwise it will not try to | ||
| assign devices and instead use them as they are configured already. | ||
|
|
||
| smbios3-entrypoint: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I understand this is a header and the tables could be elsewhere. So what are the semantics of that? Should we require that the tables be immediately after this 'entry header'? If the tables are elsewhere, does that mean we have a reserved-memory section?
Re the SMBIOS spec, having written a generator and parsers for it, it is pretty a pretty ugly and old-fashioned format which could be implemented nicely in devicetree.
There are still two types of entry point structures, and so existing implementations that provide both might have to be updated to comply with this requirement. Given that there is no technical need for the structure and the tables to be adjacent in memory, I don't think it should be added as a requirement here.
That is a good point, actually, but it applies to both the entry point structure and the tables. When booting via EFI, the provisions in the EFI spec should be followed, which states that SMBIOS tables and the entry point should be in memory of type So when not booting via EFI, the memory does need to be marked as reserved in another way, presumably via the
I don't disagree, but our personal views on SMBIOS aesthetics are not the point here. There is an existing corpus of tooling that people want to reuse, and re-inventing SMBIOS in DT is only going to result in more fragmentation than there already is. |
Yes, when testing this change, the device tree included a reserved-memory node to prevent the structure of being overwritten. |
Humm, we shouldn't have the same information twice. Besides just being redundant, what if they disagree? Other things in /chosen (e.g. initrd) are not in /reserved-memory. It is up to the OS to move or reserve those regions (just like the DT itself). I think either way can work here. /chosen is more for things the prior boot stage sets up or picks one of multiple options (e.g. stdout-path). /reserved-memory is better if this is static forever once set up (e.g. kexec wouldn't touch it and just pass it thru to the next stage). |
I think the latter case applies here. |
|
In my use case, the SMBIOS entry point exists inside a larger memory region already reserved for firmware data but we can split it into separate nodes. If we do move this from chosen to a dedicated /reserved-memory node, what is the best way to ensure standardized discovery? In the chosen case we could rely on the property name, but for the /reserved-memory node we can't restrict the node naming. One possible approach would be to define a new compatible string (compatible = "smbios3-entrypoint") for the kernel to find instead of searching for the property name: |
That may be a reason to keep it in /chosen. How does this work for EFI?
That would be the way to do it if we went this route.
Only 32 bytes? I don't think we want to make reserved regions that fine grained. Is this just pointing to another chunk of memory presumably in that same firmware data region? |
On EFI boot the bootloader also updates the memory map with the SMBIOS region address. This means for this case were U-boot fills that data when EFI is not used, the bootloader should also check that there is a reserved region protecting that memory, otherwise add it in the device tree.
We only need 32 bytes for SMBIOS data which is fixed in size, the node above was an example how it would look like. In my actual case I have a 4KB region reserved for firmware data which includes those 32 bytes filled in by bootloader something like this: |
EFI has its own memory map, which typically describes the SMBIOS as
32 bytes is the size of the so-called We might decide to be normative here, and state that SMBIOS tables reported this way need to be covered by a single reservation, along with the entry point structure, which needs to stay in place, as existing tools expect to be able to access it. That would mean, though, that the entry point structure needs to be at the start of the region, and I'm not sure whether or not existing implementations manage it that way, given that no such requirement exists today. |
Nit: the |
|
I guess the conclusion here is this is fine as-is. However, your Signed-off-by needs to be your full name. Also, please rebase on current main as the first commit can be dropped now. |
034adf7 to
75b8826
Compare
This property allows a bootloader to pass the physical address of the SMBIOSv3 entrypoint structure to the kernel via the /chosen node. This provides a fallback mechanism where the standard EFI configuration tables are not available but SMBIOS data is still present. Signed-off-by: Adriana Nicolae <[email protected]>
75b8826 to
33dfc7e
Compare
Some bootloaders like U-boot, particularly for the ARM architecture,
provide SMBIOS/DMI tables at a specific memory address. However, these
systems often do not boot using a full UEFI environment, which means the
kernel's standard EFI DMI scanner cannot find these tables.
This property allows a bootloader to pass the physical address of the
SMBIOSv3 entrypoint structure to the kernel via the /chosen node.