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

Re: [Xen-devel] How the pv guest responds hypercall_create_continuation ?

On Thu, May 23, 2013 at 12:03 PM, Xinxin Jin <xinxinjin89@xxxxxxxxx> wrote:
> Hi all,
> In Xen's hypercall handler, sometimes when -EAGAIN error happens, Xen will
> call a function hypercall_create_continuation(), which writes the arguments
> of this hypercall to guest user registers. I guess the purpose of this
> function is to indicate guest to try the failed hypercall again, right ?
> Then I looked at guest Linux's code and try to find the interface:
> A typical guest hypercall calling routine is (take HYPERVISOR_mmu_update for
> example):
> static inline int
> HYPERVISOR_mmu_update(
>     mmu_update_t *req, int count, int *success_count, domid_t domid)
> {
>     return _hypercall4(int, mmu_update, req, count, success_count, domid);
> }
> Then _hypercall4 will call corresponding code in hypercall_page and return.
> But where is the interface with hypercall_create_continuation()? How the
> guest knows it needs to try the hypercall again?

You must have missed this part of hypercall_create_continuation:

This rewinds the guest's IP so that the hypercall is re-executed when
the guest is rescheduled. The guest hypercall argument register writes
you saw (as defined by the 'format' argument) ensure that work
continues where it was left off when the hypercall was stopped and a
continuation formed.

- Matthew

> Thanks a lot,
> Xinxin
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxx
> http://lists.xen.org/xen-devel

Xen-devel mailing list



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