Re: [PATCH] virtio: Prevent double swap due to target pre 1.0 VirtIO

2020-01-10 Thread André Silva
> Unrelated, -enable-kvm isn't needed since... Thanks. > Could you try your patch against master with if=virtio and the > -global above ? There you go! I got the same error as you! This looks like the only case that makes slof complain. If I use virtio-blk without the -global option slof works

Re: [PATCH] virtio: Prevent double swap due to target pre 1.0 VirtIO

2020-01-10 Thread Greg Kurz
On Fri, 10 Jan 2020 09:00:50 -0300 André Silva wrote: > > What are the symptoms without your patch ? What's the QEMU version ? > > If using virtio for networking, guest vtnet0 interface appears with > 'status: no carrier'. Applying the patch the interface appears as > 'status: active' and works

Re: [PATCH] virtio: Prevent double swap due to target pre 1.0 VirtIO

2020-01-10 Thread André Silva
> What are the symptoms without your patch ? What's the QEMU version ? If using virtio for networking, guest vtnet0 interface appears with 'status: no carrier'. Applying the patch the interface appears as 'status: active' and works normally. I tested with branches stable-4.1 and master. > Do you

Re: [PATCH] virtio: Prevent double swap due to target pre 1.0 VirtIO

2020-01-10 Thread Greg Kurz
On Thu, 9 Jan 2020 18:18:57 -0300 André Silva wrote: > Hi Greg, > Hi André, > Thanks for the commit info. > But I'm testing in this scenario, that is, a ppc64le host with a ppc64 > BE guest, and without my patch I can't get virtio to work. The patch What are the symptoms without your patch ?

Re: [PATCH] virtio: Prevent double swap due to target pre 1.0 VirtIO

2020-01-09 Thread André Silva
Hi Greg, Thanks for the commit info. But I'm testing in this scenario, that is, a ppc64le host with a ppc64 BE guest, and without my patch I can't get virtio to work. The patch makes virtio 0.95 (legacy) net, scsi, blk work. I don't get the firmware error. I also tested with a ppc64le guest and

Re: [PATCH] virtio: Prevent double swap due to target pre 1.0 VirtIO

2020-01-09 Thread Greg Kurz
On Thu, 9 Jan 2020 07:39:17 -0500 "Michael S. Tsirkin" wrote: > On Thu, Jan 09, 2020 at 09:25:42AM -0300, André Silva wrote: > > Hi Michael! > > Thanks for reviewing the patch! > > > > > we always get LE values from memory subsystem, > > > not target endian values: > > > > I see. So do you

Re: [PATCH] virtio: Prevent double swap due to target pre 1.0 VirtIO

2020-01-09 Thread Michael S. Tsirkin
On Thu, Jan 09, 2020 at 09:25:42AM -0300, André Silva wrote: > Hi Michael! > Thanks for reviewing the patch! > > > we always get LE values from memory subsystem, > > not target endian values: > > I see. So do you think the patch is correct in eliminating the extra > swap (as virtio_config_readw

Re: [PATCH] virtio: Prevent double swap due to target pre 1.0 VirtIO

2020-01-09 Thread André Silva
Hi Michael! Thanks for reviewing the patch! > we always get LE values from memory subsystem, > not target endian values: I see. So do you think the patch is correct in eliminating the extra swap (as virtio_config_readw for example already makes a swap)? Thanks, andré On Thu, Jan 9, 2020 at

Re: [PATCH] virtio: Prevent double swap due to target pre 1.0 VirtIO

2020-01-09 Thread Michael S. Tsirkin
On Wed, Jan 08, 2020 at 01:16:18PM -0300, Andre Silva wrote: > Remove the bswap function calls after reading and before writing > memory bytes in virtio_pci_config_read and virtio_pci_config_write > because they are reverting back an already swapped bytes. > > Consider the table below in the

Re: [PATCH] virtio: Prevent double swap due to target pre 1.0 VirtIO

2020-01-08 Thread André Silva
Yes, it looks like. virtio_pci_config_read is called via a pointer from memory_region_read_accessor and memory_region_write_accessor calls virtio_pci_config_write. I tested the patch in a linux/ppc64 host with a FreeBSD/ppc64 guest and VirtIO 0.9 (legacy) driver and from what I saw the config area

Re: [PATCH] virtio: Prevent double swap due to target pre 1.0 VirtIO

2020-01-08 Thread Peter Maydell
On Wed, 8 Jan 2020 at 16:20, Andre Silva wrote: > > Remove the bswap function calls after reading and before writing > memory bytes in virtio_pci_config_read and virtio_pci_config_write > because they are reverting back an already swapped bytes Is "because we wrote it via

[PATCH] virtio: Prevent double swap due to target pre 1.0 VirtIO

2020-01-08 Thread Andre Silva
Remove the bswap function calls after reading and before writing memory bytes in virtio_pci_config_read and virtio_pci_config_write because they are reverting back an already swapped bytes. Consider the table below in the context of virtio_pci_config_read function. Host Target

Re: [PATCH] virtio: Prevent double swap due to target pre 1.0 VirtIO

2020-01-08 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200108125658.208480-2-afscoe...@gmail.com/ Hi, This series seems to have some coding style problems. See output below for more information: Subject: [PATCH] virtio: Prevent double swap due to target pre 1.0 VirtIO Type: series Message-id

[PATCH] virtio: Prevent double swap due to target pre 1.0 VirtIO

2020-01-08 Thread Andre Silva
Remove the bswap function calls after reading and before writing memory bytes in virtio_pci_config_read and virtio_pci_config_write because they are reverting back an already swapped bytes. Consider the table below in the context of virtio_pci_config_read function. Host Target

[PATCH] virtio: Prevent double swap due to target pre 1.0 VirtIO

2020-01-08 Thread Andre Silva
Remove the bswap function calls after reading and before writing memory bytes in virtio_pci_config_read and virtio_pci_config_write because they are reverting back an already swapped bytes. Consider the table below in the context of virtio_pci_config_read function. Host Target