-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Creates C-State, P-State and CPC objects under processor for X64 arch #6484
base: master
Are you sure you want to change the base?
Conversation
2817556
to
a13b8af
Compare
Add _CSD version and number of entries definition. These were introduced in the ACPI 3.0 specification. Reference: ACPI 6.5 specification, section 8.4.1.2, Table 8.3: C-State Dependency Package Values. Signed-off-by: Abdul Lateef Attar <[email protected]>
Introduces functions to create C-State and P-State objects. Includes code generation functions for _CST, _CSD, _PCT, and _PSS ACPI processor objects. Signed-off-by: Abdul Lateef Attar <[email protected]>
Introduces configuration manager objects for C-State and P-State. These objects are used to parse and store the configuration data for C-State and P-State tables. Signed-off-by: Abdul Lateef Attar <[email protected]>
Add ACPI processor _CST, _CSD, _PCT, and _PSS objects for X64 CPU SSDT table creation. Also, add the _PPC method. Signed-off-by: Abdul Lateef Attar <[email protected]>
Introduce _PSD and _CPC ACPI objects for X64 platforms. Signed-off-by: Abdul Lateef Attar <[email protected]>
Adds _STA device status bit definations. Reference: ACPI 6.5 specification, section 6.3.7 Signed-off-by: Abdul Lateef Attar <[email protected]>
Implement the _STA method for the CPU object based on the value provided by the configuration manager. Signed-off-by: Abdul Lateef Attar <[email protected]>
Hi @pierregondois, |
/** A structure that describes a | ||
processor power state control package Info. | ||
|
||
Cf. ACPI 6.1, s8.4.1.1 _CST (Processor Power State Control). |
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.
Please move to 6.5 spec
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.
Ack
/// Worst case latency for entering and exiting the C-State, in milliseconds. | ||
UINT16 Latency; | ||
|
||
/// Power consumption in the C-State. |
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: is it possible to add that this is in mW ?
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.
Ack
EFIAPI | ||
AmlCreatePssNode ( | ||
IN AML_PSS_INFO *PssInfo, | ||
IN UINT32 NumPackages, |
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.
IIRC, PssInfo
is an array of NumPackages
elements. Is it possible to mention it in the parameter description.
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.
Ack
goto error_handler; | ||
} | ||
|
||
for (Index = 0; Index < NumPackages; Index++) { |
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 think you need to iterate over the different PssInfo
elements, it seems you are using the first entry for all the iterations.
I.e. use PssInfo[Index].XXX
in the loop.
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.
Ack
AML_OBJECT_NODE_HANDLE PssMainPackage; | ||
UINT32 Index; | ||
|
||
if ((PssInfo == NULL) || |
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.
Would it be possible to forbid calling the function with NumPackages
== 0 ?
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.
Ack
Status // Integer (DWORD) | ||
}) | ||
Cf. ACPI 6.4, s8.4.5.2 _PSS (Processor Supported Performance States). |
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.
Should update to 6.5 spec (maybe same comment at other places)
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.
Ack
/** Create _PSS node | ||
Generates and optionally appends the following node: | ||
Name (_PSS, Package() |
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 think the description of what is generated is incorrect: each PState is in a package and _PSS returns a package of PState, so it should be as in the spec:
Package {
PState [0] // Package - Performance state 0
....
PState [n] // Package - Performance state n
}
Each Pstate sub-Package contains the elements described below:
Package {
CoreFrequency, // Integer (DWORD)
Power, // Integer (DWORD)
Latency, // Integer (DWORD)
BusMasterLatency, // Integer (DWORD)
Control, // Integer (DWORD)
Status, // Integer (DWORD)
}
I think some comments for AmlCreatePssNode() can be applied to AmlCreateCsdNode() and AmlCreateCstNode(). Is it possible to check please ?
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.
Ack, agree will update the description.
} | ||
|
||
for (Index = 0; Index < NumEntries; Index++) { | ||
if ((CsdInfo[Index].NumEntries != EFI_ACPI_6_4_AML_CSD_NUM_ENTRIES) || |
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.
Should be 6.5 spec
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.
Ack
@@ -19,6 +19,15 @@ | |||
// | |||
#pragma pack(1) | |||
|
|||
/// | |||
/// _STA bit definitions ACPI 6.5 s6.3.7 |
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.
Not here, but typo in the commit message: definations -> definitions
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.
Ack
/** Optional field: Reference Token for the Cst info of this processor. | ||
i.e. a token referencing a CM_ARCH_COMMON_CST_INFO object. | ||
*/ | ||
CM_OBJECT_TOKEN CstToken; |
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 think these should be token identifying a CM_ARCH_COMMON_OBJ_REF
structure instead.
Indeed, it is likely that most of the CPUs on the platform will have the same set of C-States or P-States (or other). So instead of having all functions returning the same set of values for each CPU, it would be better to factorize these values in one object. For instance, all CPUs on the platform could implement the _CST
method as:
Scope (\_SB) {
Name (CST0, Package() {
0, // Count
Package() {
Register,
Type,
Latency,
Power
},
} // Name CST0
}
// and for each CPU:
Scope(\_PR.CPU0) {
Method(_CST,0) {
Return(\_SB.CST0)
}
}
Scope(\_PR.CPU1) {
Method(_CST,0) {
Return(\_SB.CST0)
}
}
Scope(\_PR.CPU2) {
Method(_CST,0) {
Return(\_SB.CST0)
}
}
...
This seems to be also how platform vendors have implemented their _PSS
, _PCT
methods.
Please check the GenerateLpiStates()
and CreateAmlLpiMethod()
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.
Didnt opted the factorization for below reason.
- to generate the code similar to what ACPI spec says and close to the acpi spec examples.
- There are possibilities(hypothetical scenario) that each processor might support different set of C-State and P-State.
Also different processor might have different values(in package) to put the processor into different C-State.
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.
Using a CM_ARCH_COMMON_OBJ_REF
would still allow CPUs to have different C-States/P-states. However they would have to be written only once. Each CPU can then aggregate these C/P-states how they desire.
Please have a look at the Lpi-States configuration at [1]. The Juno platform has an asymmetric topology, so for most platforms Lpi-States configuration would be simpler to configure (and so would it be for the C/P-States).
Description
This PR creates below ACPI objects for processor device for X64 arch
C-State: Creates _CST and _CSD objects.
P-State: Create _PCT, _PSS objects plus _PPC method
_PSD object for domain dependency
_CPC continue performance control object
Update AML library to generate _CST, _CSD, _PCT and _PSS node.
Generates _STA method based on configuration data.
How This Was Tested
Tested on AMD Platform
Integration Instructions
N/A