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>
This commit is contained in:
parent
5014e33b1e
commit
57f9d9c84a
@ -64,6 +64,8 @@ typedef struct MemTxAttrs {
|
|||||||
uint16_t _reserved2;
|
uint16_t _reserved2;
|
||||||
} MemTxAttrs;
|
} MemTxAttrs;
|
||||||
|
|
||||||
|
QEMU_BUILD_BUG_ON(sizeof(MemTxAttrs) > 8);
|
||||||
|
|
||||||
/* Bus masters which don't specify any attributes will get this,
|
/* Bus masters which don't specify any attributes will get this,
|
||||||
* which has all attribute bits clear except the topmost one
|
* which has all attribute bits clear except the topmost one
|
||||||
* (so that we can distinguish "all attributes deliberately clear"
|
* (so that we can distinguish "all attributes deliberately clear"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user