Re: [PATCH kernel] vfio: Add explicit alignments in vfio_iommu_spapr_tce_create

From: Alex Williamson
Date: Tue Dec 22 2015 - 15:09:44 EST


On Fri, 2015-12-18 at 12:35 +1100, Alexey Kardashevskiy wrote:
> The vfio_iommu_spapr_tce_create struct has 4x32bit and 2x64bit fields
> which should have resulted in sizeof(fio_iommu_spapr_tce_create)
> equal
> to 32 bytes. However due to the gcc's default alignment, the actual
> size of this struct is 40 bytes.
>
> This fills gaps with __resv1/2 fields.
>
> This should not cause any change in behavior.
>
> Signed-off-by: Alexey Kardashevskiy <aik@xxxxxxxxx>
> ---

Applied to next for v4.5 with David's ack. ÂThanks!

Alex

> Âinclude/uapi/linux/vfio.h | 2 ++
> Â1 file changed, 2 insertions(+)
>
> diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h
> index 9fd7b5d..d117233 100644
> --- a/include/uapi/linux/vfio.h
> +++ b/include/uapi/linux/vfio.h
> @@ -568,8 +568,10 @@ struct vfio_iommu_spapr_tce_create {
> Â __u32 flags;
> Â /* in */
> Â __u32 page_shift;
> + __u32 __resv1;
> Â __u64 window_size;
> Â __u32 levels;
> + __u32 __resv2;
> Â /* out */
> Â __u64 start_addr;
> Â};

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/