[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH RFC V8 4/5] xen, libxc: Request page fault injection via libxc

On 08/27/2014 11:59 PM, Tian, Kevin wrote:
>> From: Razvan Cojocaru [mailto:rcojocaru@xxxxxxxxxxxxxxx]
>> 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:

>> +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.

Razvan Cojocaru

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.