All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
	lvivier@redhat.com, agraf@suse.de, stefanha@redhat.com,
	mst@redhat.com, mdroth@linux.vnet.ibm.com, groug@kaod.org,
	thuth@redhat.com
Subject: Re: [Qemu-devel] [PATCHv5 07/12] libqos: Implement mmio accessors in terms of mem{read, write}
Date: Tue, 25 Oct 2016 23:16:54 +1100	[thread overview]
Message-ID: <20161025121654.GD11052@umbus.fritz.box> (raw)
In-Reply-To: <a34c01d1-cda8-8180-a90d-bcab37a7929c@ozlabs.ru>

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

On Tue, Oct 25, 2016 at 05:47:43PM +1100, Alexey Kardashevskiy wrote:
> On 24/10/16 15:59, David Gibson wrote:
> > In the libqos PCI code we now have accessors both for registers (byte
> > significance preserving) and for streaming data (byte address order
> > preserving).  These exist in both the interface for qtest drivers and in
> > the machine specific backends.
> > 
> > However, the register-style accessors aren't actually necessary in the
> > backend.  They can be implemented in terms of the byte address order
> > preserving accessors by the libqos wrappers.  This works because PCI is
> > always little endian.
> > 
> > This does assume that the back end byte address order preserving accessors
> > will perform the equivalent of a single bus transaction for short lengths.
> > This is the case, and in fact they currently end up using the same
> > cpu_physical_memory_rw() implementation within the qtest accelerator.
> > 
> > Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> > Reviewed-by: Laurent Vivier <lvivier@redhat.com>
> > Reviewed-by: Greg Kurz <groug@kaod.org>
> > ---
> >  tests/libqos/pci-pc.c    | 38 --------------------------------------
> >  tests/libqos/pci-spapr.c | 44 --------------------------------------------
> >  tests/libqos/pci.c       | 20 ++++++++++++++------
> >  tests/libqos/pci.h       |  8 --------
> >  4 files changed, 14 insertions(+), 96 deletions(-)
> > 
> 
> [...]
> 
> > diff --git a/tests/libqos/pci.h b/tests/libqos/pci.h
> > index 2b08362..ce6ed08 100644
> > --- a/tests/libqos/pci.h
> > +++ b/tests/libqos/pci.h
> > @@ -27,18 +27,10 @@ struct QPCIBus {
> >      uint16_t (*pio_readw)(QPCIBus *bus, uint32_t addr);
> >      uint32_t (*pio_readl)(QPCIBus *bus, uint32_t addr);
> >  
> > -    uint8_t (*mmio_readb)(QPCIBus *bus, uint32_t addr);
> > -    uint16_t (*mmio_readw)(QPCIBus *bus, uint32_t addr);
> > -    uint32_t (*mmio_readl)(QPCIBus *bus, uint32_t addr);
> > -
> >      void (*pio_writeb)(QPCIBus *bus, uint32_t addr, uint8_t value);
> >      void (*pio_writew)(QPCIBus *bus, uint32_t addr, uint16_t value);
> >      void (*pio_writel)(QPCIBus *bus, uint32_t addr, uint32_t value);
> >  
> > -    void (*mmio_writeb)(QPCIBus *bus, uint32_t addr, uint8_t value);
> > -    void (*mmio_writew)(QPCIBus *bus, uint32_t addr, uint16_t value);
> > -    void (*mmio_writel)(QPCIBus *bus, uint32_t addr, uint32_t value);
> > -
> >      void (*memread)(QPCIBus *bus, uint32_t addr, void *buf, size_t len);
> >      void (*memwrite)(QPCIBus *bus, uint32_t addr, const void *buf, size_t len);
> >  
> > 
> 
> You added them in "libqos: Handle PCI IO de-multiplexing in common code"
> (few patched before) and removing them now - if you moved this patch
> earlier, it would reduce the series, or what do I miss?

Well, it can't go before the PIO / MMIO split, because on x86 the PIO
part is implemented with inw/outw instead of readw/writew, and those
don't have a memread/memwrite equivalent.

The change could go at the same time, but my feeling was that logical
separation of the steps was worth a bit of temporary extra code.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2016-10-25 12:17 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-24  4:59 [Qemu-devel] [PATCHv5 00/12] Cleanups to qtest PCI handling David Gibson
2016-10-24  4:59 ` [Qemu-devel] [PATCHv5 01/12] libqos: Give qvirtio_config_read*() consistent semantics David Gibson
2016-10-24  4:59 ` [Qemu-devel] [PATCHv5 02/12] libqos: Handle PCI IO de-multiplexing in common code David Gibson
2016-10-24  4:59 ` [Qemu-devel] [PATCHv5 03/12] libqos: Move BAR assignment to " David Gibson
2016-10-24  4:59 ` [Qemu-devel] [PATCHv5 04/12] libqos: Better handling of PCI legacy IO David Gibson
2016-10-25 12:34   ` Greg Kurz
2016-10-24  4:59 ` [Qemu-devel] [PATCHv5 05/12] tests: Adjust tco-test to use qpci_legacy_iomap() David Gibson
2016-10-25 12:35   ` Greg Kurz
2016-10-24  4:59 ` [Qemu-devel] [PATCHv5 06/12] libqos: Add streaming accessors for PCI MMIO David Gibson
2016-10-24  4:59 ` [Qemu-devel] [PATCHv5 07/12] libqos: Implement mmio accessors in terms of mem{read, write} David Gibson
2016-10-25  6:47   ` Alexey Kardashevskiy
2016-10-25 12:16     ` David Gibson [this message]
2016-10-26  1:18       ` Alexey Kardashevskiy
2016-10-26  4:22         ` David Gibson
2016-10-24  4:59 ` [Qemu-devel] [PATCHv5 08/12] tests: Clean up IO handling in ide-test David Gibson
2016-10-25  7:01   ` Alexey Kardashevskiy
2016-10-25 12:25     ` David Gibson
2016-10-26  1:57       ` Alexey Kardashevskiy
2016-10-26  4:11         ` David Gibson
2016-10-25 12:36   ` Greg Kurz
2016-10-24  4:59 ` [Qemu-devel] [PATCHv5 09/12] libqos: Add 64-bit PCI IO accessors David Gibson
2016-10-24  4:59 ` [Qemu-devel] [PATCHv5 10/12] tests: Use qpci_mem{read, write} in ivshmem-test David Gibson
2016-10-25  9:23   ` Greg Kurz
2016-10-24  5:00 ` [Qemu-devel] [PATCHv5 11/12] tests: Don't assume structure of PCI IO base in ahci-test David Gibson
2016-10-24 16:50   ` John Snow
2016-10-25  8:58   ` Greg Kurz
2016-10-24  5:00 ` [Qemu-devel] [PATCHv5 12/12] libqos: Change PCI accessors to take opaque BAR handle David Gibson
2016-10-25  9:21   ` Greg Kurz
2016-10-25  3:35 ` [Qemu-devel] [PATCHv5 00/12] Cleanups to qtest PCI handling David Gibson
2016-10-25 13:14   ` Greg Kurz
2016-10-26  4:27     ` David Gibson

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=20161025121654.GD11052@umbus.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=groug@kaod.org \
    --cc=lvivier@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=thuth@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.