-
Notifications
You must be signed in to change notification settings - Fork 2.7k
DynamicTablesPkg: Add CEDT table generation #11010
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: master
Are you sure you want to change the base?
DynamicTablesPkg: Add CEDT table generation #11010
Conversation
0e2342c
to
1a65675
Compare
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.
Hello Nick,
Thanks for the PR, I added a few comments.
I haven't checked the tests yet, but would it be possible to place them in another patch/commit ?
Regards,
Pierre
UINT64 ComponentRegisterBase; | ||
} CM_ARCH_COMMON_CXL_HOST_BRIDGE_INFO; | ||
|
||
#define CFMWS_MAX_INTERLEAVE_WAYS (16) |
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.
Ideally we should not need to have fixed-length arrays. Would it be possible to replace InterleaveTargetTokens
by a token to a CM_ARCH_COMMON_OBJ_REF
instead ?
The CM_ARCH_COMMON_OBJ_REF
array would then contain tokens referencing CM_ARCH_COMMON_CXL_HOST_BRIDGE_INFO
objects
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.
The max size is given in the CXL spec, see section 8.2.4.19.7. What is the advantage of declaring the array out-of-band with respect to the parent struct?
@@ -129,4 +132,3 @@ | |||
NULL|DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyLib.inf | |||
NULL|DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieLib.inf | |||
} | |||
|
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.
No need I think
DynamicTablesPkg/Library/Acpi/Common/AcpiCedtLib/CedtGenerator.c
Outdated
Show resolved
Hide resolved
InterleaveTargetIndex < WindowList[Index].NumberOfInterleaveWays; | ||
InterleaveTargetIndex++) | ||
{ | ||
UINT32 HostBridgeCount; |
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.
NIT: unfortunately there is a coding standard requesting to declare variables at the beginning of functions. So would it be possible to move these variable declarations up ?
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.
section 5.4.1.1 allows for block scope declaration in the spec here: https://tianocore-docs.github.io/edk2-CCodingStandardsSpecification/release-2.20/edk2-CCodingStandardsSpecification-release-2.20.pdf
// Also validate that the provided interleave ways is compliant. | ||
TotalInterleaveTargets = 0; | ||
for (Index = 0; Index < WindowCount; Index++) { | ||
UINT8 InterleaveWays = WindowList[Index].NumberOfInterleaveWays; |
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.
Same comment about declaring variables at the beginning of functions
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.
Can you point me to where this convention is defined?
DynamicTablesPkg/Library/Acpi/Common/AcpiCedtLib/CedtGenerator.c
Outdated
Show resolved
Hide resolved
return Status; | ||
} | ||
|
||
Cfmws->InterleaveTargetList[InterleaveTargetIndex] = HostBridge->Uid; |
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.
Also, I'm reading the following in the spec:
a.
If ENIW=0,
N=0
b.
If ENIW=1,
N= HPA[8+HBIG]
[...]
I'm not sure to interpret this correctly, but shouldn't this be a list of conditions to check ?
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 know the section you're referencing; in my opinion it is not written clearly and would be better placed elsewhere.
This field is simply an ordered list of the targets involved with the interleaving.
The formula provided in the table prescribes the HDM decoder (Host-managed Device Memory) settings for each interleave target (i.e. CHBS entry). Configuring the HDM decoders correctly is out of scope for CEDT table generation and is delegated to the specific CXL implementation.
- Add objects for CEDT CHBS and CEDT CFMWS. These describe CXL host bridges and CXL fixed memory windows, respectively. Signed-off-by: Nick Graves <[email protected]>
72344f2
to
7ce03b2
Compare
- Generate CEDT table from ConfigurationManager objects. - Only CHBS and CFMWS sub-tables are supported currently. Signed-off-by: Nick Graves <[email protected]>
- Add unit tests for CEDT generator. Signed-off-by: Nick Graves <[email protected]>
7ce03b2
to
79ea2ab
Compare
Done, moved tests to a separate commit. |
Description
Add namespace objects for CEDT table generation.
Add generator to create CEDT table
Add unit tests for generator.
Breaking change?
Impacts security?
Includes tests?
How This Was Tested
Integration Instructions
N/A