From patchwork Sun Aug 24 13:32:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Knut Omang X-Patchwork-Id: 382494 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 5EDEF1400B9 for ; Sun, 24 Aug 2014 23:37:15 +1000 (EST) Received: from localhost ([::1]:44237 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XLXyr-00053s-I2 for incoming@patchwork.ozlabs.org; Sun, 24 Aug 2014 09:37:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47640) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XLXw7-00014q-GW for qemu-devel@nongnu.org; Sun, 24 Aug 2014 09:34:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XLXvm-0005Pb-1T for qemu-devel@nongnu.org; Sun, 24 Aug 2014 09:34:23 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:30470) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XLXvl-0005PQ-S2 for qemu-devel@nongnu.org; Sun, 24 Aug 2014 09:34:01 -0400 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s7ODXqZD011323 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 24 Aug 2014 13:33:53 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s7ODXqND021213 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 24 Aug 2014 13:33:52 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s7ODXqVk009956; Sun, 24 Aug 2014 13:33:52 GMT Received: from abi.no.oracle.com (/10.172.144.123) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 24 Aug 2014 06:33:51 -0700 From: Knut Omang To: qemu-devel@nongnu.org Date: Sun, 24 Aug 2014 15:32:17 +0200 Message-Id: <1408887140-3320-2-git-send-email-knut.omang@oracle.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1408887140-3320-1-git-send-email-knut.omang@oracle.com> References: <1408887140-3320-1-git-send-email-knut.omang@oracle.com> X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 Cc: Marcel Apfelbaum , Alexey Kardashevskiy , Juan Quintela , Knut Omang , Markus Armbruster , "Gonglei \(Arei\)" , "Michael S. Tsirkin" , Igor Mammedov , Paolo Bonzini Subject: [Qemu-devel] [PATCH v2 1/4] pcie: Fix incorrect write to the ari capability next function field X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org PCI_ARI_CAP_NFN, a macro for reading next function was used instead of the intended write. Signed-off-by: Knut Omang --- hw/pci/pcie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c index a123c01..de0e967 100644 --- a/hw/pci/pcie.c +++ b/hw/pci/pcie.c @@ -630,5 +630,5 @@ void pcie_ari_init(PCIDevice *dev, uint16_t offset, uint16_t nextfn) { pcie_add_capability(dev, PCI_EXT_CAP_ID_ARI, PCI_ARI_VER, offset, PCI_ARI_SIZEOF); - pci_set_long(dev->config + offset + PCI_ARI_CAP, PCI_ARI_CAP_NFN(nextfn)); + pci_set_long(dev->config + offset + PCI_ARI_CAP, (nextfn & 0xff) << 8); }