From 6a11d5845b62f4f1a1c481b9be33aae9acded335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Tue, 10 Jun 2025 13:37:05 +0100 Subject: [PATCH 35/43] hw/scsi/lsi53c895a: skip automatic zero-init of large array MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RH-Author: Stefan Hajnoczi RH-MergeRequest: 381: Solve -ftrivial-auto-var-init performance regression with QEMU_UNINITIALIZED RH-Jira: RHEL-95479 RH-Acked-by: Miroslav Rezanina RH-Commit: [27/31] d54767678b4bd133b69cc7461220121eee04c9bb (stefanha/centos-stream-qemu-kvm) The 'lsi_memcpy' method has a 4k byte array used for copying data to/from the device. 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 data is copied. Signed-off-by: Daniel P. Berrangé Reviewed-by: Stefan Hajnoczi Reviewed-by: Klaus Jensen Reviewed-by: Harsh Prateek Bora Message-id: 20250610123709.835102-28-berrange@redhat.com Signed-off-by: Stefan Hajnoczi (cherry picked from commit 55243edf42ee87bce9f36ca251f3ab9cda1563e4) Signed-off-by: Stefan Hajnoczi --- hw/scsi/lsi53c895a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index 6689ebba25..bacc6593f6 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -1112,7 +1112,7 @@ bad: static void lsi_memcpy(LSIState *s, uint32_t dest, uint32_t src, int count) { int n; - uint8_t buf[LSI_BUF_SIZE]; + QEMU_UNINITIALIZED uint8_t buf[LSI_BUF_SIZE]; trace_lsi_memcpy(dest, src, count); while (count) { -- 2.39.3