xen/include: public: Document the padding in struct xen_hvm_param
PATCH 1/1 xen/include: public: Document the padding in struct xen_hvm_param
From: Julien Grall <[email protected]>
There is an implicit padding of 2 bytes in struct xen_hvm_param between the field domid and index. Make it explicit by introduce a padding field. This can also serve as documentation.
Note that I don't think we can mandate it to be zero because a guest may not have initialized the padding.
--- xen/include/public/hvm/hvm_op.h | 1 + 1 file changed, 1 insertion(+)
xen/include/public/hvm/hvm_op.h +1 -0
@@ -32,6 +32,7 @@#define HVMOP_get_param 1struct xen_hvm_param {domid_t domid;/* IN */ +uint16_t pad;uint32_t index;/* IN */ uint64_t value;/* IN/OUT */ };
Signature · 7 lines
2.17.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 8 lines · Julien Grall
From: Julien Grall <[email protected]>
There is an implicit padding of 2 bytes in struct
xen_hvm_parambetween the field domid and index. Make it explicit by introduce a padding field. This can also serve as documentation.Note that I don't think we can mandate it to be zero because a guest may not have initialized the padding.
Agreed - we can mandate such only at introduction, not at any later time.
Quoted 1 line
Signed-off-by Julien Grall <[email protected]>
(I doubt this is the only missing field to make padding explicit.)
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Hi Jan,
Quoted 10 lines · Jan Beulich
Quoted 8 lines · Julien Grall
From: Julien Grall <[email protected]>
There is an implicit padding of 2 bytes in struct
xen_hvm_parambetween the field domid and index. Make it explicit by introduce a padding field. This can also serve as documentation.Note that I don't think we can mandate it to be zero because a guest may not have initialized the padding.
Quoted 6 lines
Agreed - we can mandate such only at introduction, not at any later time.
Quoted 1 line
Signed-off-by Julien Grall <[email protected]>Acked-by Jan Beulich <[email protected]>
Thank you!
Quoted 1 line
(I doubt this is the only missing field to make padding explicit.)
Probably not, sadly. I stumbled accross the HVM param implicit padding while looking at liveupdating the HVM param.
I guess I could use pahole to check the paddings are explicit for all the public structure.
Cheers,
Signature · 6 lines
Julien Grall _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 10 lines · Julien Grall
From: Julien Grall <[email protected]>
There is an implicit padding of 2 bytes in struct
xen_hvm_parambetween the field domid and index. Make it explicit by introduce a padding field. This can also serve as documentation.Note that I don't think we can mandate it to be zero because a guest may not have initialized the padding.
Signed-off-by Julien Grall <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel