[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 03/61] hw/cxl/cxl-mailbox-utils: remove unneeded mailbox output
From: |
Michael S. Tsirkin |
Subject: |
[PULL v2 03/61] hw/cxl/cxl-mailbox-utils: remove unneeded mailbox output payload space zeroing |
Date: |
Tue, 23 Jul 2024 06:55:22 -0400 |
From: Fan Ni <fan.ni@samsung.com>
The whole mailbox output payload space is already zeroed after copying
out the input payload, which happens before processing the specific mailbox
command:
https://elixir.bootlin.com/qemu/v8.2.1/source/hw/cxl/cxl-device-utils.c#L204
Signed-off-by: Fan Ni <fan.ni@samsung.com>
Link: https://lore.kernel.org/r/20240221221824.1092966-1-nifan.cxl@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Message-Id: <20240705113956.941732-3-Jonathan.Cameron@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/cxl/cxl-mailbox-utils.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/hw/cxl/cxl-mailbox-utils.c b/hw/cxl/cxl-mailbox-utils.c
index 74eeb6fde7..facec42dc8 100644
--- a/hw/cxl/cxl-mailbox-utils.c
+++ b/hw/cxl/cxl-mailbox-utils.c
@@ -235,7 +235,6 @@ static CXLRetCode cmd_events_get_records(const struct
cxl_cmd *cmd,
log_type = payload_in[0];
pl = (CXLGetEventPayload *)payload_out;
- memset(pl, 0, sizeof(*pl));
max_recs = (cxlds->payload_size - CXL_EVENT_PAYLOAD_HDR_SIZE) /
CXL_EVENT_RECORD_SIZE;
@@ -273,7 +272,6 @@ static CXLRetCode cmd_events_get_interrupt_policy(const
struct cxl_cmd *cmd,
CXLEventLog *log;
policy = (CXLEventInterruptPolicy *)payload_out;
- memset(policy, 0, sizeof(*policy));
log = &cxlds->event_logs[CXL_EVENT_TYPE_INFO];
if (log->irq_enabled) {
@@ -372,7 +370,6 @@ static CXLRetCode cmd_infostat_identify(const struct
cxl_cmd *cmd,
QEMU_BUILD_BUG_ON(sizeof(*is_identify) != 18);
is_identify = (void *)payload_out;
- memset(is_identify, 0, sizeof(*is_identify));
is_identify->pcie_vid = class->vendor_id;
is_identify->pcie_did = class->device_id;
if (object_dynamic_cast(OBJECT(cci->d), TYPE_CXL_USP)) {
@@ -606,7 +603,6 @@ static CXLRetCode cmd_infostat_bg_op_sts(const struct
cxl_cmd *cmd,
QEMU_BUILD_BUG_ON(sizeof(*bg_op_status) != 8);
bg_op_status = (void *)payload_out;
- memset(bg_op_status, 0, sizeof(*bg_op_status));
bg_op_status->status = cci->bg.complete_pct << 1;
if (cci->bg.runtime > 0) {
bg_op_status->status |= 1U << 0;
@@ -647,7 +643,6 @@ static CXLRetCode cmd_firmware_update_get_info(const struct
cxl_cmd *cmd,
}
fw_info = (void *)payload_out;
- memset(fw_info, 0, sizeof(*fw_info));
fw_info->slots_supported = 2;
fw_info->slot_info = BIT(0) | BIT(3);
@@ -805,7 +800,6 @@ static CXLRetCode cmd_identify_memory_device(const struct
cxl_cmd *cmd,
}
id = (void *)payload_out;
- memset(id, 0, sizeof(*id));
snprintf(id->fw_revision, 0x10, "BWFW VERSION %02d", 0);
@@ -1095,7 +1089,6 @@ static CXLRetCode cmd_media_get_poison_list(const struct
cxl_cmd *cmd,
out_pl_len = sizeof(*out) + record_count * sizeof(out->records[0]);
assert(out_pl_len <= CXL_MAILBOX_MAX_PAYLOAD_SIZE);
- memset(out, 0, out_pl_len);
QLIST_FOREACH(ent, poison_list, node) {
uint64_t start, stop;
--
MST
- [PULL v2 00/61] virtio,pci,pc: features,fixes, Michael S. Tsirkin, 2024/07/23
- [PULL v2 01/61] hw/virtio/virtio-crypto: Fix op_code assignment in virtio_crypto_create_asym_session, Michael S. Tsirkin, 2024/07/23
- [PULL v2 02/61] MAINTAINERS: add Stefano Garzarella as vhost/vhost-user reviewer, Michael S. Tsirkin, 2024/07/23
- [PULL v2 03/61] hw/cxl/cxl-mailbox-utils: remove unneeded mailbox output payload space zeroing,
Michael S. Tsirkin <=
- [PULL v2 05/61] hw/cxl/cxl-host: Fix segmentation fault when getting cxl-fmw property, Michael S. Tsirkin, 2024/07/23
- [PULL v2 06/61] hw/cxl: Add get scan media capabilities cmd support, Michael S. Tsirkin, 2024/07/23
- [PULL v2 07/61] hw/cxl/mbox: replace sanitize_running() with cxl_dev_media_disabled(), Michael S. Tsirkin, 2024/07/23
- [PULL v2 04/61] hw/cxl: Check for multiple mappings of memory backends., Michael S. Tsirkin, 2024/07/23
- [PULL v2 08/61] hw/cxl/events: discard all event records during sanitation, Michael S. Tsirkin, 2024/07/23
- [PULL v2 09/61] hw/cxl: Add get scan media results cmd support, Michael S. Tsirkin, 2024/07/23
- [PULL v2 10/61] cxl/mailbox: move mailbox effect definitions to a header, Michael S. Tsirkin, 2024/07/23
- [PULL v2 11/61] hw/cxl/cxl-mailbox-utils: Add support for feature commands (8.2.9.6), Michael S. Tsirkin, 2024/07/23
- [PULL v2 12/61] hw/cxl/cxl-mailbox-utils: Add device patrol scrub control feature, Michael S. Tsirkin, 2024/07/23
- [PULL v2 13/61] hw/cxl/cxl-mailbox-utils: Add device DDR5 ECS control feature, Michael S. Tsirkin, 2024/07/23