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

Re: [Xen-devel] Immediate kernel panic using gntdev device

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@xxxxxxxxxx> 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

> (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@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®.