From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49268) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WmKap-0007AY-8K for qemu-devel@nongnu.org; Mon, 19 May 2014 06:14:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WmKal-00057F-H4 for qemu-devel@nongnu.org; Mon, 19 May 2014 06:14:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32220) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WmKal-000579-9Y for qemu-devel@nongnu.org; Mon, 19 May 2014 06:14:47 -0400 Date: Mon, 19 May 2014 13:13:21 +0300 From: "Michael S. Tsirkin" Message-ID: <20140519101321.GB29266@redhat.com> References: <1400237624-8505-1-git-send-email-tiejun.chen@intel.com> <1400237624-8505-5-git-send-email-tiejun.chen@intel.com> <1400481887.32155.34.camel@nilsson.home.kraxel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [v2][PATCH 4/8] xen, gfx passthrough: reserve 00:02.0 for INTEL IGD List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Chen, Tiejun" Cc: "peter.maydell@linaro.org" , "xen-devel@lists.xensource.com" , "stefano.stabellini@eu.citrix.com" , "jean.guyader@eu.citrix.com" , "Kay, Allen M" , "Kelly.Zytaruk@amd.com" , "qemu-devel@nongnu.org" , "Zhang, Yang Z" , Gerd Hoffmann , "anthony@codemonkey.ws" , "anthony.perard@citrix.com" On Mon, May 19, 2014 at 09:25:19AM +0000, Chen, Tiejun wrote: > > -----Original Message----- > > From: Gerd Hoffmann [mailto:kraxel@redhat.com] > > Sent: Monday, May 19, 2014 2:45 PM > > To: Chen, Tiejun > > Cc: anthony.perard@citrix.com; stefano.stabellini@eu.citrix.com; > > mst@redhat.com; Kelly.Zytaruk@amd.com; peter.maydell@linaro.org; > > xen-devel@lists.xensource.com; weidong.han@intel.com; Kay, Allen M; > > qemu-devel@nongnu.org; jean.guyader@eu.citrix.com; > > anthony@codemonkey.ws; Zhang, Yang Z > > Subject: Re: [Qemu-devel] [v2][PATCH 4/8] xen, gfx passthrough: reserve > > 00:02.0 for INTEL IGD > > > > Hi, > > > > > + /* > > > + * Some video bioses and gfx drivers will assume the bdf of IGD is > > 00:02.0. > > > + * So user need to set it to 00:02.0 in Xen configure file explicitly, > > > + * otherwise IGD will fail to work. > > > + */ > > > + pci_reserve_pci_devfn(b, PCI_DEVFN(2, 0)); > > > > That is asking for trouble. Slot 2 is used by the qemu vga cards by default, and > > for quite a while (before memory api was merged) it even was impossible to > > change it. libvirt still places the vga card at slot > > 2 for that reason -> boom. I wouldn't be surprised if you find that assumption > > in other management libs / apps too. > > > > Why do you need that patch in the first place? It should be possible to > > configure qemu to not occupy slot 2 if you need it that way. Just pass '-vga > > none' to qemu. Which you probably want anyway if you pass-through a vga to > > the guest. And explicitly configure a slot (via addr= > > I think '-vga none' just guarantees the qemu vga cards doesn't occupy 00:02.0, but this doesn't mean others use this specific slot since in qemu internal, we always pass -1 to assign a slot automatically to register a PCI device. So in some cases, we can't get this slot as we expect since that is already assigned previously before we need this. So stop doing this. Address -1 is a short-cut intended for humans. In particular we have no way to guarantee that migration works unless you specify addresses explicitly. > > property) for all your pci devices. Doing it only for the IGD works too if you list > > the device before any other pci device on the qemu command line. > > So in my test scenario, we can see this information: > > PCI: slot 2 function 0 not available for xen-pci-passthrough, in use by xen-platform > Thanks > Tiejun I think the best fix is to give priority to devices that supply a specific slot. I'll look into this. -- MST