From: Daniel P. Berrangé Date: Tue, 10 Jun 2025 12:37:04 +0000 (+0100) Subject: hw/usb/hcd-ohci: skip automatic zero-init of large array X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=14997d521d1cd0bb36c902ef1032f0d3f2a3c912;p=thirdparty%2Fqemu.git hw/usb/hcd-ohci: skip automatic zero-init of large array The 'ohci_service_iso_td' method has a 8k byte array used for copying data between guest and host. Skip the automatic zero-init of this array to eliminate the performance overhead in the I/O hot path. The 'buf' array will be fully initialized when reading data from guest memory. Signed-off-by: Daniel P. Berrangé Reviewed-by: Stefan Hajnoczi Reviewed-by: Klaus Jensen Reviewed-by: Harsh Prateek Bora Message-id: 20250610123709.835102-27-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c index 71b54914d3..72a9f9f474 100644 --- a/hw/usb/hcd-ohci.c +++ b/hw/usb/hcd-ohci.c @@ -577,7 +577,7 @@ static int ohci_service_iso_td(OHCIState *ohci, struct ohci_ed *ed) USBDevice *dev; USBEndpoint *ep; USBPacket *pkt; - uint8_t buf[8192]; + QEMU_UNINITIALIZED uint8_t buf[8192]; bool int_req; struct ohci_iso_td iso_td; uint32_t addr;