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

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

@@ -3137,6 +3172,8 @@ void vmx_vmenter_helper(const struct cpu_user_regs *regs)
     if ( unlikely(need_flush) )

+    check_pf_injection();

The function check_pf_injection isn't just 'checking', it does issue the page fault injection as well under the right circumstances, and as such the naming of the function is a bit misleading. Breaking it into two functions might be an improvement where the actual check itself could be wrapped into an unlikely(). But isn't this a bit of an overkill at every VMENTER for every domain? Surely there are less invasive mechanisms to trigger a VMEXIT when you know your VM will be in a state where you can inject your page fault, without incurring an overhead for every domain.

Another question is, how do you know when the page fault had been handled and the page can be inspected? You would need some other trigger just at the right point in the execution of the VM or the page could be swapped out again before you had a chance to inspect it.

Also, it might make sense to perform some sanity checks on the vaddr and address space before injection (ie. is the page really swapped out). There is no guarantee that the page is still swapped out, even if you checked before issuing xc_domain_set_pagefault_info, unless the domain had been paused for both checking and setting.

Xen-devel mailing list



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