Solve -ftrivial-auto-var-init performance regression with QEMU_UNINITIALIZED
Merge Request Required Information
Summary of Changes
The -ftrivial-auto-var-init compiler flag zeroes stack variables to reduce the risk of uninitialized variable accesses. The introduction of this compiler flag caused a performance regression because some hot code paths in QEMU have large stack buffers.
Mark these buffers with the new QEMU_UNINITIALIZED macro, which disabled -ftrivial-auto-var-init for a single variable. This solves the performance regression while keeping -ftrivial-auto-var-init protection for most variables.
Approved Development Ticket(s)
Resolves: RHEL-95479
Jira: https://issues.redhat.com/browse/RHEL-95479
Signed-off-by: Stefan Hajnoczi stefanha@redhat.com
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=68027445
Edited by Stefan Hajnoczi