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

Re: [PATCH v2] xen/evtchn: Add design for static event channel signaling


  • To: Julien Grall <julien@xxxxxxx>
  • From: Rahul Singh <Rahul.Singh@xxxxxxx>
  • Date: Wed, 11 May 2022 14:32:12 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=enBMQK0dPx4KY+Ea7ZkAJcVaM7PbJR8pO6XB8EeJtmo=; b=SE76akA3B0N8nxzyMBDe4/aDOyLgZ1iDeDfvI+4Aa5aB3HYc77K02atomKvzmm2oFbqzdaZoAUVerDEW9JohsFobAURvMWnqiZSKqFDPZuT4dRQfpQsltoAjRMlM7HgD4uQ/mhiGLPPQsIE0kOtdphjpDRe2THbk5XXbW2FSltYZWBScI27WXbmdbIHrq1t31zpbEnUN0/2WH7FKHi51ZMRgcbBVcK/u1zU5/srF9IU1oL2BrZTWx8c92LqNhnNwpEniJUuTnh7n/wAyMQMWwyDBfIiWafCDmrhU8gMDuN5Rg+UetFcmwiyB4M/f3t2e3U0vUJqxm4mAzf2yY4bTXQ==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=enBMQK0dPx4KY+Ea7ZkAJcVaM7PbJR8pO6XB8EeJtmo=; b=iAKuf31r0rOffH3zCVtV9pg2YfSiHS4DqGNtudz9RI9ekD1utYS2BvSIr4BvRAECjoOiOkR1O3mfrfznN3Ggk+mFuPZQHQgZL/kLBRPuh2cTQfJOAnbZ0Ys4stV+chEnhw0EJGabOgq4HaLClECNaEkvqn0Gxed5c0+iXGvElsFXR0VgQGsskNH/+FNnnHcHFoy1mSWKlU+6HoeLYm5W5BE8H62siUGhdhkfuxF+6CLtsJeqVraVHIgbAGs9XD3yYjMtwugSvdXc3/SmOSpZwwL149Xc7mNJPo1z0l/1U+fOEnVnBQdEH2WeAGrTL6lfczKA+jlnX2yr9haNS61YnA==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=WbWI1uv/ITPu28AT9OlxO+Q6op1geG+a1BU1q2wU8AjhFwd+s7SOLd5XH9MJljZY7VSny4+yyZo61KLGOyNOUQ/vRscT+9cZZQa//XhOzCtlDhAP/Wt1XymIsCZ+YucnLm+0oTT8Bh9nN9S4NwQijcfEPKqTXLA8k4dIUc22bFMaRafon6YIi5hh1oUemN2xGGI3AglcGW7RArBorRKZ8CMCBpMghlGiZ9x+vVoQ4r8BfN1137EGMev2O8Yeuo4wxo4+g/IFhOKJGGmj68YNyOI8S9YVBD8QvmBcNXJTqRo923M6PUS0EsVWhjkuVpc+/koDcvyrOA4up/WY4F5I6w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q1DTzPk8gZ7o5nsrod4PZw1V81CGZ+nBfbxEiHrd1qYUz0zIZmjOABzA6v+LCPfr9L/gr6mENc6pHT8WpkmJzXrPSwiL05dIJUV+5DEswHf1VnUTQnzYgko99J6D6uTtkeYntxAPNqLAvHk+VBKu9sykex0r9Q/6EQ9HXg4YjGwwq+a+Uu69D4RWBL5IWidE7nGe1d8egxD66daSeVzWDz5lnxpt/exxiIow4pZcvgc3IC+ripmKPuIxmEwkkNlq0PwVs8LU+zGd13Cq592Y53+yNNQxwd62OqOTTb3q56DpOwSAdZvzWk0Ag7ouUk3f+BYiGXUbMhAazEw8X3FCDg==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Wed, 11 May 2022 14:32:38 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYX91LOZcKc9ovCE+M72ipF+LMFK0YFGsAgAGzp4A=
  • Thread-topic: [PATCH v2] xen/evtchn: Add design for static event channel signaling

Hi Julien

> On 10 May 2022, at 1:32 pm, Julien Grall <julien@xxxxxxx> wrote:
> 
> Hi Rahul,
> 
> On 04/05/2022 18:34, Rahul Singh wrote:
>> This patch introduces a new feature to support the signaling between
>> two domains in dom0less system.
>> Signed-off-by: Rahul Singh <rahul.singh@xxxxxxx>
>> ---
>> v2 changes:
>> - switch to the one-subnode-per-evtchn under xen,domain" compatible node.
>> - Add more detail about event-channel
>> ---
>> docs/designs/dom0less-evtchn.md | 126 ++++++++++++++++++++++++++++++++
> 
> Answering here to also keep the history. On IRC, Bertrand was asking whether 
> we merge design proposal.
> 
> We have merged proposal in the past (e.g. non-cooperative migration) and I 
> would be ready to do it again as it is easier to find them afterwards.
> 
> However, I wonder whether it would be better to turn this proposal to a 
> binding change in misc/arm/device-tree/. Any thoughts?

I am okay with that. I think are you referring to "docs/misc/arm/device-tree/ “ 
> 
>> 1 file changed, 126 insertions(+)
>> create mode 100644 docs/designs/dom0less-evtchn.md
>> diff --git a/docs/designs/dom0less-evtchn.md 
>> b/docs/designs/dom0less-evtchn.md
>> new file mode 100644
>> index 0000000000..62ec8a4009
>> --- /dev/null
>> +++ b/docs/designs/dom0less-evtchn.md
>> @@ -0,0 +1,126 @@
>> +# Signaling support between two domUs on dom0less system
>> +
>> +## Current state: Draft version
>> +
>> +## Proposer(s): Rahul Singh, Bertrand Marquis
>> +
>> +## Problem Statement:
>> +
>> +Dom0less guests would benefit from a statically-defined memory sharing and
>> +signally system for communication. One that would be immediately available 
>> at
>> +boot without any need for dynamic configurations.
>> +
>> +In embedded a great variety of guest operating system kernels exist, many of
>> +which don't have support for xenstore, grant table, or other complex 
>> drivers.
> 
> I am not sure I would consider event channel FIFO a "trival" drivers :).
> 
>> +Some of them are small kernel-space applications (often called "baremetal",
>> +not to be confused with the term "baremetal" used in the data center which
>> +means "without hypervisors") or RTOSes. Additionally, for safety reasons, 
>> users
>> +often need to be able to configure the full system statically so that it can
>> +be verified statically.
>> +
>> +Event channels are very simple and can be added even to baremetal 
>> applications.
>> +This proposal introduces a way to define them statically to make them 
>> suitable
>> +for dom0less embedded deployments.
>> +
>> +## Proposal:
>> +
>> +Event channels are the basic primitive provided by Xen for event 
>> notifications.
>> +An event channel is a logical connection between 2 domains (more 
>> specifically
>> +between dom1,port1, and dom2,port2). Each event has a pending and a masked 
>> bit.
>> +The pending bit indicates the event has been raised. The masked bit is used 
>> by
>> +the domain to prevent the delivery of that specific event. Xen only 
>> performs a
>> +0 → 1 transition on the pending bits and does not touch the mask bit. The
> 
> NIT: I think → is not an ascii character. Can you use "->”?
Ack. 
> 
>> +domain may toggle masked bits in the masked bit field and should clear the
>> +pending bit when an event has been processed
>> +
>> +Events are received by a domain via an interrupt from Xen to the domain,
>> +indicating when an event arrives (setting the bit). Further notifications 
>> are
>> +blocked until the bit is cleared again. Events are delivered asynchronously 
>> to
>> +a domain and are enqueued when the domain is not running.
>> +More information about FIFO based event channel can be found at:
> 
> I think the explanation is fine for a design proposal. If you want to use it 
> as documentation, then I would suggest to clarify there are two different ABI 
> for event channel: FIFO and 2L.
> 
> 2L is the easiest one to implement and for embedded we may want to steer the 
> users towards it.

I will rephrase the sentence as below:

Xen supports two different ABI for event channel FIFO and 2L. More information 
about FIFO based event channel can be found at:

> 
>> +https://xenbits.xen.org/people/dvrabel/event-channels-H.pdf
> 
> It is quite unfortunate that this wasn't merged in docs/. Oh well, no action 
> for you here.
> 
>> +
>> +The event channel communication will be established statically between two
>> +domains (dom0 and domU also) before unpausing the domains after domain 
>> creation.
>> +Event channel connection information between domains will be passed to XEN 
>> via
> 
> NIT: above you are using "Xen". So s/XEN/Xen/ for consistency.

Ack. 
> 
>> +the device tree node. The event channel will be created and established
>> +beforehand in XEN before the domain started. The domain doesn’t need to do 
>> any
> 
> Same here.
> 
> NIT: I think "beforehand" and "before" is redundant.

Ack. 
> 
>> +operation to establish a connection. Domain only needs hypercall
>> +EVTCHNOP_send(local port) to send notifications to the remote guest.
>> +
>> +There is no need to describe the static event channel info in the domU 
>> device
>> +tree. Static event channels are only useful in fully static configurations,
>> +and in those configurations the domU device tree dynamically generated by 
>> Xen
>> +is not needed.
>> +
>> +Under the "xen,domain" compatible node, there need to be sub-nodes with
>> +compatible "xen,evtchn" that describe the event channel connection between 
>> two
>> +domains(dom0 and domU also).
> 
> Below you provided an example between two domUs. Can you provide one between 
> dom0 and a domU?
Yes I will provide an example b/w dom0 and domU in next version.
> 
>> +
>> +The event channel sub-node has the following properties:
>> +
>> +- compatible
>> +
>> + "xen,evtchn"
>> +
>> +- xen,evtchn
>> +
>> + The property is tuples of two numbers
>> + (local-evtchn link-to-foreign-evtchn) where:
>> +
>> + local-evtchn is an integer value that will be used to allocate local port
>> + for a domain to send and receive event notifications to/from the remote
>> + domain.
> Port 0 is reserved and both FIFO/2L have limit on the port numbers.
> 
> I think we should let know the users about those limitations but I am not 
> sure whether the binding is the right place for that.

If you are okay I can add this limitation in this design doc.

>> +
>> + link-to-foreign-evtchn is a single phandle to a remote evtchn to which
>> + local-evtchn will be connected.
> 
> I would consider to relax the wording so a user can create an event channel 
> with the both end in the same domain.
> 
> Implementation wise, it should make no difference as you still need to lookup 
> the domain.

I will rephrase as:
link-to-foreign-evtchn is a single phandle to a foreign evtchn to which
       local-evtchn will be connected.


Regards,
Rahul


 


Rackspace

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