qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 02/11] tests: Add virtio device initializatio


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v4 02/11] tests: Add virtio device initialization
Date: Wed, 13 Aug 2014 17:52:00 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

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.

Attachment: pgpy00YNH2i01.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]