All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Christian Refvik <christian.refvik@onlive.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"win-pv-devel@lists.xenproject.org"
	<win-pv-devel@lists.xenproject.org>
Subject: Re: Mapping Data between Dom0 and DomU
Date: Thu, 08 Jan 2015 02:01:36 +0000	[thread overview]
Message-ID: <54ADE500.4080003@citrix.com> (raw)
In-Reply-To: <B4DC7AAB07005D4DA887F0BE517884F2A23DD4@mailbox02.onlive.corp>

On 08/01/2015 01:22, Christian Refvik wrote:
> Hello,
>
> My name is Christian and I am new to Xen development, and I've been struggling a bit.  I'm trying to develop a device driver so that a Windows 2012 Server VM  has a way to send about 10MB of data to a CentOS VM.  There is no real device on the backend, I just need a way to constantly send a large buffer between DomU and Dom0 using a zero copy solution.
>
> I wrote a Linux device driver (simple char device) in Dom0 which allocates the memory and reserves the pages.  However, I'm not sure how to offer these pages to the Windows VM.  I also have a Windows device driver that I've installed in the Windows VM, but again I'm not sure how to connect the two drivers.
>
> I've been browsing the QEMU source code, the Windows PV source code, the Xen source code, and the "Definitive Guide to the Xen Hypervisor" for answers.  Unfortunately, I am a bit lost.  I'm hoping someone with some experience with shared data communication between Dom0 and DomU can point me at some source files to study in order to figure out how to implement what I'm trying to do.  A tutorial, sample code, and/or general direction would be great.
>
> Thanks for your help,
> Christian

You will want to use grants, and in particular grant mappings, which is
the Xen interface for creating shared memory between VMs.

The basic premise is that domain A nominates some of its pages to be
grantable.  Domain A gives the grant references to domain B (usually
negotiated via xenstore), which allows domain B to make a mapping of
domain A's nominated pages.

A relevant bit of code to look at would be tools/libvchan/ , which as
far as I am aware does pretty much what you describe (but without the
windows support).

~Andrew

       reply	other threads:[~2015-01-08  2:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <B4DC7AAB07005D4DA887F0BE517884F2A23DD4@mailbox02.onlive.corp>
2015-01-08  2:01 ` Andrew Cooper [this message]
2015-01-08  8:59   ` Mapping Data between Dom0 and DomU Ian Campbell
2015-01-08 10:20     ` Paul Durrant
     [not found]     ` <9AAE0902D5BC7E449B7C8E4E778ABCD0257B4EDC@AMSPEX01CL01.citrite.net>
2015-01-08 19:26       ` Christian Refvik
2015-01-08  1:22 Christian Refvik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54ADE500.4080003@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=christian.refvik@onlive.com \
    --cc=win-pv-devel@lists.xenproject.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.