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

Re: [Xen-devel] Vmx_vmenter_helper() and hvm_inject_page_fault()

At 13:43 +0200 on 07 Nov (1383828227), Razvan Cojocaru wrote:
> Hello Tim, thank you for your answer!
> > Or, even easier, just leave the EPT state that caused the mem_event in
> > the first place -- if the guest retries the instruction it will exit
> > again with the same fault and you can have some state in the EPT fault
> > handler to say 'next time, inject a pagefault'.
> Good suggestion, I'm exploring it as we speak.
> But, I would also like to know what the dangers of doing this in the
> VMENTRY helper function are. Is it that the VMCS information is not yet
> fully there? Is guest_cpu_user_regs() not reliable at that point? What
> exactly could go wrong there?

vmx_vmenter_helper() is called last thing on the VMENTER code path,
after all the other checks that happen before guest entry.  Injecting
a trap can change vcpu state in ways that invalidate those checks
(e.g. by causing a nested-hvm guest to do an emulated VMEXIT, or by
triggering an emulated triple fault).  It's also called with
interrupts disabled, though I don't see a specific example where that
would cause trouble.


Xen-devel mailing list



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