From: Ben Catterall <Ben.Catterall@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xen.org
Subject: Re: RFC on deprivileged x86 hypervisor device models
Date: Fri, 17 Jul 2015 16:19:25 +0100 [thread overview]
Message-ID: <55A91CFD.8090900@citrix.com> (raw)
In-Reply-To: <55A92B530200007800092802@mail.emea.novell.com>
On 17/07/15 15:20, Jan Beulich wrote:
>>>> On 17.07.15 at 12:09, <Ben.Catterall@citrix.com> wrote:
>> Moving between privilege levels
>> --------------------------------
>> The general process is to determine if we need to run a device model (or
>> similar) and then, if so, switch into deprivileged mode. The operation
>> is performed by deprivileged code which calls into the hypervisor as and
>> when needed. After the operation completes, we return to the hypervisor.
>>
>> If deprivileged mode needs to make any hypervisor requests, it can do
>> these using a syscall interface, possibly placing an operation code into
>> a register to indicate the operation. This would allow it to get data
>> to/from the hypervisor.
> What I didn't understand from this as well as the individual models'
> descriptions is in whose address space the device model is to be
> run. Since you're hijacking the vCPU, it sounds like you're intending
> Xen's address space to be re-used, just such that the code gets
> run at CPL 3.
Yep, this will be in Xen's address space using a monitor table patch,
mapping in the code for ring 3 execution.
> Which would potentially even allow for read-only data
> sharing (so that calls back into the hypervisor would be needed only
> when data needs to be updated). But perhaps I guessed wrong?
Yep, that sounds like a good idea for read-only data. I should be able
to do page aliasing for this if I make the data and code page-aligned in
their own sections, provided the code is compiled to be position
independent and the data is accessed via a pointer. Andrew mentioned
mapping in all of Xen's .text section so that I can make use of small
helpers. More involved functionality would still need a hypercall due to
hardcoded-virtual addresses for data access.
>
> If not, then method 2 would seem quite a bit less troublesome than
> method 1, yet method 3 would (even if more involved in terms of
> changes to be done) perhaps result in the most elegant result.
I agree that method three is more elegant. If both you and Andrew are ok
with going in a per-vcpu stack direction for Xen in general then I'll
write a per-vcpu patch first and then do another patch which adds the
ring 3 feature on-top of that.
>
> Again if not, whose runtime environment would the device model
> use? It hardly would be qemu you intend to run that way, but
> custom code would likely still require some runtime library code to
> assist it. Do you mean to re-use hypervisor code for that (perhaps
> again utilizing read-only [and executable] data sharing)?
>
> Jan
>
Thanks once again,
Ben
next prev parent reply other threads:[~2015-07-17 15:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-17 10:09 RFC on deprivileged x86 hypervisor device models Ben Catterall
2015-07-17 10:27 ` Fabio Fantoni
2015-07-17 10:29 ` Andrew Cooper
2015-07-17 12:32 ` Paul Durrant
2015-07-17 14:20 ` Jan Beulich
2015-07-17 15:19 ` Ben Catterall [this message]
2015-07-17 15:38 ` Jan Beulich
2015-07-20 13:43 ` Andrew Cooper
2015-07-20 13:58 ` Jan Beulich
2015-07-20 14:10 ` Ben Catterall
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=55A91CFD.8090900@citrix.com \
--to=ben.catterall@citrix.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@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.