aboutsummaryrefslogtreecommitdiff
path: root/scripts/xml-preprocess-test.py
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2024-12-13 18:23:37 +0000
committerPeter Maydell <peter.maydell@linaro.org>2024-12-17 15:19:06 +0000
commit9678b9c505725732353baefedb88b53c2eb8a184 (patch)
treec61448d4c9a7c6522ab6ed75c2070a1a70028c81 /scripts/xml-preprocess-test.py
parentdaae2280cad120a307083342ed0913f523b5aeb1 (diff)
downloadqemu-9678b9c505725732353baefedb88b53c2eb8a184.zip
qemu-9678b9c505725732353baefedb88b53c2eb8a184.tar.gz
qemu-9678b9c505725732353baefedb88b53c2eb8a184.tar.bz2
hw/intc/arm_gicv3_its: Zero initialize local DTEntry etc structs
In the GICv3 ITS model, we have a common coding pattern which has a local C struct like "DTEntry dte", which is a C representation of an in-guest-memory data structure, and we call a function such as get_dte() to read guest memory and fill in the C struct. These functions to read in the struct sometimes have cases where they will leave early and not fill in the whole struct (for instance get_dte() will set "dte->valid = false" and nothing else for the case where it is passed an entry_addr implying that there is no L2 table entry for the DTE). This then causes potential use of uninitialized memory later, for instance when we call a trace event which prints all the fields of the struct. Sufficiently advanced compilers may produce -Wmaybe-uninitialized warnings about this, especially if LTO is enabled. Rather than trying to carefully separate out these trace events into "only the 'valid' field is initialized" and "all fields can be printed", zero-init all the structs when we define them. None of these structs are large (the biggest is 24 bytes) and having consistent behaviour is less likely to be buggy. Cc: qemu-stable@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2718 Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20241213182337.3343068-1-peter.maydell@linaro.org
Diffstat (limited to 'scripts/xml-preprocess-test.py')
0 files changed, 0 insertions, 0 deletions