hw/ufs/lu: skip automatic zero-init of large array

The 'ufs_emulate_scsi_cmd' method has a 4k byte array used for
copying data from the device. Skip the automatic zero-init of
this array to eliminate the performance overhead in the I/O hot
path.

The 'outbuf' array will be fully initialized when data is copied
from the guest.

Signed-off-by: Daniel P. Berrangé <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Klaus Jensen <[email protected]>
Reviewed-by: Harsh Prateek Bora <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
This commit is contained in:
Daniel P. Berrangé authored and Stefan Hajnoczi committed 2025-06-12 13:40:16 -04:00
1 parent ca0559e235
commit 7708e29818
1 file changed
+1 -1
+1 -1
View File
@@ -194,7 +194,7 @@ static int ufs_emulate_wlun_inquiry(UfsRequest *req, uint8_t *outbuf,
static UfsReqResult ufs_emulate_scsi_cmd(UfsLu *lu, UfsRequest *req)
{
uint8_t lun = lu->lun;
uint8_t outbuf[4096];
QEMU_UNINITIALIZED uint8_t outbuf[4096];
uint8_t sense_buf[UFS_SENSE_SIZE];
uint8_t scsi_status;
int len = 0;