On 10/6/25 14:36, Daniel P. Berrangé wrote:
This series is an extension of Stefan's proposal:
https://lists.nongnu.org/archive/html/qemu-devel/2025-06/msg00736.html
It used '-Wframe-larger-than=4096' to identify all code locations
with more than 4k on the stack. Any locations in the I/O paths
were chosen to avoid automatic zero-init, to eliminate the performance
overhead of the automatic initialization.
Should we eventually add it to our default CFLAGS?
Note, although all the changed locations are I/O paths, this does not
imply that the changes make a measurement performance difference in
every case.
This is because many of the emulated devices are likely limited by the
emulation impl, rather than any implicit memory zero'ing overhead of
stack data.
None the less the memory zero'ing is still a redundant CPU burn in
all these cases, so I felt it worth setting the general precedent
that any data over 4k on a stack in a device I/O path should be
skipping zero-init.
I did reasonable review in each case to identify that the data was
indeed initialized explicitly later in the method.