]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/hyperv/syndbg: skip automatic zero-init of large array
authorDaniel P. Berrangé <berrange@redhat.com>
Tue, 10 Jun 2025 12:36:55 +0000 (13:36 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Thu, 12 Jun 2025 17:40:15 +0000 (13:40 -0400)
The 'handle_recv_msg' method has a 4k byte array used for copying
data between the network socket and guest memory. Skip the automatic
zero-init of this array to eliminate the performance overhead in the
I/O hot path.

The 'data_buf' array will be fully initialized when data is read
off the network socket.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20250610123709.835102-18-berrange@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
hw/hyperv/syndbg.c

index 8b8a14750dd3de77a3fbba0bc6cba1c4e5ff56f1..ac7e15f6f1d5e612b0689fe0fbc940ddd11be515 100644 (file)
@@ -192,7 +192,7 @@ static uint16_t handle_recv_msg(HvSynDbg *syndbg, uint64_t outgpa,
 {
     uint16_t ret;
     g_assert(MSG_BUFSZ >= qemu_target_page_size());
-    uint8_t data_buf[MSG_BUFSZ];
+    QEMU_UNINITIALIZED uint8_t data_buf[MSG_BUFSZ];
     hwaddr out_len;
     void *out_data;
     ssize_t recv_byte_count;