From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: Fatal crash on xen4.2 HVM + qemu-xen dm + NFS Date: Tue, 22 Jan 2013 10:05:16 +0000 Message-ID: <1358849116.3279.306.camel@zakaz.uk.xensource.com> References: <5B4525F296F6ABEB38B0E614@nimrod.local> <50CEFDA602000078000B0B11@nat28.tlf.novell.com> <3B1D0701EAEA6532CEA91EA0@Ximines.local> <77822E2DDAEA8F94631B6A52@Ximines.local> <1358781790.3279.224.camel@zakaz.uk.xensource.com> <1358783420.3279.235.camel@zakaz.uk.xensource.com> <1358787073.3279.257.camel@zakaz.uk.xensource.com> <1358789574.3279.273.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Alex Bligh Cc: Konrad Wilk , Xen Devel , Jan Beulich , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Mon, 2013-01-21 at 18:14 +0000, Alex Bligh wrote: > Ian, > > --On 21 January 2013 17:32:54 +0000 Ian Campbell > wrote: > > > You would also need to malloc/free the buffer you are copying to/from. I > > don't know how hard that is within qemu. > > I think it's ioreq_map and ioreq_unmap within hw/xen_disk.c. I had > foolishly assumed xc would do the grant copy, but it looks like > as you say I need malloc/free (or mmap equivalents) + memcpy. > > Is this a useful approach to try? I've never looked inside xen_qdisk so I can't really advise, but that sound broadly correct, except you'd want to use gnttab_copy not mmap +memcpy. e.g. (totally making up the API because I'm too lazy to go look): buffer = malloc(SIZE) if (writing) gnttab_copy_from(buffer, gntref, size) io->buffer = buffer submit(io) ... wait for completion: if (reading) gnttab_copy_to(...) free(io->buffer) Hopefully you get the idea ;-) Sounds like before the ... goes in ioreq_map and after the ... goes in ioreq_unmap. Ian.