From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: PCI passthrough (pci-attach) to HVM guests bug (BAR64 addresses are bogus) Date: Mon, 10 Nov 2014 16:32:48 -0500 Message-ID: <20141110213248.GA23182@laptop.dumpdata.com> References: <20141110173248.GA13778@laptop.dumpdata.com> <5460F908.4040208@citrix.com> <20141110180720.GA15286@laptop.dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xnwa1-0006Cs-SI for xen-devel@lists.xenproject.org; Mon, 10 Nov 2014 21:32:57 +0000 Content-Disposition: inline In-Reply-To: <20141110180720.GA15286@laptop.dumpdata.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: David Vrabel Cc: xen-devel@lists.xenproject.org, jbeulich@suse.com List-Id: xen-devel@lists.xenproject.org On Mon, Nov 10, 2014 at 01:07:20PM -0500, Konrad Rzeszutek Wilk wrote: > On Mon, Nov 10, 2014 at 05:42:32PM +0000, David Vrabel wrote: > > On 10/11/14 17:32, Konrad Rzeszutek Wilk wrote: > > > Hey, > > > = > > > With Xen 4.5 (today's staging), when I boot a guest and then do pci-a= ttach > > > the BARs values are corrupt. I can reproduce this with Xen 4.4, Xen 4.3 and Xen 4.1. A bit digging in and I realized that: (XEN) memory_map:add: dom1 gfn=3Df4000 mfn=3Dd8000 nr=3D4000 [64M] (XEN) AMD-Vi: update_paging_mode Try to access pdev_list without aquiring p= cidevs_lock. (XEN) memory_map:add: dom1 gfn=3Df8000 mfn=3Dfc000 nr=3D2000 [32M] (XEN) ioport_map:add: dom1 gport=3D1000 mport=3Dc000 nr=3D80 (XEN) AMD-Vi: Disable: device id =3D 0x500, domain =3D 0, paging mode =3D 3 (XEN) AMD-Vi: Setup I/O page table: device id =3D 0x500, type =3D 0x1, root= table =3D 0x228b02000, domain =3D 1, paging mode =3D 3 The sizes are my own editing. This means QEMU is putting the devices in the MMIO region - and doing it succesfully. But then: > > = > > = > > > [ 152.572965] pci 0000:00:04.0: BAR 1: no space for [mem size 0x0800= 0000 64bit pref] > [ =A0152.518320] pci 0000:00:04.0: reg 0x14: [mem 0x00000000-0x07ffffff 6= 4bit pref] .. The guest computes the right size for them, but reads the wrong BAR value that was set by QEMU and also created in the hypervisor. Perhaps this is Linux kernel being on fritz. Will try another kernel.