mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
hw/cxl/events: Improve QMP interfaces and documentation for add/release dynamic capacity.
New DCD command definitions updated in response to review comments from Markus. - Used CxlXXXX instead of CXLXXXXX for newly added types. - Expanded some abreviations in type names to be easier to read. - Additional documentation for some fields. - Replace slightly vague cxl r3.1 references with "Compute Express Link (CXL) Specification, Revision 3.1, XXXX" to bring them inline with what it says on the specification cover. Suggested-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Message-Id: <20240625170805.359278-2-Jonathan.Cameron@huawei.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
0f130d9e37
commit
efc4ad6f99
3 changed files with 103 additions and 67 deletions
|
@ -1874,7 +1874,7 @@ static bool cxl_extent_groups_overlaps_dpa_range(CXLDCExtentGroupList *list,
|
|||
*/
|
||||
static void qmp_cxl_process_dynamic_capacity_prescriptive(const char *path,
|
||||
uint16_t hid, CXLDCEventType type, uint8_t rid,
|
||||
CXLDynamicCapacityExtentList *records, Error **errp)
|
||||
CxlDynamicCapacityExtentList *records, Error **errp)
|
||||
{
|
||||
Object *obj;
|
||||
CXLEventDynamicCapacity dCap = {};
|
||||
|
@ -1882,7 +1882,7 @@ static void qmp_cxl_process_dynamic_capacity_prescriptive(const char *path,
|
|||
CXLType3Dev *dcd;
|
||||
uint8_t flags = 1 << CXL_EVENT_TYPE_INFO;
|
||||
uint32_t num_extents = 0;
|
||||
CXLDynamicCapacityExtentList *list;
|
||||
CxlDynamicCapacityExtentList *list;
|
||||
CXLDCExtentGroup *group = NULL;
|
||||
g_autofree CXLDCExtentRaw *extents = NULL;
|
||||
uint8_t enc_log = CXL_EVENT_TYPE_DYNAMIC_CAP;
|
||||
|
@ -2032,13 +2032,13 @@ static void qmp_cxl_process_dynamic_capacity_prescriptive(const char *path,
|
|||
}
|
||||
|
||||
void qmp_cxl_add_dynamic_capacity(const char *path, uint16_t host_id,
|
||||
CXLExtSelPolicy sel_policy, uint8_t region,
|
||||
const char *tag,
|
||||
CXLDynamicCapacityExtentList *extents,
|
||||
CxlExtentSelectionPolicy sel_policy,
|
||||
uint8_t region, const char *tag,
|
||||
CxlDynamicCapacityExtentList *extents,
|
||||
Error **errp)
|
||||
{
|
||||
switch (sel_policy) {
|
||||
case CXL_EXT_SEL_POLICY_PRESCRIPTIVE:
|
||||
case CXL_EXTENT_SELECTION_POLICY_PRESCRIPTIVE:
|
||||
qmp_cxl_process_dynamic_capacity_prescriptive(path, host_id,
|
||||
DC_EVENT_ADD_CAPACITY,
|
||||
region, extents, errp);
|
||||
|
@ -2050,14 +2050,14 @@ void qmp_cxl_add_dynamic_capacity(const char *path, uint16_t host_id,
|
|||
}
|
||||
|
||||
void qmp_cxl_release_dynamic_capacity(const char *path, uint16_t host_id,
|
||||
CXLExtRemovalPolicy removal_policy,
|
||||
CxlExtentRemovalPolicy removal_policy,
|
||||
bool has_forced_removal,
|
||||
bool forced_removal,
|
||||
bool has_sanitize_on_release,
|
||||
bool sanitize_on_release,
|
||||
uint8_t region,
|
||||
const char *tag,
|
||||
CXLDynamicCapacityExtentList *extents,
|
||||
CxlDynamicCapacityExtentList *extents,
|
||||
Error **errp)
|
||||
{
|
||||
CXLDCEventType type = DC_EVENT_RELEASE_CAPACITY;
|
||||
|
@ -2070,7 +2070,7 @@ void qmp_cxl_release_dynamic_capacity(const char *path, uint16_t host_id,
|
|||
}
|
||||
|
||||
switch (removal_policy) {
|
||||
case CXL_EXT_REMOVAL_POLICY_PRESCRIPTIVE:
|
||||
case CXL_EXTENT_REMOVAL_POLICY_PRESCRIPTIVE:
|
||||
qmp_cxl_process_dynamic_capacity_prescriptive(path, host_id, type,
|
||||
region, extents, errp);
|
||||
return;
|
||||
|
|
|
@ -70,24 +70,24 @@ void qmp_cxl_inject_correctable_error(const char *path, CxlCorErrorType type,
|
|||
|
||||
void qmp_cxl_add_dynamic_capacity(const char *path,
|
||||
uint16_t host_id,
|
||||
CXLExtSelPolicy sel_policy,
|
||||
CxlExtentSelectionPolicy sel_policy,
|
||||
uint8_t region,
|
||||
const char *tag,
|
||||
CXLDynamicCapacityExtentList *extents,
|
||||
CxlDynamicCapacityExtentList *extents,
|
||||
Error **errp)
|
||||
{
|
||||
error_setg(errp, "CXL Type 3 support is not compiled in");
|
||||
}
|
||||
|
||||
void qmp_cxl_release_dynamic_capacity(const char *path, uint16_t host_id,
|
||||
CXLExtRemovalPolicy removal_policy,
|
||||
CxlExtentRemovalPolicy removal_policy,
|
||||
bool has_forced_removal,
|
||||
bool forced_removal,
|
||||
bool has_sanitize_on_release,
|
||||
bool sanitize_on_release,
|
||||
uint8_t region,
|
||||
const char *tag,
|
||||
CXLDynamicCapacityExtentList *extents,
|
||||
CxlDynamicCapacityExtentList *extents,
|
||||
Error **errp)
|
||||
{
|
||||
error_setg(errp, "CXL Type 3 support is not compiled in");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue