]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/ufs/lu: skip automatic zero-init of large array
authorDaniel P. Berrangé <berrange@redhat.com>
Tue, 10 Jun 2025 12:37:07 +0000 (13:37 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Thu, 12 Jun 2025 17:40:16 +0000 (13:40 -0400)
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é <berrange@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
Message-id: 20250610123709.835102-30-berrange@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
hw/ufs/lu.c

index 57b307ea5605d9947fe192dcc1b69cbb9da0aabf..2d8ffd72c5d998f3237658e9e916c29fb6cb1f82 100644 (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;