From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TnTPn-0003u5-NS for qemu-devel@nongnu.org; Tue, 25 Dec 2012 07:15:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TnTPj-0004I1-Qj for qemu-devel@nongnu.org; Tue, 25 Dec 2012 07:15:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37749) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TnTPj-0004Hq-J4 for qemu-devel@nongnu.org; Tue, 25 Dec 2012 07:15:19 -0500 Date: Tue, 25 Dec 2012 14:18:20 +0200 From: "Michael S. Tsirkin" Message-ID: <20121225121820.GB12528@redhat.com> References: <1355866589.8438.6.camel@ori.omang.mine.nu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1355866589.8438.6.camel@ori.omang.mine.nu> Subject: Re: [Qemu-devel] [PATCH] pcie: Fix bug in pcie_ext_cap_set_next List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Knut Omang Cc: qemu-devel@nongnu.org On Tue, Dec 18, 2012 at 10:36:29PM +0100, Knut Omang wrote: > Upper 16 bits of the PCIe Extended Capability Header was truncated during update, > also breaking pcie_add_capability. > > Signed-off-by: Knut Omang Applied, thanks. > --- > hw/pcie.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/pcie.c b/hw/pcie.c > index 7c92f19..fa260af 100644 > --- a/hw/pcie.c > +++ b/hw/pcie.c > @@ -494,7 +494,7 @@ uint16_t pcie_find_capability(PCIDevice *dev, uint16_t cap_id) > > static void pcie_ext_cap_set_next(PCIDevice *dev, uint16_t pos, uint16_t next) > { > - uint16_t header = pci_get_long(dev->config + pos); > + uint32_t header = pci_get_long(dev->config + pos); > assert(!(next & (PCI_EXT_CAP_ALIGN - 1))); > header = (header & ~PCI_EXT_CAP_NEXT_MASK) | > ((next << PCI_EXT_CAP_NEXT_SHIFT) & PCI_EXT_CAP_NEXT_MASK); > -- > 1.7.11.7 >