xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Razvan Cojocaru <rzvncj@gmail.com>
To: xen-devel@lists.xen.org
Subject: Hypervisor to dom0 communication
Date: Mon, 12 Nov 2012 23:12:25 +0200	[thread overview]
Message-ID: <50A16639.2090209@gmail.com> (raw)

Hello,

I'm interested in establishing a communication channel between the Xen
hypervisor and a dom0 userspace application. Ideally this would be a
2-way channel, with the hypervisor asynchronously notifying this
application, and then (for certain types of messages) wait for a reply
from the userspace consumer.

To this end, I've been reading xen-devel posts [1], read the
xentrace-related Xen source code [2], and studied tools such as Ether
[3]. I've also read as much as time permitted of "The Definitive Guide
to the Xen Hypervisor" [4] book. However, I have very limited experience
as a kernel developer, and none working on the Xen hypervisor, so I'm
still digesting the information.

A particularly good choice is riding on xentrace, since that's already
been tested, has it's own tools, and it's the fastest way to get data
moving in one direction. However (putting aside the fact that it's not
bidirectional communication) the problem is that the messages I'd like
to pass to my application are longer than 28 bytes, so to be able to get
what I need I'd have to either increase the default trace buffer, or
send a message in several chunks. None of these solutions look elegant
to me.

So I'm thinking about writing a custom channel from scratch, and I'd
like to know what the best way to proceed is. I'll likely need to add a
new VIRQ like the TRACE VIRQ and use that for notifications. However,
allocating and sharing a new page is trickier. I've read about grant
tables and HYPERVISOR_grant_table_op, but trace.c simply calls
share_xen_page_with_privileged_guests(). I've read about ring buffers
and DEFINE_RING_TYPES, but trace.{h,c} has nothing to do with that
macro. Is the "The Definitive Guide to the Xen Hypervisor" book still
relevant?

What would you recommend for my case? Where (if anywhere) might I be
able to find a clear, concise, example of allocating and sharing memory
pages containing a ring buffer used for hypervisor <-> dom0 userspace
communication (hopefully even simpler that trace.c)?

What resources that would accelerate learning and facilitate Xen
enlightenment would you recommend to a developer new to the Xen hypervisor?

Thank you,
Razvan

[1]
http://old-list-archives.xen.org/archives/html/xen-devel/2008-07/msg00589.html
[2] http://code.metager.de/source/xref/xen/xen/common/trace.c
[3] http://ether.gtisc.gatech.edu/source.html
[4] http://www.amazon.com/The-Definitive-Guide-Xen-Hypervisor/dp/013234971X

             reply	other threads:[~2012-11-12 21:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-12 21:12 Razvan Cojocaru [this message]
2012-11-13  9:59 ` Hypervisor to dom0 communication Ian Campbell
2012-11-13 10:26   ` Razvan Cojocaru
2012-11-13 10:36     ` Ian Campbell
2012-11-13 10:49       ` Razvan Cojocaru
2012-11-13 11:12         ` Ian Campbell
2012-11-13 11:24           ` Razvan Cojocaru
2012-11-15 14:26             ` Steven Maresca
2012-11-15 14:37               ` Razvan Cojocaru
2012-11-16 16:51               ` Razvan Cojocaru
2012-11-15 12:10         ` Tim Deegan
  -- strict thread matches above, loose matches on Subject: below --
2008-07-10 12:26 Matthew Donovan
2008-07-11 14:47 ` Mark Williamson

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=50A16639.2090209@gmail.com \
    --to=rzvncj@gmail.com \
    --cc=xen-devel@lists.xen.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).