pvcalls: Document correctly and explicitely the padding for all arches

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 alignment 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.

Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Release-acked-by: Paul Durrant <paul@xen.org>
Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
This commit is contained in:
Julien Grall authored and Stefano Stabellini committed 2020-07-10 09:52:24 -07:00
1 parent 8655fb5f46
commit 02d69864b5
2 files changed
+4 -8

No files matched your search

-8
View File
@@ -246,9 +246,7 @@ The format is defined as follows:
uint32_t domain; uint32_t domain;
uint32_t type; uint32_t type;
uint32_t protocol; uint32_t protocol;
#ifdef CONFIG_X86_32
uint8_t pad[4]; uint8_t pad[4];
#endif
} socket; } socket;
struct xen_pvcalls_connect { struct xen_pvcalls_connect {
uint64_t id; uint64_t id;
@@ -257,16 +255,12 @@ The format is defined as follows:
uint32_t flags; uint32_t flags;
grant_ref_t ref; grant_ref_t ref;
uint32_t evtchn; uint32_t evtchn;
#ifdef CONFIG_X86_32
uint8_t pad[4]; uint8_t pad[4];
#endif
} connect; } connect;
struct xen_pvcalls_release { struct xen_pvcalls_release {
uint64_t id; uint64_t id;
uint8_t reuse; uint8_t reuse;
#ifdef CONFIG_X86_32
uint8_t pad[7]; uint8_t pad[7];
#endif
} release; } release;
struct xen_pvcalls_bind { struct xen_pvcalls_bind {
uint64_t id; uint64_t id;
@@ -276,9 +270,7 @@ The format is defined as follows:
struct xen_pvcalls_listen { struct xen_pvcalls_listen {
uint64_t id; uint64_t id;
uint32_t backlog; uint32_t backlog;
#ifdef CONFIG_X86_32
uint8_t pad[4]; uint8_t pad[4];
#endif
} listen; } listen;
struct xen_pvcalls_accept { struct xen_pvcalls_accept {
uint64_t id; uint64_t id;
+4
View File
@@ -68,6 +68,7 @@ struct xen_pvcalls_request {
uint32_t domain; uint32_t domain;
uint32_t type; uint32_t type;
uint32_t protocol; uint32_t protocol;
uint8_t pad[4];
} socket; } socket;
struct xen_pvcalls_connect { struct xen_pvcalls_connect {
uint64_t id; uint64_t id;
@@ -76,10 +77,12 @@ struct xen_pvcalls_request {
uint32_t flags; uint32_t flags;
grant_ref_t ref; grant_ref_t ref;
uint32_t evtchn; uint32_t evtchn;
uint8_t pad[4];
} connect; } connect;
struct xen_pvcalls_release { struct xen_pvcalls_release {
uint64_t id; uint64_t id;
uint8_t reuse; uint8_t reuse;
uint8_t pad[7];
} release; } release;
struct xen_pvcalls_bind { struct xen_pvcalls_bind {
uint64_t id; uint64_t id;
@@ -89,6 +92,7 @@ struct xen_pvcalls_request {
struct xen_pvcalls_listen { struct xen_pvcalls_listen {
uint64_t id; uint64_t id;
uint32_t backlog; uint32_t backlog;
uint8_t pad[4];
} listen; } listen;
struct xen_pvcalls_accept { struct xen_pvcalls_accept {
uint64_t id; uint64_t id;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.