* [Qemu-devel] [PATCH] pcie: Fix bug in pcie_ext_cap_set_next
@ 2012-12-18 21:36 Knut Omang
2012-12-25 12:18 ` Michael S. Tsirkin
0 siblings, 1 reply; 2+ messages in thread
From: Knut Omang @ 2012-12-18 21:36 UTC (permalink / raw)
To: qemu-devel; +Cc: Michael S.Tsirkin
Upper 16 bits of the PCIe Extended Capability Header was truncated during update,
also breaking pcie_add_capability.
Signed-off-by: Knut Omang <knut.omang@oracle.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] pcie: Fix bug in pcie_ext_cap_set_next
2012-12-18 21:36 [Qemu-devel] [PATCH] pcie: Fix bug in pcie_ext_cap_set_next Knut Omang
@ 2012-12-25 12:18 ` Michael S. Tsirkin
0 siblings, 0 replies; 2+ messages in thread
From: Michael S. Tsirkin @ 2012-12-25 12:18 UTC (permalink / raw)
To: Knut Omang; +Cc: qemu-devel
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 <knut.omang@oracle.com>
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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-12-25 12:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-18 21:36 [Qemu-devel] [PATCH] pcie: Fix bug in pcie_ext_cap_set_next Knut Omang
2012-12-25 12:18 ` Michael S. Tsirkin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).