In general, I agree this solution that lets SMBIOS driver directly absorbs the 
SMBIOS table from PEI.
This can eliminate the needs of a separate driver that consumes the HOB and 
calls SMBIOS protocol to add the SMBIOS structures.

There are two options for the HOB design:
1. A single HOB that points to the SMBIOS table.
2. Multiple HOBs that each points to a SMBIOS structure.

In my opinion, option #2 is more flexible because it doesn't require the 
bootloader to consolidate all the SMBIOS structures together.
The CPU module in the bootloader can produce the type 4 and 7 structures. 
The PCI module in the bootloader can produce the type 9 structures.

But, I am not sure if option #2 is conflict with what coreboot does. Does 
coreboot produce the whole SMBIOS table in a single buffer?
Option #2 also doesn't care whether it's a SMBIOS 3.0 table or 2.x table. 

>+  Status = EfiGetSystemConfigurationTable (

1. Why don't you directly get the data from HOB list? This can eliminate the 
code in BlSupportDxe that gets data in HOB and publishes to
configuration table.

> +ValidateSmbios20Table(
> +ValidateSmbios30Table(

2. I will defer to experts (Dandan, Star and Zhichao) to review whether the 
above two functions are implemented properly.

> 
> +ParseAndAddExistingSmbiosTable(
> +  IN EFI_HANDLE                    ImageHandle,
> +  IN SMBIOS_STRUCTURE_POINTER      Smbios,
> +  IN UINTN                         Length
> +) {
> +  EFI_STATUS                    Status;
> +  CHAR8                         *String;
> +  EFI_SMBIOS_HANDLE             SmbiosHandle;
> +  SMBIOS_STRUCTURE_POINTER      SmbiosEnd;
> +
> +  SmbiosEnd.Raw = Smbios.Raw + Length;
> +
> +  do {
> +    // Check for end marker
> +    if (Smbios.Hdr->Type == 127) {

3. Please use SMBIOS_TYPE_END_OF_TABLE instead of hardcode 127.

> 
> +    CopyMem (Smbios.Raw, (VOID *)Smbios30Table, Smbios30Table-
> >TableMaximumSize);

4. Should we copy from Smbios30Table->TableAddress instead of Smbios30Table?

> 
> +    Status = ParseAndAddExistingSmbiosTable(ImageHandle, Smbios,
> Smbios30Table->TableMaximumSize);

5. Can you explain in specific why SMBIOS table should be duplicated before 
parsing?
 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#72379): https://edk2.groups.io/g/devel/message/72379
Mute This Topic: https://groups.io/mt/80998570/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to