qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: "Marc Marí" <marc.mari.barcelo@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v6 2/7] tests: Add virtio device initialization
Date: Wed, 27 Aug 2014 14:51:10 +0100	[thread overview]
Message-ID: <20140827135110.GL8280@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1408955773-4778-3-git-send-email-marc.mari.barcelo@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 980 bytes --]

On Mon, Aug 25, 2014 at 10:36:08AM +0200, Marc Marí wrote:
> +static uint16_t qvirtio_pci_config_readw(QVirtioDevice *d, void *addr)
> +{
> +    QVirtioPCIDevice *dev = (QVirtioPCIDevice *)d;
> +    return qpci_io_readw(dev->pdev, addr);
> +}
> +
> +static uint32_t qvirtio_pci_config_readl(QVirtioDevice *d, void *addr)
> +{
> +    QVirtioPCIDevice *dev = (QVirtioPCIDevice *)d;
> +    return qpci_io_readl(dev->pdev, addr);
> +}
> +
> +static uint64_t qvirtio_pci_config_readq(QVirtioDevice *d, void *addr)
> +{
> +    QVirtioPCIDevice *dev = (QVirtioPCIDevice *)d;
> +    int i;
> +    union {
> +        uint8_t bytes[8];
> +        uint64_t u64;
> +    } quad;
> +
> +    for (i = 0; i < 8; ++i) {
> +        quad.bytes[i] = qpci_io_readb(dev->pdev, addr + i);
> +    }
> +
> +    return quad.u64;
> +}

readw and readl are in host CPU endianness.

readq is in guest CPU endianness.

Please use qtest readq so that endianness is consistent.

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2014-08-27 13:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-25  8:36 [Qemu-devel] [PATCH v6 0/7] Virtio PCI libqos driver Marc Marí
2014-08-25  8:36 ` [Qemu-devel] [PATCH v6 1/7] tests: Functions bus_foreach and device_find from libqos virtio API Marc Marí
2014-08-25  8:36 ` [Qemu-devel] [PATCH v6 2/7] tests: Add virtio device initialization Marc Marí
2014-08-27 13:51   ` Stefan Hajnoczi [this message]
2014-08-25  8:36 ` [Qemu-devel] [PATCH v6 3/7] libqos: Added basic virtqueue support to virtio implementation Marc Marí
2014-08-27 13:57   ` Stefan Hajnoczi
2014-08-25  8:36 ` [Qemu-devel] [PATCH v6 4/7] libqos: Added indirect descriptor " Marc Marí
2014-08-27 13:58   ` Stefan Hajnoczi
2014-08-25  8:36 ` [Qemu-devel] [PATCH v6 5/7] libqos: Added test case for configuration changes in virtio-blk test Marc Marí
2014-08-27 13:59   ` Stefan Hajnoczi
2014-08-25  8:36 ` [Qemu-devel] [PATCH v6 6/7] libqos: Added MSI-X support Marc Marí
2014-08-25  8:36 ` [Qemu-devel] [PATCH v6 7/7] libqos: Added EVENT_IDX support Marc Marí
2014-08-27 14:02 ` [Qemu-devel] [PATCH v6 0/7] Virtio PCI libqos driver Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140827135110.GL8280@stefanha-thinkpad.redhat.com \
    --to=stefanha@gmail.com \
    --cc=marc.mari.barcelo@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).