From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XK1is-0004AH-1O for qemu-devel@nongnu.org; Wed, 20 Aug 2014 04:58:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XK1il-0007Az-D4 for qemu-devel@nongnu.org; Wed, 20 Aug 2014 04:58:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1370) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XK1il-0007Ap-4S for qemu-devel@nongnu.org; Wed, 20 Aug 2014 04:58:19 -0400 Message-ID: <1408525048.13594.49.camel@localhost.localdomain> From: Marcel Apfelbaum Date: Wed, 20 Aug 2014 11:57:28 +0300 In-Reply-To: <1408517610.25437.103.camel@ori.omang.mine.nu> References: <1408517610.25437.103.camel@ori.omang.mine.nu> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/3] ioh3420: Support ARI forwarding List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Knut Omang Cc: Juan Quintela , Alexey Kardashevskiy , "Michael S.Tsirkin" , Markus Armbruster , qemu-devel@nongnu.org, Gonglei , Igor Mammedov , Paolo Bonzini On Wed, 2014-08-20 at 08:53 +0200, Knut Omang wrote: > Enable the PCIe capability bit that indicates that this port is able to support > and forward requests to > 8 functions for ARI capable devices. > > Signed-off-by: Knut Omang > --- > hw/pci-bridge/ioh3420.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/hw/pci-bridge/ioh3420.c b/hw/pci-bridge/ioh3420.c > index 8f6c8b0..c14ea6b 100644 > --- a/hw/pci-bridge/ioh3420.c > +++ b/hw/pci-bridge/ioh3420.c > @@ -92,8 +92,10 @@ static void ioh3420_reset(DeviceState *qdev) > > static int ioh3420_initfn(PCIDevice *d) > { > + PCIBridge* br = PCI_BRIDGE(d); > PCIEPort *p = PCIE_PORT(d); > PCIESlot *s = PCIE_SLOT(d); > + uint8_t *exp_cap; > int rc; > char tmp[100]; > sprintf(tmp, "pcie_port.%d", s->slot); > @@ -121,6 +123,10 @@ static int ioh3420_initfn(PCIDevice *d) > if (rc < 0) { > goto err_msi; > } > + /* Support ARI forwarding */ > + exp_cap = d->config + d->exp.exp_cap; > + pci_word_test_and_set_mask(exp_cap + PCI_EXP_DEVCAP2, PCI_EXP_DEVCAP2_ARI); > + Hi, I think is better to move the implementation to a function, say pcie_cap_ari_init and place it into hw/pci/pcie.c so other devices like downstream ports can use it. Thanks, Marcel > pcie_cap_deverr_init(d); > pcie_cap_slot_init(d, s->slot); > pcie_chassis_create(s->chassis); > @@ -151,6 +157,7 @@ err_bridge: > static void ioh3420_exitfn(PCIDevice *d) > { > PCIESlot *s = PCIE_SLOT(d); > + PCIBridge* br = PCI_BRIDGE(d); > > pcie_aer_exit(d); > pcie_chassis_del_slot(s);