[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH 1/3] tests: add libpci qtest library
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [RFC PATCH 1/3] tests: add libpci qtest library |
Date: |
Mon, 16 Apr 2012 10:14:18 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Sat, Apr 14, 2012 at 12:32:00PM +0000, Blue Swirl wrote:
> On Fri, Apr 13, 2012 at 14:27, Stefan Hajnoczi
> <address@hidden> wrote:
> > This patch adds a common PCI bus driver library which works for
> > i386/x86-64 targets. Tests can use the library to probe for PCI
> > devices, map BARs, and access configuration space.
>
> I guess we have almost identical code in SeaBIOS, OpenBIOS, various OS
> and maybe userland PCI tools. Would it be possible to reduce NIH
> somewhere?
Probably not given how small these functions are and how they use glib
assert calls because they are part of tests.
> > +void pci_config_writel(PciDevice *dev, unsigned int offset, uint32_t l)
> > +{
> > + pci_config_setup(dev, offset);
> > + outl(PCI_CONFIG_DATA, l);
> > +}
>
> All code above is specific to i440fx or similar PCI bridges, other
> bridges may use different config space access methods. If we want to
> share the rest for example with Sparc64 or PPC, the above would need
> to be changed. How about splitting the above to a separate file? It
> could be done later too.
Yes, it's only i440fx for now. I think it makes sense to move it later
since we have no non-x86 qtests yet.
> > +
> > +/* Initialize a PciDevice if a device is present on the bus */
>
> The comment talks about initalizing instead of only probing which is
> actually what the code does, please fix.
Sorry this comment is unclear. I meant initializing the "PciDevice"
struct, not the physical PCI device. Will change.
Stefan
[Qemu-devel] [RFC PATCH 2/3] virtio: move virtio spec constants to separate headers, Stefan Hajnoczi, 2012/04/13
[Qemu-devel] [RFC PATCH 3/3] qtest: add virtio-test test-case, Stefan Hajnoczi, 2012/04/13