From 5a1f614d0cd0bcc8e84e0b7ab6af63d56bd348a2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Tue, 10 Jun 2025 13:36:55 +0100 Subject: [PATCH] hw/hyperv/syndbg: skip automatic zero-init of large array MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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é Reviewed-by: Stefan Hajnoczi Message-id: 20250610123709.835102-18-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- hw/hyperv/syndbg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/hyperv/syndbg.c b/hw/hyperv/syndbg.c index 8b8a14750d..ac7e15f6f1 100644 --- a/hw/hyperv/syndbg.c +++ b/hw/hyperv/syndbg.c @@ -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; -- 2.39.5