Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1294381 > unrolled thread

[PATCH kernel] vfio: Add explicit alignments in vfio_iommu_spapr_tce_create

Started byAlexey Kardashevskiy <aik@ozlabs.ru>
First post2015-12-18 02:40 +0100
Last post2015-12-22 21:10 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH kernel] vfio: Add explicit alignments in vfio_iommu_spapr_tce_create Alexey Kardashevskiy <aik@ozlabs.ru> - 2015-12-18 02:40 +0100
    Re: [PATCH kernel] vfio: Add explicit alignments in  vfio_iommu_spapr_tce_create David Gibson <david@gibson.dropbear.id.au> - 2015-12-21 02:00 +0100
    Re: [PATCH kernel] vfio: Add explicit alignments in  vfio_iommu_spapr_tce_create Alex Williamson <alex.williamson@redhat.com> - 2015-12-22 21:10 +0100

#1294381 — [PATCH kernel] vfio: Add explicit alignments in vfio_iommu_spapr_tce_create

FromAlexey Kardashevskiy <aik@ozlabs.ru>
Date2015-12-18 02:40 +0100
Subject[PATCH kernel] vfio: Add explicit alignments in vfio_iommu_spapr_tce_create
Message-ID<qGSbw-7rk-7@gated-at.bofh.it>
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@ozlabs.ru>
---
 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;
 };
-- 
2.5.0.rc3

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

[toc] | [next] | [standalone]


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

FromDavid Gibson <david@gibson.dropbear.id.au>
Date2015-12-21 02:00 +0100
SubjectRe: [PATCH kernel] vfio: Add explicit alignments in vfio_iommu_spapr_tce_create
Message-ID<qHWZs-7Vb-19@gated-at.bofh.it>
In reply to#1294381

[Multipart message — attachments visible in raw view] — view raw

On Fri, Dec 18, 2015 at 12:35:47PM +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@ozlabs.ru>

Oops, that was a bit sloppy.  Oh well.

Acked-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  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;
>  };

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[toc] | [prev] | [next] | [standalone]


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

FromAlex Williamson <alex.williamson@redhat.com>
Date2015-12-22 21:10 +0100
SubjectRe: [PATCH kernel] vfio: Add explicit alignments in vfio_iommu_spapr_tce_create
Message-ID<qIBpU-8vR-19@gated-at.bofh.it>
In reply to#1294381
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@ozlabs.ru>
> ---

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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web