[PATCH v2 08/17] public/io: xs_wire: Include event channel in interface page

Jason Andryuk posted 17 patches 3 months, 2 weeks ago
[PATCH v2 08/17] public/io: xs_wire: Include event channel in interface page
Posted by Jason Andryuk 3 months, 2 weeks ago
Include the event channel in struct xenstore_domain_interface.  This way
the toolstack or xen can communicate the event channel to xenstored in
memory xenstored already needs to access.

xenstored maps the grant with the well known GNTTAB_RESERVED_XENSTORE
index, so no further information is needed.

Suggested-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/include/public/io/xs_wire.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/xen/include/public/io/xs_wire.h b/xen/include/public/io/xs_wire.h
index e92a87a07b..f2c0afd107 100644
--- a/xen/include/public/io/xs_wire.h
+++ b/xen/include/public/io/xs_wire.h
@@ -110,6 +110,7 @@ struct xenstore_domain_interface {
     uint32_t server_features; /* Bitmap of features supported by the server */
     uint32_t connection;
     uint32_t error;
+    uint32_t evtchn_port;
 };
 
 /* Violating this is very bad.  See docs/misc/xenstore.txt. */
@@ -134,6 +135,12 @@ struct xenstore_domain_interface {
 #define XENSTORE_ERROR_RINGIDX 2 /* Invalid ring index */
 #define XENSTORE_ERROR_PROTO   3 /* Protocol violation (payload too long) */
 
+/*
+ * The evtchn_port field is the domU's event channel for xenstored to signal.
+ * It is filled in by Xen for dom0less/Hyperlaunch domains.  It is only used
+ * when non-zero.  Otherwise the event channel from XS_INTRODUCE is used.
+ */
+
 #endif /* _XS_WIRE_H */
 
 /*
-- 
2.50.0
Re: [PATCH v2 08/17] public/io: xs_wire: Include event channel in interface page
Posted by Juergen Gross 3 months, 2 weeks ago
On 16.07.25 23:14, Jason Andryuk wrote:
> Include the event channel in struct xenstore_domain_interface.  This way
> the toolstack or xen can communicate the event channel to xenstored in
> memory xenstored already needs to access.
> 
> xenstored maps the grant with the well known GNTTAB_RESERVED_XENSTORE
> index, so no further information is needed.
> 
> Suggested-by: Juergen Gross <jgross@suse.com>
> Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
> ---
>   xen/include/public/io/xs_wire.h | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/xen/include/public/io/xs_wire.h b/xen/include/public/io/xs_wire.h
> index e92a87a07b..f2c0afd107 100644
> --- a/xen/include/public/io/xs_wire.h
> +++ b/xen/include/public/io/xs_wire.h
> @@ -110,6 +110,7 @@ struct xenstore_domain_interface {
>       uint32_t server_features; /* Bitmap of features supported by the server */
>       uint32_t connection;
>       uint32_t error;
> +    uint32_t evtchn_port;
>   };
>   
>   /* Violating this is very bad.  See docs/misc/xenstore.txt. */
> @@ -134,6 +135,12 @@ struct xenstore_domain_interface {
>   #define XENSTORE_ERROR_RINGIDX 2 /* Invalid ring index */
>   #define XENSTORE_ERROR_PROTO   3 /* Protocol violation (payload too long) */
>   
> +/*
> + * The evtchn_port field is the domU's event channel for xenstored to signal.

Nit:

s/domU/domain/

This might be the interface of dom0 to a xenstore-stubdom, so "domU" is not
fully appropriate.

With that fixed:

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


Juergen