diff for duplicates of <1563810480347.95681@bt.com> diff --git a/a/2.bin b/a/2.bin deleted file mode 100644 index 9cb5cb0..0000000 --- a/a/2.bin +++ /dev/null @@ -1,110 +0,0 @@ -<html> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> -<style type="text/css" style="display:none"><!-- P { margin-top: 0px; margin-bottom: 0px; } .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left-width: 2px; border-left-style: solid; border-left-color: rgb(128, 0, 0); }--></style> -</head> -<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;"> -<p></p> -<div><span style="font-size: 12pt;">On 17/07/19 08:06, Paolo Bonzini wrote:</span><br> -</div> -<div><br> -</div> -<div>> My main concern is that MO_BE/MO_LE/MO_TE do not really apply to the </div> -<div>> memory.c paths. MO_BSWAP is never passed into the MemOp, even if target </div> -<div>> endianness != host endianness.</div> -<div>> </div> -<div>> Therefore, you could return MO_TE | MO_{8,16,32,64} from this function, </div> -<div>> and change memory_region_endianness_inverted to test </div> -<div>> HOST_WORDS_BIGENDIAN instead of TARGET_WORDS_BIGENDIAN. Then the two</div> -<div>> MO_BSWAPs (one from MO_TE, one from adjust_endianness because</div> -<div>> memory_region_endianness_inverted returns true) cancel out if the</div> -<div>> memory region's endianness is the same as the host's but different</div> -<div>> from the target's.</div> -<div>> </div> -<div>> Some care is needed in virtio_address_space_write and zpci_write_bar. I </div> -<div>> think the latter is okay, while the former could do something like this:</div> -<div>> </div> -<div>> diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c</div> -<div>> index ce928f2429..61885f020c 100644</div> -<div>> --- a/hw/virtio/virtio-pci.c</div> -<div>> +++ b/hw/virtio/virtio-pci.c</div> -<div>> @@ -541,16 +541,16 @@ void virtio_address_space_write(VirtIOPCIProxy *proxy, </div> -<div>> hwaddr addr,</div> -<div>> val = pci_get_byte(buf);</div> -<div>> break;</div> -<div>> case 2:</div> -<div>> - val = cpu_to_le16(pci_get_word(buf));</div> -<div>> + val = pci_get_word(buf);</div> -<div>> break;</div> -<div>> case 4:</div> -<div>> - val = cpu_to_le32(pci_get_long(buf));</div> -<div>> + val = pci_get_long(buf);</div> -<div>> break;</div> -<div>> default:</div> -<div>> /* As length is under guest control, handle illegal values. */</div> -<div>> return;</div> -<div>> }</div> -<div>> - memory_region_dispatch_write(mr, addr, val, len, MEMTXATTRS_UNSPECIFIED);</div> -<div>> + memory_region_dispatch_write(mr, addr, val, size_memop(len) & ~MO_BSWAP, </div> -<div>> MEMTXATTRS_UNSPECIFIED);</div> -<div>> }</div> -<div>> </div> -<div>> static void</div> -<div><br> -</div> -<div>Sorry Paolo, I noted the need to take care in virtio_address_space_write and</div> -<div>zpci_write_bar but did not understand.</div> -<div><br> -</div> -<div>> Some care is needed in virtio_address_space_write and zpci_write_bar.</div> -<div>Is this advice for my v1 implementation, or in the case of the</div> -<div>MO_TE | MO_{8,16,32,64} idead suggested in the paragraph before?</div> -<div><br> -</div> -<div>Signed-off-by: Tony Nguyen <tony.nguyen@bt.com></div> -<div>---</div> -<div> hw/virtio/virtio-pci.c | 7 +++++--</div> -<div> 1 file changed, 5 insertions(+), 2 deletions(-)</div> -<div><br> -</div> -<div>diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c</div> -<div>index ce928f2..265f066 100644</div> -<div>--- a/hw/virtio/virtio-pci.c</div> -<div>+++ b/hw/virtio/virtio-pci.c</div> -<div>@@ -17,6 +17,7 @@</div> -<div> </div> -<div> #include "qemu/osdep.h"</div> -<div> </div> -<div>+#include "exec/memop.h"</div> -<div> #include "standard-headers/linux/virtio_pci.h"</div> -<div> #include "hw/virtio/virtio.h"</div> -<div> #include "hw/pci/pci.h"</div> -<div>@@ -550,7 +551,8 @@ void virtio_address_space_write(VirtIOPCIProxy *proxy, hwaddr addr,</div> -<div> /* As length is under guest control, handle illegal values. */</div> -<div> return;</div> -<div> }</div> -<div>- memory_region_dispatch_write(mr, addr, val, len, MEMTXATTRS_UNSPECIFIED);</div> -<div>+ memory_region_dispatch_write(mr, addr, val, SIZE_MEMOP(len),</div> -<div>+ MEMTXATTRS_UNSPECIFIED);</div> -<div> }</div> -<div> </div> -<div> static void</div> -<div>@@ -573,7 +575,8 @@ virtio_address_space_read(VirtIOPCIProxy *proxy, hwaddr addr,</div> -<div> /* Make sure caller aligned buf properly */</div> -<div> assert(!(((uintptr_t)buf) & (len - 1)));</div> -<div> </div> -<div>- memory_region_dispatch_read(mr, addr, &val, len, MEMTXATTRS_UNSPECIFIED);</div> -<div>+ memory_region_dispatch_read(mr, addr, &val, SIZE_MEMOP(len),</div> -<div>+ MEMTXATTRS_UNSPECIFIED);</div> -<div> switch (len) {</div> -<div> case 1:</div> -<div> pci_set_byte(buf, val);</div> -<div>-- </div> -<div>1.8.3.1</div> -<div><br> -<br> -</div> -<p><br> -</p> -</body> -</html> diff --git a/a/2.hdr b/a/2.hdr deleted file mode 100644 index e54d0ae..0000000 --- a/a/2.hdr +++ /dev/null @@ -1,2 +0,0 @@ -Content-Type: text/html; charset="iso-8859-1" -Content-Transfer-Encoding: quoted-printable diff --git a/a/content_digest b/N1/content_digest index 49c349c..21b981b 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,34 +1,34 @@ "ref\0e9c6e5310b1a4863be45d45bf087fc3d@tpw09926dag18e.domain1.systemhost.net\0" "From\0<tony.nguyen@bt.com>\0" - "Subject\0[Qemu-riscv] [Qemu-devel] [PATCH v2 11/20] hw/virtio: Access MemoryRegion with MemOp\0" + "Subject\0[Qemu-devel] [PATCH v2 11/20] hw/virtio: Access MemoryRegion with MemOp\0" "Date\0Mon, 22 Jul 2019 15:48:00 +0000\0" "To\0<qemu-devel@nongnu.org>\0" - "Cc\0<peter.maydell@linaro.org>" - <walling@linux.ibm.com> - <david@redhat.com> - <palmer@sifive.com> - <mark.cave-ayland@ilande.co.uk> - <Alistair.Francis@wdc.com> - <arikalo@wavecomp.com> - <mst@redhat.com> - <pasic@linux.ibm.com> - <borntraeger@de.ibm.com> - <rth@twiddle.net> - <atar4qemu@gmail.com> - <ehabkost@redhat.com> - <sw@weilnetz.de> - <alex.williamson@redhat.com> - <qemu-arm@nongnu.org> - <david@gibson.dropbear.id.au> - <qemu-riscv@nongnu.org> - <cohuck@redhat.com> - <claudio.fontana@huawei.com> - <qemu-s390x@nongnu.org> - <qemu-ppc@nongnu.org> - <amarkovic@wavecomp.com> - <pbonzini@redhat.com> - " <aurelien@aurel32.net>\0" - "\01:1\0" + "Cc\0peter.maydell@linaro.org" + walling@linux.ibm.com + mst@redhat.com + palmer@sifive.com + mark.cave-ayland@ilande.co.uk + Alistair.Francis@wdc.com + arikalo@wavecomp.com + david@redhat.com + pasic@linux.ibm.com + borntraeger@de.ibm.com + rth@twiddle.net + atar4qemu@gmail.com + ehabkost@redhat.com + sw@weilnetz.de + qemu-s390x@nongnu.org + qemu-arm@nongnu.org + david@gibson.dropbear.id.au + qemu-riscv@nongnu.org + cohuck@redhat.com + claudio.fontana@huawei.com + alex.williamson@redhat.com + qemu-ppc@nongnu.org + amarkovic@wavecomp.com + pbonzini@redhat.com + " aurelien@aurel32.net\0" + "\00:1\0" "b\0" "On 17/07/19 08:06, Paolo Bonzini wrote:\n" "\n" @@ -120,117 +120,5 @@ " pci_set_byte(buf, val);\n" "--\n" 1.8.3.1 - "\01:2\0" - "b\0" - "<html>\r\n" - "<head>\r\n" - "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\r\n" - "<style type=\"text/css\" style=\"display:none\"><!-- P { margin-top: 0px; margin-bottom: 0px; } .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left-width: 2px; border-left-style: solid; border-left-color: rgb(128, 0, 0); }--></style>\r\n" - "</head>\r\n" - "<body dir=\"ltr\" style=\"font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;\">\r\n" - "<p></p>\r\n" - "<div><span style=\"font-size: 12pt;\">On 17/07/19 08:06, Paolo Bonzini wrote:</span><br>\r\n" - "</div>\r\n" - "<div><br>\r\n" - "</div>\r\n" - "<div>> My main concern is that MO_BE/MO_LE/MO_TE do not really apply to the </div>\r\n" - "<div>> memory.c paths. MO_BSWAP is never passed into the MemOp, even if target </div>\r\n" - "<div>> endianness != host endianness.</div>\r\n" - "<div>> </div>\r\n" - "<div>> Therefore, you could return MO_TE | MO_{8,16,32,64} from this function, </div>\r\n" - "<div>> and change memory_region_endianness_inverted to test </div>\r\n" - "<div>> HOST_WORDS_BIGENDIAN instead of TARGET_WORDS_BIGENDIAN. Then the two</div>\r\n" - "<div>> MO_BSWAPs (one from MO_TE, one from adjust_endianness because</div>\r\n" - "<div>> memory_region_endianness_inverted returns true) cancel out if the</div>\r\n" - "<div>> memory region's endianness is the same as the host's but different</div>\r\n" - "<div>> from the target's.</div>\r\n" - "<div>> </div>\r\n" - "<div>> Some care is needed in virtio_address_space_write and zpci_write_bar. I </div>\r\n" - "<div>> think the latter is okay, while the former could do something like this:</div>\r\n" - "<div>> </div>\r\n" - "<div>> diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c</div>\r\n" - "<div>> index ce928f2429..61885f020c 100644</div>\r\n" - "<div>> --- a/hw/virtio/virtio-pci.c</div>\r\n" - "<div>> +++ b/hw/virtio/virtio-pci.c</div>\r\n" - "<div>> @@ -541,16 +541,16 @@ void virtio_address_space_write(VirtIOPCIProxy *proxy, </div>\r\n" - "<div>> hwaddr addr,</div>\r\n" - "<div>> val = pci_get_byte(buf);</div>\r\n" - "<div>> break;</div>\r\n" - "<div>> case 2:</div>\r\n" - "<div>> - val = cpu_to_le16(pci_get_word(buf));</div>\r\n" - "<div>> + val = pci_get_word(buf);</div>\r\n" - "<div>> break;</div>\r\n" - "<div>> case 4:</div>\r\n" - "<div>> - val = cpu_to_le32(pci_get_long(buf));</div>\r\n" - "<div>> + val = pci_get_long(buf);</div>\r\n" - "<div>> break;</div>\r\n" - "<div>> default:</div>\r\n" - "<div>> /* As length is under guest control, handle illegal values. */</div>\r\n" - "<div>> return;</div>\r\n" - "<div>> }</div>\r\n" - "<div>> - memory_region_dispatch_write(mr, addr, val, len, MEMTXATTRS_UNSPECIFIED);</div>\r\n" - "<div>> + memory_region_dispatch_write(mr, addr, val, size_memop(len) & ~MO_BSWAP, </div>\r\n" - "<div>> MEMTXATTRS_UNSPECIFIED);</div>\r\n" - "<div>> }</div>\r\n" - "<div>> </div>\r\n" - "<div>> static void</div>\r\n" - "<div><br>\r\n" - "</div>\r\n" - "<div>Sorry Paolo, I noted the need to take care in virtio_address_space_write and</div>\r\n" - "<div>zpci_write_bar but did not understand.</div>\r\n" - "<div><br>\r\n" - "</div>\r\n" - "<div>> Some care is needed in virtio_address_space_write and zpci_write_bar.</div>\r\n" - "<div>Is this advice for my v1 implementation, or in the case of the</div>\r\n" - "<div>MO_TE | MO_{8,16,32,64} idead suggested in the paragraph before?</div>\r\n" - "<div><br>\r\n" - "</div>\r\n" - "<div>Signed-off-by: Tony Nguyen <tony.nguyen@bt.com></div>\r\n" - "<div>---</div>\r\n" - "<div> hw/virtio/virtio-pci.c | 7 +++++--</div>\r\n" - "<div> 1 file changed, 5 insertions(+), 2 deletions(-)</div>\r\n" - "<div><br>\r\n" - "</div>\r\n" - "<div>diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c</div>\r\n" - "<div>index ce928f2..265f066 100644</div>\r\n" - "<div>--- a/hw/virtio/virtio-pci.c</div>\r\n" - "<div>+++ b/hw/virtio/virtio-pci.c</div>\r\n" - "<div>@@ -17,6 +17,7 @@</div>\r\n" - "<div> </div>\r\n" - "<div> #include "qemu/osdep.h"</div>\r\n" - "<div> </div>\r\n" - "<div>+#include "exec/memop.h"</div>\r\n" - "<div> #include "standard-headers/linux/virtio_pci.h"</div>\r\n" - "<div> #include "hw/virtio/virtio.h"</div>\r\n" - "<div> #include "hw/pci/pci.h"</div>\r\n" - "<div>@@ -550,7 +551,8 @@ void virtio_address_space_write(VirtIOPCIProxy *proxy, hwaddr addr,</div>\r\n" - "<div> /* As length is under guest control, handle illegal values. */</div>\r\n" - "<div> return;</div>\r\n" - "<div> }</div>\r\n" - "<div>- memory_region_dispatch_write(mr, addr, val, len, MEMTXATTRS_UNSPECIFIED);</div>\r\n" - "<div>+ memory_region_dispatch_write(mr, addr, val, SIZE_MEMOP(len),</div>\r\n" - "<div>+ MEMTXATTRS_UNSPECIFIED);</div>\r\n" - "<div> }</div>\r\n" - "<div> </div>\r\n" - "<div> static void</div>\r\n" - "<div>@@ -573,7 +575,8 @@ virtio_address_space_read(VirtIOPCIProxy *proxy, hwaddr addr,</div>\r\n" - "<div> /* Make sure caller aligned buf properly */</div>\r\n" - "<div> assert(!(((uintptr_t)buf) & (len - 1)));</div>\r\n" - "<div> </div>\r\n" - "<div>- memory_region_dispatch_read(mr, addr, &val, len, MEMTXATTRS_UNSPECIFIED);</div>\r\n" - "<div>+ memory_region_dispatch_read(mr, addr, &val, SIZE_MEMOP(len),</div>\r\n" - "<div>+ MEMTXATTRS_UNSPECIFIED);</div>\r\n" - "<div> switch (len) {</div>\r\n" - "<div> case 1:</div>\r\n" - "<div> pci_set_byte(buf, val);</div>\r\n" - "<div>-- </div>\r\n" - "<div>1.8.3.1</div>\r\n" - "<div><br>\r\n" - "<br>\r\n" - "</div>\r\n" - "<p><br>\r\n" - "</p>\r\n" - "</body>\r\n" - "</html>\r\n" -464d5897a9fe71e1490b640eb9d57bf4567f555128b0786a5266732cb8aa1dd2 +408ebd4ec16acec29109780fcc789bb339e66fa1ec89374e79bf5ea945ee2019
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.