xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Llopis <pllopis@arcos.inf.uc3m.es>
To: D Sundstrom <sunds@peapod.net>
Cc: xen-devel@lists.xen.org
Subject: Re: Immediate kernel panic using gntdev device
Date: Mon, 12 Nov 2012 12:36:20 +0100	[thread overview]
Message-ID: <CAL08nMGDeaQO6HAJypK+pzmsmg8wcz2=WnLWwX==R5MRBCyoPA@mail.gmail.com> (raw)
In-Reply-To: <CAP4+OA3-CsKxJizFpx-V48cCFKJc5KXNQzzY4oQ6pQ5pu0RFMg@mail.gmail.com>

Hello David,

I am not a Xen developer, but I think I can help with your issue :)

On Mon, Nov 12, 2012 at 12:35 AM, D Sundstrom <sunds@peapod.net> wrote:
>
> Running under debian wheezy kernel 3.2.0-3-686-pae (32 bit), under Xen 4.1
> HVM.
>
> The linux PV drivers load and all appears to be fine.
>
> I want to use the gntalloc device to allocate a page of memory from Domain A
> and then map that into Domain B using gntdev.  Both are unprivileged
> domains.
>
> Using Daniel DeGraaf's test program here:
> http://lists.xen.org/archives/html/xen-devel/2011-01/txtzDU6iZhTkB.txt
>

I am running a slightly different version of the tool,
http://lists.xen.org/archives/html/xen-devel/2011-02/msg00231.html (I
think this one is more up to date, I did not check if there was a more
recent one)

> I can run the command to create a grant, but upon running the command to map
> the grant (from either the same domain or another DomU), the kernel
> immediately crashes with no diagnostic output.
>
> Should I expect to be able to map grants in a DomU allocated in another
> DomU?

Yes, I think that is the main goal of grant references.

>
> Example of running the test:
>
> $  xenstore-read domid
> 8
>
> $  thetestprogram
>
> src-add <domid>       return gntref, address
> map <domid> <ref>     return index, address
> src-del <gntref>      no rv
> gu <index>            no rv
> unmap <address>       no rv
> show                  print and change mapped items
> This process bumps by 4000
>
> src-add 8
>
> src-add mapped 1372 at 0=0
>
> show
>
> 00(-1217044480,0): current     4000    new    0
>
> map 8 1372

It is not clear from your output from which domain you are running
each command. It looks like you are trying to issue a grant and map it
from within the same domain. That's probably the reason it crashes.
You are supposed to run this tool from both domains, running the calls
which interface with gntalloc from one domain, and the calls which
interface with gntdev from the other domain.
In any case, the domid you have to specify in the map must be the
domid of the domain which issued the grant. In other words, when
creating a grant, the domid which is granted access is specified. When
mapping a grant, the domid which issued the grant is specified. (i.e.
If you did "src-add 8" from dom0 you should run map 0 1372 from domU
8)

>
> (immediately crashes the VM)

I have also experienced this crash. The crash should probably not
happen, especially if it can be triggered from user-space, but I have
not looked into that.

>
>
> Thanks,
>
> David
>
>
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>

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

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-11 23:35 Immediate kernel panic using gntdev device D Sundstrom
2012-11-12 11:36 ` Pablo Llopis [this message]
2012-11-12 13:15   ` D Sundstrom
2012-11-13 16:24     ` Daniel De Graaf
2012-12-04  0:49       ` D Sundstrom
2012-12-04 14:18         ` Daniel De Graaf
2012-12-04 17:48           ` D Sundstrom
2012-12-04 17:54             ` Daniel De Graaf

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='CAL08nMGDeaQO6HAJypK+pzmsmg8wcz2=WnLWwX==R5MRBCyoPA@mail.gmail.com' \
    --to=pllopis@arcos.inf.uc3m.es \
    --cc=sunds@peapod.net \
    --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).