aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhao Liu <zhao1.liu@intel.com>2025-01-21 23:13:22 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2025-01-23 11:50:53 +0100
commit57f9d9c84a9112d534fa90f2a6dad74bd71150b6 (patch)
tree0f170e35539dbe0a99f6502a32ec247884dda4a2
parent5014e33b1e00d330f13df33c09a3932ac88f8d94 (diff)
downloadqemu-57f9d9c84a9112d534fa90f2a6dad74bd71150b6.zip
qemu-57f9d9c84a9112d534fa90f2a6dad74bd71150b6.tar.gz
qemu-57f9d9c84a9112d534fa90f2a6dad74bd71150b6.tar.bz2
memattrs: Check the size of MemTxAttrs
Make sure MemTxAttrs is packed into 8 bytes and does not exceed 8 bytes. Suggested-by: Philippe Mathieu-Daudà <philmd@linaro.org> Signed-off-by: Zhao Liu <zhao1.liu@intel.com> Link: https://lore.kernel.org/r/20250121151322.171832-3-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--include/exec/memattrs.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/exec/memattrs.h b/include/exec/memattrs.h
index 4fde4ee..060b7e7 100644
--- a/include/exec/memattrs.h
+++ b/include/exec/memattrs.h
@@ -64,6 +64,8 @@ typedef struct MemTxAttrs {
uint16_t _reserved2;
} MemTxAttrs;
+QEMU_BUILD_BUG_ON(sizeof(MemTxAttrs) > 8);
+
/* Bus masters which don't specify any attributes will get this,
* which has all attribute bits clear except the topmost one
* (so that we can distinguish "all attributes deliberately clear"