Skip to content

Conversation

@samimujawar
Copy link

Some SMBIOS tables have dependencies on other SMBIOS tables. These
dependencies are established using handles pointing to the dependent
SMBIOS tables.
This requires the dependent SMBIOS table to be installed before the
parent SMBIOS table can be installed.

To facilitate dynamic SMBIOS table generation, a SMBIOS table
dispatcher has been introduced. The SMBIOS table dispatcher
schedules the installation of dependent SMBIOS tables before
the parent SMBIOS table is installed.

This v3 series addresses the feedback received for the v2 series.
The feedback for the v2 series was posted in #510

The SMBIOS dispatcher categorises the SMBIOS tables as:

  • default ordered
  • ordered.

The default ordered SMBIOS tables have a fixed defined dependency
i.e. their dependency list can be traversed by the dispatcher to
schedule their dispatch.

Ordered SMBIOS tables do not have a well defined dependency and
could depend on any SMBIOS table, for e.g. the SMBIOS table Group
Associations (Type 14) does not have a well defined dependency as
it can be used to associate any two SMBIOS tables.
Therefore, ordered SMBIOS tables are scheduled for dispatch after
the default ordered SMBIOS tables are dispatched. The ordered SMBIOS
tables can also have a level that allows the dispatcher to sequence
their dispatch.

Note: The PR #510 needs to catchup with this PR.

SMBIOS Structure Types 0 through 127 (7Fh) are reserved
for and defined by the SMBIOS specification. Types 128
through 256 (80h to FFh) are available for system and
OEM-specific information.

Therefore, define a new type 'SMBIOS_TABLE_TYPE' that
represents a SMBIOS structure type and include it in
the definition of CM_STD_OBJ_SMBIOS_TABLE_INFO.

Acked-by: Abner Chang <[email protected]>
Signed-off-by: Sami Mujawar <[email protected]>
Cc: Alexei Fedorov <[email protected]>
Cc: Pierre Gondois <[email protected]>
Cc: Girish Mahadevan <[email protected]>
Cc: Jeff Brasen <[email protected]>
Cc: Ashish Singhal <[email protected]>
Cc: Nick Ramirez <[email protected]>
Cc: William Watson <[email protected]>
Cc: Abner Chang <[email protected]>
Cc: Samer El-Haj-Mahmoud <[email protected]>
Cc: Jose Marinho <[email protected]>
Some SMBIOS structure/table fields have dependency on other SMBIOS
structures/tables. These dependencies are established using handles
pointing to the dependent tables.

A SMBIOS table handle can be obtained by either installing a SMBIOS
table or by allocating a handle, which requires complex management
to avoid any clashes.

Obtaining a SMBIOS handle by installation requires that the dependent
table is installed before the parent SMBIOS table can be installed.
Therefore, introduce a SMBIOS table dispatcher that walks the SMBIOS
dependency list and schedules the dependent tables to be installed
before the parent table is installed.

Signed-off-by: Sami Mujawar <[email protected]>
Cc: Alexei Fedorov <[email protected]>
Cc: Pierre Gondois <[email protected]>
Cc: Girish Mahadevan <[email protected]>
Cc: Jeff Brasen <[email protected]>
Cc: Ashish Singhal <[email protected]>
Cc: Nick Ramirez <[email protected]>
Cc: William Watson <[email protected]>
Cc: Abner Chang <[email protected]>
Cc: Samer El-Haj-Mahmoud <[email protected]>
Cc: Jose Marinho <[email protected]>
Update the SMBIOS table dispatcher dependency table to add the
table dependencies for SMBIOS table Type 19, Type 20, Type 27,
Type 35 and Type 37.

The SMBIOS table Type 35 can have dependency on 6 other SMBIOS
tables. Therefore, increase the MAX_SMBIOS_DEPENDENCY to 6, and
also update the SMBIOS table dispatcher table accordingly.

Signed-off-by: Sami Mujawar <[email protected]>
Cc: Alexei Fedorov <[email protected]>
Cc: Pierre Gondois <[email protected]>
Cc: Girish Mahadevan <[email protected]>
Cc: Jeff Brasen <[email protected]>
Cc: Ashish Singhal <[email protected]>
Cc: Nick Ramirez <[email protected]>
Cc: William Watson <[email protected]>
Cc: Abner Chang <[email protected]>
Cc: Samer El-Haj-Mahmoud <[email protected]>
Cc: Jose Marinho <[email protected]>
Some SMBIOS tables do not have a fixed dependency and can depend on any
other SMBIOS tables. Therefore, the SMBIOS dispatcher cannot define a
fixed sequence for dispatching these tables. A possible solution is to
defer the dispatch of such SMBIOS tables towards the end, assuming that
the dependent SMBIOS tables would have been dispatched by then.

Therefore, introduce a dispatch order attribute such that SMBIOS tables
that have a fixed dependency sequence are configured as Default Ordered,
and the SMBIOS tables that do not have a fixed dependency have an Order
attribute specifying an Order Level. An Order Level is used to sequence
the dispatch of Ordered SMBIOS tables.

The Default Ordered SMBIOS tables are dispatched first and a dependency
walk is performed to dispatch the dependent tables by iterating through
the SMBIOS_TABLE_DISPATCHER.Dependency[].

Once all Default ordered SMBIOS tables have been dispatched, the Ordered
SMBIOS tables would be scheduled for dispatch in increasing order as of
the Order Level, e.g. OrderL1, OrderL2, ...
Note: The dispatcher does not perform a dependency walk for the Ordered
SMBIOS tables as the expectation is that the dependent SMBIOS tables
would be already dispatched.

A top level dispatch function DispatchSmbiosTables() has been introduced
to schedule the dispatch of Default Ordered and Ordered SMBIOS tables.

Signed-off-by: Sami Mujawar <[email protected]>
Cc: Alexei Fedorov <[email protected]>
Cc: Pierre Gondois <[email protected]>
Cc: Girish Mahadevan <[email protected]>
Cc: Jeff Brasen <[email protected]>
Cc: Ashish Singhal <[email protected]>
Cc: Nick Ramirez <[email protected]>
Cc: William Watson <[email protected]>
Cc: Abner Chang <[email protected]>
Cc: Samer El-Haj-Mahmoud <[email protected]>
Cc: Jose Marinho <[email protected]>
@samimujawar
Copy link
Author

@gmahadevan I have generated this PR to get the initial SMBIOS dispatcher patches merged into staging.

@gmahadevan
Copy link

@gmahadevan I have generated this PR to get the initial SMBIOS dispatcher patches merged into staging.

Hi @samimujawar

Thanks !

Do we want to merge the last patch 3cf8e06
as part of the rest of the SMBIOS table generator PR ?

@gmahadevan I have generated this PR to get the initial SMBIOS dispatcher patches merged into staging.

Copy link

@pierregondois pierregondois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The patches look good to me

@pierregondois
Copy link

@gmahadevan I have generated this PR to get the initial SMBIOS dispatcher patches merged into staging.

Hi @samimujawar

Thanks !

Do we want to merge the last patch 3cf8e06 as part of the rest of the SMBIOS table generator PR ?

@gmahadevan I have generated this PR to get the initial SMBIOS dispatcher patches merged into staging.

@gmahadevan Is there any concern ?

@samimujawar
Copy link
Author

@gmahadevan I have generated this PR to get the initial SMBIOS dispatcher patches merged into staging.

Hi @samimujawar
Thanks !
Do we want to merge the last patch 3cf8e06 as part of the rest of the SMBIOS table generator PR ?

@gmahadevan I have generated this PR to get the initial SMBIOS dispatcher patches merged into staging.

@gmahadevan Is there any concern ?
@gmahadevan For this patch, have I missed out something that was there in your PR ?
I think as long as this patch does not break your series, we should just get that merged straightaway.

@gmahadevan
Copy link

@gmahadevan I have generated this PR to get the initial SMBIOS dispatcher patches merged into staging.

Hi @samimujawar
Thanks !
Do we want to merge the last patch 3cf8e06 as part of the rest of the SMBIOS table generator PR ?

@gmahadevan I have generated this PR to get the initial SMBIOS dispatcher patches merged into staging.

@gmahadevan Is there any concern ?
@gmahadevan For this patch, have I missed out something that was there in your PR ?
I think as long as this patch does not break your series, we should just get that merged straightaway.

Agree . Thanks @pierregondois @samimujawar

@samimujawar samimujawar merged commit ba97acd into tianocore:dynamictables-reorg Apr 9, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants