The current implementation of pci_find_space does not correctly align
PCI capabilities in the PCI configuration space. It also does not
support PCI-Express devices. This patch fixes these issues.
Thanks to Alex Williamson for feedback.
Signed-off-by: Matt Renzelmann
---
Re-sending to add CC
nu.org [mailto:qemu-devel-
> bounces+mjr=cs.wisc@nongnu.org] On Behalf Of Matt Renzelmann
> Sent: Saturday, September 29, 2012 9:51 AM
> To: qemu-devel@nongnu.org
> Cc: blauwir...@gmail.com; alex.william...@redhat.com
> Subject: [Qemu-devel] [PATCH v5] Align PCI capabilities in pc
The current implementation of pci_find_space does not correctly align
PCI capabilities in the PCI configuration space. It also does not
support PCI-Express devices. This patch fixes these issues.
Thanks to Alex Williamson for feedback.
Signed-off-by: Matt Renzelmann
---
Braces added.
hw
The current implementation of pci_find_space does not correctly align
PCI capabilities in the PCI configuration space. It also does not
support PCI-Express devices. This patch fixes these issues.
Thanks to Alex Williamson for feedback.
Signed-off-by: Matt Renzelmann
---
This version adds the
>
> Mismatched uses of "size" here. We need both the end of the range to
> search and the size of the sub-range we're looking for. Maybe start,
> end, and size. Thanks,
>
Ah of course, how's this:
static int pci_find_space(PCIDevice *pdev, uint32_t start,
uint32_t e
> > static int pci_find_space(PCIDevice *pdev, uint8_t size, bool pcie_space)
> > {
> > int config_base;
> > int config_size;
> > int offset = PCI_CONFIG_HEADER_SIZE;
> > int i;
> > uint32_t *dword_used = &pdev->used[PCI_CONFIG_HEADER_SIZE];
>
> This needs to change too.
>
> I
> >
> > hw/pci.c | 28 +---
> > 1 files changed, 21 insertions(+), 7 deletions(-)
> >
> > diff --git a/hw/pci.c b/hw/pci.c
> > index f855cf3..2217dda 100644
> > --- a/hw/pci.c
> > +++ b/hw/pci.c
> > @@ -1626,16 +1626,30 @@ PCIDevice *pci_create_simple(PCIBus *bus, int dev