xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 for-4.14 0/2] pvcalls: Reconciliate the spec and the
@ 2020-06-27  9:55 Julien Grall
  2020-06-27  9:55 ` [PATCH v4 for-4.14 1/2] pvcalls: Clearly spell out that the header is just a reference Julien Grall
  2020-06-27  9:55 ` [PATCH v4 for-4.14 2/2] pvcalls: Document correctly and explicitely the padding for all arches Julien Grall
  0 siblings, 2 replies; 16+ messages in thread
From: Julien Grall @ 2020-06-27  9:55 UTC (permalink / raw)
  To: xen-devel
  Cc: Juergen Gross, Stefano Stabellini, Julien Grall, Wei Liu, paul,
	Andrew Cooper, Julien Grall, Ian Jackson, George Dunlap,
	Jan Beulich

From: Julien Grall <jgrall@amazon.com>

Hi all,

This is v4 to try to reconciliate the pvcalls spec and the header. The
series gain an extra patch (#1) to make clear the header is just a
reference.

This series is candidate for 4.14 to avoid continuing to ship wrong
header even they are just a reference.

For all the changes see in each patch.

Best regards,


Julien Grall (2):
  pvcalls: Clearly spell out that the header is just a reference
  pvcalls: Document correctly and explicitely the padding for all arches

 docs/misc/pvcalls.pandoc        | 8 --------
 xen/include/public/io/pvcalls.h | 7 +++++++
 2 files changed, 7 insertions(+), 8 deletions(-)

-- 
2.17.1



^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH v4 for-4.14 1/2] pvcalls: Clearly spell out that the header is just a reference
  2020-06-27  9:55 [PATCH v4 for-4.14 0/2] pvcalls: Reconciliate the spec and the Julien Grall
@ 2020-06-27  9:55 ` Julien Grall
  2020-06-27 11:55   ` Jürgen Groß
  2020-06-27  9:55 ` [PATCH v4 for-4.14 2/2] pvcalls: Document correctly and explicitely the padding for all arches Julien Grall
  1 sibling, 1 reply; 16+ messages in thread
From: Julien Grall @ 2020-06-27  9:55 UTC (permalink / raw)
  To: xen-devel; +Cc: Juergen Gross, Julien Grall, paul

From: Julien Grall <jgrall@amazon.com>

A recent thread on xen-devel [1] pointed out that the header was
provided as a reference for the specification.

Unfortunately, this was never written down in xen.git so for an external
user (or a reviewer) it is not clear whether the spec or the header
shoudl be followed when there is a conflict.

To avoid more confusion, a paragraph is added at the top of the header
to clearly spell out it is only provided for reference.

[1] https://lore.kernel.org/xen-devel/alpine.DEB.2.21.2006151343430.9074@sstabellini-ThinkPad-T480s/

Signed-off-by: Julien Grall <jgrall@amazon.com>

---
    Changes in v4:
        - New patch
---
 xen/include/public/io/pvcalls.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/include/public/io/pvcalls.h b/xen/include/public/io/pvcalls.h
index cb8171275c13..905880735dda 100644
--- a/xen/include/public/io/pvcalls.h
+++ b/xen/include/public/io/pvcalls.h
@@ -3,6 +3,9 @@
  *
  * Refer to docs/misc/pvcalls.markdown for the specification
  *
+ * The header is provided as a C reference for the specification. In
+ * case of conflict, the specification is authoritative.
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
  * deal in the Software without restriction, including without limitation the
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v4 for-4.14 2/2] pvcalls: Document correctly and explicitely the padding for all arches
  2020-06-27  9:55 [PATCH v4 for-4.14 0/2] pvcalls: Reconciliate the spec and the Julien Grall
  2020-06-27  9:55 ` [PATCH v4 for-4.14 1/2] pvcalls: Clearly spell out that the header is just a reference Julien Grall
@ 2020-06-27  9:55 ` Julien Grall
  2020-06-27 11:53   ` Jürgen Groß
                     ` (3 more replies)
  1 sibling, 4 replies; 16+ messages in thread
From: Julien Grall @ 2020-06-27  9:55 UTC (permalink / raw)
  To: xen-devel
  Cc: Juergen Gross, Stefano Stabellini, Julien Grall, Wei Liu, paul,
	Andrew Cooper, Julien Grall, Ian Jackson, George Dunlap,
	Jan Beulich

From: Julien Grall <jgrall@amazon.com>

The specification of pvcalls suggests there is padding for 32-bit x86
at the end of most the structure. However, they are not described in
in the public header.

Because of that all the structures would be 32-bit aligned and not
64-bit aligned for 32-bit x86.

For all the other architectures supported (Arm and 64-bit x86), the
structure are aligned to 64-bit because they contain uint64_t field.
Therefore all the structures contain implicit padding.

Given the specification is authoriitative, the padding will the same for
the all architectures. The potential breakage of compatibility is ought
to be fine as pvcalls is still a tech preview.

As an aside, the padding sadly cannot be mandated to be 0 as they are
already present. So it is not going to be possible to use the padding
for extending a command in the future.

Signed-off-by: Julien Grall <jgrall@amazon.com>

---
    This wants to be included in Xen 4.14 to avoid more users to rely on
    wrong public headers.

    Changes in v4:
        - Revert back to v1 for the patch and expand the commit message

    Changes in v3:
        - Use __i386__ rather than CONFIG_X86_32

    Changes in v2:
        - It is not possible to use the same padding for 32-bit x86 and
        all the other supported architectures.
---
 docs/misc/pvcalls.pandoc        | 8 --------
 xen/include/public/io/pvcalls.h | 4 ++++
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/docs/misc/pvcalls.pandoc b/docs/misc/pvcalls.pandoc
index 665dad556c39..971cd8f4b122 100644
--- a/docs/misc/pvcalls.pandoc
+++ b/docs/misc/pvcalls.pandoc
@@ -246,9 +246,7 @@ The format is defined as follows:
     			uint32_t domain;
     			uint32_t type;
     			uint32_t protocol;
-    			#ifdef CONFIG_X86_32
     			uint8_t pad[4];
-    			#endif
     		} socket;
     		struct xen_pvcalls_connect {
     			uint64_t id;
@@ -257,16 +255,12 @@ The format is defined as follows:
     			uint32_t flags;
     			grant_ref_t ref;
     			uint32_t evtchn;
-    			#ifdef CONFIG_X86_32
     			uint8_t pad[4];
-    			#endif
     		} connect;
     		struct xen_pvcalls_release {
     			uint64_t id;
     			uint8_t reuse;
-    			#ifdef CONFIG_X86_32
     			uint8_t pad[7];
-    			#endif
     		} release;
     		struct xen_pvcalls_bind {
     			uint64_t id;
@@ -276,9 +270,7 @@ The format is defined as follows:
     		struct xen_pvcalls_listen {
     			uint64_t id;
     			uint32_t backlog;
-    			#ifdef CONFIG_X86_32
     			uint8_t pad[4];
-    			#endif
     		} listen;
     		struct xen_pvcalls_accept {
     			uint64_t id;
diff --git a/xen/include/public/io/pvcalls.h b/xen/include/public/io/pvcalls.h
index 905880735dda..6da6b5533a10 100644
--- a/xen/include/public/io/pvcalls.h
+++ b/xen/include/public/io/pvcalls.h
@@ -68,6 +68,7 @@ struct xen_pvcalls_request {
             uint32_t domain;
             uint32_t type;
             uint32_t protocol;
+            uint8_t pad[4];
         } socket;
         struct xen_pvcalls_connect {
             uint64_t id;
@@ -76,10 +77,12 @@ struct xen_pvcalls_request {
             uint32_t flags;
             grant_ref_t ref;
             uint32_t evtchn;
+            uint8_t pad[4];
         } connect;
         struct xen_pvcalls_release {
             uint64_t id;
             uint8_t reuse;
+            uint8_t pad[7];
         } release;
         struct xen_pvcalls_bind {
             uint64_t id;
@@ -89,6 +92,7 @@ struct xen_pvcalls_request {
         struct xen_pvcalls_listen {
             uint64_t id;
             uint32_t backlog;
+            uint8_t pad[4];
         } listen;
         struct xen_pvcalls_accept {
             uint64_t id;
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH v4 for-4.14 2/2] pvcalls: Document correctly and explicitely the padding for all arches
  2020-06-27  9:55 ` [PATCH v4 for-4.14 2/2] pvcalls: Document correctly and explicitely the padding for all arches Julien Grall
@ 2020-06-27 11:53   ` Jürgen Groß
  2020-06-29  7:37     ` Paul Durrant
  2020-06-29  8:28   ` Jan Beulich
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 16+ messages in thread
From: Jürgen Groß @ 2020-06-27 11:53 UTC (permalink / raw)
  To: Julien Grall, xen-devel
  Cc: Stefano Stabellini, Wei Liu, paul, Andrew Cooper, Julien Grall,
	Ian Jackson, George Dunlap, Jan Beulich

On 27.06.20 11:55, Julien Grall wrote:
> From: Julien Grall <jgrall@amazon.com>
> 
> The specification of pvcalls suggests there is padding for 32-bit x86
> at the end of most the structure. However, they are not described in
> in the public header.
> 
> Because of that all the structures would be 32-bit aligned and not
> 64-bit aligned for 32-bit x86.
> 
> For all the other architectures supported (Arm and 64-bit x86), the
> structure are aligned to 64-bit because they contain uint64_t field.
> Therefore all the structures contain implicit padding.
> 
> Given the specification is authoriitative, the padding will the same for

s/authoriitative/authoritative/

> the all architectures. The potential breakage of compatibility is ought

s/the//

> to be fine as pvcalls is still a tech preview.
> 
> As an aside, the padding sadly cannot be mandated to be 0 as they are
> already present. So it is not going to be possible to use the padding
> for extending a command in the future.
> 
> Signed-off-by: Julien Grall <jgrall@amazon.com>

With above fixed:

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v4 for-4.14 1/2] pvcalls: Clearly spell out that the header is just a reference
  2020-06-27  9:55 ` [PATCH v4 for-4.14 1/2] pvcalls: Clearly spell out that the header is just a reference Julien Grall
@ 2020-06-27 11:55   ` Jürgen Groß
  2020-06-29  7:38     ` Paul Durrant
  0 siblings, 1 reply; 16+ messages in thread
From: Jürgen Groß @ 2020-06-27 11:55 UTC (permalink / raw)
  To: Julien Grall, xen-devel; +Cc: Julien Grall, paul

On 27.06.20 11:55, Julien Grall wrote:
> From: Julien Grall <jgrall@amazon.com>
> 
> A recent thread on xen-devel [1] pointed out that the header was
> provided as a reference for the specification.
> 
> Unfortunately, this was never written down in xen.git so for an external
> user (or a reviewer) it is not clear whether the spec or the header
> shoudl be followed when there is a conflict.

should

> 
> To avoid more confusion, a paragraph is added at the top of the header
> to clearly spell out it is only provided for reference.
> 
> [1] https://lore.kernel.org/xen-devel/alpine.DEB.2.21.2006151343430.9074@sstabellini-ThinkPad-T480s/
> 
> Signed-off-by: Julien Grall <jgrall@amazon.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen


^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: [PATCH v4 for-4.14 2/2] pvcalls: Document correctly and explicitely the padding for all arches
  2020-06-27 11:53   ` Jürgen Groß
@ 2020-06-29  7:37     ` Paul Durrant
  0 siblings, 0 replies; 16+ messages in thread
From: Paul Durrant @ 2020-06-29  7:37 UTC (permalink / raw)
  To: 'Jürgen Groß', 'Julien Grall', xen-devel
  Cc: 'Stefano Stabellini', 'Wei Liu',
	'Andrew Cooper', 'Julien Grall',
	'Ian Jackson', 'George Dunlap',
	'Jan Beulich'

> -----Original Message-----
> From: Jürgen Groß <jgross@suse.com>
> Sent: 27 June 2020 12:54
> To: Julien Grall <julien@xen.org>; xen-devel@lists.xenproject.org
> Cc: paul@xen.org; Julien Grall <jgrall@amazon.com>; Andrew Cooper <andrew.cooper3@citrix.com>; George
> Dunlap <george.dunlap@citrix.com>; Ian Jackson <ian.jackson@eu.citrix.com>; Jan Beulich
> <jbeulich@suse.com>; Stefano Stabellini <sstabellini@kernel.org>; Wei Liu <wl@xen.org>
> Subject: Re: [PATCH v4 for-4.14 2/2] pvcalls: Document correctly and explicitely the padding for all
> arches
> 
> On 27.06.20 11:55, Julien Grall wrote:
> > From: Julien Grall <jgrall@amazon.com>
> >
> > The specification of pvcalls suggests there is padding for 32-bit x86
> > at the end of most the structure. However, they are not described in
> > in the public header.
> >
> > Because of that all the structures would be 32-bit aligned and not
> > 64-bit aligned for 32-bit x86.
> >
> > For all the other architectures supported (Arm and 64-bit x86), the
> > structure are aligned to 64-bit because they contain uint64_t field.
> > Therefore all the structures contain implicit padding.
> >
> > Given the specification is authoriitative, the padding will the same for
> 
> s/authoriitative/authoritative/
> 
> > the all architectures. The potential breakage of compatibility is ought
> 
> s/the//
> 
> > to be fine as pvcalls is still a tech preview.
> >
> > As an aside, the padding sadly cannot be mandated to be 0 as they are
> > already present. So it is not going to be possible to use the padding
> > for extending a command in the future.
> >
> > Signed-off-by: Julien Grall <jgrall@amazon.com>
> 
> With above fixed:
> 
> Reviewed-by: Juergen Gross <jgross@suse.com>
> 

Release-acked-by: Paul Durrant <paul@xen.org>

> 
> Juergen



^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: [PATCH v4 for-4.14 1/2] pvcalls: Clearly spell out that the header is just a reference
  2020-06-27 11:55   ` Jürgen Groß
@ 2020-06-29  7:38     ` Paul Durrant
  0 siblings, 0 replies; 16+ messages in thread
From: Paul Durrant @ 2020-06-29  7:38 UTC (permalink / raw)
  To: 'Jürgen Groß', 'Julien Grall', xen-devel
  Cc: 'Julien Grall'

> -----Original Message-----
> From: Jürgen Groß <jgross@suse.com>
> Sent: 27 June 2020 12:55
> To: Julien Grall <julien@xen.org>; xen-devel@lists.xenproject.org
> Cc: paul@xen.org; Julien Grall <jgrall@amazon.com>
> Subject: Re: [PATCH v4 for-4.14 1/2] pvcalls: Clearly spell out that the header is just a reference
> 
> On 27.06.20 11:55, Julien Grall wrote:
> > From: Julien Grall <jgrall@amazon.com>
> >
> > A recent thread on xen-devel [1] pointed out that the header was
> > provided as a reference for the specification.
> >
> > Unfortunately, this was never written down in xen.git so for an external
> > user (or a reviewer) it is not clear whether the spec or the header
> > shoudl be followed when there is a conflict.
> 
> should
> 
> >
> > To avoid more confusion, a paragraph is added at the top of the header
> > to clearly spell out it is only provided for reference.
> >
> > [1] https://lore.kernel.org/xen-devel/alpine.DEB.2.21.2006151343430.9074@sstabellini-ThinkPad-T480s/
> >
> > Signed-off-by: Julien Grall <jgrall@amazon.com>
> 
> Reviewed-by: Juergen Gross <jgross@suse.com>
> 

Release-acked-by: Paul Durrant <paul@xen.org>

> 
> Juergen



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v4 for-4.14 2/2] pvcalls: Document correctly and explicitely the padding for all arches
  2020-06-27  9:55 ` [PATCH v4 for-4.14 2/2] pvcalls: Document correctly and explicitely the padding for all arches Julien Grall
  2020-06-27 11:53   ` Jürgen Groß
@ 2020-06-29  8:28   ` Jan Beulich
  2020-06-29 10:03     ` Julien Grall
  2020-06-29 15:41   ` Stefano Stabellini
  2020-07-04 15:29   ` Julien Grall
  3 siblings, 1 reply; 16+ messages in thread
From: Jan Beulich @ 2020-06-29  8:28 UTC (permalink / raw)
  To: Julien Grall
  Cc: Juergen Gross, Stefano Stabellini, Wei Liu, paul, Andrew Cooper,
	Julien Grall, Ian Jackson, George Dunlap, xen-devel

On 27.06.2020 11:55, Julien Grall wrote:
> From: Julien Grall <jgrall@amazon.com>
> 
> The specification of pvcalls suggests there is padding for 32-bit x86
> at the end of most the structure. However, they are not described in
> in the public header.
> 
> Because of that all the structures would be 32-bit aligned and not
> 64-bit aligned for 32-bit x86.

The added padding doesn't change the alignment. It's sizeof() which
gets corrected this way.

> For all the other architectures supported (Arm and 64-bit x86), the
> structure are aligned to 64-bit because they contain uint64_t field.
> Therefore all the structures contain implicit padding.
> 
> Given the specification is authoriitative, the padding will the same for

Nit: ... will be the same ...

> the all architectures. The potential breakage of compatibility is ought

Nit: Drop "is".

> to be fine as pvcalls is still a tech preview.
> 
> As an aside, the padding sadly cannot be mandated to be 0 as they are
> already present. So it is not going to be possible to use the padding
> for extending a command in the future.

Why is the other adjustment fine to make due to still being tech
preview, but this one wouldn't be for the same reason?

Jan


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v4 for-4.14 2/2] pvcalls: Document correctly and explicitely the padding for all arches
  2020-06-29  8:28   ` Jan Beulich
@ 2020-06-29 10:03     ` Julien Grall
  2020-06-29 11:22       ` Jan Beulich
  0 siblings, 1 reply; 16+ messages in thread
From: Julien Grall @ 2020-06-29 10:03 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Juergen Gross, Stefano Stabellini, Wei Liu, paul, Andrew Cooper,
	Julien Grall, Ian Jackson, George Dunlap, xen-devel

Hi Jan,

On 29/06/2020 09:28, Jan Beulich wrote:
> On 27.06.2020 11:55, Julien Grall wrote:
>> From: Julien Grall <jgrall@amazon.com>
>>
>> The specification of pvcalls suggests there is padding for 32-bit x86
>> at the end of most the structure. However, they are not described in
>> in the public header.
>>
>> Because of that all the structures would be 32-bit aligned and not
>> 64-bit aligned for 32-bit x86.
> 
> The added padding doesn't change the alignment. It's sizeof() which
> gets corrected this way.

I will update the commit message.

> 
>> For all the other architectures supported (Arm and 64-bit x86), the
>> structure are aligned to 64-bit because they contain uint64_t field.
>> Therefore all the structures contain implicit padding.
>>
>> Given the specification is authoriitative, the padding will the same for
> 
> Nit: ... will be the same ...

Ok.

> 
>> the all architectures. The potential breakage of compatibility is ought
> 
> Nit: Drop "is".

Ok.

>> to be fine as pvcalls is still a tech preview.
>>
>> As an aside, the padding sadly cannot be mandated to be 0 as they are
>> already present. So it is not going to be possible to use the padding
>> for extending a command in the future.
> 
> Why is the other adjustment fine to make due to still being tech
> preview, but this one wouldn't be for the same reason?

This is mostly a left-over of the previous message. Although, I am not 
really inclined to address this myself any time soon.

Cheers,

-- 
Julien Grall


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v4 for-4.14 2/2] pvcalls: Document correctly and explicitely the padding for all arches
  2020-06-29 10:03     ` Julien Grall
@ 2020-06-29 11:22       ` Jan Beulich
  2020-06-29 11:24         ` Julien Grall
  0 siblings, 1 reply; 16+ messages in thread
From: Jan Beulich @ 2020-06-29 11:22 UTC (permalink / raw)
  To: Julien Grall
  Cc: Juergen Gross, Stefano Stabellini, Wei Liu, paul, Andrew Cooper,
	Julien Grall, Ian Jackson, George Dunlap, xen-devel

On 29.06.2020 12:03, Julien Grall wrote:
> On 29/06/2020 09:28, Jan Beulich wrote:
>> On 27.06.2020 11:55, Julien Grall wrote:
>>> As an aside, the padding sadly cannot be mandated to be 0 as they are
>>> already present. So it is not going to be possible to use the padding
>>> for extending a command in the future.
>>
>> Why is the other adjustment fine to make due to still being tech
>> preview, but this one wouldn't be for the same reason?
> 
> This is mostly a left-over of the previous message. Although, I am not 
> really inclined to address this myself any time soon.

Sure, I didn't mean to indicate I might expect you to. But perhaps
here the wording could be slightly changed as well?

Jan


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v4 for-4.14 2/2] pvcalls: Document correctly and explicitely the padding for all arches
  2020-06-29 11:22       ` Jan Beulich
@ 2020-06-29 11:24         ` Julien Grall
  0 siblings, 0 replies; 16+ messages in thread
From: Julien Grall @ 2020-06-29 11:24 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Juergen Gross, Stefano Stabellini, Wei Liu, paul, Andrew Cooper,
	Julien Grall, Ian Jackson, George Dunlap, xen-devel



On 29/06/2020 12:22, Jan Beulich wrote:
> On 29.06.2020 12:03, Julien Grall wrote:
>> On 29/06/2020 09:28, Jan Beulich wrote:
>>> On 27.06.2020 11:55, Julien Grall wrote:
>>>> As an aside, the padding sadly cannot be mandated to be 0 as they are
>>>> already present. So it is not going to be possible to use the padding
>>>> for extending a command in the future.
>>>
>>> Why is the other adjustment fine to make due to still being tech
>>> preview, but this one wouldn't be for the same reason?
>>
>> This is mostly a left-over of the previous message. Although, I am not
>> really inclined to address this myself any time soon.
> 
> Sure, I didn't mean to indicate I might expect you to. But perhaps
> here the wording could be slightly changed as well?

I am planning to remove the paragraph completely.

Cheers,

-- 
Julien Grall


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v4 for-4.14 2/2] pvcalls: Document correctly and explicitely the padding for all arches
  2020-06-27  9:55 ` [PATCH v4 for-4.14 2/2] pvcalls: Document correctly and explicitely the padding for all arches Julien Grall
  2020-06-27 11:53   ` Jürgen Groß
  2020-06-29  8:28   ` Jan Beulich
@ 2020-06-29 15:41   ` Stefano Stabellini
  2020-07-04 15:29   ` Julien Grall
  3 siblings, 0 replies; 16+ messages in thread
From: Stefano Stabellini @ 2020-06-29 15:41 UTC (permalink / raw)
  To: Julien Grall
  Cc: Juergen Gross, Stefano Stabellini, Wei Liu, paul, Andrew Cooper,
	Julien Grall, Ian Jackson, George Dunlap, Jan Beulich, xen-devel

On Sat, 27 Jun 2020, Julien Grall wrote:
> From: Julien Grall <jgrall@amazon.com>
> 
> The specification of pvcalls suggests there is padding for 32-bit x86
> at the end of most the structure. However, they are not described in
> in the public header.
> 
> Because of that all the structures would be 32-bit aligned and not
> 64-bit aligned for 32-bit x86.
> 
> For all the other architectures supported (Arm and 64-bit x86), the
> structure are aligned to 64-bit because they contain uint64_t field.
> Therefore all the structures contain implicit padding.
> 
> Given the specification is authoriitative, the padding will the same for
> the all architectures. The potential breakage of compatibility is ought
> to be fine as pvcalls is still a tech preview.
> 
> As an aside, the padding sadly cannot be mandated to be 0 as they are
> already present. So it is not going to be possible to use the padding
> for extending a command in the future.
> 
> Signed-off-by: Julien Grall <jgrall@amazon.com>

Aside from typos other mentioned:

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>     This wants to be included in Xen 4.14 to avoid more users to rely on
>     wrong public headers.
> 
>     Changes in v4:
>         - Revert back to v1 for the patch and expand the commit message
> 
>     Changes in v3:
>         - Use __i386__ rather than CONFIG_X86_32
> 
>     Changes in v2:
>         - It is not possible to use the same padding for 32-bit x86 and
>         all the other supported architectures.
> ---
>  docs/misc/pvcalls.pandoc        | 8 --------
>  xen/include/public/io/pvcalls.h | 4 ++++
>  2 files changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/docs/misc/pvcalls.pandoc b/docs/misc/pvcalls.pandoc
> index 665dad556c39..971cd8f4b122 100644
> --- a/docs/misc/pvcalls.pandoc
> +++ b/docs/misc/pvcalls.pandoc
> @@ -246,9 +246,7 @@ The format is defined as follows:
>      			uint32_t domain;
>      			uint32_t type;
>      			uint32_t protocol;
> -    			#ifdef CONFIG_X86_32
>      			uint8_t pad[4];
> -    			#endif
>      		} socket;
>      		struct xen_pvcalls_connect {
>      			uint64_t id;
> @@ -257,16 +255,12 @@ The format is defined as follows:
>      			uint32_t flags;
>      			grant_ref_t ref;
>      			uint32_t evtchn;
> -    			#ifdef CONFIG_X86_32
>      			uint8_t pad[4];
> -    			#endif
>      		} connect;
>      		struct xen_pvcalls_release {
>      			uint64_t id;
>      			uint8_t reuse;
> -    			#ifdef CONFIG_X86_32
>      			uint8_t pad[7];
> -    			#endif
>      		} release;
>      		struct xen_pvcalls_bind {
>      			uint64_t id;
> @@ -276,9 +270,7 @@ The format is defined as follows:
>      		struct xen_pvcalls_listen {
>      			uint64_t id;
>      			uint32_t backlog;
> -    			#ifdef CONFIG_X86_32
>      			uint8_t pad[4];
> -    			#endif
>      		} listen;
>      		struct xen_pvcalls_accept {
>      			uint64_t id;
> diff --git a/xen/include/public/io/pvcalls.h b/xen/include/public/io/pvcalls.h
> index 905880735dda..6da6b5533a10 100644
> --- a/xen/include/public/io/pvcalls.h
> +++ b/xen/include/public/io/pvcalls.h
> @@ -68,6 +68,7 @@ struct xen_pvcalls_request {
>              uint32_t domain;
>              uint32_t type;
>              uint32_t protocol;
> +            uint8_t pad[4];
>          } socket;
>          struct xen_pvcalls_connect {
>              uint64_t id;
> @@ -76,10 +77,12 @@ struct xen_pvcalls_request {
>              uint32_t flags;
>              grant_ref_t ref;
>              uint32_t evtchn;
> +            uint8_t pad[4];
>          } connect;
>          struct xen_pvcalls_release {
>              uint64_t id;
>              uint8_t reuse;
> +            uint8_t pad[7];
>          } release;
>          struct xen_pvcalls_bind {
>              uint64_t id;
> @@ -89,6 +92,7 @@ struct xen_pvcalls_request {
>          struct xen_pvcalls_listen {
>              uint64_t id;
>              uint32_t backlog;
> +            uint8_t pad[4];
>          } listen;
>          struct xen_pvcalls_accept {
>              uint64_t id;
> -- 
> 2.17.1
> 


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v4 for-4.14 2/2] pvcalls: Document correctly and explicitely the padding for all arches
  2020-06-27  9:55 ` [PATCH v4 for-4.14 2/2] pvcalls: Document correctly and explicitely the padding for all arches Julien Grall
                     ` (2 preceding siblings ...)
  2020-06-29 15:41   ` Stefano Stabellini
@ 2020-07-04 15:29   ` Julien Grall
  2020-07-09 12:01     ` Julien Grall
  3 siblings, 1 reply; 16+ messages in thread
From: Julien Grall @ 2020-07-04 15:29 UTC (permalink / raw)
  To: xen-devel
  Cc: Juergen Gross, Stefano Stabellini, Wei Liu, paul, Andrew Cooper,
	Julien Grall, Ian Jackson, George Dunlap, Jan Beulich

Hi,

On 27/06/2020 10:55, Julien Grall wrote:
> From: Julien Grall <jgrall@amazon.com>
> 
> The specification of pvcalls suggests there is padding for 32-bit x86
> at the end of most the structure. However, they are not described in
> in the public header.
> 
> Because of that all the structures would be 32-bit aligned and not
> 64-bit aligned for 32-bit x86.
> 
> For all the other architectures supported (Arm and 64-bit x86), the
> structure are aligned to 64-bit because they contain uint64_t field.
> Therefore all the structures contain implicit padding.
> 
> Given the specification is authoriitative, the padding will the same for
> the all architectures. The potential breakage of compatibility is ought
> to be fine as pvcalls is still a tech preview.
> 
> As an aside, the padding sadly cannot be mandated to be 0 as they are
> already present. So it is not going to be possible to use the padding
> for extending a command in the future.
> 
> Signed-off-by: Julien Grall <jgrall@amazon.com>

It looks like most of the comments are on the commit message. So rather 
than sending the series again, below a new version of the commit message:

"
The specification of pvcalls suggests there is padding for 32-bit x86
at the end of most the structure. However, they are not described in
in the public header.

Because of that all the structures would have a different size between 
32-bit x86 and 64-bit x86.

For all the other architectures supported (Arm and 64-bit x86), the
structure have the sames sizes because they contain implicit padding 
thanks to the 64-bit alinment of the field uint64_t field.

Given the specification is authoritative, the padding will now be the 
same for all architectures. The potential breakage of compatibility is 
ought to be fine as pvcalls is still a tech preview.
"

Cheers,


-- 
Julien Grall


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v4 for-4.14 2/2] pvcalls: Document correctly and explicitely the padding for all arches
  2020-07-04 15:29   ` Julien Grall
@ 2020-07-09 12:01     ` Julien Grall
  2020-07-09 21:43       ` Stefano Stabellini
  0 siblings, 1 reply; 16+ messages in thread
From: Julien Grall @ 2020-07-09 12:01 UTC (permalink / raw)
  To: xen-devel
  Cc: Juergen Gross, Stefano Stabellini, Wei Liu, paul, Andrew Cooper,
	Julien Grall, Ian Jackson, George Dunlap, Jan Beulich

Hi,

Gentle ping.

Is the new commit message fine?

Cheers,

On 04/07/2020 16:29, Julien Grall wrote:
> Hi,
> 
> On 27/06/2020 10:55, Julien Grall wrote:
>> From: Julien Grall <jgrall@amazon.com>
>>
>> The specification of pvcalls suggests there is padding for 32-bit x86
>> at the end of most the structure. However, they are not described in
>> in the public header.
>>
>> Because of that all the structures would be 32-bit aligned and not
>> 64-bit aligned for 32-bit x86.
>>
>> For all the other architectures supported (Arm and 64-bit x86), the
>> structure are aligned to 64-bit because they contain uint64_t field.
>> Therefore all the structures contain implicit padding.
>>
>> Given the specification is authoriitative, the padding will the same for
>> the all architectures. The potential breakage of compatibility is ought
>> to be fine as pvcalls is still a tech preview.
>>
>> As an aside, the padding sadly cannot be mandated to be 0 as they are
>> already present. So it is not going to be possible to use the padding
>> for extending a command in the future.
>>
>> Signed-off-by: Julien Grall <jgrall@amazon.com>
> 
> It looks like most of the comments are on the commit message. So rather 
> than sending the series again, below a new version of the commit message:
> 
> "
> The specification of pvcalls suggests there is padding for 32-bit x86
> at the end of most the structure. However, they are not described in
> in the public header.
> 
> Because of that all the structures would have a different size between 
> 32-bit x86 and 64-bit x86.
> 
> For all the other architectures supported (Arm and 64-bit x86), the
> structure have the sames sizes because they contain implicit padding 
> thanks to the 64-bit alinment of the field uint64_t field.
> 
> Given the specification is authoritative, the padding will now be the 
> same for all architectures. The potential breakage of compatibility is 
> ought to be fine as pvcalls is still a tech preview.
> "
> 
> Cheers,
> 
> 

-- 
Julien Grall


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v4 for-4.14 2/2] pvcalls: Document correctly and explicitely the padding for all arches
  2020-07-09 12:01     ` Julien Grall
@ 2020-07-09 21:43       ` Stefano Stabellini
  2020-07-10  5:44         ` Julien Grall
  0 siblings, 1 reply; 16+ messages in thread
From: Stefano Stabellini @ 2020-07-09 21:43 UTC (permalink / raw)
  To: Julien Grall
  Cc: Juergen Gross, Stefano Stabellini, Wei Liu, paul, Andrew Cooper,
	Julien Grall, Ian Jackson, George Dunlap, Jan Beulich, xen-devel

On Thu, 9 Jul 2020, Julien Grall wrote:
> Hi,
> 
> Gentle ping.
> 
> Is the new commit message fine?
> 
> Cheers,
> 
> On 04/07/2020 16:29, Julien Grall wrote:
> > Hi,
> > 
> > On 27/06/2020 10:55, Julien Grall wrote:
> > > From: Julien Grall <jgrall@amazon.com>
> > > 
> > > The specification of pvcalls suggests there is padding for 32-bit x86
> > > at the end of most the structure. However, they are not described in
> > > in the public header.
> > > 
> > > Because of that all the structures would be 32-bit aligned and not
> > > 64-bit aligned for 32-bit x86.
> > > 
> > > For all the other architectures supported (Arm and 64-bit x86), the
> > > structure are aligned to 64-bit because they contain uint64_t field.
> > > Therefore all the structures contain implicit padding.
> > > 
> > > Given the specification is authoriitative, the padding will the same for
> > > the all architectures. The potential breakage of compatibility is ought
> > > to be fine as pvcalls is still a tech preview.
> > > 
> > > As an aside, the padding sadly cannot be mandated to be 0 as they are
> > > already present. So it is not going to be possible to use the padding
> > > for extending a command in the future.
> > > 
> > > Signed-off-by: Julien Grall <jgrall@amazon.com>
> > 
> > It looks like most of the comments are on the commit message. So rather than
> > sending the series again, below a new version of the commit message:
> > 
> > "
> > The specification of pvcalls suggests there is padding for 32-bit x86
> > at the end of most the structure. However, they are not described in
> > in the public header.
> > 
> > Because of that all the structures would have a different size between
> > 32-bit x86 and 64-bit x86.
> > 
> > For all the other architectures supported (Arm and 64-bit x86), the
> > structure have the sames sizes because they contain implicit padding thanks
> > to the 64-bit alinment of the field uint64_t field.
> > 
> > Given the specification is authoritative, the padding will now be the same
> > for all architectures. The potential breakage of compatibility is ought to
> > be fine as pvcalls is still a tech preview.
> > "

Looks good to me

Acked-by: Stefano Stabellini <sstabellini@kernel.org>


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v4 for-4.14 2/2] pvcalls: Document correctly and explicitely the padding for all arches
  2020-07-09 21:43       ` Stefano Stabellini
@ 2020-07-10  5:44         ` Julien Grall
  0 siblings, 0 replies; 16+ messages in thread
From: Julien Grall @ 2020-07-10  5:44 UTC (permalink / raw)
  To: Stefano Stabellini
  Cc: Juergen Gross, Wei Liu, Paul Durrant, Andrew Cooper,
	Julien Grall, Ian Jackson, George Dunlap, Jan Beulich, xen-devel

[-- Attachment #1: Type: text/plain, Size: 2542 bytes --]

On Thu, 9 Jul 2020, 22:43 Stefano Stabellini, <sstabellini@kernel.org>
wrote:

> On Thu, 9 Jul 2020, Julien Grall wrote:
> > Hi,
> >
> > Gentle ping.
> >
> > Is the new commit message fine?
> >
> > Cheers,
> >
> > On 04/07/2020 16:29, Julien Grall wrote:
> > > Hi,
> > >
> > > On 27/06/2020 10:55, Julien Grall wrote:
> > > > From: Julien Grall <jgrall@amazon.com>
> > > >
> > > > The specification of pvcalls suggests there is padding for 32-bit x86
> > > > at the end of most the structure. However, they are not described in
> > > > in the public header.
> > > >
> > > > Because of that all the structures would be 32-bit aligned and not
> > > > 64-bit aligned for 32-bit x86.
> > > >
> > > > For all the other architectures supported (Arm and 64-bit x86), the
> > > > structure are aligned to 64-bit because they contain uint64_t field.
> > > > Therefore all the structures contain implicit padding.
> > > >
> > > > Given the specification is authoriitative, the padding will the same
> for
> > > > the all architectures. The potential breakage of compatibility is
> ought
> > > > to be fine as pvcalls is still a tech preview.
> > > >
> > > > As an aside, the padding sadly cannot be mandated to be 0 as they are
> > > > already present. So it is not going to be possible to use the padding
> > > > for extending a command in the future.
> > > >
> > > > Signed-off-by: Julien Grall <jgrall@amazon.com>
> > >
> > > It looks like most of the comments are on the commit message. So
> rather than
> > > sending the series again, below a new version of the commit message:
> > >
> > > "
> > > The specification of pvcalls suggests there is padding for 32-bit x86
> > > at the end of most the structure. However, they are not described in
> > > in the public header.
> > >
> > > Because of that all the structures would have a different size between
> > > 32-bit x86 and 64-bit x86.
> > >
> > > For all the other architectures supported (Arm and 64-bit x86), the
> > > structure have the sames sizes because they contain implicit padding
> thanks
> > > to the 64-bit alinment of the field uint64_t field.
> > >
> > > Given the specification is authoritative, the padding will now be the
> same
> > > for all architectures. The potential breakage of compatibility is
> ought to
> > > be fine as pvcalls is still a tech preview.
> > > "
>
> Looks good to me
>
> Acked-by: Stefano Stabellini <sstabellini@kernel.org>
>


Thanks! I don't have access to my work laptop today. Can any of the
committers merge it so it doesn't miss 4.14?

Cheers,

>

[-- Attachment #2: Type: text/html, Size: 3906 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2020-07-10  5:44 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-27  9:55 [PATCH v4 for-4.14 0/2] pvcalls: Reconciliate the spec and the Julien Grall
2020-06-27  9:55 ` [PATCH v4 for-4.14 1/2] pvcalls: Clearly spell out that the header is just a reference Julien Grall
2020-06-27 11:55   ` Jürgen Groß
2020-06-29  7:38     ` Paul Durrant
2020-06-27  9:55 ` [PATCH v4 for-4.14 2/2] pvcalls: Document correctly and explicitely the padding for all arches Julien Grall
2020-06-27 11:53   ` Jürgen Groß
2020-06-29  7:37     ` Paul Durrant
2020-06-29  8:28   ` Jan Beulich
2020-06-29 10:03     ` Julien Grall
2020-06-29 11:22       ` Jan Beulich
2020-06-29 11:24         ` Julien Grall
2020-06-29 15:41   ` Stefano Stabellini
2020-07-04 15:29   ` Julien Grall
2020-07-09 12:01     ` Julien Grall
2020-07-09 21:43       ` Stefano Stabellini
2020-07-10  5:44         ` Julien Grall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).