From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WR3Dg-000462-SV for qemu-devel@nongnu.org; Fri, 21 Mar 2014 13:27:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WR3Db-0004qy-Nb for qemu-devel@nongnu.org; Fri, 21 Mar 2014 13:27:00 -0400 Received: from smtp.citrix.com ([66.165.176.89]:37641) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WR3Db-0004qn-Jf for qemu-devel@nongnu.org; Fri, 21 Mar 2014 13:26:55 -0400 Date: Fri, 21 Mar 2014 17:26:54 +0000 From: Anthony PERARD Message-ID: <20140321172654.GB8417@perard.uk.xensource.com> References: <1392965053-1069-1-git-send-email-yang.z.zhang@intel.com> <1392965053-1069-3-git-send-email-yang.z.zhang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1392965053-1069-3-git-send-email-yang.z.zhang@intel.com> Subject: Re: [Qemu-devel] [PATCH 2/5] xen, gfx passthrough: reserve 00:02.0 for INTEL IGD List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yang Zhang Cc: peter.maydell@linaro.org, xen-devel@lists.xensource.com, stefano.stabellini@eu.citrix.com, allen.m.kay@intel.com, weidong.han@intel.com, qemu-devel@nongnu.org, jean.guyader@eu.citrix.com, anthony@codemonkey.ws On Fri, Feb 21, 2014 at 02:44:10PM +0800, Yang Zhang wrote: > From: Yang Zhang > > Some VBIOSs and drivers assume the IGD BDF (bus:device:function) is > always 00:02.0, so this patch reserves 00:02.0 for assigned IGD in > guest. > > The original patch is from Weidong Han > > Signed-off-by: Yang Zhang > Cc: Weidong Han > --- > hw/pci/pci.c | 6 ++++++ > 1 files changed, 6 insertions(+), 0 deletions(-) > > diff --git a/hw/pci/pci.c b/hw/pci/pci.c > index 4e0701d..e81816e 100644 > --- a/hw/pci/pci.c > +++ b/hw/pci/pci.c > @@ -808,6 +808,12 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus, > if (devfn < 0) { > for(devfn = bus->devfn_min ; devfn < ARRAY_SIZE(bus->devices); > devfn += PCI_FUNC_MAX) { > +#if defined(CONFIG_XEN_PCI_PASSTHROUGH) > + /* If gfx_passthru is in use, reserve 00:02.* for the IGD */ > + if (gfx_passthru && devfn == 0x10) { > + continue; > + } > +#endif > if (!bus->devices[devfn]) > goto found; > } This does not look quite right, there is maybe another way to reserve a devfn. -- Anthony PERARD From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony PERARD Subject: Re: [PATCH 2/5] xen, gfx passthrough: reserve 00:02.0 for INTEL IGD Date: Fri, 21 Mar 2014 17:26:54 +0000 Message-ID: <20140321172654.GB8417@perard.uk.xensource.com> References: <1392965053-1069-1-git-send-email-yang.z.zhang@intel.com> <1392965053-1069-3-git-send-email-yang.z.zhang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Return-path: Content-Disposition: inline In-Reply-To: <1392965053-1069-3-git-send-email-yang.z.zhang@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org To: Yang Zhang Cc: peter.maydell@linaro.org, xen-devel@lists.xensource.com, stefano.stabellini@eu.citrix.com, allen.m.kay@intel.com, weidong.han@intel.com, qemu-devel@nongnu.org, jean.guyader@eu.citrix.com, anthony@codemonkey.ws List-Id: xen-devel@lists.xenproject.org On Fri, Feb 21, 2014 at 02:44:10PM +0800, Yang Zhang wrote: > From: Yang Zhang > > Some VBIOSs and drivers assume the IGD BDF (bus:device:function) is > always 00:02.0, so this patch reserves 00:02.0 for assigned IGD in > guest. > > The original patch is from Weidong Han > > Signed-off-by: Yang Zhang > Cc: Weidong Han > --- > hw/pci/pci.c | 6 ++++++ > 1 files changed, 6 insertions(+), 0 deletions(-) > > diff --git a/hw/pci/pci.c b/hw/pci/pci.c > index 4e0701d..e81816e 100644 > --- a/hw/pci/pci.c > +++ b/hw/pci/pci.c > @@ -808,6 +808,12 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus, > if (devfn < 0) { > for(devfn = bus->devfn_min ; devfn < ARRAY_SIZE(bus->devices); > devfn += PCI_FUNC_MAX) { > +#if defined(CONFIG_XEN_PCI_PASSTHROUGH) > + /* If gfx_passthru is in use, reserve 00:02.* for the IGD */ > + if (gfx_passthru && devfn == 0x10) { > + continue; > + } > +#endif > if (!bus->devices[devfn]) > goto found; > } This does not look quite right, there is maybe another way to reserve a devfn. -- Anthony PERARD