[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 04/11] xen/dom0less: store xenstore event channel in page
- To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jason Andryuk <jason.andryuk@xxxxxxx>
- Date: Fri, 25 Jul 2025 19:58:51 -0400
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org 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=dsQY3CEOxMXmJwgGeLeDonCu0Zez5UFFVJskUGMmihQ=; b=CO2slDsl2xUZKHQlQjQPtIy7y9FwCNklsGOP+dWZMGfC2/mXD5+gPbQB7Ep3T2uhGBxt9Ry2OpmmK7ujV35z21dQsTXzyr1GmRvKHhK9YUjC0wq4oV/utBvtO64hFYmKWJGMO0VjFDUJDFdeZ02jSHSVi2UfIq5Xs8MsZxFLhbdYZniC1L58dhxXMShrtQ0TTKY6adRQImUJyiYRoDvNxOwyKIJpaLjWVzqzDNF3yxykd6sacZI2LbXgeI5Q92pKlMfVGbKeA3fy57r7ba37ZVR66cAGYyyyU2vcID8CQPX0Qv20J0+mSZ+iPEu0iKu29G7pl3XFZIst4ibo85pXuQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Bv0ayVK/ZUar1HU36NQNxcJvXXt3neKqnmpI+hE4S407klkjZmzOaiKi8dfoaVB0ky7YkFnHznwitrVE6kBm+nMZsIMQd2jJ6fzJcjNoqp7fbao029j6XALv/kIYiA96EF0oXRoOha0KLW4QLSPfh4Jf17N/jN6oc7AKR8rRmA3y0rxCjeFcm5Dlr+/Awk/+sy8scJ+faD8VNPoos6Ri3NZiJ06TBNp2M9Y7ponHMibMw1OSfelFcPWvKfeLF1+v8w5rKQ4HnqLJJ+0u0q+n8IRSj6iPTjiwJtIHMCPvwjyHzBgYVUddTJH4YEAPHMIrpggBeb0BU8VCzpNvmRAuiw==
- Cc: Jason Andryuk <jason.andryuk@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
- Delivery-date: Fri, 25 Jul 2025 23:59:40 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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>
---
This is ARM-only for the time being. A common function to write to
guest physical address will be needed.
---
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 6bb038111d..a96089d9bb 100644
--- a/xen/common/device-tree/dom0less-build.c
+++ b/xen/common/device-tree/dom0less-build.c
@@ -26,6 +26,7 @@
#include <public/event_channel.h>
#include <public/io/xs_wire.h>
+#include <asm/guest_access.h>
#include <asm/setup.h>
#include <xen/static-memory.h>
@@ -120,8 +121,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 */);
}
}
}
--
2.50.1
|