qemu-cr16/include/qemu
Stefan Hajnoczi c653b67d18 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 <stefanha@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-id: 20250610123709.835102-2-berrange@redhat.com
[DB: split off patch & rewrite guidance on when to use the annotation]
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2025-06-12 13:39:07 -04:00
..
accel.h include/qemu: Remove ifndef CONFIG_USER_ONLY from accel.h 2025-04-23 14:08:44 -07:00
async-teardown.h
atomic.h tcg: Remove TCG_OVERSIZED_GUEST 2025-02-18 07:33:42 -08:00
atomic128.h qemu/atomic128: Include missing 'qemu/atomic.h' header 2025-03-08 09:35:06 -08:00
base64.h
bcd.h
bitmap.h bitops.h: Define bit operations on 'uint32_t' arrays 2024-11-19 13:02:06 +00:00
bitops.h bitops.h: Define bit operations on 'uint32_t' arrays 2024-11-19 13:02:06 +00:00
bswap.h exec/cpu-all: remove this header 2025-04-23 15:04:57 -07:00
buffer.h
cacheflush.h util/cacheflush.c: Update cache flushing mechanism for Emscripten 2025-05-06 16:02:04 +02:00
cacheinfo.h
chardev_open.h
co-shared-resource.h util/co-shared-resource: Remove unused co_try_get_from_shres 2024-09-30 10:53:18 +03:00
compiler.h include/qemu/compiler: add QEMU_UNINITIALIZED attribute macro 2025-06-12 13:39:07 -04:00
config-file.h
coroutine-core.h
coroutine-tls.h
coroutine.h qemu/coroutine: Include missing 'qemu/atomic.h' header 2024-12-20 17:44:57 +01:00
coroutine_int.h
cpu-float.h
cpuid.h
crc-ccitt.h license: Update deprecated SPDX tag GPL-2.0 to GPL-2.0-only 2024-09-20 10:11:59 +03:00
crc32c.h
ctype.h
cutils.h hw/vmapple/aes: Introduce aes engine 2025-03-04 14:45:34 +01:00
datadir.h system/datadir: Add new type constant for DTB files 2025-04-25 17:09:58 +02:00
dbus.h
defer-call.h
drm.h
envlist.h envlist: Remove unused envlist_parse 2024-09-20 10:00:27 +03:00
error-report.h
event_notifier.h
fifo8.h fifo8: introduce fifo8_peek() function 2024-09-13 20:11:13 +02:00
fifo32.h
filemonitor.h
futex.h futex: Support Windows 2025-06-06 14:32:55 +02:00
guest-random.h
hbitmap.h
help-texts.h docs: update copyright date to the year 2025 2025-01-02 07:44:28 +01:00
help_option.h
host-pci-mmio.h include: Add a header to define host PCI MMIO functions 2025-05-08 10:21:10 -04:00
host-utils.h target/i386: use compiler builtin to compute PF 2024-10-31 18:28:33 +01:00
hw-version.h
id.h
int128.h
interval-tree.h
iov.h util/iov: Do not assert offset is in iov 2025-03-10 17:07:16 +08:00
iova-tree.h include/system: Move exec/memory.h to system/memory.h 2025-04-23 14:08:21 -07:00
jhash.h
job.h test-bdrv-drain: Fix data races 2025-04-08 15:00:01 +02:00
keyval.h
lockable.h lockable: Do not cast function pointers 2024-05-29 12:41:56 +02:00
lockcnt.h qemu-thread: Use futex if available for QemuLockCnt 2025-06-06 14:32:55 +02:00
log-for-trace.h
log.h log: Add separate debug option for logging invalid memory accesses 2024-12-20 17:44:55 +01:00
madvise.h
main-loop.h Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
memalign.h
memfd.h
mmap-alloc.h
module.h
mprotect.h
notify.h
nvdimm-utils.h
option.h
option_int.h
osdep.h include/qemu/osdep.h: Add Emscripten-specific OS dependencies 2025-05-06 16:02:04 +02:00
path.h
plugin-event.h
plugin-memory.h include/qemu: plugin-memory.h doesn't need cpu-defs.h 2025-03-10 10:30:01 +00:00
plugin.h plugins: save value during memory accesses 2024-09-19 15:58:01 +01:00
pmem.h include/qemu: remove return after g_assert_not_reached() 2024-09-24 13:53:35 +02:00
processor.h
progress_meter.h
qdist.h
qemu-plugin.h plugins: fix kdoc annotation 2025-01-17 10:45:38 +00:00
qemu-print.h
qemu-progress.h
qht.h
qsp.h
qtree.h
queue.h
range.h util/range: Make ranges_overlap() return bool 2024-07-23 20:30:36 +02:00
ratelimit.h
rcu.h
rcu_queue.h
readline.h
reserved-region.h include/system: Move exec/memory.h to system/memory.h 2025-04-23 14:08:21 -07:00
s390x_pci_mmio.h util: Add functions for s390x mmio read/write 2025-05-08 10:03:07 -04:00
selfmap.h
seqlock.h
sockets.h sockets: Remove deadcode 2024-10-22 11:44:23 +01:00
stats64.h
sys_membarrier.h
systemd.h
target-info-impl.h qemu: Introduce target_long_bits() 2025-04-30 12:51:51 -07:00
target-info.h qemu: Introduce target_long_bits() 2025-04-30 12:51:51 -07:00
thread-context.h
thread-posix.h qemu-thread: Use futex for QemuEvent on Windows 2025-06-06 14:32:55 +02:00
thread-win32.h qemu-thread: Use futex for QemuEvent on Windows 2025-06-06 14:32:55 +02:00
thread.h qemu-thread: Document QemuEvent 2025-06-06 14:32:55 +02:00
throttle-options.h
throttle.h
timed-average.h license: Simplify GPL-2.0-or-later license descriptions 2024-09-20 10:11:59 +03:00
timer.h qemu/timer: Clarify timer_new*() must be freed with timer_free() 2025-02-14 08:49:06 +03:00
transactions.h
tsan.h
typedefs.h Generic CPUs / accelerators patch queue 2025-03-07 07:39:49 +08:00
unicode.h
units.h
userfaultfd.h util/userfaultfd: Remove unused uffd_poll_events 2024-10-08 15:28:55 -04:00
uuid.h
vfio-helpers.h
vhost-user-server.h
win_dump_defs.h
xattr.h
xxhash.h
yank.h