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

Re: [Xen-devel] questions regarding interdomain communication and xen-guest communication



On 28 October 2013 17:10, Jan Beulich <JBeulich@xxxxxxxx> wrote:
>>>> On 28.10.13 at 16:21, Aastha Mehta <aasthakm@xxxxxxxxx> wrote:
>> On 25 October 2013 14:18, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>>> That callback will need to be registered in any case - the (general)
>>> event upcall.
>>>
>> Could you please clarify which general event upcall are you referring to
>> here?
>
> The one you would e.g. register with CALLBACKTYPE_event.
>
>> Let me clarify my question a bit more. My requirement is that I need
>> to perform some computations on an application data, but I cannot
>> allow the application to do so directly. I would like to provide the
>> computation as a service from, say dom0. Here are two approaches that
>> come to my mind -
>> Approach 1
>> 1. Application makes a syscall into DomU kernel requesting for the
>> computation.
>> 2. DomU copies the application data into a kernel buffer and makes a
>> hypercall into Xen forwarding application's request.
>> 3. Xen upcalls into dom0 kernel for the service (a new vIRQ?).
>
> Definitely not. This would be a normal event channel.
>
>> 4. Dom0 performs the computation and sends the results back to Xen via
>> a hypercall.
>> 5. Xen returns the results to DomU kernel through another upcall (another
>> vIRQ).
>
> Again an event channel.
>
>> 6. DomU kernel forwards the result to the application and returns the
>> syscall.
>>
>> Approach 2
>> Replace steps 2-5 in the above approach with interdomain event channel
>
> Ah, okay - so just forget about #1 then.
>
>> notification between dom0 and domU and sharing the data pages through
>> grant table mechanism. So domU will notify dom0 that it has sent a
>> request for the computation, after placing the data to be used in the
>> shared memory. dom0's handler will get the request and the shared
>> data, compute the result, place it in another shared memory region and
>> notify domU of the completion of the request.
>>
>> Do the two approaches even make sense?
>> I looked at the blkfront-blkback drivers, and how they use event
>> channels, grant tables and xenbus. If I understand correctly, the
>> event channels have to be associated with the xenbus, but it seems
>> that xenbus can only be used by drivers. I do not understand how the
>> event channels can be setup ad hoc between two domains. How do I know
>> what xenbus_device to connect to?
>
> There's examples of how to use the event channel device to use
> them from user space. But as pointed out in someone else's
> response - perhaps all you need to do is use an already existing
> library.
>
>> Another question I have is, if a domU makes a hypercall into Xen and
>> if the hypercall is long running, does it block the entire domU until
>> the hypercall returns? What if there are multiple vcpus?
>
> No, just the particular vCPU would be blocked.
>
> Jan
>

Thanks for the quick responses. libvchan seems to be useful for what I
would like to do. A few more questions on that -
I tried running the vchan-node1 and vchan-node2 test executables. I
provide the nodepath as data/vchan/0/ports or even data/vchan/4/ports
but xs_read/write do not seem to work. Is there something I need to do
to the xenstore?

I looked at qubes OS and linpicker, which use this library, but I
don't completely follow how it is to be used. I need to have the
libraries in both the domains that I want to communicate between, and
the applications running in these domains use it.

Could you please point me to the example on using the event channel
device from user space?

Regards


-- 
Aastha Mehta
MPI-SWS, Germany
E-mail: aasthakm@xxxxxxxxxxx

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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