[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 09/17] xen/dom0less: store xenstore event channel in page


  • To: Jürgen Groß <jgross@xxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Thu, 17 Jul 2025 16:02:17 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=V4jSH3SslUkUMZYNYcUqPeXMhxtkwbKgaKG3ZL4+Zpg=; b=v/OROobeHPujGm4YUr9+e+36s3ody3i/mbBA+ESc7t2538eOQsjTP+UtcELZshgxeLBkSpWXcHBOAjHvCKTicQrFwlSwLyqHr8tzOFRkQ+2h/5k+fgwayJbxUivElLX0Foto+H5y85pUJu5i+a7aOW5P7yJWPanjifBfI5MRASZYU9SDbAHnMBbzz68nUWyK/7YWsvpV2lSaoXbOxFD0BDGpZiGV7QjjaSv+S5ntZlIzD1bZI9WcBTm2ttxypINx28B2gZSdNR7eITtPzNmGBdS56NgBJCwM/4/+rFqfPE+ajq77LvYjdrjnsZGX6FbvEDZOrsL2Ww92RcSveoYAMw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jXUW4TK/TX5tPlrsMIZ0g+qNwjzVMbwiqBIglwH32NYPwOePX/0iJjG9WgxyhF6DsLfOCJrPOjN08jVsshbzRaqcOiiTgxfZqGGNCezu2JDyss2SjY4DJra4SHEEYoq7i2uhZiBL4GE7RwrGMuTCK6TD8sBiHz2BgeWAqgg/ob5BFKF6C9rsvb/P4jwnD9KcgCf4nInEMGh/mmk6WrtAAC5PkBPk7PCucYE7t9QKyV4q6Zf8w7topAV+3XueEeJv47xmmT+zekH2SPTCoNvtsIYkV3yyc8hcpBjMOHJKaVrWe5vXPqDI3Mx8Q58Cr/fo8yFetAiqGDdkFohL5Bebnw==
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 17 Jul 2025 20:02:46 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>



On 2025-07-17 02:43, Jürgen Groß wrote:
On 17.07.25 08:25, Jan Beulich wrote:
On 17.07.2025 08:19, Juergen Gross wrote:
On 16.07.25 23:14, Jason Andryuk wrote:
Write the associated event channel into the xenstore page so xenstored
can read it.  xenstored can map the grant by the reserved grant table
entry, and then read out the event channel and bind it.  This eliminates
the need for an additional mechanism to discover the event channel.

Signed-off-by: Jason Andryuk <jason.andryuk@xxxxxxx>
---
   xen/common/device-tree/dom0less-build.c | 7 +++++++
   1 file changed, 7 insertions(+)

diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/ device-tree/dom0less-build.c
index a2789e3bdf..284139bf14 100644
--- a/xen/common/device-tree/dom0less-build.c
+++ b/xen/common/device-tree/dom0less-build.c
@@ -26,6 +26,7 @@
   #include <public/io/xs_wire.h>
   #include <asm/dom0less-build.h>
+#include <asm/guest_access.h>
   #include <asm/setup.h>
   #include <xen/static-memory.h>
@@ -126,8 +127,14 @@ static void __init initialize_domU_xenstore(void)
           if ( gfn != XENSTORE_PFN_LATE_ALLOC && IS_ENABLED(CONFIG_GRANT_TABLE) )
           {
+            evtchn_port_t port = d- >arch.hvm.params[HVM_PARAM_STORE_EVTCHN];
+            paddr_t evtchn_gaddr = gfn_to_gaddr(_gfn(gfn)) +
+                offsetof(struct xenstore_domain_interface, evtchn_port);
+
               ASSERT(gfn < UINT32_MAX);
               gnttab_seed_entry(d, GNTTAB_RESERVED_XENSTORE, xs_domid, gfn); +            access_guest_memory_by_gpa(d, evtchn_gaddr, &port, sizeof(port),
+                                       true /* is_write */);

I couldn't find access_guest_memory_by_gpa() for x86. I think you either need to
introduce it for all archs, or you need to handle this differently.

This code isn't buildable (yet) for x86, is it? There's a series of Alejandro's moving in that direction, but that didn't go in yet. And even then aiui this
file would still be excluded.

I think this would need to be explicitly mentioned in the commit message
then. I thought this whole work would be targeting x86 as well, but I
might be wrong, of course.

Truth be told, I wrote this when dom0less was still in arch/arm. For x86, I modified the hyperlaunch code to use hvm_copy_to_guest_phys(). Looks like Xen needs some unified accessors.

Thanks,
Jason



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.