Re: [Qemu-devel] [PATCH v3] Align PCI capabilities in pci_find_space

2012-09-26 Thread Alex Williamson
On Wed, 2012-09-26 at 13:05 -0500, Matt Renzelmann wrote: > > > > 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

Re: [Qemu-devel] [PATCH v3] Align PCI capabilities in pci_find_space

2012-09-26 Thread Matt Renzelmann
> > 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

Re: [Qemu-devel] [PATCH v3] Align PCI capabilities in pci_find_space

2012-09-26 Thread Don Slutz
On 09/26/12 14:02, Don Slutz wrote: On 09/26/12 13:55, Alex Williamson wrote: On Wed, 2012-09-26 at 12:49 -0500, Matt Renzelmann wrote: static int pci_find_space(PCIDevice *pdev, uint8_t size, bool pcie_space) { int config_base; int config_size; int offset = PCI_CONFIG_HEADER_S

Re: [Qemu-devel] [PATCH v3] Align PCI capabilities in pci_find_space

2012-09-26 Thread Don Slutz
On 09/26/12 13:55, Alex Williamson wrote: On Wed, 2012-09-26 at 12:49 -0500, Matt Renzelmann wrote: 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_u

Re: [Qemu-devel] [PATCH v3] Align PCI capabilities in pci_find_space

2012-09-26 Thread Alex Williamson
On Wed, 2012-09-26 at 12:49 -0500, Matt Renzelmann wrote: > > > 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 = &p

Re: [Qemu-devel] [PATCH v3] Align PCI capabilities in pci_find_space

2012-09-26 Thread Matt Renzelmann
> > 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

Re: [Qemu-devel] [PATCH v3] Align PCI capabilities in pci_find_space

2012-09-26 Thread Alex Williamson
On Wed, 2012-09-26 at 11:50 -0500, Matt Renzelmann wrote: > > > > > > 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 > >

Re: [Qemu-devel] [PATCH v3] Align PCI capabilities in pci_find_space

2012-09-26 Thread Matt Renzelmann
> > > > 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

Re: [Qemu-devel] [PATCH v3] Align PCI capabilities in pci_find_space

2012-09-26 Thread Alex Williamson
On Wed, 2012-09-26 at 10:30 -0500, m...@cs.wisc.edu wrote: > From: Matt Renzelmann > > The current implementation of pci_find_space does not correctly align > PCI capabilities in the PCI configuration space. It also does not > distinguish PCI and PCI-Express devices. This patch fixes these > is

[Qemu-devel] [PATCH v3] Align PCI capabilities in pci_find_space

2012-09-26 Thread mjr
From: Matt Renzelmann The current implementation of pci_find_space does not correctly align PCI capabilities in the PCI configuration space. It also does not distinguish PCI and PCI-Express devices. This patch fixes these issues. Thanks to Alex Williamson for continuing feedback. Signed-off-b