On Tue, Aug 12, 2014 at 01:41:47PM +0200, Marc Marí wrote: > +static uint64_t qvirtio_pci_config_readq(QVirtioDevice *d, void *addr) > +{ > + QVirtioPCIDevice *dev = (QVirtioPCIDevice *)d; > + return qpci_io_readl(dev->pdev, addr) | qpci_io_readl(dev->pdev, addr+4);
This is broken because it never shifts bits into the upper 32 bits. Which value to shift up depends on endianness. Another solution is to do byte reads into a uint64_t variable like memcpy. I suggest you simply drop 64-bit accesses for now since they are probably not used.
pgpZ4N0hKlhg_.pgp
Description: PGP signature