Re: [Qemu-devel] [PATCH 0/2] virtio len fixes for qemu.

2015-03-19 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Mon, Mar 16, 2015 at 01:44:22PM +1030, Rusty Russell wrote: diff --git a/content.tex b/content.tex index 6ba079d..2c946a5 100644 --- a/content.tex +++ b/content.tex @@ -600,10 +600,19 @@ them: it is only written to by the device, and read

Re: [Qemu-devel] virtio fixes pull for 4.0?

2015-03-16 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Mon, Mar 09, 2015 at 05:43:19PM +1030, Rusty Russell wrote: I think it's a good idea to merge these patches (maybe except the !TASK_RUNNING thing) sooner rather than later, to make sure people have the time to test the fixes properly. Would you

Re: [Qemu-devel] [PATCH 0/2] virtio len fixes for qemu.

2015-03-15 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Fri, Mar 13, 2015 at 11:47:18AM +1030, Rusty Russell wrote: Here's my proposed spec patch, which spells this out: diff --git a/content.tex b/content.tex index 6ba079d..b6345a8 100644 --- a/content.tex +++ b/content.tex @@ -600,10 +600,19

Re: [Qemu-devel] [PATCH 0/2] virtio len fixes for qemu.

2015-03-12 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Thu, Mar 12, 2015 at 11:34:35AM +1030, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: On Wed, Mar 11, 2015 at 10:06:40PM +1030, Rusty Russell wrote: Each entry in the ring is a pair: \field{id} indicates the head

Re: [Qemu-devel] [PATCH] uapi/virtio_scsi: allow overriding CDB/SENSE size

2015-03-12 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Wed, Mar 11, 2015 at 02:19:03PM +0100, Michael S. Tsirkin wrote: QEMU wants to use virtio scsi structures with a different VIRTIO_SCSI_CDB_SIZE/VIRTIO_SCSI_SENSE_SIZE, let's add ifdefs to allow overriding them. Keep the old defines under new

Re: [Qemu-devel] [PATCH 0/2] virtio len fixes for qemu.

2015-03-11 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Wed, Mar 11, 2015 at 10:06:40PM +1030, Rusty Russell wrote: Each entry in the ring is a pair: \field{id} indicates the head entry of the descriptor chain describing the buffer (this matches an entry placed in the available

Re: [Qemu-devel] [PATCH] virtio_rpmsg: set DRIVER_OK before using device

2015-03-11 Thread Rusty Russell
Ohad Ben-Cohen o...@wizery.com writes: On Mon, Mar 9, 2015 at 10:41 AM, Michael S. Tsirkin m...@redhat.com wrote: On Sat, Mar 07, 2015 at 08:06:56PM +0100, Michael S. Tsirkin wrote: virtio spec requires that all drivers set DRIVER_OK before using devices. While rpmsg isn't yet included in the

[Qemu-devel] [PATCH 1/2] virtio: make it clear that len for a used descriptor is len written.

2015-03-11 Thread Rusty Russell
And enforce this with a check that it's = the writable length. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- hw/virtio/virtio.c | 19 --- include/hw/virtio/virtio.h | 4 ++-- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/hw/virtio/virtio.c b/hw

[Qemu-devel] [PATCH 2/2] virtio-blk: fix length calculations for write operations.

2015-03-11 Thread Rusty Russell
We only fill in the 'req-qiov.size' bytes on a (successful) read, not on a write. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- hw/block/virtio-blk.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 258bb4c

[Qemu-devel] [PATCH 0/2] virtio len fixes for qemu.

2015-03-11 Thread Rusty Russell
. The first patch changes the 'len' formal parameter name to 'len_written' to make the API clearer, and adds an assert(). The second fixes block writes. Cheers, Rusty. PS. It's based on MST's virtio-1.0 tree, but should be easily ported. Rusty Russell (2): virtio: make it clear that len

Re: [Qemu-devel] [PATCH 0/2] virtio len fixes for qemu.

2015-03-11 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Wed, Mar 11, 2015 at 02:47:47PM +0800, Fam Zheng wrote: On Wed, 03/11 07:19, Michael S. Tsirkin wrote: On Wed, Mar 11, 2015 at 04:29:30PM +1030, Rusty Russell wrote: The virtio 'used' ring describes descriptors which have been used. It also

Re: [Qemu-devel] [PATCH 2/2] virtio-blk: fix length calculations for write operations.

2015-03-11 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Wed, Mar 11, 2015 at 04:29:32PM +1030, Rusty Russell wrote: We only fill in the 'req-qiov.size' bytes on a (successful) read, not on a write. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- hw/block/virtio-blk.c | 10 +- 1 file

Re: [Qemu-devel] [PATCH] virtio_rpmsg: set DRIVER_OK before using device

2015-03-09 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: virtio spec requires that all drivers set DRIVER_OK before using devices. While rpmsg isn't yet included in the virtio 1 spec, previous spec versions also required this. virtio rpmsg violates this rule: is calls kick before setting DRIVER_OK. The

Re: [Qemu-devel] virtio fixes pull for 4.0?

2015-03-09 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: Hi Rusty! There are a bunch of (mostly virtio 1.0 related) fixes for virtio that need to go into 4.0 I think. virtio_blk: typo fix virtio_blk: fix comment for virtio 1.0 OK, I've added these two. I tend to be overcautious after the

Re: [Qemu-devel] [PATCH 2/2] virtio-pci: switch to modern accessors for 1.0

2015-03-04 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Wed, Mar 04, 2015 at 11:06:08AM +1030, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: virtio 1.0 config space is in LE format for all devices, use modern wrappers when accessed through the 1.0 BAR. Hmm, I'm not so sure about

Re: [Qemu-devel] [PATCH 2/2] virtio-pci: switch to modern accessors for 1.0

2015-03-03 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: virtio 1.0 config space is in LE format for all devices, use modern wrappers when accessed through the 1.0 BAR. Hmm, I'm not so sure about these patches. It's easy to miss the existence of the _modern variants, and they're 90% the same as the legacy

Re: [Qemu-devel] [PATCH 2/2] virtio_blk: fix comment for virtio 1.0

2015-03-02 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: Fix up comment to match virtio 1.0 logic: virtio_blk_outhdr isn't the first elements anymore, the only requirement is that it comes first in the s/g list. Signed-off-by: Michael S. Tsirkin m...@redhat.com Thanks, both applied. Cheers, Rusty.

[Qemu-devel] Qemu and virtio 1.0

2015-02-24 Thread Rusty Russell
laptop, and a BE and LE guest on a BE powerpc machine, to check that all combinations work correctly. If others test too, that would be appreciated! Cheers, Rusty. From 95ac91554ed602f856a2a5fcc25eaffcad1b1c8d Mon Sep 17 00:00:00 2001 From: Rusty Russell ru...@rustcorp.com.au Date: Tue, 24 Feb 2015

Re: [Qemu-devel] [PATCH RFC 03/11] virtio: support more feature bits

2014-10-13 Thread Rusty Russell
Cornelia Huck cornelia.h...@de.ibm.com writes: With virtio-1, we support more than 32 feature bits. Let's make vdev-guest_features depend on the number of supported feature bits, allowing us to grow the feature bits automatically. It's a judgement call, but I would say that simply using

Re: [Qemu-devel] [PATCH RFC 08/11] virtio_blk: use virtio v1.0 endian

2014-10-13 Thread Rusty Russell
Cornelia Huck cornelia.h...@de.ibm.com writes: Note that we care only about the fields still in use for virtio v1.0. Reviewed-by: Thomas Huth th...@linux.vnet.ibm.com Reviewed-by: David Hildenbrand d...@linux.vnet.ibm.com Signed-off-by: Cornelia Huck cornelia.h...@de.ibm.com Hi Cornelia,

Re: [Qemu-devel] Using virtio for inter-VM communication

2014-06-12 Thread Rusty Russell
Jan Kiszka jan.kis...@siemens.com writes: On 2014-06-12 04:27, Rusty Russell wrote: Henning Schild henning.sch...@siemens.com writes: It was also never implemented, and remains a thought experiment. However, implementing it in lguest should be fairly easy. The reason why a trusted helper

Re: [Qemu-devel] Using virtio for inter-VM communication

2014-06-11 Thread Rusty Russell
Henning Schild henning.sch...@siemens.com writes: Hi, i am working on the jailhouse[1] project and am currently looking at inter-VM communication. We want to connect guests directly with virtual consoles based on shared memory. The code complexity in the hypervisor should be minimal, it

Re: [Qemu-devel] [PATCH v3 3/4] target-ppc: ppc can be either endian

2014-05-08 Thread Rusty Russell
Alexander Graf ag...@suse.de writes: On 05/07/2014 12:19 PM, Greg Kurz wrote: The uglyness about the current_cpu bit is that devices are usually not supposed to know about the cpu accesses come from usually. But then again devices shouldn't know about the endianness of a cpu either so I

Re: [Qemu-devel] [PATCH] virtio-rng: support multiple virtio-rng devices

2014-04-28 Thread Rusty Russell
Amos Kong ak...@redhat.com writes: Current hwrng core supports to register multiple hwrng devices, and there is only one device really works in the same time. QEMU alsu supports to have multiple virtio-rng backends. This patch changes virtio-rng driver to support multiple virtio-rng devices.

Re: [Qemu-devel] virtio device error reporting best practice?

2014-03-19 Thread Rusty Russell
Markus Armbruster arm...@redhat.com writes: Rusty Russell ru...@rustcorp.com.au writes: The litmus test: does *your* guest handle failures other than by giving up on the device? If so, sure, you need to have a sane error-reporting strategy. Err, isn't this a circular argument? No need

Re: [Qemu-devel] virtio device error reporting best practice?

2014-03-18 Thread Rusty Russell
Dave Airlie airl...@gmail.com writes: So I'm looking at how best to do virtio gpu device error reporting, and how to deal with illegal stuff, I've two levels of errors I want to support, a) unrecoverable or bad guest kernel programming errors, The QEMU standard approach is to exit at this

Re: [Qemu-devel] [PATCH 1/8] virtio_get_byteswap: function for endian-ambivalent targets using virtio.

2014-02-20 Thread Rusty Russell
--- /dev/null +++ b/include/hw/virtio/virtio-access.h @@ -0,0 +1,132 @@ +/* + * Virtio Accessor Support: In case your target can change endian. + * + * Copyright IBM, Corp. 2013 + * + * Authors: + * Rusty Russell ru...@au.ibm.com + * + * This work is licensed under the terms

Re: [Qemu-devel] [PATCH 1/8] virtio_get_byteswap: function for endian-ambivalent targets using virtio.

2014-02-20 Thread Rusty Russell
Alexander Graf ag...@suse.de writes: On 02/18/2014 05:17 PM, Cornelia Huck wrote: Hm. So whatever_le for 1.0 devices, and virtio_whatever (checking the byteswap value) for legacy devices? The device implementation will be aware of the virtio version anyway. Yeah, but I would hope we want to

Re: [Qemu-devel] [PATCH 0/7] virtio endian-ambivalent target fixes.

2013-11-19 Thread Rusty Russell
Thomas Huth th...@linux.vnet.ibm.com writes: On Thu, 17 Oct 2013 14:23:35 +1030 Rusty Russell ru...@rustcorp.com.au wrote: This is a re-transmit of the core of the virtio endian code. Since there seems to be some interest in ARM BE virtio, I've separated this from the direct problem I

Re: [Qemu-devel] QueuePFN peculiarity in virtio-mmio

2013-10-22 Thread Rusty Russell
Laszlo Ersek ler...@redhat.com writes: Hi, Appendix X: virtio-mmio in the virtio spec says Hi Laszlo, You're in luck! We're currently revising the virtio spec under the OASIS banner. I'd really like you to post your suggestion to their mailing list

[Qemu-devel] [PATCH 5/7] hw/block/virtio-blk: use virtio wrappers to access headers.

2013-10-16 Thread Rusty Russell
Note that st*_raw and ld*_raw are effectively replaced by st*_p and ld*_p. Signed-off-by: Rusty Russell ru...@rustcorp.com.au Reviewed-by: Anthony Liguori aligu...@us.ibm.com --- hw/block/virtio-blk.c | 35 ++- 1 file changed, 18 insertions(+), 17 deletions

[Qemu-devel] [PATCH 1/7] virtio_get_byteswap: function for endian-ambivalent targets using virtio.

2013-10-16 Thread Rusty Russell
(which is done before any driver is loaded) since it may involve a system call to get the status when running under kvm. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- hw/virtio/virtio.c| 6 ++ include/hw/virtio/virtio-access.h | 133

[Qemu-devel] [PATCH 7/7] hw/char/virtio-serial-bus: use virtio wrappers to access headers.

2013-10-16 Thread Rusty Russell
Signed-off-by: Rusty Russell ru...@rustcorp.com.au Reviewed-by: Anthony Liguori aligu...@us.ibm.com --- hw/char/virtio-serial-bus.c | 34 ++ 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c

[Qemu-devel] [PATCH 2/7] virtio: allow byte swapping for vring and config access

2013-10-16 Thread Rusty Russell
This is based on a simpler patch by Anthony Liguouri, which only handled the vring accesses. We also need some drivers to access these helpers, eg. for data which contains headers. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- hw/virtio/virtio.c | 28 ++-- 1

[Qemu-devel] [PATCH 6/7] hw/scsi/virtio-scsi: use virtio wrappers to access headers.

2013-10-16 Thread Rusty Russell
Note that st*_raw and ld*_raw are effectively replaced by st*_p and ld*_p. Signed-off-by: Rusty Russell ru...@rustcorp.com.au Reviewed-by: Anthony Liguori aligu...@us.ibm.com --- hw/scsi/virtio-scsi.c | 33 + 1 file changed, 17 insertions(+), 16 deletions(-) diff

[Qemu-devel] [PATCH 4/7] hw/net/virtio-balloon: use virtio wrappers to access page frame numbers.

2013-10-16 Thread Rusty Russell
Signed-off-by: Rusty Russell ru...@rustcorp.com.au Reviewed-by: Anthony Liguori aligu...@us.ibm.com --- hw/virtio/virtio-balloon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 9504877..97c4ac5 100644 --- a/hw

[Qemu-devel] [PATCH 3/7] hw/net/virtio-net: use virtio wrappers to access headers.

2013-10-16 Thread Rusty Russell
Signed-off-by: Rusty Russell ru...@rustcorp.com.au Reviewed-by: Anthony Liguori aligu...@us.ibm.com --- hw/net/virtio-net.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 22dbd05..431a4b6 100644 --- a/hw/net

[Qemu-devel] [PATCH 0/7] virtio endian-ambivalent target fixes.

2013-10-16 Thread Rusty Russell
This is a re-transmit of the core of the virtio endian code. Since there seems to be some interest in ARM BE virtio, I've separated this from the direct problem I was solving: PowerPC LE. Please apply! Rusty. Rusty Russell (7): virtio_get_byteswap: function for endian-ambivalent targets using

Re: [Qemu-devel] [PATCH 2/2] virtio: refresh registers at reset time

2013-10-15 Thread Rusty Russell
Greg Kurz gk...@linux.vnet.ibm.com writes: We need to support the guest endianness as soon as a virtio device shows up. Alex suggested this can achieved by calling cpu_synchronize_state(). To have it working on PowerPC, we need to add LPCR in the sync register functions. Signed-off-by: Greg

Re: [Qemu-devel] [PATCH] hw/9pfs/virtio_9p_device: use virtio wrappers to access headers.

2013-09-10 Thread Rusty Russell
Greg Kurz gk...@linux.vnet.ibm.com writes: Follow-up to Rusty's virtio endianness serie: enough to get a working virtfs mount. Note that st*_raw and ld*_raw are effectively replaced by st*_p and ld*_p. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com Thanks! I've reworked my patches in

Re: [Qemu-devel] [PATCH 1/8] virtio_get_byteswap: function for endian-ambivalent targets using virtio.

2013-09-05 Thread Rusty Russell
Benjamin Herrenschmidt b...@kernel.crashing.org writes: On Mon, 2013-08-12 at 17:29 +0930, Rusty Russell wrote: virtio data structures are defined as target endian, which assumes that's a fixed value. In fact, that actually means it's platform-specific. Hopefully the OASIS virtio 1.0 spec

Re: [Qemu-devel] Would virtio support 64 bit address for vring virtqueue?

2013-09-04 Thread Rusty Russell
Xie, Huawei huawei@intel.com writes: If this is the case, one possible fix would be: Write two continuous 32bit DWORD to combine a 64bit address Use the upper 12 bits of PFN val to indicate if it is combined write In this way, we wouldn't break other virtio driver, register

Re: [Qemu-devel] [PATCH 1/8] virtio_get_byteswap: function for endian-ambivalent targets using virtio.

2013-08-13 Thread Rusty Russell
Benjamin Herrenschmidt b...@kernel.crashing.org writes: On Tue, 2013-08-13 at 13:50 +0930, Rusty Russell wrote: We can have it call once (eg. when the first and storing the status word) and store the result. And fail with kexec of a different endian kernel :-) Let's not bother yet. Merge

[Qemu-devel] [PATCH 0/8] virtio for endian curious guests Take #2

2013-08-12 Thread Rusty Russell
The driver parts (patches 3-8) are unchanged, so didn't repost. 1) Rebased onto more recent git tree. 2) New stub is virtio_get_byteswap() 3) PPC64 uses endianness of first CPU interrupt vectors, not CPU endiannes. Hope this one is closer... Rusty. Rusty Russell (8): virtio_get_byteswap

Re: [Qemu-devel] [PATCH 1/7] virtio: allow byte swapping for vring and config access

2013-08-12 Thread Rusty Russell
Peter Maydell peter.mayd...@linaro.org writes: On 9 August 2013 08:35, Rusty Russell ru...@rustcorp.com.au wrote: That's a lot of replumbing and indirect function calls for a fairly obscure case. We certainly don't have a nice CPUState lying around in virtio at the moment, for example

[Qemu-devel] [PATCH 3/8] virtio: allow byte swapping for vring and config access

2013-08-12 Thread Rusty Russell
This is based on a simpler patch by Anthony Liguouri, which only handled the vring accesses. We also need some drivers to access these helpers, eg. for data which contains headers. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- hw/virtio/virtio.c | 29 +++-- 1

[Qemu-devel] [PATCH 1/8] virtio_get_byteswap: function for endian-ambivalent targets using virtio.

2013-08-12 Thread Rusty Russell
virtio data structures are defined as target endian, which assumes that's a fixed value. In fact, that actually means it's platform-specific. Hopefully the OASIS virtio 1.0 spec will fix this. Meanwhile, create a hook for little endian ppc. Signed-off-by: Rusty Russell ru...@rustcorp.com.au

[Qemu-devel] [PATCH 2/8] target-ppc: ppc64 target's virtio can be either endian.

2013-08-12 Thread Rusty Russell
We base it on the OS endian, as reflected by the endianness of the interrupt vectors. Suggested-by: Benjamin Herrenschmidt b...@kernel.crashing.org Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- target-ppc/misc_helper.c | 9 + 1 file changed, 9 insertions(+) diff --git a/target

Re: [Qemu-devel] [PATCH 1/8] virtio_get_byteswap: function for endian-ambivalent targets using virtio.

2013-08-12 Thread Rusty Russell
Anthony Liguori anth...@codemonkey.ws writes: Benjamin Herrenschmidt b...@kernel.crashing.org writes: On Mon, 2013-08-12 at 17:29 +0930, Rusty Russell wrote: virtio data structures are defined as target endian, which assumes that's a fixed value. In fact, that actually means it's platform

Re: [Qemu-devel] [PATCH 1/7] virtio: allow byte swapping for vring and config access

2013-08-11 Thread Rusty Russell
Anthony Liguori anth...@codemonkey.ws writes: Rusty Russell ru...@rustcorp.com.au writes: (Qemu run under eatmydata to eliminate syncs) FYI, cache=unsafe is equivalent to using eatmydata. Ah, thanks! I can reproduce this although I also see a larger standard deviation. BEFORE: MIN

Re: [Qemu-devel] [PATCH 1/7] virtio: allow byte swapping for vring and config access

2013-08-11 Thread Rusty Russell
Benjamin Herrenschmidt b...@kernel.crashing.org writes: This whole exercise should have nothing to do with the current endian mode of the CPU. If for example you are running lx86 (the x86 emulator IBM provides) which exploits MSR:LE on POWER7 to run x86 binaries in userspace, you don't want

Re: [Qemu-devel] [PATCH 1/7] virtio: allow byte swapping for vring and config access

2013-08-09 Thread Rusty Russell
Anthony Liguori anth...@codemonkey.ws writes: I suspect this is a premature optimization. With a weak function called directly in the accessors below, I suspect you would see no measurable performance overhead compared to this approach. It's all very predictable so the CPU should do a decent

Re: [Qemu-devel] [PATCH 1/7] virtio: allow byte swapping for vring and config access

2013-08-09 Thread Rusty Russell
Andreas Färber afaer...@suse.de writes: Am 08.08.2013 15:31, schrieb Anthony Liguori: Rusty Russell ru...@rustcorp.com.au writes: We have a mechanism to do weak functions via stubs/. I think it would be better to do cpu_get_byteswap() as a stub function and then overload it in the ppc64 code

Re: [Qemu-devel] [PATCH 1/7] virtio: allow byte swapping for vring and config access

2013-08-09 Thread Rusty Russell
Andreas Färber afaer...@suse.de writes: Am 08.08.2013 17:40, schrieb Anthony Liguori: Andreas Färber afaer...@suse.de writes: Am 08.08.2013 15:31, schrieb Anthony Liguori: We have a mechanism to do weak functions via stubs/. I think it would be better to do cpu_get_byteswap() as a stub

Re: [Qemu-devel] [PATCH 1/7] virtio: allow byte swapping for vring and config access

2013-08-08 Thread Rusty Russell
Andreas Färber afaer...@suse.de writes: Am 08.08.2013 15:31, schrieb Anthony Liguori: Rusty Russell ru...@rustcorp.com.au writes: Virtio is currently defined to work as guest endian, but this is a problem if the guest can change endian. As most targets can't change endian, we make it a per

Re: [Qemu-devel] [PATCH 1/7] virtio: allow byte swapping for vring and config access

2013-08-08 Thread Rusty Russell
Anthony Liguori anth...@codemonkey.ws writes: Daniel P. Berrange berra...@redhat.com writes: On Thu, Aug 08, 2013 at 10:40:28AM -0500, Anthony Liguori wrote: Andreas Färber afaer...@suse.de writes: We have a mechanism to do weak functions via stubs/. I think it would be better to do

[Qemu-devel] [PATCH 7/7] hw/char/virtio-serial-bus: use virtio wrappers to access headers.

2013-08-07 Thread Rusty Russell
Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- hw/char/virtio-serial-bus.c | 34 ++ 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c index cc3d1dd..0421725 100644 --- a/hw/char/virtio

[Qemu-devel] [PATCH 3/7] hw/net/virtio-net: use virtio wrappers to access headers.

2013-08-07 Thread Rusty Russell
Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- hw/net/virtio-net.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 1ea9556..e77e28d 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -21,6 +21,7

[Qemu-devel] [PATCH 6/7] hw/scsi/virtio-scsi: use virtio wrappers to access headers.

2013-08-07 Thread Rusty Russell
Note that st*_raw and ld*_raw are effectively replaced by st*_p and ld*_p. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- hw/scsi/virtio-scsi.c | 33 + 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio

[Qemu-devel] [PATCH 0/7] Virtio support for endian-curious guests.

2013-08-07 Thread Rusty Russell
Virtio is currently defined as guest-endian, but that's a slippery concept when the target can change endian. In particular, virtio devices fail on little-endian powerpc 64. Feedback welcome! Rusty. Rusty Russell (7): virtio: allow byte swapping for vring and config access target-ppc: ppc64

[Qemu-devel] [PATCH 2/7] target-ppc: ppc64 targets can be either endian.

2013-08-07 Thread Rusty Russell
Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- configure| 1 + target-ppc/misc_helper.c | 8 2 files changed, 9 insertions(+) diff --git a/configure b/configure index ad32f87..cee32af 100755 --- a/configure +++ b/configure @@ -4217,6 +4217,7 @@ case $target_name

[Qemu-devel] [PATCH 7/7] patch virtio-serial-biendian.patch

2013-08-07 Thread Rusty Russell
--- hw/char/virtio-serial-bus.c | 34 ++ 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c index cc3d1dd..0421725 100644 --- a/hw/char/virtio-serial-bus.c +++ b/hw/char/virtio-serial-bus.c @@

[Qemu-devel] [PATCH 1/7] virtio: allow byte swapping for vring and config access

2013-08-07 Thread Rusty Russell
also need some drivers to access these helpers, eg. for data which contains headers. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- hw/virtio/virtio.c| 46 + include/hw/virtio/virtio-access.h | 138 ++ 2 files changed, 170

[Qemu-devel] [PATCH 5/7] hw/block/virtio-blk: use virtio wrappers to access headers.

2013-08-07 Thread Rusty Russell
Note that st*_raw and ld*_raw are effectively replaced by st*_p and ld*_p. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- hw/block/virtio-blk.c | 35 ++- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/hw/block/virtio-blk.c b/hw/block

Re: [Qemu-devel] vhost acceleration broken?

2013-07-28 Thread Rusty Russell
Anthony Liguori anth...@codemonkey.ws writes: Michael S. Tsirkin m...@redhat.com writes: On Thu, Jul 25, 2013 at 04:56:05PM +0200, Andreas Färber wrote: Am 25.07.2013 16:52, schrieb Michael S. Tsirkin: On Thu, Jul 25, 2013 at 08:28:00AM -0500, Anthony Liguori wrote: We have a pretty awful

[Qemu-devel] vhost acceleration broken?

2013-07-24 Thread Rusty Russell
Hi all, Using latest kernel and master qemu, the following doesn't use vhost acceleration: sudo qemu-system-x86_64 -machine pc,accel=kvm $ARGS -m 1024 -net tap,script=/home/rusty/bin/kvm-ifup,downscript=no,vhost=on -net nic,model=virtio -drive

Re: [Qemu-devel] vhost acceleration broken?

2013-07-24 Thread Rusty Russell
Anthony Liguori anth...@codemonkey.ws writes: On Wed, Jul 24, 2013 at 8:55 PM, Rusty Russell ru...@rustcorp.com.au wrote: Hi all, Using latest kernel and master qemu, the following doesn't use vhost acceleration: sudo qemu-system-x86_64 -machine pc,accel=kvm $ARGS -m 1024 -net tap

Re: [Qemu-devel] [PATCH] virtio-net: put virtio net header inline with data

2013-07-12 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Tue, Jul 09, 2013 at 11:46:23AM +0930, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: For small packets we can simplify xmit processing by linearizing buffers with the header: most packets seem to have enough head room we can

Re: [Qemu-devel] virtio indirect with lots of descriptors

2013-07-09 Thread Rusty Russell
Dave Airlie airl...@gmail.com writes: Hi Rusty, playing with my virtio gpu, I started hitting the qemu error_report(Too many read descriptors in indirect table); Now I'm not sure but this doesn't seem to be a virtio limit that the guest catches from what I can see, since my host dies quite

Re: [Qemu-devel] [PATCH RFC] virtio-pci: support config layout in BAR1

2013-06-06 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: Some setups don't support enabling BAR0 (IO BAR). Reasons range from CPU limitations (e.g. on some powerpc setups) to architecture limmitations (e.g. a setup with 15 PCI bridges, with one virtio device behind each, on x86). PCI Express spec made IO

Re: [Qemu-devel] [PATCH] virtio-net: put virtio net header inline with data

2013-06-06 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: For small packets we can simplify xmit processing by linearizing buffers with the header: most packets seem to have enough head room we can use for this purpose. Since some older hypervisors (e.g. qemu before version 1.5) required that header is the

Re: [Qemu-devel] updated: kvm networking todo wiki

2013-06-02 Thread Rusty Russell
Anthony Liguori anth...@codemonkey.ws writes: Michael S. Tsirkin m...@redhat.com writes: On Thu, May 30, 2013 at 08:40:47AM -0500, Anthony Liguori wrote: Stefan Hajnoczi stefa...@gmail.com writes: On Thu, May 30, 2013 at 7:23 AM, Rusty Russell ru...@rustcorp.com.au wrote: Anthony

Re: [Qemu-devel] updated: kvm networking todo wiki

2013-05-30 Thread Rusty Russell
Stefan Hajnoczi stefa...@gmail.com writes: On Thu, May 30, 2013 at 7:23 AM, Rusty Russell ru...@rustcorp.com.au wrote: On the receive side, what can we do better than readv? If we need to return to userspace to tell the guest that we've got a new packet, we don't win on latency. We might

Re: [Qemu-devel] updated: kvm networking todo wiki

2013-05-29 Thread Rusty Russell
Anthony Liguori anth...@codemonkey.ws writes: Rusty Russell ru...@rustcorp.com.au writes: On Fri, May 24, 2013 at 08:47:58AM -0500, Anthony Liguori wrote: FWIW, I think what's more interesting is using vhost-net as a networking backend with virtio-net in QEMU being what's guest facing

Re: [Qemu-devel] updated: kvm networking todo wiki

2013-05-28 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Fri, May 24, 2013 at 08:47:58AM -0500, Anthony Liguori wrote: Michael S. Tsirkin m...@redhat.com writes: On Fri, May 24, 2013 at 05:41:11PM +0800, Jason Wang wrote: On 05/23/2013 04:50 PM, Michael S. Tsirkin wrote: Hey guys, I've updated

Re: [Qemu-devel] [PATCH v2 00/11] qemu: use virtio linux headers in portable code

2013-05-28 Thread Rusty Russell
Anthony Liguori anth...@codemonkey.ws writes: The headers say they are BSD licensed... but they include a GPLv2+ header. Doesn't make a lot of sense, does it? It makes perfect sense: you're overthinking it. It just means that copying the BSD headers outside Linux is encouraged. And it's

Re: [Qemu-devel] [PATCH v2 00/11] qemu: use virtio linux headers in portable code

2013-05-28 Thread Rusty Russell
Anthony Liguori anth...@codemonkey.ws writes: Rusty Russell ru...@rustcorp.com.au writes: Anthony Liguori anth...@codemonkey.ws writes: Paolo Bonzini pbonz...@redhat.com writes: Il 26/05/2013 22:02, Michael S. Tsirkin ha scritto: My fault. I should have looked at linux/types.h (actually

Re: [Qemu-devel] [PATCH v2 00/11] qemu: use virtio linux headers in portable code

2013-05-27 Thread Rusty Russell
Anthony Liguori anth...@codemonkey.ws writes: Paolo Bonzini pbonz...@redhat.com writes: Il 26/05/2013 22:02, Michael S. Tsirkin ha scritto: My fault. I should have looked at linux/types.h (actually asm-generic/). Not really, __uX appear in the headers that were posted. Which is a

Re: [Qemu-devel] [PATCH 1/2 V4] virtio-spec: dynamic network offloads configuration

2013-05-21 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Mon, May 20, 2013 at 03:43:51PM +0200, Paolo Bonzini wrote: Is there a story behind skipping virtio-net feature bits 2..4? Paolo Bits 3-4 now :) I'm curious too. Not a good one :) The year is 2007. virtio_net was the posterchild of free

Re: [Qemu-devel] [PATCH 0/1 V4] virtio-net: dynamic network offloads configuration

2013-04-21 Thread Rusty Russell
Dmitry Fleytman dmi...@daynix.com writes: Spec patch already inside. Sent from my iPad On Apr 20, 2013, at 8:04 PM, Michael S. Tsirkin m...@redhat.com wrote: On Fri, Apr 19, 2013 at 10:10:01AM +0300, Dmitry Fleytman wrote: Hello All, Any news regarding this patch? Thanks, Dmitry

Re: [Qemu-devel] [PATCH 1/2 V3] virtio-spec: dynamic network offloads configuration

2013-04-03 Thread Rusty Russell
Dmitry Fleytman dmi...@daynix.com writes: From: Dmitry Fleytman dfley...@redhat.com Virtio-net driver currently negotiates network offloads on startup via features mechanism and have no ability to change offloads state later. This patch introduced a new control command that allows to

Re: [Qemu-devel] [RFC qemu PATCH] only writing out the last byte of MAC makes it have effect

2013-03-21 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Thu, Mar 21, 2013 at 02:44:50PM +0800, Amos Kong wrote: The lengcy guests don't have mac programming command, we don't know when it's safe to use MAC. This patch changed qemu to makes MAC change effect when the last byte of MAC is written to config

Re: [Qemu-devel] virtio-s390: document GPR4/GPR2 cookie values

2013-03-12 Thread Rusty Russell
Cornelia Huck cornelia.h...@de.ibm.com writes: On Thu, 7 Mar 2013 20:02:21 +0200 Michael S. Tsirkin m...@redhat.com wrote: virtio-s390 on kvm can use a cookie value passed to guest s/virtio-s390/virtio-ccw/ (to avoid confusion with s390-virtio, which was never specced) to optimize

Re: [Qemu-devel] Headsup: windows virtio networking does not work on current git

2013-02-06 Thread Rusty Russell
Vadim Rozenfeld vroze...@redhat.com writes: On Tue, 2013-02-05 at 13:58 +0200, Michael S. Tsirkin wrote: On Tue, Feb 05, 2013 at 03:45:38PM +0400, Michael Tokarev wrote: Is it really that bad that the config space size changed? Why it has this effect? Because in this case it's hard to

Re: [Qemu-devel] Headsup: windows virtio networking does not work on current git

2013-02-06 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: Maybe we should ask for some centrally assigned vendor id? We could ask IANA to keep the database. Or we could make it the task of the virtio spec. I don't think it's vital... Cheers, Rusty.

Re: [Qemu-devel] Headsup: windows virtio networking does not work on current git

2013-02-05 Thread Rusty Russell
Anthony Liguori anth...@codemonkey.ws writes: Rusty Russell ru...@rustcorp.com.au writes: If I could find a way, I'd like to create some code as an appendix to the virtio spec which would torture test each driver and/or device by configuring it in strange ways. But that's pure speculation

Re: [Qemu-devel] Headsup: windows virtio networking does not work on current git

2013-02-03 Thread Rusty Russell
Anthony Liguori anth...@codemonkey.ws writes: Michael Tokarev m...@tls.msk.ru writes: 03.02.2013 17:23, Yan Vugenfirer wrote: If it helps, mq changes the config size from 8 to 16 bytes. If the driver was making an assumption about an 8-byte config size, that's likely what the problem is.

Re: [Qemu-devel] [QEMU PATCH v2] virtio-net: introduce a new macaddr control

2013-01-16 Thread Rusty Russell
ak...@redhat.com writes: @@ -349,6 +351,14 @@ static int virtio_net_handle_mac(VirtIONet *n, uint8_t cmd, { struct virtio_net_ctrl_mac mac_data; +if (cmd == VIRTIO_NET_CTRL_MAC_ADDR_SET elem-out_num == 2 +elem-out_sg[1].iov_len == ETH_ALEN) { +/* Set MAC

Re: [Qemu-devel] [RFC PATCH 0/2] make mac programming for virtio net more robust

2013-01-10 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Thu, Jan 10, 2013 at 10:45:39PM +0800, ak...@redhat.com wrote: From: Amos Kong ak...@redhat.com Currenly mac is programmed byte by byte. This means that we have an intermediate step where mac is wrong. Second patch introduced a new vq

Re: [Qemu-devel] [RFC PATCH 2/2] virtio-net: introduce a new control to set macaddr

2013-01-10 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: +if (virtio_has_feature(vdev, VIRTIO_NET_F_MAC)) { +/* Set MAC address by writing config space */ vdev-config-set(vdev, offsetof(struct virtio_net_config, mac), dev-dev_addr, dev-addr_len);

Re: [Qemu-devel] [PATCH v6 12/12] virtio-blk: add x-data-plane=on|off performance feature

2012-12-19 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Tue, Dec 18, 2012 at 03:57:17PM +0100, Stefan Hajnoczi wrote: @@ -407,6 +409,14 @@ static void virtio_blk_handle_output(VirtIODevice *vdev, VirtQueue *vq) .num_writes = 0, }; +/* Some guests kick before setting

Re: [Qemu-devel] [PATCH 3/4] virtio: modify savevm to have a stable wire format

2012-12-13 Thread Rusty Russell
Anthony Liguori anth...@codemonkey.ws writes: Rusty Russell ru...@rustcorp.com.au writes: Anthony Liguori aligu...@us.ibm.com writes: We were memcpy()'ing a structure to the wire :-/ Since savevm really only works on x86 today, lets just declare that this element is sent over the wire

Re: [Qemu-devel] [PATCHv2] virtio: verify that all outstanding buffers are flushed

2012-12-13 Thread Rusty Russell
Anthony Liguori aligu...@us.ibm.com writes: Yes, take a look at the series I sent out that scrubs all of this to just send the index and the addresses of the element. We technically should save the addresses and sizes too. It makes it a heck of a lot safer then re-reading guest memory since

Re: [Qemu-devel] [PATCH] virtio: verify that all outstanding buffers are flushed (was Re: vmstate conversion for virtio?)

2012-12-10 Thread Rusty Russell
Anthony Liguori anth...@codemonkey.ws writes: Rusty Russell ru...@rustcorp.com.au writes: Michael S. Tsirkin m...@redhat.com writes: No, because I don't understand it. Is it true for the case of virtio_blk, which has outstanding requests? Currently we dump a massive structure; it's

Re: [Qemu-devel] [PATCH 3/4] virtio: modify savevm to have a stable wire format

2012-12-10 Thread Rusty Russell
Anthony Liguori aligu...@us.ibm.com writes: We were memcpy()'ing a structure to the wire :-/ Since savevm really only works on x86 today, lets just declare that this element is sent over the wire as a little endian value in order to fix the bitness. Unfortunately, we also send raw pointers

Re: [Qemu-devel] [PATCH] virtio: verify that all outstanding buffers are flushed (was Re: vmstate conversion for virtio?)

2012-12-06 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Thu, Dec 06, 2012 at 04:33:06PM +1030, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: Add sanity check to address the following concern: On Wed, Dec 05, 2012 at 09:47:22AM +1030, Rusty Russell wrote: All we need is the index

Re: [Qemu-devel] [PATCH] virtio: verify that all outstanding buffers are flushed (was Re: vmstate conversion for virtio?)

2012-12-05 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: Add sanity check to address the following concern: On Wed, Dec 05, 2012 at 09:47:22AM +1030, Rusty Russell wrote: All we need is the index of the request; the rest can be re-read from the ring. The terminology I used here was loose, indeed. We need

Re: [Qemu-devel] vmstate conversion for virtio?

2012-12-04 Thread Rusty Russell
Juan Quintela quint...@redhat.com writes: Rusty Russell ru...@rustcorp.com.au wrote: Hi all, I want to rework the qemu virtio subsystem, but various structures are currently blatted to disk in save/load. So I looked at altering that, only to discover that it needs conversion

[Qemu-devel] vmstate conversion for virtio?

2012-12-03 Thread Rusty Russell
Hi all, I want to rework the qemu virtio subsystem, but various structures are currently blatted to disk in save/load. So I looked at altering that, only to discover that it needs conversion to vmstate, and 2009 patches in patchwork which have never been applied. Has there been any

Re: [Qemu-devel] [PATCH] virtio-scsi Fix some endian bugs with virtio-scsi

2012-12-02 Thread Rusty Russell
is never actually touched. The tag field is a uint64_t, but since its value is completely arbitrary, it might as well be uint8_t[8] and so it does not need swapping. Cc: Paolo Bonzini pbonz...@redhat.com Cc: Paul 'Rusty' Russell ru...@rustcorp.com.au Signed-off-by: David Gibson da

  1   2   3   >