From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43314) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WmK7A-0004V5-V5 for qemu-devel@nongnu.org; Mon, 19 May 2014 05:44:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WmK76-0003X1-F3 for qemu-devel@nongnu.org; Mon, 19 May 2014 05:44:12 -0400 Received: from mga02.intel.com ([134.134.136.20]:43721) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WmK76-0003Wu-9U for qemu-devel@nongnu.org; Mon, 19 May 2014 05:44:08 -0400 From: "Chen, Tiejun" Date: Mon, 19 May 2014 09:43:43 +0000 Message-ID: References: <1400237624-8505-1-git-send-email-tiejun.chen@intel.com> <1400237624-8505-3-git-send-email-tiejun.chen@intel.com> <20140516140701.GB3154@phenom.dumpdata.com> In-Reply-To: <20140516140701.GB3154@phenom.dumpdata.com> Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [Qemu-devel] [Xen-devel] [v2][PATCH 2/8] pci: provide a way to reserve some specific devfn List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Konrad Rzeszutek Wilk Cc: "peter.maydell@linaro.org" , "xen-devel@lists.xensource.com" , "mst@redhat.com" , "stefano.stabellini@eu.citrix.com" , "Kay, Allen M" , "Kelly.Zytaruk@amd.com" , "qemu-devel@nongnu.org" , "Zhang, Yang Z" , "anthony@codemonkey.ws" , "anthony.perard@citrix.com" > -----Original Message----- > From: Konrad Rzeszutek Wilk [mailto:konrad.wilk@oracle.com] > Sent: Friday, May 16, 2014 10:07 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: [Xen-devel] [v2][PATCH 2/8] pci: provide a way to reserve so= me > specific devfn >=20 > On Fri, May 16, 2014 at 06:53:38PM +0800, Tiejun Chen wrote: > > Sometime we may need to reserve some specific devfn since some vgabios > > or drivers have to work well with a fixed bdf. > > > > Signed-off-by: Tiejun Chen > > --- > > v2: > > > > * New patch > > > > hw/pci/pci.c | 11 +++++++++++ > > include/hw/pci/pci.h | 1 + > > 2 files changed, 12 insertions(+) > > > > diff --git a/hw/pci/pci.c b/hw/pci/pci.c index ef944cf..06b0c92 100644 > > --- a/hw/pci/pci.c > > +++ b/hw/pci/pci.c > > @@ -813,6 +813,17 @@ static void do_pci_unregister_device(PCIDevice > *pci_dev) > > memory_region_destroy(&pci_dev->bus_master_enable_region); > > } > > > > + > > +void pci_reserve_pci_devfn(PCIBus *bus, uint8_t devfn) { > > + int ret =3D test_and_set_bit(devfn, bus->pci_bdf_bitmap); >=20 > unsigned int please. Fixed. > > + if (ret) { > > + error_report("PCI: %02x:%02x:%02x is not available to reserve.= ", > > + pci_bus_num(bus), PCI_SLOT(devfn), > PCI_FUNC(devfn)); > > + return; > > + } > > +} >=20 > Don't we want to return whether we are failed or not? Its my typo so I will remove that "return" simply. Thanks Tiejun From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Chen, Tiejun" Subject: Re: [Xen-devel] [v2][PATCH 2/8] pci: provide a way to reserve some specific devfn Date: Mon, 19 May 2014 09:43:43 +0000 Message-ID: References: <1400237624-8505-1-git-send-email-tiejun.chen@intel.com> <1400237624-8505-3-git-send-email-tiejun.chen@intel.com> <20140516140701.GB3154@phenom.dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20140516140701.GB3154@phenom.dumpdata.com> Content-Language: en-US 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: Konrad Rzeszutek Wilk Cc: "peter.maydell@linaro.org" , "xen-devel@lists.xensource.com" , "mst@redhat.com" , "stefano.stabellini@eu.citrix.com" , "Kay, Allen M" , "Kelly.Zytaruk@amd.com" , "qemu-devel@nongnu.org" , "Zhang, Yang Z" , "anthony@codemonkey.ws" , "anthony.perard@citrix.com" List-Id: xen-devel@lists.xenproject.org > -----Original Message----- > From: Konrad Rzeszutek Wilk [mailto:konrad.wilk@oracle.com] > Sent: Friday, May 16, 2014 10:07 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: [Xen-devel] [v2][PATCH 2/8] pci: provide a way to reserve so= me > specific devfn >=20 > On Fri, May 16, 2014 at 06:53:38PM +0800, Tiejun Chen wrote: > > Sometime we may need to reserve some specific devfn since some vgabios > > or drivers have to work well with a fixed bdf. > > > > Signed-off-by: Tiejun Chen > > --- > > v2: > > > > * New patch > > > > hw/pci/pci.c | 11 +++++++++++ > > include/hw/pci/pci.h | 1 + > > 2 files changed, 12 insertions(+) > > > > diff --git a/hw/pci/pci.c b/hw/pci/pci.c index ef944cf..06b0c92 100644 > > --- a/hw/pci/pci.c > > +++ b/hw/pci/pci.c > > @@ -813,6 +813,17 @@ static void do_pci_unregister_device(PCIDevice > *pci_dev) > > memory_region_destroy(&pci_dev->bus_master_enable_region); > > } > > > > + > > +void pci_reserve_pci_devfn(PCIBus *bus, uint8_t devfn) { > > + int ret =3D test_and_set_bit(devfn, bus->pci_bdf_bitmap); >=20 > unsigned int please. Fixed. > > + if (ret) { > > + error_report("PCI: %02x:%02x:%02x is not available to reserve.= ", > > + pci_bus_num(bus), PCI_SLOT(devfn), > PCI_FUNC(devfn)); > > + return; > > + } > > +} >=20 > Don't we want to return whether we are failed or not? Its my typo so I will remove that "return" simply. Thanks Tiejun