From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: qemu-xen-dir + PCI passthrough = BOOM Date: Fri, 6 Dec 2013 09:49:36 -0500 Message-ID: <20131206144935.GA3603@pegasus.dumpdata.com> References: <20131204195147.GA3833@pegasus.dumpdata.com> <20131205121632.GO10855@perard.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Vowiw-00036b-Ba for xen-devel@lists.xenproject.org; Fri, 06 Dec 2013 14:49:46 +0000 Content-Disposition: inline In-Reply-To: <20131205121632.GO10855@perard.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Anthony PERARD Cc: xen-devel@lists.xenproject.org, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org On Thu, Dec 05, 2013 at 12:16:32PM +0000, Anthony PERARD wrote: > On Wed, Dec 04, 2013 at 02:51:48PM -0500, Konrad Rzeszutek Wilk wrote: > > Hey, > > > > I just started noticing it today - with qemu-xen (tip is > > commit b97307ecaad98360f41ea36cd9674ef810c4f8cf > > xen_disk: mark ioreq as mapped before unmapping in error case) > > > > when I try to pass in a PCI device at bootup it blows up with: > > > > char device redirected to /dev/pts/2 (label serial0) > > qemu: hardware error: xen: failed to populate ram at 40050000 > > There is a good chance that the issue is in QEMU. > > By default, qemu-xen is not very verbose, so a > #define XEN_PT_LOGGING_ENABLED > can help identifying what is missing. > > The error is reported by xen_ram_alloc(), so it might help to enable > trace for it. It's easy: > sh$ cat > /tmp/trace-to-enable << EOF > xen_ram_alloc > EOF > > then > device_model_args_hvm = [ '-trace', 'events=/tmp/trace-to-enable' ] > > There is more of those trace events in qemu.git/trace-events char device redirected to /dev/pts/2 (label serial0) xen_ram_alloc requested: 0x3f800000, size 0x800000 xen_ram_alloc requested: 0x40000000, size 0x10000 xen_ram_alloc requested: 0x40010000, size 0x40000 [00:05.0] xen_pt_initfn: Assigning real physical device 01:00.0 to devfn 0x28 [00:05.0] xen_pt_register_regions: IO region 0 registered (size=0x20000lx base_addr=0xfbc20000lx type: 0) [00:05.0] xen_pt_register_regions: IO region 1 registered (size=0x400000lx base_addr=0xfb800000lx type: 0) [00:05.0] xen_pt_register_regions: IO region 2 registered (size=0x20lx base_addr=0xe020lx type: 0x1) [00:05.0] xen_pt_register_regions: IO region 3 registered (size=0x4000lx base_addr=0xfbc44000lx type: 0) xen_ram_alloc requested: 0x40050000, size 0x400000 qemu: hardware error: xen: failed to populate ram at 40050000 > > Does it works if you `xl pci-attach` after the guest has booted ? -bash-4.1# xl pci-attach latest 01:00.0 libxl: error: libxl_qmp.c:448:qmp_next: Socket read error: Connection reset by peer -bash-4.1# head -16 /var/log/xen/qemu-dm-latest.log char device redirected to /dev/pts/3 (label serial0) xen_ram_alloc requested: 0x3f800000, size 0x800000 xen_ram_alloc requested: 0x40000000, size 0x10000 xen_ram_alloc requested: 0x40010000, size 0x40000 xen be: vkbd-0: initialise() failed xen be: vkbd-0: initialise() failed xen be: vkbd-0: initialise() failed [00:04.0] xen_pt_initfn: Assigning real physical device 01:00.0 to devfn 0x20 [00:04.0] xen_pt_register_regions: IO region 0 registered (size=0x20000lx base_addr=0xfbc20000lx type: 0) [00:04.0] xen_pt_register_regions: IO region 1 registered (size=0x400000lx base_addr=0xfb800000lx type: 0) [00:04.0] xen_pt_register_regions: IO region 2 registered (size=0x20lx base_addr=0xe020lx type: 0x1) [00:04.0] xen_pt_register_regions: IO region 3 registered (size=0x4000lx base_addr=0xfbc44000lx type: 0) xen_ram_alloc requested: 0x40010000, size 0x400000 qemu: hardware error: xen: failed to populate ram at 40010000 CPU #0: EAX=00000000 EBX=00000000 ECX=00000000 EDX=00000633