vfio: trivially use __aligned_u64 for ioctl structs
authorStefan Hajnoczi <stefanha@redhat.com>
Mon, 18 Sep 2023 20:56:15 +0000 (16:56 -0400)
committerAlex Williamson <alex.williamson@redhat.com>
Thu, 28 Sep 2023 18:12:08 +0000 (12:12 -0600)
commit2f8d25fa8aed030d7d049f0aef1b78713f431a79
tree4033519491e314e6c05f2be2db3c58cbf2d6588a
parent8a97ab9b8b31790d0014d3183f33a167454171c0
vfio: trivially use __aligned_u64 for ioctl structs

u64 alignment behaves differently depending on the architecture and so
<uapi/linux/types.h> offers __aligned_u64 to achieve consistent behavior
in kernel<->userspace ABIs.

There are structs in <uapi/linux/vfio.h> that can trivially be updated
to __aligned_u64 because the struct sizes are multiples of 8 bytes.
There is no change in memory layout on any CPU architecture and
therefore this change is safe.

The commits that follow this one handle the trickier cases where
explanation about ABI breakage is necessary.

Suggested-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Link: https://lore.kernel.org/r/20230918205617.1478722-2-stefanha@redhat.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
include/uapi/linux/vfio.h