Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: 12aeef9378b58ed360f9cea432ce33664c053d78
      
https://github.com/qemu/qemu/commit/12aeef9378b58ed360f9cea432ce33664c053d78
  Author: Stefan Hajnoczi <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M include/qemu/compiler.h

  Log Message:
  -----------
  include/qemu/compiler: add QEMU_UNINITIALIZED attribute macro

The QEMU_UNINITIALIZED macro is to be used to skip the default compiler
variable initialization done by -ftrivial-auto-var-init=zero.

Use this in cases where there a method in the device I/O path (or other
important hot paths), that has large variables on the stack. A rule of
thumb is that "large" means a method with 4kb data in the local stack
frame. Any variables which are KB in size, should be annotated with this
attribute, to pre-emptively eliminate any potential overhead from the
compiler zero'ing memory.

Given that this turns off a security hardening feature, when using this
to flag variables, it is important that the code is double-checked to
ensure there is no possible use of uninitialized data in the method.

Signed-off-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Daniel P. Berrangé <[email protected]>
Message-id: [email protected]
[DB: split off patch & rewrite guidance on when to use the annotation]
Signed-off-by: Daniel P. Berrangé <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: 685a03dec565a7a51f8f61379390c040a9c10fcc
      
https://github.com/qemu/qemu/commit/685a03dec565a7a51f8f61379390c040a9c10fcc
  Author: Stefan Hajnoczi <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M hw/virtio/virtio.c

  Log Message:
  -----------
  hw/virtio/virtio: avoid cost of -ftrivial-auto-var-init in hot path

Since commit 7ff9ff039380 ("meson: mitigate against use of uninitialize
stack for exploits") the -ftrivial-auto-var-init=zero compiler option is
used to zero local variables. While this reduces security risks
associated with uninitialized stack data, it introduced a measurable
bottleneck in the virtqueue_split_pop() and virtqueue_packed_pop()
functions.

These virtqueue functions are in the hot path. They are called for each
element (request) that is popped from a VIRTIO device's virtqueue. Using
__attribute__((uninitialized)) on large stack variables in these
functions improves fio randread bs=4k iodepth=64 performance from 304k
to 332k IOPS (+9%).

This issue was found using perf-top(1). virtqueue_split_pop() was one of
the top CPU consumers and the "annotate" feature showed that the memory
zeroing instructions at the beginning of the functions were hot.

Fixes: 7ff9ff039380 ("meson: mitigate against use of uninitialize stack for 
exploits")
Cc: Daniel P. Berrangé <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: df2f28b50988a424286184c3c572e25240fdf239
      
https://github.com/qemu/qemu/commit/df2f28b50988a424286184c3c572e25240fdf239
  Author: Daniel P. Berrangé <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M block/linux-aio.c

  Log Message:
  -----------
  block: skip automatic zero-init of large array in ioq_submit

The 'ioq_submit' method has a struct array that is 8k in size.
Skip the automatic zero-init of this array to eliminate the
performance overhead in the I/O hot path.

The 'iocbs' array will selectively initialized when processing
the I/O data.

Signed-off-by: Daniel P. Berrangé <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: d2fc3152b91d48de6094aff3d828eb821a039e37
      
https://github.com/qemu/qemu/commit/d2fc3152b91d48de6094aff3d828eb821a039e37
  Author: Daniel P. Berrangé <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M chardev/char-fd.c

  Log Message:
  -----------
  chardev/char-fd: skip automatic zero-init of large array

The 'fd_chr_read' method has a 4k byte array used for copying
data between the socket and 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 reading data off
the network socket.

Signed-off-by: Daniel P. Berrangé <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: e0791ce0bd567b40c4e91a733d7e687b34e31735
      
https://github.com/qemu/qemu/commit/e0791ce0bd567b40c4e91a733d7e687b34e31735
  Author: Daniel P. Berrangé <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M chardev/char-pty.c

  Log Message:
  -----------
  chardev/char-pty: skip automatic zero-init of large array

The 'pty_chr_read' method has a 4k byte array used for copying
data between the PTY and 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 reading data off
the PTY.

Signed-off-by: Daniel P. Berrangé <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: ba0f8f0e4930e1cb631fef48c218364b6865face
      
https://github.com/qemu/qemu/commit/ba0f8f0e4930e1cb631fef48c218364b6865face
  Author: Daniel P. Berrangé <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M chardev/char-socket.c

  Log Message:
  -----------
  chardev/char-socket: skip automatic zero-init of large array

The 'tcp_chr_read' method has a 4k byte array used for copying
data between the socket and 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 reading data off
the network socket.

Signed-off-by: Daniel P. Berrangé <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: 1579bf9f0c55e11315d4074136a3388f3f00f1bc
      
https://github.com/qemu/qemu/commit/1579bf9f0c55e11315d4074136a3388f3f00f1bc
  Author: Daniel P. Berrangé <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M hw/audio/ac97.c

  Log Message:
  -----------
  hw/audio/ac97: skip automatic zero-init of large arrays

The 'read_audio' & 'write_audio' methods have a 4k byte array used
for copying data between the audio backend and device. Skip the
automatic zero-init of these arrays to eliminate the performance
overhead in the I/O hot path.

The 'tmpbuf' array will be fully initialized when reading data from
the audio backend and/or device memory.

Signed-off-by: Daniel P. Berrangé <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: 19e9555ab3f15c26c1746325a9e1286c271c4fb2
      
https://github.com/qemu/qemu/commit/19e9555ab3f15c26c1746325a9e1286c271c4fb2
  Author: Daniel P. Berrangé <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M hw/audio/cs4231a.c

  Log Message:
  -----------
  hw/audio/cs4231a: skip automatic zero-init of large arrays

The 'cs_write_audio' method has a pair of byte arrays, one 4k in size
and one 8k, which are used in converting audio samples. Skip the
automatic zero-init of these arrays to eliminate the performance
overhead in the I/O hot path.

The 'tmpbuf' array will be fully initialized when reading a block of
data from the guest. The 'linbuf' array will be fully initialized
when converting the audio samples.

Signed-off-by: Daniel P. Berrangé <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: 75f8d57fe98eadee1e5eb4e10d1d43d4ed9d1f75
      
https://github.com/qemu/qemu/commit/75f8d57fe98eadee1e5eb4e10d1d43d4ed9d1f75
  Author: Daniel P. Berrangé <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M hw/audio/es1370.c

  Log Message:
  -----------
  hw/audio/es1370: skip automatic zero-init of large array

The 'es1370_transfer_audio' method has a 4k byte array used for
copying data between the audio backend and device. Skip the automatic
zero-init of this array to eliminate the performance overhead in
the I/O hot path.

The 'tmpbuf' array will be fully initialized when reading data from
the audio backend and/or device memory.

Signed-off-by: Daniel P. Berrangé <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: 0b259ce4f5d2b56ca5f2c7ff04b686f44315d58a
      
https://github.com/qemu/qemu/commit/0b259ce4f5d2b56ca5f2c7ff04b686f44315d58a
  Author: Daniel P. Berrangé <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M hw/audio/gus.c

  Log Message:
  -----------
  hw/audio/gus: skip automatic zero-init of large array

The 'GUS_read_DMA' method has a 4k byte array used for copying
data between the audio backend and device. Skip the automatic
zero-init of this array to eliminate the performance overhead in
the I/O hot path.

The 'tmpbuf' array will be fully initialized when reading data
from device memory.

Signed-off-by: Daniel P. Berrangé <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: 52c484a8a605b6991a912e8a351b54dc7500b927
      
https://github.com/qemu/qemu/commit/52c484a8a605b6991a912e8a351b54dc7500b927
  Author: Daniel P. Berrangé <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M hw/audio/marvell_88w8618.c

  Log Message:
  -----------
  hw/audio/gus: skip automatic zero-init of large array

The 'mv88w8618_audio_callback' method has a 4k byte array used for
copying data between the audio backend and 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 reading data from
device memory.

Signed-off-by: Daniel P. Berrangé <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: 5f7c80db71cc43d0c5df942467b4f22aa7cd339b
      
https://github.com/qemu/qemu/commit/5f7c80db71cc43d0c5df942467b4f22aa7cd339b
  Author: Daniel P. Berrangé <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M hw/audio/sb16.c

  Log Message:
  -----------
  hw/audio/sb16: skip automatic zero-init of large array

The 'write_audio' method has a 4k byte array used for copying data
between the audio backend and device. Skip the automatic zero-init
of this array to eliminate the performance overhead in the I/O hot
path.

The 'tmpbuf' array will be fully initialized when reading data from
device memory.

Signed-off-by: Daniel P. Berrangé <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: 2bd74b6a5d48f0d0bb873f94e06ef8133a3bbb67
      
https://github.com/qemu/qemu/commit/2bd74b6a5d48f0d0bb873f94e06ef8133a3bbb67
  Author: Daniel P. Berrangé <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M hw/audio/via-ac97.c

  Log Message:
  -----------
  hw/audio/via-ac97: skip automatic zero-init of large array

The 'out_cb' method has a 4k byte array used for copying data
between the audio backend and device. Skip the automatic zero-init
of this array to eliminate the performance overhead in the I/O hot
path.

The 'tmpbuf' array will be fully initialized when reading data from
device memory.

Signed-off-by: Daniel P. Berrangé <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: 8a73687868308cd8a308ae7bee37a17103fafa07
      
https://github.com/qemu/qemu/commit/8a73687868308cd8a308ae7bee37a17103fafa07
  Author: Daniel P. Berrangé <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M hw/char/sclpconsole-lm.c

  Log Message:
  -----------
  hw/char/sclpconsole-lm: skip automatic zero-init of large array

The 'process_mdb' method has a 4k byte array used for copying data
between the guest and the chardev backend. Skip the automatic zero-init
of this array to eliminate the performance overhead in the I/O hot
path.

The 'buffer' array will be selectively initialized when data is converted
between EBCDIC and ASCII.

Signed-off-by: Daniel P. Berrangé <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: 6a7d21986b342b25d757b140521c7e168a656363
      
https://github.com/qemu/qemu/commit/6a7d21986b342b25d757b140521c7e168a656363
  Author: Daniel P. Berrangé <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M hw/dma/xlnx_csu_dma.c

  Log Message:
  -----------
  hw/dma/xlnx_csu_dma: skip automatic zero-init of large array

The 'xlnx_csu_dma_src_notify' method has a 4k byte array used for
copying DMA data. 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é <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: 7c94d5e81fc36d3526e1525fd7a3b58ed86f8169
      
https://github.com/qemu/qemu/commit/7c94d5e81fc36d3526e1525fd7a3b58ed86f8169
  Author: Daniel P. Berrangé <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M hw/display/vmware_vga.c

  Log Message:
  -----------
  hw/display/vmware_vga: skip automatic zero-init of large struct

The 'vmsvga_fifo_run' method has a struct which is a little over 20k
in size, used for holding image data for cursor changes. Skip the
automatic zero-init of this struct to eliminate the performance
overhead in the I/O hot path.

The cursor variable will be fully initialized only when processing
a cursor definition message from the guest.

Signed-off-by: Daniel P. Berrangé <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: 59b71d939cb4b0f12f6a98474e66e18a2d17f277
      
https://github.com/qemu/qemu/commit/59b71d939cb4b0f12f6a98474e66e18a2d17f277
  Author: Daniel P. Berrangé <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M hw/hyperv/syndbg.c

  Log Message:
  -----------
  hw/hyperv/syndbg: skip automatic zero-init of large array

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é <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: 88af9852400f792bfbce9e6524e5bfcd8bd7ae57
      
https://github.com/qemu/qemu/commit/88af9852400f792bfbce9e6524e5bfcd8bd7ae57
  Author: Daniel P. Berrangé <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M hw/misc/aspeed_hace.c

  Log Message:
  -----------
  hw/misc/aspeed_hace: skip automatic zero-init of large array

The 'do_hash_operation' method has a 256 element iovec array used for
holding pointers to data that is to be hashed. Skip the automatic
zero-init of this array to eliminate the performance overhead in the
I/O hot path.

The 'iovec' array will be selectively initialized based on data that
needs to be hashed.

Signed-off-by: Daniel P. Berrangé <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: 4b443e5f097db0a500ada53c45eefafee3800e33
      
https://github.com/qemu/qemu/commit/4b443e5f097db0a500ada53c45eefafee3800e33
  Author: Daniel P. Berrangé <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M hw/net/rtl8139.c

  Log Message:
  -----------
  hw/net/rtl8139: skip automatic zero-init of large array

The 'rtl8139_transmit_one' 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 'txbuffer' will be fully initialized when reading PCI DMA
buffers.

Signed-off-by: Daniel P. Berrangé <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: ec4791a52ba92e3d6fe8243ec9abc521f77541c1
      
https://github.com/qemu/qemu/commit/ec4791a52ba92e3d6fe8243ec9abc521f77541c1
  Author: Daniel P. Berrangé <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M hw/net/tulip.c

  Log Message:
  -----------
  hw/net/tulip: skip automatic zero-init of large array

The 'tulip_setup_frame' method has a 4k byte array used for copynig
DMA data 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 reading data from the
device.

Signed-off-by: Daniel P. Berrangé <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: 3bdd75078d7c6c6065ea348a1ff8ade539cf3529
      
https://github.com/qemu/qemu/commit/3bdd75078d7c6c6065ea348a1ff8ade539cf3529
  Author: Daniel P. Berrangé <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M hw/net/virtio-net.c

  Log Message:
  -----------
  hw/net/virtio-net: skip automatic zero-init of large arrays

The 'virtio_net_receive_rcu' method has three arrays with
VIRTQUEUE_MAX_SIZE elements, which are apprixmately 32k in
size used for copying data between guest and host. Skip the
automatic zero-init of these arrays to eliminate the
performance overhead in the I/O hot path.

The three arrays will be selectively initialized as required
when processing network buffers.

Signed-off-by: Daniel P. Berrangé <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: 99ab3a8c6129d0f8e7f0800aae294d784e3a49aa
      
https://github.com/qemu/qemu/commit/99ab3a8c6129d0f8e7f0800aae294d784e3a49aa
  Author: Daniel P. Berrangé <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M hw/net/xgmac.c

  Log Message:
  -----------
  hw/net/xgamc: skip automatic zero-init of large array

The 'xgmac_enet_send' 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 'frame' buffer will be fully initialized when reading guest
memory to fetch the data to send.

Signed-off-by: Daniel P. Berrangé <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: e978bfc68a34ad10c11b56c9817d6d49992afa90
      
https://github.com/qemu/qemu/commit/e978bfc68a34ad10c11b56c9817d6d49992afa90
  Author: Daniel P. Berrangé <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M hw/nvme/ctrl.c

  Log Message:
  -----------
  hw/nvme/ctrl: skip automatic zero-init of large arrays

The 'nvme_map_sgl' method has a 256 element array 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 'segment' array will be fully initialized when reading data from
the device.

The 'nme_changed_nslist' method has a 4k byte array that is 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 array is statically initialized.

Signed-off-by: Daniel P. Berrangé <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Klaus Jensen <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: eb48063f34e76703db3e82a9237cf7721f233a36
      
https://github.com/qemu/qemu/commit/eb48063f34e76703db3e82a9237cf7721f233a36
  Author: Daniel P. Berrangé <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M hw/ppc/pnv_occ.c

  Log Message:
  -----------
  hw/ppc/pnv_occ: skip automatic zero-init of large struct

The 'occ_model_tick' method has a 12k struct used for copying
data between guest and host. Skip the automatic zero-init of this
struct to eliminate the performance overhead in the I/O hot path.

The 'dynamic_data' buffer will be fully initialized when reading
data from the guest.

Signed-off-by: Daniel P. Berrangé <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Klaus Jensen <[email protected]>
Reviewed-by: Harsh Prateek Bora <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: 3986f5deba92088e74309581855f2cab12e164d3
      
https://github.com/qemu/qemu/commit/3986f5deba92088e74309581855f2cab12e164d3
  Author: Daniel P. Berrangé <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M hw/ppc/spapr_tpm_proxy.c

  Log Message:
  -----------
  hw/ppc/spapr_tpm_proxy: skip automatic zero-init of large arrays

The 'tpm_execute' method has a pair of 4k arrays used for copying
data between guest and host. Skip the automatic zero-init of these
arrays to eliminate the performance overhead in the I/O hot path.

The two arrays will be fully initialized when reading data from
guest memory or reading data from the proxy FD.

Signed-off-by: Daniel P. Berrangé <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Klaus Jensen <[email protected]>
Reviewed-by: Harsh Prateek Bora <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: bd37efdb0e8d7bcb96f005ee8c29f12e2040bcc9
      
https://github.com/qemu/qemu/commit/bd37efdb0e8d7bcb96f005ee8c29f12e2040bcc9
  Author: Daniel P. Berrangé <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M hw/usb/hcd-ohci.c

  Log Message:
  -----------
  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é <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Klaus Jensen <[email protected]>
Reviewed-by: Harsh Prateek Bora <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: 533b89ec57b01724b1dd0f0cbfe269bde6ea3219
      
https://github.com/qemu/qemu/commit/533b89ec57b01724b1dd0f0cbfe269bde6ea3219
  Author: Daniel P. Berrangé <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M hw/scsi/lsi53c895a.c

  Log Message:
  -----------
  hw/scsi/lsi53c895a: skip automatic zero-init of large array

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é <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Klaus Jensen <[email protected]>
Reviewed-by: Harsh Prateek Bora <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: ebd72338bfe9c0870c3a4f6c705e7afd29ca3ae7
      
https://github.com/qemu/qemu/commit/ebd72338bfe9c0870c3a4f6c705e7afd29ca3ae7
  Author: Daniel P. Berrangé <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M hw/scsi/megasas.c

  Log Message:
  -----------
  hw/scsi/megasas: skip automatic zero-init of large arrays

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é <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Klaus Jensen <[email protected]>
Reviewed-by: Harsh Prateek Bora <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: 6af559cf109daa3f20cb6772d6a862f7fa5364d1
      
https://github.com/qemu/qemu/commit/6af559cf109daa3f20cb6772d6a862f7fa5364d1
  Author: Daniel P. Berrangé <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M hw/ufs/lu.c

  Log Message:
  -----------
  hw/ufs/lu: skip automatic zero-init of large array

The 'ufs_emulate_scsi_cmd' method has a 4k byte array 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 'outbuf' array will be fully initialized when data is copied
from the guest.

Signed-off-by: Daniel P. Berrangé <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Klaus Jensen <[email protected]>
Reviewed-by: Harsh Prateek Bora <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: 93f34cf954772612f7a40610e8fb3e56ba878e2f
      
https://github.com/qemu/qemu/commit/93f34cf954772612f7a40610e8fb3e56ba878e2f
  Author: Daniel P. Berrangé <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M net/socket.c

  Log Message:
  -----------
  net/socket: skip automatic zero-init of large array

The 'net_socket_send' method has a 68k 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 'buf1' array will be fully initialized when reading data off
the network socket.

Signed-off-by: Daniel P. Berrangé <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Klaus Jensen <[email protected]>
Reviewed-by: Harsh Prateek Bora <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: dc0dfd00f428f7aed17ce2fd01a156186d5f76a3
      
https://github.com/qemu/qemu/commit/dc0dfd00f428f7aed17ce2fd01a156186d5f76a3
  Author: Daniel P. Berrangé <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M net/stream.c

  Log Message:
  -----------
  net/stream: skip automatic zero-init of large array

The 'net_stream_send' method has a 68k 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 'buf1' array will be fully initialized when reading data off
the network socket.

Signed-off-by: Daniel P. Berrangé <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Klaus Jensen <[email protected]>
Reviewed-by: Harsh Prateek Bora <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: f5fc8e6661a1df129ac91389e72b6934ba6b50ff
      
https://github.com/qemu/qemu/commit/f5fc8e6661a1df129ac91389e72b6934ba6b50ff
  Author: Stefan Hajnoczi <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M block/linux-aio.c
    M chardev/char-fd.c
    M chardev/char-pty.c
    M chardev/char-socket.c
    M hw/audio/ac97.c
    M hw/audio/cs4231a.c
    M hw/audio/es1370.c
    M hw/audio/gus.c
    M hw/audio/marvell_88w8618.c
    M hw/audio/sb16.c
    M hw/audio/via-ac97.c
    M hw/char/sclpconsole-lm.c
    M hw/display/vmware_vga.c
    M hw/dma/xlnx_csu_dma.c
    M hw/hyperv/syndbg.c
    M hw/misc/aspeed_hace.c
    M hw/net/rtl8139.c
    M hw/net/tulip.c
    M hw/net/virtio-net.c
    M hw/net/xgmac.c
    M hw/nvme/ctrl.c
    M hw/ppc/pnv_occ.c
    M hw/ppc/spapr_tpm_proxy.c
    M hw/scsi/lsi53c895a.c
    M hw/scsi/megasas.c
    M hw/ufs/lu.c
    M hw/usb/hcd-ohci.c
    M hw/virtio/virtio.c
    M include/qemu/compiler.h
    M net/socket.c
    M net/stream.c

  Log Message:
  -----------
  Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into 
staging

Pull request

# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCgAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmhJyhMACgkQnKSrs4Gr
# c8j1AAgAvbsT6ttqGMzg53w9nL5pT2jZUkDGjec4WdTU+5xh0IiAtjCer9DslbDn
# 2wdsrNT3Oh/Tmw2UkqXcB6C3eOEBWQV2iwDr01+thI4RQazjetZo9A9pDr/s7uf5
# VX9iM2aOq91CFq76lpt/8rS5nIi3n+RclS6Gz12OapmGuUcWrTYYH0QPgB+j/Mpt
# UpO1fOeGRXh5OyRzKVbrq6gDtx/RbWHTwDrdV+HzjswwX6hMyNar/P0dtz1XpdUo
# bqtkZzL5g0Zu4vOswhKzvQ5kPAyxQHtI9p3mUK+UdBu/GdWtiEwidjGGJFTo7sCp
# TXCkHvkRcwMvG8ztF8QpvWdYS9L+OA==
# =kqC3
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 11 Jun 2025 14:25:23 EDT
# gpg:                using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <[email protected]>" [ultimate]
# gpg:                 aka "Stefan Hajnoczi <[email protected]>" [ultimate]
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* tag 'block-pull-request' of https://gitlab.com/stefanha/qemu: (31 commits)
  net/stream: skip automatic zero-init of large array
  net/socket: skip automatic zero-init of large array
  hw/ufs/lu: skip automatic zero-init of large array
  hw/scsi/megasas: skip automatic zero-init of large arrays
  hw/scsi/lsi53c895a: skip automatic zero-init of large array
  hw/usb/hcd-ohci: skip automatic zero-init of large array
  hw/ppc/spapr_tpm_proxy: skip automatic zero-init of large arrays
  hw/ppc/pnv_occ: skip automatic zero-init of large struct
  hw/nvme/ctrl: skip automatic zero-init of large arrays
  hw/net/xgamc: skip automatic zero-init of large array
  hw/net/virtio-net: skip automatic zero-init of large arrays
  hw/net/tulip: skip automatic zero-init of large array
  hw/net/rtl8139: skip automatic zero-init of large array
  hw/misc/aspeed_hace: skip automatic zero-init of large array
  hw/hyperv/syndbg: skip automatic zero-init of large array
  hw/display/vmware_vga: skip automatic zero-init of large struct
  hw/dma/xlnx_csu_dma: skip automatic zero-init of large array
  hw/char/sclpconsole-lm: skip automatic zero-init of large array
  hw/audio/via-ac97: skip automatic zero-init of large array
  hw/audio/sb16: skip automatic zero-init of large array
  ...

Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: 773c4e0fbb4eef59c6a46b9ecf64fbb352c4d75e
      
https://github.com/qemu/qemu/commit/773c4e0fbb4eef59c6a46b9ecf64fbb352c4d75e
  Author: Stefan Hajnoczi <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M pc-bios/bios-256k.bin
    M pc-bios/bios-microvm.bin
    M pc-bios/bios.bin
    M pc-bios/vgabios-ati.bin
    M pc-bios/vgabios-bochs-display.bin
    M pc-bios/vgabios-cirrus.bin
    M pc-bios/vgabios-qxl.bin
    M pc-bios/vgabios-ramfb.bin
    M pc-bios/vgabios-stdvga.bin
    M pc-bios/vgabios-virtio.bin
    M pc-bios/vgabios-vmware.bin
    M pc-bios/vgabios.bin

  Log Message:
  -----------
  Revert "seabios: update binaries to 1.17.0"

This reverts commit cba36cf3881e907553ba2de38abd5edf7f952de1.

Daniel P. Berrangé <[email protected]> pointed out that "Bug 2372329 -
seabios 1.17.0 breaks virtio-pci devices"
https://bugzilla.redhat.com/show_bug.cgi?id=2372329 is unresolved. Roll
back the version upgrade.

Suggested-by: Daniel P. Berrangé <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: 8055b6a9a11640b531b7e9b2d1d4ec1816f482f4
      
https://github.com/qemu/qemu/commit/8055b6a9a11640b531b7e9b2d1d4ec1816f482f4
  Author: Stefan Hajnoczi <[email protected]>
  Date:   2025-06-11 (Wed, 11 Jun 2025)

  Changed paths:
    M roms/seabios

  Log Message:
  -----------
  Revert "seabios: update submodule to 1.17.0"

This reverts commit 832cd70452e25c56309450fb10ff012513a7a410.

Daniel P. Berrangé <[email protected]> pointed out that "Bug 2372329 -
seabios 1.17.0 breaks virtio-pci devices"
https://bugzilla.redhat.com/show_bug.cgi?id=2372329 is unresolved. Roll
back the version upgrade.

Suggested-by: Daniel P. Berrangé <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>


Compare: https://github.com/qemu/qemu/compare/d9ce74873a6a...8055b6a9a116

To unsubscribe from these emails, change your notification settings at 
https://github.com/qemu/qemu/settings/notifications


Reply via email to