Received: from eggs.gnu.org ([2001:4830:134:3::10]:52431) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzCrU-0000P6-Bg for qemu-devel@nongnu.org; Tue, 25 Oct 2016 21:19:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bzCr8-0001YD-D1 for qemu-devel@nongnu.org; Tue, 25 Oct 2016 21:18:36 -0400 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:34039) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bzCr7-0001Xg-Rb for qemu-devel@nongnu.org; Tue, 25 Oct 2016 21:18:14 -0400 Received: by mail-pf0-x241.google.com with SMTP id u84so678821pfj.1 for ; Tue, 25 Oct 2016 18:18:13 -0700 (PDT) References: <1477285201-10244-1-git-send-email-david@gibson.dropbear.id.au> <1477285201-10244-8-git-send-email-david@gibson.dropbear.id.au> <20161025121654.GD11052@umbus.fritz.box> From: Alexey Kardashevskiy Message-ID: <325755c7-d493-145a-eeb4-c898e484dd53@ozlabs.ru> Date: Wed, 26 Oct 2016 12:18:03 +1100 MIME-Version: 1.0 In-Reply-To: <20161025121654.GD11052@umbus.fritz.box> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="RRaP1V8wxH3e9ljf3fJdxoF1CuMUJlpHi" Subject: Re: [Qemu-devel] [PATCHv5 07/12] libqos: Implement mmio accessors in terms of mem{read, write} List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson 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 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --RRaP1V8wxH3e9ljf3fJdxoF1CuMUJlpHi From: Alexey Kardashevskiy To: David Gibson 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 Message-ID: <325755c7-d493-145a-eeb4-c898e484dd53@ozlabs.ru> Subject: Re: [PATCHv5 07/12] libqos: Implement mmio accessors in terms of mem{read,write} References: <1477285201-10244-1-git-send-email-david@gibson.dropbear.id.au> <1477285201-10244-8-git-send-email-david@gibson.dropbear.id.au> <20161025121654.GD11052@umbus.fritz.box> In-Reply-To: <20161025121654.GD11052@umbus.fritz.box> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: quoted-printable On 25/10/16 23:16, David Gibson wrote: > 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 th= e >>> 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 acce= ssors >>> will perform the equivalent of a single bus transaction for short len= gths. >>> 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 >>> Reviewed-by: Laurent Vivier >>> Reviewed-by: Greg Kurz >>> --- >>> 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); >>> =20 >>> - 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);= >>> =20 >>> - 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 l= en); >>> void (*memwrite)(QPCIBus *bus, uint32_t addr, const void *buf, s= ize_t len); >>> =20 >>> >> >> You added them in "libqos: Handle PCI IO de-multiplexing in common cod= e" >> (few patched before) and removing them now - if you moved this patch >> earlier, it would reduce the series, or what do I miss? >=20 > 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. >=20 > 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. It is a bit hard to follow the logic of the patchset when you do not know= if the new code is going to stay or not - I automatically assumed it is staying and when I saw it is being removed - I wondered if you are removi= ng what you just added, and this - in my opinion - kills the idea of making smaller patches to make review easier, better just squash them all... But= since Greg is happy and things seems not working worse (make check fails = on my setup but whatever), you can ignore me :) --=20 Alexey --RRaP1V8wxH3e9ljf3fJdxoF1CuMUJlpHi Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIrBAEBCAAVBQJYEARLDhxhaWtAb3psYWJzLnJ1AAoJEIYTPdgrwSC5Hf8P/23l UnNXg6mRCtOQl1I37gYozCv09af7AF3Wx+/2TRozzcwfsIgLkYPvEJZTBNCZSdPE g3EbbzxbLrmv+fqNwlaaP5keCgvy61orcjt2LkA8IHxaujBkFCPcg74v4BSfd1o0 BJ0nosV/p7Gk3bBdus1p6AGtXMBVh+SlZHAdGgsKSIIKkJT0P3smagfhKNnDn6zl gnvHDcY6fC91e98zKLDTK1fOMCxGEPpsA5oNZ8yNY7LM0OP7XSwlIF1rNBde8Nrd gTkXBwkVBkrE3ZdbEI8YzsB8+Wc4Mf6fX6zoaQxXn37FtUxKD6TPQ4tSmALtx48e 3ctW2beAL9SNtfz+xXJW+keUVNrTnc+3Le0t+KL24NxHUXlwrlahfFeyIxjxcgoB /AQnBKk5PNG0BrwrY5OL3gFpbVnJhZyQdgT3ctHK6oDk/mc5+7YUkS9CUgeCPl4/ u2/VSVAdkNyoVR75NeE7So0r8m2jp6uk21iBXa9jkh05lRmpLaFdBDxVjidoxplm Xy7QJmpNVltW4mZ99K9z6lXTU0k17Mg5qgq3fN+7TuuX0FSCu2aEDltvCi2mA816 KaTUZM/izYaMOb+/8Wrqumu+eZbFQnGASs3iUR2V+UT9TobCiFgA8AFyZdgZyMJK OAGZ5bdzuKmnr7pVT1CvRLziVhM6y1N7rcp1s+IU =zdwK -----END PGP SIGNATURE----- --RRaP1V8wxH3e9ljf3fJdxoF1CuMUJlpHi--