- kvm-s390x-Fix-leak-in-machine_set_loadparm.patch [RHEL-98555] - kvm-hw-s390x-ccw-device-Fix-memory-leak-in-loadparm-sett.patch [RHEL-98555] - kvm-target-i386-Update-EPYC-CPU-model-for-Cache-property.patch [RHEL-52650] - kvm-target-i386-Update-EPYC-Rome-CPU-model-for-Cache-pro.patch [RHEL-52650] - kvm-target-i386-Update-EPYC-Milan-CPU-model-for-Cache-pr.patch [RHEL-52650] - kvm-target-i386-Add-couple-of-feature-bits-in-CPUID_Fn80.patch [RHEL-52650] - kvm-target-i386-Update-EPYC-Genoa-for-Cache-property-per.patch [RHEL-52650] - kvm-target-i386-Add-support-for-EPYC-Turin-model.patch [RHEL-52650] - kvm-include-qemu-compiler-add-QEMU_UNINITIALIZED-attribu.patch [RHEL-95479] - kvm-hw-virtio-virtio-avoid-cost-of-ftrivial-auto-var-ini.patch [RHEL-95479] - kvm-block-skip-automatic-zero-init-of-large-array-in-ioq.patch [RHEL-95479] - kvm-chardev-char-fd-skip-automatic-zero-init-of-large-ar.patch [RHEL-95479] - kvm-chardev-char-pty-skip-automatic-zero-init-of-large-a.patch [RHEL-95479] - kvm-chardev-char-socket-skip-automatic-zero-init-of-larg.patch [RHEL-95479] - kvm-hw-audio-ac97-skip-automatic-zero-init-of-large-arra.patch [RHEL-95479] - kvm-hw-audio-cs4231a-skip-automatic-zero-init-of-large-a.patch [RHEL-95479] - kvm-hw-audio-es1370-skip-automatic-zero-init-of-large-ar.patch [RHEL-95479] - kvm-hw-audio-gus-skip-automatic-zero-init-of-large-array.patch [RHEL-95479] - kvm-hw-audio-marvell_88w8618-skip-automatic-zero-init-of.patch [RHEL-95479] - kvm-hw-audio-sb16-skip-automatic-zero-init-of-large-arra.patch [RHEL-95479] - kvm-hw-audio-via-ac97-skip-automatic-zero-init-of-large-.patch [RHEL-95479] - kvm-hw-char-sclpconsole-lm-skip-automatic-zero-init-of-l.patch [RHEL-95479] - kvm-hw-dma-xlnx_csu_dma-skip-automatic-zero-init-of-larg.patch [RHEL-95479] - kvm-hw-display-vmware_vga-skip-automatic-zero-init-of-la.patch [RHEL-95479] - kvm-hw-hyperv-syndbg-skip-automatic-zero-init-of-large-a.patch [RHEL-95479] - kvm-hw-misc-aspeed_hace-skip-automatic-zero-init-of-larg.patch [RHEL-95479] - kvm-hw-net-rtl8139-skip-automatic-zero-init-of-large-arr.patch [RHEL-95479] - kvm-hw-net-tulip-skip-automatic-zero-init-of-large-array.patch [RHEL-95479] - kvm-hw-net-virtio-net-skip-automatic-zero-init-of-large-.patch [RHEL-95479] - kvm-hw-net-xgamc-skip-automatic-zero-init-of-large-array.patch [RHEL-95479] - kvm-hw-nvme-ctrl-skip-automatic-zero-init-of-large-array.patch [RHEL-95479] - kvm-hw-ppc-pnv_occ-skip-automatic-zero-init-of-large-str.patch [RHEL-95479] - kvm-hw-ppc-spapr_tpm_proxy-skip-automatic-zero-init-of-l.patch [RHEL-95479] - kvm-hw-usb-hcd-ohci-skip-automatic-zero-init-of-large-ar.patch [RHEL-95479] - kvm-hw-scsi-lsi53c895a-skip-automatic-zero-init-of-large.patch [RHEL-95479] - kvm-hw-scsi-megasas-skip-automatic-zero-init-of-large-ar.patch [RHEL-95479] - kvm-hw-ufs-lu-skip-automatic-zero-init-of-large-array.patch [RHEL-95479] - kvm-net-socket-skip-automatic-zero-init-of-large-array.patch [RHEL-95479] - kvm-net-stream-skip-automatic-zero-init-of-large-array.patch [RHEL-95479] - kvm-hw-i386-amd_iommu-Isolate-AMDVI-PCI-from-amd-iommu-d.patch [RHEL-85649] - kvm-hw-i386-amd_iommu-Allow-migration-when-explicitly-cr.patch [RHEL-85649] - kvm-Enable-amd-iommu-device.patch [RHEL-85649] - kvm-ui-vnc-Update-display-update-interval-when-VM-state-.patch [RHEL-83883] - Resolves: RHEL-98555 ([s390x][RHEL10.1][ccw-device] there would be memory leak with virtio_blk disks) - Resolves: RHEL-52650 ([AMDSERVER 10.1 Feature] Turin: Qemu EPYC-Turin Model) - Resolves: RHEL-95479 (-ftrivial-auto-var-init=zero reduced performance) - Resolves: RHEL-85649 ([RHEL 10]Qemu/amd-iommu: Add ability to manually specify the AMDVI-PCI device) - Resolves: RHEL-83883 (Video stuck after switchover phase when play one video during migration)
74 lines
2.9 KiB
Diff
74 lines
2.9 KiB
Diff
From e1ca896e3388b7a92e3f65c37c7d0f7a9b4679a0 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
|
|
Date: Tue, 10 Jun 2025 13:37:06 +0100
|
|
Subject: [PATCH 36/43] hw/scsi/megasas: skip automatic zero-init of large
|
|
arrays
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
RH-Author: Stefan Hajnoczi <stefanha@redhat.com>
|
|
RH-MergeRequest: 381: Solve -ftrivial-auto-var-init performance regression with QEMU_UNINITIALIZED
|
|
RH-Jira: RHEL-95479
|
|
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
RH-Commit: [28/31] 2123323efa4331a9899c62af9edeeac388f09fc4 (stefanha/centos-stream-qemu-kvm)
|
|
|
|
The 'megasas_dcmd_pd_get_list' and 'megasas_dcmd_get_properties'
|
|
methods have 4k structs 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 'info' structs are manually initialized with memset(). The
|
|
compiler ought to be intelligent enough to turn the memset()
|
|
into a static initialization operation, and thus not duplicate
|
|
the automatic zero-init. Replacing memset() with '{}' makes it
|
|
unambiguous that the arrays are statically initialized.
|
|
|
|
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-29-berrange@redhat.com
|
|
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
(cherry picked from commit ca0559e2350c618048f7caf80cb79c1259e7cfd2)
|
|
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
---
|
|
hw/scsi/megasas.c | 7 ++-----
|
|
1 file changed, 2 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
|
|
index 9f3b30e6ce..79b0fdcfe3 100644
|
|
--- a/hw/scsi/megasas.c
|
|
+++ b/hw/scsi/megasas.c
|
|
@@ -981,13 +981,11 @@ static int megasas_event_wait(MegasasState *s, MegasasCmd *cmd)
|
|
|
|
static int megasas_dcmd_pd_get_list(MegasasState *s, MegasasCmd *cmd)
|
|
{
|
|
- struct mfi_pd_list info;
|
|
- size_t dcmd_size = sizeof(info);
|
|
+ struct mfi_pd_list info = {};
|
|
BusChild *kid;
|
|
uint32_t offset, dcmd_limit, num_pd_disks = 0, max_pd_disks;
|
|
dma_addr_t residual;
|
|
|
|
- memset(&info, 0, dcmd_size);
|
|
offset = 8;
|
|
dcmd_limit = offset + sizeof(struct mfi_pd_address);
|
|
if (cmd->iov_size < dcmd_limit) {
|
|
@@ -1429,11 +1427,10 @@ static int megasas_dcmd_cfg_read(MegasasState *s, MegasasCmd *cmd)
|
|
|
|
static int megasas_dcmd_get_properties(MegasasState *s, MegasasCmd *cmd)
|
|
{
|
|
- struct mfi_ctrl_props info;
|
|
+ struct mfi_ctrl_props info = {};
|
|
size_t dcmd_size = sizeof(info);
|
|
dma_addr_t residual;
|
|
|
|
- memset(&info, 0x0, dcmd_size);
|
|
if (cmd->iov_size < dcmd_size) {
|
|
trace_megasas_dcmd_invalid_xfer_len(cmd->index, cmd->iov_size,
|
|
dcmd_size);
|
|
--
|
|
2.39.3
|
|
|