All of lore.kernel.org
 help / color / mirror / Atom feed
From: Razvan Cojocaru <rcojocaru@bitdefender.com>
To: "Tian, Kevin" <kevin.tian@intel.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: "Dong, Eddie" <eddie.dong@intel.com>,
	"stefano.stabellini@eu.citrix.com"
	<stefano.stabellini@eu.citrix.com>,
	"Nakajima, Jun" <jun.nakajima@intel.com>,
	"andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>,
	"tim@xen.org" <tim@xen.org>,
	"JBeulich@suse.com" <JBeulich@suse.com>,
	"ian.jackson@eu.citrix.com" <ian.jackson@eu.citrix.com>,
	"ian.campbell@citrix.com" <ian.campbell@citrix.com>
Subject: Re: [PATCH RFC V8 4/5] xen, libxc: Request page fault injection via libxc
Date: Thu, 28 Aug 2014 10:54:47 +0300	[thread overview]
Message-ID: <53FEE047.3090101@bitdefender.com> (raw)
In-Reply-To: <AADFC41AFE54684AB9EE6CBC0274A5D126050208@SHSMSX101.ccr.corp.intel.com>

On 08/27/2014 11:59 PM, Tian, Kevin wrote:
>> From: Razvan Cojocaru [mailto:rcojocaru@bitdefender.com]
>> Sent: Wednesday, August 27, 2014 7:02 AM
>>
>> Added new XEN_DOMCTL_set_pagefault_info hypercall, used by libxc's
>> new xc_domain_set_pagefault_info() function to set per-domain page
>> fault injection information. All a call does is set per-domain info,
>> and nothing actually happens until VMENTRY time, and then only if
>> all conditions are met (the guest is in user mode, the set value
>> matches CR3, and there are no other pending traps).
>> This mechanism allows bringing in swapped-out pages for inspection.
> 
> Is there any impact on the whole introspection process, regarding to when
> next VM exit on the inspected address space actually comes? 
> 
> btw how is the whole flow of inspecting swapped-out pages with this
> interface?

Andrei has explained the flow here:
http://lists.xen.org/archives/html/xen-devel/2014-07/msg03013.html

>> +static void vmx_inject_pf(void)
>> +{
>> +    struct vcpu *curr = current;
>> +    struct domain *currd = curr->domain;
>> +    uint64_t virtual_address =
>> currd->arch.hvm_domain.fault_info.virtual_address;
>> +
>> +    currd->arch.hvm_domain.fault_info.valid = 0;
> 
> Do you need handle the race with next coming fault injection hypercall?
> 
> Is the memory introspection caring about how many page faults are injected
> at one time? two vcpus may both enter the same address space, and trigger
> the VM exit at the same time, then it's non-deterministic whether both vcpus
> will receive a page fault.

No, the application doesn't care if one or more page faults happen on
one or more VCPUs, as long as the swapped out page is brought back in.
Also, within our model (mem_event-based application) concurrency issues
don't really happen by design.

But I do understand your concern, and if I understood things correctly I
believe that this was also Jan's objection - to that end I'll look into
making the Xen part more generic (VCPU-based instead of domain-based
injection requests) and simply only use VCPU 0 from our application.


Thanks,
Razvan Cojocaru

  reply	other threads:[~2014-08-28  7:54 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-27 14:01 [PATCH RFC V8 1/5] xen: Emulate with no writes Razvan Cojocaru
2014-08-27 14:01 ` [PATCH RFC V8 2/5] xen: Optimize introspection access to guest state Razvan Cojocaru
2014-08-27 14:01 ` [PATCH RFC V8 3/5] xen, libxc: Force-enable relevant MSR events Razvan Cojocaru
2014-08-27 15:44   ` Jan Beulich
2014-08-27 20:25   ` Tian, Kevin
2014-08-28  7:40     ` Razvan Cojocaru
2014-08-28  8:25       ` Jan Beulich
2014-08-28  8:26         ` Razvan Cojocaru
2014-08-28 21:27       ` Tian, Kevin
2014-08-27 14:01 ` [PATCH RFC V8 4/5] xen, libxc: Request page fault injection via libxc Razvan Cojocaru
2014-08-27 15:46   ` Jan Beulich
2014-08-27 16:04     ` Razvan Cojocaru
2014-08-27 20:59   ` Tian, Kevin
2014-08-28  7:54     ` Razvan Cojocaru [this message]
2014-08-28 21:22       ` Tian, Kevin
2014-08-27 14:01 ` [PATCH RFC V8 5/5] xen: Handle resumed instruction based on previous mem_event reply Razvan Cojocaru
2014-08-27 15:52   ` Jan Beulich
2014-08-27 21:06     ` Tian, Kevin
2014-08-28  7:30       ` Razvan Cojocaru
2014-08-27 15:40 ` [PATCH RFC V8 1/5] xen: Emulate with no writes Jan Beulich
2014-08-27 15:42   ` Razvan Cojocaru

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=53FEE047.3090101@bitdefender.com \
    --to=rcojocaru@bitdefender.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --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=stefano.stabellini@eu.citrix.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 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.