hw/cxl: Misc fixes
cover hw/cxl: Misc fixes
Two fixes that Fan posted a while back found testing the improving Linux kernel support.
(qemu prefix is just to avoid confusion in the linux-cxl patchwork instance)
Based-on: [PATCH 0/7] hw/cxl: Round up of fixes.
Based-on: Message-id: [email protected]
Fan Ni (2):
cxl/cxl-mailbox-utils: Fix size check for cmd_firmware_update_get_info hw/cxl/cxl-mailbox-util: Fix output buffer index update when
retrieving DC extents
hw/cxl/cxl-mailbox-utils.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
Signature · 1 line
2.43.0
PATCH 1/2 cxl/cxl-mailbox-utils: Fix size check for cmd_firmware_update_get_info
From: Fan Ni <[email protected]>
In the function cmd_firmware_update_get_info for handling Get FW info command (0x0200h), the vmem, pmem and DC capacity size check were incorrect. The size should be aligned to 256MiB, not smaller than 256MiB.
--- hw/cxl/cxl-mailbox-utils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
hw/cxl/cxl-mailbox-utils.c +3 -3
@@ -649,9 +649,9 @@ static CXLRetCode cmd_firmware_update_get_info(const struct cxl_cmd *cmd, }QEMU_PACKED *fw_info;QEMU_BUILD_BUG_ON (sizeof (*fw_info) !=0x50 ); -if ((cxl_dstate->vmem_size <CXL_CAPACITY_MULTIPLIER ) || - (cxl_dstate->pmem_size <CXL_CAPACITY_MULTIPLIER ) || - (ct3d->dc.total_capacity <CXL_CAPACITY_MULTIPLIER )) { +if (!QEMU_IS_ALIGNED (cxl_dstate->vmem_size,CXL_CAPACITY_MULTIPLIER ) || + !QEMU_IS_ALIGNED (cxl_dstate->pmem_size,CXL_CAPACITY_MULTIPLIER ) || + !QEMU_IS_ALIGNED (ct3d->dc.total_capacity,CXL_CAPACITY_MULTIPLIER )) {return CXL_MBOX_INTERNAL_ERROR ; }
Signature · 1 line
2.43.0
PATCH 2/2 hw/cxl/cxl-mailbox-util: Fix output buffer index update when retrieving DC extents
In reply to Jonathan CameronFrom: Fan Ni <[email protected]>
In the function of retrieving DC extents (cmd_dcd_get_dyn_cap_ext_list), the output buffer index was not correctly updated while iterating the extent list on the device, leaving the extents returned incorrect except for the first one.
--- hw/cxl/cxl-mailbox-utils.c | 1 + 1 file changed, 1 insertion(+)
hw/cxl/cxl-mailbox-utils.c +1 -0
@@ -2227,6 +2227,7 @@ static CXLRetCode cmd_dcd_get_dyn_cap_ext_list(const struct cxl_cmd *cmd,stw_le_p (&out_rec->shared_seq, ent->shared_seq); record_done++; + out_rec++;if (record_done == record_count) {break ; }
Signature · 1 line
2.43.0