From: Julien Grall <julien.grall@arm.com>
To: Bhupinder Thakur <bhupinder.thakur@linaro.org>,
Stefano Stabellini <sstabellini@kernel.org>
Cc: 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>,
Christoffer Dall <christoffer.dall@linaro.org>
Subject: Re: Xen ARM - Exposing a PL011 to the guest
Date: Fri, 16 Dec 2016 17:03:13 +0000 [thread overview]
Message-ID: <7c3a29e7-aea6-5f9c-61b0-b4f82bcafa34@arm.com> (raw)
In-Reply-To: <CACtJ1JTwjufP0S-TKHUjecvdTFfOQdK3-dOLBOoOotv+21TAeA@mail.gmail.com>
(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?
For your testing, you could consider that the ring is only used by the
pl011. I would recommend you to disable the HVC console driver in the
guest (see CONFIG_HVC_XEN).
I looked at the event channel code and I can only find a function for
xen to create an event channel (see alloc_unbound_xen_event_channel).
But in your case, you want a function to bind an event channel.
>
> Is this the correct way to find out the console event channel for a
> given domU or there is some other way? I could not locate in the Xen
> source code, where exactly the start_info page is created for a new
> domain, which would contain the console event channel and and machine
> page where the ring buffers are mapped.
You can give a look to HVM_PARAM_CONSOLE_EVTCHN and
HVM_PARAM_CONSOLE_PFN (see more details above).
Cheers,
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-12-16 17:03 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 [this message]
2016-12-19 12:20 ` Christoffer Dall
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=7c3a29e7-aea6-5f9c-61b0-b4f82bcafa34@arm.com \
--to=julien.grall@arm.com \
--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=christoffer.dall@linaro.org \
--cc=george.dunlap@eu.citrix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).