From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Razvan Cojocaru <rcojocaru@bitdefender.com>,
Tamas K Lengyel <tamas.lengyel@zentific.com>
Cc: "Tian, Kevin" <kevin.tian@intel.com>,
Ian Campbell <ian.campbell@citrix.com>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
Jun Nakajima <jun.nakajima@intel.com>,
"Dong, Eddie" <eddie.dong@intel.com>,
George Dunlap <dunlapg@umich.edu>, Tim Deegan <tim@xen.org>,
Jan Beulich <JBeulich@suse.com>,
xen-devel <xen-devel@lists.xenproject.org>,
Ian Jackson <ian.jackson@eu.citrix.com>
Subject: Re: [PATCH RFC V9 4/5] xen, libxc: Request page fault injection via libxc
Date: Wed, 10 Sep 2014 10:34:43 +0100 [thread overview]
Message-ID: <54101B33.7040205@citrix.com> (raw)
In-Reply-To: <541011F1.70106@bitdefender.com>
On 10/09/14 09:55, Razvan Cojocaru wrote:
> On 09/10/2014 11:48 AM, Andrew Cooper wrote:
>> On 10/09/2014 09:09, Razvan Cojocaru wrote:
>>> On 09/09/2014 09:38 PM, Tamas K Lengyel wrote:
>>>> > But ultimately, as Tim said, you're basically just *hoping* that it
>>>> > won't take too long to happen to be at the hypervisor when the proper
>>>> > condition happens. If the process in question isn't getting many
>>>> > interrupts, or is spending the vast majority of its time in the
>>>> > kernel, you may end up waiting an unbounded amount of time to be able
>>>> > to "catch" it in user mode. It seems like it would be better to find
>>>> > a reliable way to trap on the return into user mode, in which case you
>>>> > wouldn't need to have a special "wait for this complicated event to
>>>> > happen" call at all, would you?
>>>>
>>>> Indeed, but it is assumed that the trap injection request is being made
>>>> by the caller in the proper context (when it knows that the condition
>>>> will be true sooner rather than later).
>>>>
>>>>
>>>> How is it known that the condition will be true soon? Some more
>>>> information on what you consider 'proper context' would be valuable.
>>> It's actually pretty simple for us: the application always requests an
>>> injection when the guest is already in the address space of the
>>> interesting application, and in user mode.
>> Does this mean that you always request a pagefault as a direct result of
>> a mem_event, when the vcpu is in blocked the correct context?
> Yes, exactly.
>
>> If so, how about extending the mem_event response mechanism with
>> trap/fault information?
> For this particular case, that is indeed a very good suggestion -
> however, things may change. From what I understand, it is likely that in
> the future we (or somebody else doing memory introspection) will need to
> request a page fault injection in other cases. The risks described above
> will of course exist in that case, but they are acceptable.
Right. I can see your concern, but designing an interface like this for
some hopeful future can be problematic, especially given only a vague
idea of how it would be used in practice.
With the Xen hypercall API/ABI, it is always possible to add something
in the future, and a concrete example of how it is suppose to work does
greatly help with justifying its design and implementation.
In this case, I feel that extending mem_event responses is a very
natural thing to do. It very closely ties the pagefault to the action
which resulted in the decision for a pagefault, rather than an
apparently asynchronous pagefault request via another mechanism which
userspace has to use when it knows that the vcpu is blocked on a mem_event.
Furthermore, having a general "please inject a fault which looks like
this" mechanism allows the mem_event userspace agent algorithm to choose
to inject other faults for different circumstances.
~Andrew
next prev parent reply other threads:[~2014-09-10 9:34 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-28 11:47 [PATCH RFC V9 1/5] xen: Emulate with no writes Razvan Cojocaru
2014-08-28 11:47 ` [PATCH RFC V9 2/5] xen: Optimize introspection access to guest state Razvan Cojocaru
2014-08-28 11:48 ` [PATCH RFC V9 3/5] xen, libxc: Force-enable relevant MSR events Razvan Cojocaru
2014-08-28 11:48 ` [PATCH RFC V9 4/5] xen, libxc: Request page fault injection via libxc Razvan Cojocaru
2014-08-28 12:03 ` Jan Beulich
2014-08-28 12:08 ` Razvan Cojocaru
2014-08-28 12:11 ` Jan Beulich
2014-08-28 12:23 ` Razvan Cojocaru
2014-08-28 12:37 ` Razvan Cojocaru
2014-08-29 7:44 ` Razvan Cojocaru
2014-08-29 9:27 ` Jan Beulich
2014-09-01 7:36 ` Razvan Cojocaru
2014-09-01 9:08 ` Jan Beulich
2014-09-01 11:54 ` Razvan Cojocaru
2014-09-01 12:05 ` Jan Beulich
2014-09-02 9:18 ` Razvan Cojocaru
2014-09-02 9:33 ` Jan Beulich
2014-09-02 9:44 ` Razvan Cojocaru
2014-09-02 10:08 ` Jan Beulich
2014-09-02 13:24 ` Tim Deegan
2014-09-09 16:57 ` George Dunlap
2014-09-09 17:39 ` Razvan Cojocaru
2014-09-09 18:38 ` Tamas K Lengyel
2014-09-10 8:09 ` Razvan Cojocaru
2014-09-10 8:48 ` Andrew Cooper
2014-09-10 8:55 ` Razvan Cojocaru
2014-09-10 9:34 ` Andrew Cooper [this message]
2014-09-10 10:39 ` George Dunlap
2014-09-10 10:49 ` Razvan Cojocaru
2014-09-09 20:14 ` Tim Deegan
2014-09-10 9:30 ` Razvan Cojocaru
2014-09-10 9:59 ` Tamas K Lengyel
2014-09-10 10:44 ` Tim Deegan
2014-08-28 11:48 ` [PATCH RFC V9 5/5] xen: Handle resumed instruction based on previous mem_event reply Razvan Cojocaru
2014-08-28 12:09 ` Jan Beulich
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=54101B33.7040205@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=dunlapg@umich.edu \
--cc=eddie.dong@intel.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jun.nakajima@intel.com \
--cc=kevin.tian@intel.com \
--cc=rcojocaru@bitdefender.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=tamas.lengyel@zentific.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xenproject.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).