From: Christoffer Dall <christoffer.dall@linaro.org>
To: Julien Grall <julien.grall@arm.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
Wei Liu <wei.liu2@citrix.com>,
Steve Capper <Steve.Capper@arm.com>,
George Dunlap <george.dunlap@eu.citrix.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
Xen Devel <xen-devel@lists.xen.org>,
Jan Beulich <JBeulich@suse.com>,
Bhupinder Thakur <bhupinder.thakur@linaro.org>
Subject: Re: Xen ARM - Exposing a PL011 to the guest
Date: Mon, 19 Dec 2016 13:20:05 +0100 [thread overview]
Message-ID: <20161219122005.GA28927@cbox> (raw)
In-Reply-To: <7c3a29e7-aea6-5f9c-61b0-b4f82bcafa34@arm.com>
On Fri, Dec 16, 2016 at 05:03:13PM +0000, Julien Grall wrote:
> (CC rest maintainers for event channel questions)
>
> On 16/12/16 10:06, Bhupinder Thakur wrote:
> >Hi,
>
> Hi Bhupinder,
>
> >The idea is for Xen to act as an intermediary as shown below:
> >
> > ring buffers
> > rx/tx fifo
> >dom0 <-------------------> Xen HYP (running pl011 emulation)
> ><-------------------> domU
> > event
> > interrupts
> >
> >Xen will directly manage the in/out console ring buffers (allocated by
> >dom0 for dom0-domU console communication) for reading/writing console
> >data from/to dom0. On the other side, Xen HYP will emulate pl011 to
> >read/write data from/to domU and pass it on to/from dom0 over the
> >in/out console ring buffers. There should be no change in dom0 as it
> >will still use the same ring buffers. Similarly there should be no
> >change in domU which would be running a standard pll011 driver.
> >
> >Currently, I am working on the interface between dom0 and Xen HYP. I
> >want to intercept the console events in Xen HYP which pass between
> >dom0 and domU. For now, I just want to capture console data coming
> >from dom0 at Xen HYP and loop it back to dom0, to confirm that this
> >interface is working.
> >
> >Since each guest domain will have a unique event channel assigned for
> >console communication, Xen HYP can find out the event channel for a
> >given domU from the start_info page of that domU, which should have
>
> The start_info page is x86 specific. If you want to get the console
> event channel for ARM, you would have to use
> d->arch.hvm_domain.params[HVM_PARAM_CONSOLE_EVTCHN].
>
> This parameter will be setup by the toolstack (see alloc_magic_pages
> in libxc/xc_dom_arm.c).
>
> >been allocated by dom0. Whenever, an event is to be dispatched via
> >evtchn_send() API in Xen, it can check if the event channel is the
> >console event channel for a given domU. If yes and its source domain
> >is dom0 and destination domain is domU then it will write the data
> >back to the console out ring buffer of the domU and raise a console
> >event to dom0.
> >
> >Once this interface is working, Xen HYP can check the source and
> >destination dom ids and decide which way the event came from and
> >accordingly process the console data. To allow a mix of PV console
> >guests and pl011 guests, Xen might have to maintain a flag per domain,
> >which tells whether Xen HYP should intercept and process the data (for
> >pl011 UART case) or let it go transparently (for PV conosle case).
>
> I am not very familiar with the event channel code. I will let the
> others comment on this bit.
>
> Regardless that, how would you decide whether the hypervisor should
> intercept the notification?
>
> I can see 2 different cases:
> 1) The guest is starting to use the pl011 then move to the HVC
> console (or HVC then pl011)
> 2) The guest is using both the PL011 and the HVC console
>
> Should we consider the second case valid? I would say yes, because a
> user could specify both on the command line. If we use the same
> ring, the output would be a total garbage.
>
> So maybe we need to allocate two distinct rings and event channel?
This sounds like the only sensible thing to me. I think this is really
about adding a new device to the Xen virtual platform, and providing the
user the option to choose which one he wants the tool in Dom0 to be
presented using stdin/out. Presumably the other console/serial can be
redirected to a file or socket or something?
Thanks,
-Christoffer
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-12-19 12:20 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-30 15:29 Xen ARM - Exposing a PL011 to the guest Julien Grall
2016-11-30 16:24 ` Christoffer Dall
2016-12-01 15:51 ` Julien Grall
2016-11-30 17:02 ` Volodymyr Babchuk
2016-11-30 22:26 ` Stefano Stabellini
2016-12-01 10:26 ` Christoffer Dall
2016-12-01 21:55 ` Stefano Stabellini
2016-12-16 10:06 ` Bhupinder Thakur
2016-12-16 17:03 ` Julien Grall
2016-12-19 12:20 ` Christoffer Dall [this message]
2016-12-19 20:24 ` Stefano Stabellini
2016-12-20 9:46 ` Bhupinder Thakur
2016-12-20 22:29 ` Stefano Stabellini
2016-12-20 12:32 ` Julien Grall
2016-12-20 19:53 ` Stefano Stabellini
2016-12-20 20:26 ` Stefano Stabellini
2016-12-21 19:19 ` Julien Grall
2016-12-21 22:12 ` Stefano Stabellini
2016-12-28 17:49 ` Julien Grall
2016-12-28 17:52 ` Julien Grall
2016-12-29 9:17 ` Bhupinder Thakur
2017-01-03 20:08 ` Stefano Stabellini
2017-01-06 10:18 ` Bhupinder Thakur
2017-01-06 21:54 ` Stefano Stabellini
2017-01-10 11:39 ` Bhupinder Thakur
2017-01-11 0:22 ` Stefano Stabellini
2017-01-17 14:01 ` Julien Grall
2017-01-17 13:31 ` Julien Grall
2017-01-17 19:27 ` Stefano Stabellini
2017-01-27 12:14 ` Bhupinder Thakur
2017-01-27 19:13 ` Stefano Stabellini
2017-01-29 11:06 ` Christoffer Dall
2017-02-03 13:53 ` Bhupinder Thakur
2017-02-03 14:08 ` Julien Grall
2017-02-08 12:39 ` Bhupinder Thakur
2017-02-09 0:10 ` Stefano Stabellini
2017-02-13 8:50 ` Bhupinder Thakur
2017-02-13 21:44 ` Stefano Stabellini
2017-02-15 8:15 ` Bhupinder Thakur
2017-02-15 8:24 ` Bhupinder Thakur
2017-02-15 21:21 ` Stefano Stabellini
2017-02-23 13:15 ` Bhupinder Thakur
2017-02-23 15:00 ` Wei Liu
2017-02-03 14:15 ` Christoffer Dall
2017-01-03 19:38 ` Stefano Stabellini
2016-12-20 12:47 ` Christoffer Dall
2016-12-20 21:33 ` Stefano Stabellini
2016-12-21 11:55 ` Christoffer Dall
2016-12-21 20:32 ` Julien Grall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161219122005.GA28927@cbox \
--to=christoffer.dall@linaro.org \
--cc=Ian.Jackson@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=Steve.Capper@arm.com \
--cc=andrew.cooper3@citrix.com \
--cc=bhupinder.thakur@linaro.org \
--cc=george.dunlap@eu.citrix.com \
--cc=julien.grall@arm.com \
--cc=sstabellini@kernel.org \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.