The Xen domctl ABI currently relies on the union containing a field with
alignment of 8.
32bit projects which only copy the used subset of functionality end up with an
ABI breakage if they don't have at least one uint64_aligned_t field copied.
Insert explicit padding, and some build assertions to ensure it never changes
moving forwards.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Julien Grall <jgrall@amazon.com>
return ret;
}
+static void __init __maybe_unused build_assertions(void)
+{
+ struct xen_domctl d;
+
+ BUILD_BUG_ON(sizeof(d) != 16 /* header */ + 128 /* union */);
+ BUILD_BUG_ON(offsetof(typeof(d), u) != 16);
+}
+
/*
* Local variables:
* mode: C
#define XEN_DOMCTL_gdbsx_domstatus 1003
uint32_t interface_version; /* XEN_DOMCTL_INTERFACE_VERSION */
domid_t domain;
+ uint16_t _pad[3];
union {
struct xen_domctl_createdomain createdomain;
struct xen_domctl_getdomaininfo getdomaininfo;