Re: [PATCH] maintainers: drop Chris Wright from pvops

2017-10-26 Thread Rusty Russell
xt > > PARAVIRT_OPS INTERFACE > M: Juergen Gross > -M: Chris Wright > M: Alok Kataria > M: Rusty Russell > L: virtualization@lists.linux-foundation.org > -- > 2.12.3 ___ Virtualization mailing list Virtualizat

Re: [PATCH] paravirt: remove paravirt ops pmd_update[_defer] and pte_update_defer

2015-11-24 Thread Rusty Russell
Juergen Gross writes: > Ping? Acked-by: Rusty Russell Cheers, Rusty. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH] x86/paravirt: remove unused operation

2015-08-30 Thread Rusty Russell
Juergen Gross writes: > Ping? Acked-by: Rusty Russell Cheers, Rusty. > On 08/06/2015 01:55 PM, Juergen Gross wrote: >> Remove the paravirt operation "get_tsc_khz" as it is used nowhere. >> >> Signed-off-by: Juergen Gross >> --- >> arch/x86/

Re: virtio-net: why not always to set avail->flags to VRING_AVAIL_F_NO_INTERRUPT

2015-06-04 Thread Rusty Russell
Linhaifeng writes: > On 2015/6/4 9:13, Rusty Russell wrote: >> Linhaifeng writes: >>> Hi, >>> >>> I'm a newbie and have a question about vring_new_virtqueue function. >>> >>> Why we set avail->flags to VRING_AVAIL_F_NO_INTERRUP

Re: virtio-net: why not always to set avail->flags to VRING_AVAIL_F_NO_INTERRUPT

2015-06-03 Thread Rusty Russell
Linhaifeng writes: > Hi, > > I'm a newbie and have a question about vring_new_virtqueue function. > > Why we set avail->flags to VRING_AVAIL_F_NO_INTERRUPT when no callbacks? > I think we should set avail->flags to VRING_AVAIL_F_NO_INTERRUPT even if no > callbacks. Hi Linhaifeng, Not su

Re: [RFC 4/4] rpmsg: DMA map sgs passed to virtio

2015-05-06 Thread Rusty Russell
"Edgar E. Iglesias" writes: > From: "Edgar E. Iglesias" > > Signed-off-by: Edgar E. Iglesias First off, I have handed maintainership off to Michael S. Tsirkin, so his word is now law. That said... there's nothing fundamentally *wrong* with this, but it's not how standard virtio works. We deci

[PATCH] virtio: pass baton to Michael Tsirkin

2015-05-01 Thread Rusty Russell
el! Signed-off-by: Rusty Russell diff --git a/MAINTAINERS b/MAINTAINERS index 2e5bbc0d68b2..16227759dfa8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -10523,7 +10523,6 @@ F: include/linux/virtio_console.h F: include/uapi/linux/virtio_console.h VIRTIO CORE, NET AND BLOCK DRIVERS

Re: [PATCH] virtio: fix typo in vring_need_event() doc comment

2015-04-20 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Sun, Apr 19, 2015 at 02:36:38PM +0930, Rusty Russell wrote: >> Stefan Hajnoczi writes: >> > Here the "other side" refers to the guest or host. >> > >> > Signed-off-by: Stefan Hajnoczi >> >&

Re: [PATCH] virtio: fix typo in vring_need_event() doc comment

2015-04-19 Thread Rusty Russell
Stefan Hajnoczi writes: > Here the "other side" refers to the guest or host. > > Signed-off-by: Stefan Hajnoczi Applied. Thanks! Rusty. > --- > include/uapi/linux/virtio_ring.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/uapi/linux/virtio_ring.h > b/inclu

Re: [PATCH v3 0/6] virtio_balloon: virtio 1 support

2015-04-14 Thread Rusty Russell
these changes merged in: >> >> Acked-by: Cornelia Huck > > > OK, here's an updated incremental patch: only comment > changed. OK, I've merged this with one change: +static void stats_sg_init(struct virtio_balloon *vb, struct scatterlist *sg) +{ + sg_init_

Re: [PATCH] virtio_balloon: drop virtio_balloon_stat_modern

2015-04-14 Thread Rusty Russell
Cornelia Huck writes: > On Tue, 14 Apr 2015 12:01:13 +0200 > "Michael S. Tsirkin" wrote: > >> Looks like we are better off sticking with the misaligned stat struct, >> to reduce the amount of virtio 1 specific code in balloon. So let's do >> it. >> >> Add a detailed comment to reduce the chance

Re: [PATCH v3 0/6] virtio_balloon: virtio 1 support

2015-04-13 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Wed, Apr 01, 2015 at 02:57:35PM +0200, Michael S. Tsirkin wrote: >> Virtio 1.0 doesn't include a modern balloon device. At some point we'll >> likely >> define an incompatible interface with a different ID and different >> semantics. But for now, it's not a big

Re: [PATCH] virtio_ring: Update weak barriers to use dma_wmb/rmb

2015-04-10 Thread Rusty Russell
Alexander Duyck writes: > This change makes it so that instead of using smp_wmb/rmb which varies > depending on the kernel configuration we can can use dma_wmb/rmb which for > most architectures should be equal to or slightly more strict than > smp_wmb/rmb. > > The advantage to this is that these

Re: [PATCH] virtio_config: reorder functions

2015-04-10 Thread Rusty Russell
Cornelia Huck writes: > On Wed, 8 Apr 2015 16:49:46 +0200 > "Michael S. Tsirkin" wrote: > >> On Tue, Mar 31, 2015 at 05:17:25PM +0200, Michael S. Tsirkin wrote: >> > This simply reorders functions in virtio_config >> > so width access wrapper helpers are all together. >> > Drops an extra empty li

[PATCH net-next] netdevice: document NETDEV_TX_BUSY deprecation.

2015-04-03 Thread Rusty Russell
This paraphrases DaveM (and steals some of his words) explaining why a device shouldn't return NETDEV_TX_BUSY, even though it looks so inviting to driver authors. See http://www.spinics.net/lists/netdev/msg322350.html Inspired-by: David Miller Signed-off-by: Rusty Russell diff --git a/in

Re: [PATCH v2 1/6] virtio_balloon: transitional interface

2015-04-01 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Wed, Apr 01, 2015 at 02:17:23PM +1030, Rusty Russell wrote: >> I would leave the device *exactly* as is, ugly structure packing and >> all. > > But why? It's going to be used for years, might as well make it clean? Because

Re: [PATCH v2 1/6] virtio_balloon: transitional interface

2015-03-31 Thread Rusty Russell
"Michael S. Tsirkin" writes: > Virtio 1.0 doesn't include a modern balloon device. > But it's not a big change to support a transitional > balloon device: this has the advantage of supporting > existing drivers, transparently. You decided to fix the packed struct... > diff --git a/drivers/virtio

Re: [PATCH] virtio: drop a useless config read

2015-03-31 Thread Rusty Russell
Cornelia Huck writes: > On Tue, 31 Mar 2015 13:55:42 +0200 > "Michael S. Tsirkin" wrote: > >> commit d71de9ec6ba806104439d3a669befda84757b5af >> "virtio: core support for config generation" >> fixed reading up 64 bit values, adding generation >> checks for such reads. >> >> By mistake, it le

Re: [PATCH v5] Add virtio-input driver.

2015-03-26 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Thu, Mar 26, 2015 at 11:49:25AM +0100, Gerd Hoffmann wrote: >> virtio-input is basically evdev-events-over-virtio, so this driver isn't >> much more than reading configuration from config space and forwarding >> incoming events to the linux input layer. >> >> Sig

Re: [PATCH v4] Add virtio-input driver.

2015-03-25 Thread Rusty Russell
Vojtech Pavlik writes: > On Wed, Mar 25, 2015 at 01:51:43PM +1030, Rusty Russell wrote: >> Imagine a future virtio standard which incorporates this. And a Windows >> or FreeBSD implementation of the device and or driver. How ugly would >> they be? > > A windows trans

Re: [PATCH v4] Add virtio-input driver.

2015-03-24 Thread Rusty Russell
Gerd Hoffmann writes: > virtio-input is basically evdev-events-over-virtio, so this driver isn't > much more than reading configuration from config space and forwarding > incoming events to the linux input layer. > > Signed-off-by: Gerd Hoffmann Is the input layer sane? I've never dealt with it

Re: [PATCH net-next] virtio: change comment in transmit

2015-03-24 Thread Rusty Russell
Stephen Hemminger writes: > The original comment was not really informative or funny > as well as sexist. Replace it with a better explanation of > why the driver does stop and what the impacts are. > > Signed-off-by: Stephen Hemminger Fair call. Comment was certainly snarky, probably sexist.

Re: virtio fixes pull for 4.0?

2015-03-16 Thread Rusty Russell
"Michael S. Tsirkin" 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 >> > th

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

2015-03-12 Thread Rusty Russell
"Michael S. Tsirkin" 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 names:

Re: [PATCH v2 log fixed] virtio_mmio: fix endian-ness for mmio

2015-03-12 Thread Rusty Russell
"Michael S. Tsirkin" writes: > Subject: [PATCH] virtio_mmio: fix access width for mmio Just for the record: Applied. Thanks, Rusty. > Going over the virtio mmio code, I noticed that it doesn't correctly > access modern device config values using "natural" accessors: it uses > readb to get/set

Re: [PATCH] 9p/trans_virtio: fix hot-unplug

2015-03-12 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Thu, Mar 12, 2015 at 11:54:10AM +1030, Rusty Russell wrote: >> "Michael S. Tsirkin" writes: >> > On device hot-unplug, 9p/virtio currently will kfree channel while >> > it might still be in use. >> >

Re: [PATCH] virtio_mmio: fix endian-ness for mmio

2015-03-12 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Thu, Mar 12, 2015 at 12:33:36PM +1030, Rusty Russell wrote: >> "Michael S. Tsirkin" writes: >> > Going over the virtio mmio code, I noticed that it doesn't correctly >> > return device config values in LE

Re: [PATCH] virtio_mmio: fix endian-ness for mmio

2015-03-11 Thread Rusty Russell
"Michael S. Tsirkin" writes: > Going over the virtio mmio code, I noticed that it doesn't correctly > return device config values in LE format when using virtio 1.0. > Borrow code from virtio_pci_modern to do this correctly. AFAICT, it doesn't need to. The endian correction is done by the caller

Re: [PATCH] virtio_mmio: generation support

2015-03-11 Thread Rusty Russell
"Michael S. Tsirkin" writes: > virtio_mmio currently lacks generation support which > makes multi-byte field access racy. > Fix by getting the value at offset 0xfc for version 2 > devices. Nothing we can do for version 1, so return > generation id 0. > > Signed-off-by: Michael S. Tsirkin > --- >

Re: [PATCH] 9p/trans_virtio: fix hot-unplug

2015-03-11 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On device hot-unplug, 9p/virtio currently will kfree channel while > it might still be in use. > > Of course, it might stay used forever, so it's an extremely ugly hack, > but it seems better than use-after-free that we have now. > > Signed-off-by: Michael S. Tsirkin

Re: [PATCH] virtio_rpmsg: set DRIVER_OK before using device

2015-03-11 Thread Rusty Russell
Ohad Ben-Cohen writes: > On Mon, Mar 9, 2015 at 10:41 AM, Michael S. Tsirkin 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 virtio 1 spec, pre

Re: virtio balloon: do not call blocking ops when !TASK_RUNNING

2015-03-09 Thread Rusty Russell
Cornelia Huck writes: > On Wed, 4 Mar 2015 11:25:56 +0100 > "Michael S. Tsirkin" wrote: > >> On Wed, Mar 04, 2015 at 04:44:54PM +1030, Rusty Russell wrote: >> > "Michael S. Tsirkin" writes: >> > > On Mon, Mar 02, 2015 at 10:37:26AM

Re: [PATCH v2] virtio-balloon: do not call blocking ops when !TASK_RUNNING

2015-03-09 Thread Rusty Russell
Thomas Huth writes: > On Wed, 25 Feb 2015 16:11:27 +0100 > Cornelia Huck wrote: > >> On Wed, 25 Feb 2015 15:36:02 +0100 >> "Michael S. Tsirkin" wrote: >> >> > virtio balloon has this code: >> > wait_event_interruptible(vb->config_change, >> > (diff = tow

Re: [PATCH] virtio_rpmsg: set DRIVER_OK before using device

2015-03-09 Thread Rusty Russell
"Michael S. Tsirkin" 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 fix

Re: virtio fixes pull for 4.0?

2015-03-09 Thread Rusty Russell
"Michael S. Tsirkin" 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 merge window.

Re: [PATCH] virtio_balloon: set DRIVER_OK before using device

2015-03-09 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Thu, Mar 05, 2015 at 01:24:47PM +1030, Rusty Russell wrote: >> "Michael S. Tsirkin" writes: >> > virtio spec requires that all drivers set DRIVER_OK >> > before using devices. While balloon isn't yet >&g

Re: [PATCH] virtio_balloon: set DRIVER_OK before using device

2015-03-04 Thread Rusty Russell
"Michael S. Tsirkin" writes: > virtio spec requires that all drivers set DRIVER_OK > before using devices. While balloon isn't yet > included in the virtio 1 spec, previous spec versions > also required this. > > virtio balloon might violate this rule: probe calls > kthread_run before setting DRIV

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

2015-03-04 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Wed, Mar 04, 2015 at 11:06:08AM +1030, Rusty Russell wrote: >> "Michael S. Tsirkin" writes: >> > virtio 1.0 config space is in LE format for all >> > devices, use modern wrappers when accessed through >> &

Re: virtio balloon: do not call blocking ops when !TASK_RUNNING

2015-03-03 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Mon, Mar 02, 2015 at 10:37:26AM +1030, Rusty Russell wrote: >> Thomas Huth writes: >> > On Thu, 26 Feb 2015 11:50:42 +1030 >> > Rusty Russell wrote: >> > >> >> Thomas Huth writes: >> >>

Re: [PATCH] virtio_console: avoid config access from irq

2015-03-03 Thread Rusty Russell
Amit Shah writes: > On (Sat) 28 Feb 2015 [18:42:25], Michael S. Tsirkin wrote: >> when multiport is off, virtio console invokes config access from irq >> context, config access is blocking on s390. >> Fix this up by scheduling work from config irq - similar to what we do >> for multiport configs.

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

2015-03-03 Thread Rusty Russell
"Michael S. Tsirkin" 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 variants.

Re: [PATCH] virtio_console: init work unconditionally

2015-03-03 Thread Rusty Russell
Amit Shah writes: > On (Sat) 28 Feb 2015 [18:41:34], Michael S. Tsirkin wrote: >> when multiport is off, we don't initialize config work, >> but we then cancel uninitialized control_work on freeze. >> >> Signed-off-by: Michael S. Tsirkin > > Reviewed-by: Amit Shah Thanks, applied. Cheers, Rus

Re: virtio balloon: do not call blocking ops when !TASK_RUNNING

2015-03-02 Thread Rusty Russell
Thomas Huth writes: > On Thu, 26 Feb 2015 11:50:42 +1030 > Rusty Russell wrote: > >> Thomas Huth writes: >> > Hi all, >> > >> > with the recent kernel 3.19, I get a kernel warning when I start my >> > KVM guest on s390 with virtio

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

2015-03-02 Thread Rusty Russell
"Michael S. Tsirkin" 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 Thanks, both applied. Cheers, Rusty.

Re: virtio balloon: do not call blocking ops when !TASK_RUNNING

2015-02-25 Thread Rusty Russell
Thomas Huth writes: > Hi all, > > with the recent kernel 3.19, I get a kernel warning when I start my > KVM guest on s390 with virtio balloon enabled: The deeper problem is that virtio_ccw_get_config just silently fails on OOM. Neither get_config nor set_config are expected to fail. Cornelia,

Qemu and virtio 1.0

2015-02-24 Thread Rusty Russell
on my x86 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 Date: Tue, 24 Feb 2015 1

[PULL] virtio-next

2015-02-17 Thread Rusty Russell
e to OASIS spec version Rusty Russell (53): virtio-pci: define layout for virtio 1.0 virtio_pci: macros for PCI layout offsets virtio: define VIRTIO_PCI_CAP_PCI_CFG in header. virtio: Don't expose legacy block features when VIRTIO_BLK_NO_LEGACY defined. virtio: Don&#x

Re: [PATCH 1/2] virtio_pci_modern: type-safe io accessors

2015-02-15 Thread Rusty Russell
Rusty Russell writes: > "Michael S. Tsirkin" writes: >> The spec is very clear on this: >> >> 4.1.3.1 Driver Requirements: PCI Device Layout >> >> The driver MUST access each field using the “natural” access method, >> i.e. 32-bit accesses for 32

Re: [PATCH RFC v5 net-next 4/6] virtio-net: add basic interrupt coalescing support

2015-02-15 Thread Rusty Russell
Pawel Moll writes: > On Fri, 2015-02-13 at 02:52 +0000, Rusty Russell wrote: >> "Michael S. Tsirkin" writes: >> > On Tue, Feb 10, 2015 at 12:02:37PM +1030, Rusty Russell wrote: >> >> Jason Wang writes: >> >> > This patch enables the interru

Re: [PATCH 1/2] virtio_pci_modern: type-safe io accessors

2015-02-15 Thread Rusty Russell
"Michael S. Tsirkin" writes: > The spec is very clear on this: > > 4.1.3.1 Driver Requirements: PCI Device Layout > > The driver MUST access each field using the “natural” access method, > i.e. 32-bit accesses for 32-bit fields, 16-bit accesses for 16-bit > fields and 8-bit accesses for 8-bit fiel

Re: [PATCH RFC v5 net-next 4/6] virtio-net: add basic interrupt coalescing support

2015-02-15 Thread Rusty Russell
Cornelia Huck writes: > On Fri, 13 Feb 2015 13:22:09 +1030 > Rusty Russell wrote: > >> "Michael S. Tsirkin" writes: >> > On Tue, Feb 10, 2015 at 12:02:37PM +1030, Rusty Russell wrote: >> >> Jason Wang writes: >> >> > This p

[PATCH] virtio: don't set VIRTIO_CONFIG_S_DRIVER_OK twice.

2015-02-12 Thread Rusty Russell
I noticed this with the console device. It's not *wrong*, just a bit weird. Signed-off-by: Rusty Russell diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c index b9f70dfc4751..5ce2aa48fc6e 100644 --- a/drivers/virtio/virtio.c +++ b/drivers/virtio/virtio.c @@ -236,7 +2

Re: [PATCH RFC v5 net-next 4/6] virtio-net: add basic interrupt coalescing support

2015-02-12 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Tue, Feb 10, 2015 at 12:02:37PM +1030, Rusty Russell wrote: >> Jason Wang writes: >> > This patch enables the interrupt coalescing setting through ethtool. >> >> The problem is that there's nothing network speci

Re: [PATCH] virtual: Documentation: simplify and generalize paravirt_ops.txt

2015-02-11 Thread Rusty Russell
"Luis R. Rodriguez" writes: > From: "Luis R. Rodriguez" > > The general documentation we have for pv_ops is currenty present > on the IA64 docs, but since this documentation covers IA64 xen > enablement and IA64 Xen support got ripped out a while ago > through commit d52eefb47 present since v3.14

[PATCH 2/2] virtio: Introducing virtio_pci.no_mmio, the worst boot option in history.

2015-02-10 Thread Rusty Russell
ength at offset cap.offset at BAR selected by cap.bar and store the first cap.length bytes in pci_cfg_data. Signed-off-by: Rusty Russell --- drivers/virtio/virtio_pci_common.c | 31 ++- drivers/virtio/virtio_pci_common.h | 21 + drivers/virtio/virtio_pci_legacy.c

Re: [PATCH RFC v5 net-next 1/6] virtio_ring: fix virtqueue_enable_cb() when only 1 buffers were pending

2015-02-10 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Tue, Feb 10, 2015 at 11:33:52AM +1030, Rusty Russell wrote: >> Jason Wang writes: >> > We currently does: >> > >> > bufs = (avail->idx - last_used_idx) * 3 / 4; >> > >> > This is ok now since

[RFC 0/2] virtio_pci: patches never to apply.

2015-02-10 Thread Rusty Russell
This should allow testing when QEMU gets VIRTIO_PCI_CAP_PCI_CFG support, but I'm pretty sure we should never allow these patches upstream. Tested with lguest (in virtio-next), which supports VIRTIO_PCI_CAP_PCI_CFG. Rusty Russell (2): virtio_pci: abstract all MMIO accesses. v

[PATCH 1/2] virtio_pci: abstract all MMIO accesses.

2015-02-10 Thread Rusty Russell
This is in preparation for testing the virtio pci config mmio backdoor. Signed-off-by: Rusty Russell --- drivers/virtio/virtio_pci_common.c | 47 - drivers/virtio/virtio_pci_common.h | 41 +++ drivers/virtio/virtio_pci_modern.c | 140

[PATCH] virtio_pci: use 16-bit accessor for queue_enable.

2015-02-09 Thread Rusty Russell
and 8-bit accesses for 8-bit fields. Signed-off-by: Rusty Russell diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c index f16e462cb4ef..2aa38e59db2e 100644 --- a/drivers/virtio/virtio_pci_modern.c +++ b/drivers/virtio/virtio_pci_modern.c @@ -294,7 +294,7

Re: [PATCH RFC v5 net-next 1/6] virtio_ring: fix virtqueue_enable_cb() when only 1 buffers were pending

2015-02-09 Thread Rusty Russell
Jason Wang writes: > We currently does: > > bufs = (avail->idx - last_used_idx) * 3 / 4; > > This is ok now since we only try to enable the delayed callbacks when > the queue is about to be full. This may not work well when there is > only one pending buffer in the virtqueue (this may be the case

Re: [PATCH RFC v5 net-next 2/6] virtio_ring: try to disable event index callbacks in virtqueue_disable_cb()

2015-02-09 Thread Rusty Russell
t; > Signed-off-by: Jason Wang Acked-by: Rusty Russell > --- > drivers/virtio/virtio_ring.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > index 545fed5..e9ffbfb 100644 > --- a/drivers/virt

Re: [PATCH RFC v5 net-next 4/6] virtio-net: add basic interrupt coalescing support

2015-02-09 Thread Rusty Russell
ability to coalesce by number of frames, but we can still do number of sg entries, as we do now with used_event, and we could change virtqueue_enable_cb_delayed() to take a precise number if we wanted. My feeling is that this should be a v1.0-only feature though (eg. feature bit 33). Cheers, Rusty

Re: [PATCH] virtio: Avoid possible kernel panic if DEBUG is enabled.

2015-02-08 Thread Rusty Russell
Tetsuo Handa writes: >>From 11fd997d724f520ca628615e7ffbfd7901c40b62 Mon Sep 17 00:00:00 2001 > From: Tetsuo Handa > Date: Fri, 6 Feb 2015 13:28:38 +0900 > Subject: [PATCH] virtio: Avoid possible kernel panic if DEBUG is enabled. > > The virtqueue_add() calls START_USE() upon entry. The virtqueu

Re: virtio for 3.20

2015-01-21 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Mon, Jan 19, 2015 at 12:56:28PM +1030, Rusty Russell wrote: >> "Michael S. Tsirkin" writes: >> > Hi Rusty, all >> > >> > I parked outstanding virtio patches here: >> > git://git.kernel.org/pub/scm

Re: [PATCH] virtio-mmio: Update the device to OASIS spec version

2015-01-21 Thread Rusty Russell
Pawel Moll writes: > This patch add a support for second version of the virtio-mmio device, > which follows OASIS "Virtual I/O Device (VIRTIO) Version 1.0" > specification. Nice job, that turned out quite neat! Applied, Rusty. ___ Virtualization mailin

Re: [PATCH v2] virtio-mmio: Update the device to OASIS spec version

2015-01-21 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Tue, Jan 20, 2015 at 06:12:11PM +, Pawel Moll wrote: >> This patch add a support for second version of the virtio-mmio device, >> which follows OASIS "Virtual I/O Device (VIRTIO) Version 1.0" >> specification. OK, applied this instead :) I'll leave it in my

Re: [PATCH v3 10/16] s390: add pci_iomap_range

2015-01-20 Thread Rusty Russell
Sebastian Ott writes: > On Wed, 14 Jan 2015, Michael S. Tsirkin wrote: >> } >> -EXPORT_SYMBOL_GPL(pci_iomap); >> +EXPORT_SYMBOL_GPL(pci_iomap_range); >> + >> +void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) >> +{ >> +return pci_iomap_range(dev, bar, 0, maxlen); >>

Re: [PATCH 0/6] virtio: graceful failure with get == NULL

2015-01-19 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Tue, Jan 13, 2015 at 04:43:07PM +0200, Michael S. Tsirkin wrote: >> virtio 1.0 says device configuration is optional, but most drivers treat it >> as >> mandatory. Even if presented by device, guest bios might disable the BAR >> holding that configuration, so we

Re: [PATCH] virtio_pci: add module param to force legacy mode

2015-01-18 Thread Rusty Russell
"Michael S. Tsirkin" writes: > If set, try legacy interface first, modern one if that fails. Useful to > work around device/driver bugs, and for compatibility testing. > > Signed-off-by: Michael S. Tsirkin Thanks, I've applied all these to virtio-next. Cheers! Rusty. __

Re: virtio for 3.20

2015-01-18 Thread Rusty Russell
"Michael S. Tsirkin" writes: > Hi Rusty, all > > I parked outstanding virtio patches here: > git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git vhost-next > this way they are merged in linux-next as well. > > Rusty if you'll be doing 3.20 window, would you mind > checking that tree to ver

Re: [RFC PATCH 0/3] Sharing MSIX irq for tx/rx queue pairs

2015-01-04 Thread Rusty Russell
mters > were simply ignored. For devices that does not use channel, it can > simply pass NULL or zero to virito core. > > With the patch, 1 MSIX irq were saved for each TX/RX queue pair. It seems fairly straightforward. Acked-by: Rusty Russell Thanks, Rusty. ___

Re: [PATCH 6/6] virtio: core support for config generation

2014-12-21 Thread Rusty Russell
"Michael S. Tsirkin" writes: > virtio 1.0 spec says: > > Drivers MUST NOT assume reads from fields greater than 32 bits wide are > atomic, nor are reads from multiple fields: drivers SHOULD read device > configuration space fields like so: > u32 before, after; > do { > be

Re: [PATCH 0/6] virtio 1.0 fixups, tweaks

2014-12-18 Thread Rusty Russell
"Michael S. Tsirkin" writes: > Fixes a couple of minor compliance issues in new virtio 1.0 code. > Plus, adds a couple of minor cleanups - not bugfixes, > but seem safe enough for 3.19. OK, I've applied these. Thanks, Rusty. > Michael S. Tsirkin (6): > virtio: set VIRTIO_CONFIG_S_FEATURES_OK

Re: [PATCH 1/6] tools/virtio: more stubs

2014-12-18 Thread Rusty Russell
"Michael S. Tsirkin" writes: > As usual, add more stubs to fix test build after main > codebase changes. This doesn't apply, since: > diff --git a/tools/virtio/linux/virtio_config.h > b/tools/virtio/linux/virtio_config.h > index dafe1c9..806d683 100644 > --- a/tools/virtio/linux/virtio_config.h

Re: [PATCH 0/3] fix up vringh/mic sparse errors

2014-12-18 Thread Rusty Russell
"Michael S. Tsirkin" writes: > This fixes remaining sparse warnings in vringh and mic by using > virtio 1.0 compliant wrappers. > > This also needs by get_user patches to avoid getting warnings > from these calls. > > Tested by running vringh_test. > > Rusty, I prefer fixing all these warnings for

Re: BUG_ON in virtio-ring.c

2014-12-17 Thread Rusty Russell
Alexey Lapitsky writes: > Hi, > > Sorry for the long delay. It prints exactly the same: > > [3.792033] virtqueue elements = 128, max_segments = 126 (1 queues) > [3.802191] vda: vda1 vda2 < vda5 > > > A little bit more about my setup (if it helps): OK, I think this is fixed by Ming Lei's

Re: [PATCH 9/9] virtio_pci: update file descriptions and copyright

2014-12-15 Thread Rusty Russell
"Michael S. Tsirkin" writes: > There's been a lot of changes since 2007. > List main authors, add Red Hat copyright. Acked-by: Rusty Russell Cheers, Rusty. > Signed-off-by: Michael S. Tsirkin > --- > drivers/virtio/virtio_pci.h| 5 - > drive

Re: [PATCH 0/2] virtio_ccw: minor enhancements

2014-12-10 Thread Rusty Russell
"Michael S. Tsirkin" writes: > Hi Rusty, I guess you are busy. > > I'd like to send all these patch series combined to Linus. To see what > I have queued, you can check the vhost-next branch in my tree. > > Will wait until tomorrow to give you a chance to respond. Hi Michael, Indeed, th

Re: [PATCH 1/2] virito: introduce methods of fixing device features

2014-11-25 Thread Rusty Russell
Jason Wang writes: > Buggy host may advertised buggy host features (a usual case is that host > advertise a feature whose dependencies were missed). In this case, driver > should detect and disable the buggy features by itself. Sorry, I've been focussing elsewhere. I would really prefer that dri

Re: [PATCH v4 4/6] hw_random: fix unregister race.

2014-11-11 Thread Rusty Russell
Amos Kong writes: > From: Rusty Russell > > The previous patch added one potential problem: we can still be > reading from a hwrng when it's unregistered. Add a wait for zero > in the hwrng_unregister path. > > v4: add cleanup_done flag to insure that cleanup is done

Re: [PATCH v4 3/6] hw_random: use reference counts on each struct hwrng.

2014-11-11 Thread Rusty Russell
Amos Kong writes: > From: Rusty Russell > > current_rng holds one reference, and we bump it every time we want > to do a read from it. > > This means we only hold the rng_mutex to grab or drop a reference, > so accessing /sys/devices/virtual/misc/hw_random/rng_current doesn

Re: kernel BUG at drivers/block/virtio_blk.c:172!

2014-11-10 Thread Rusty Russell
Jeff Layton writes: > In the latest Fedora rawhide kernel in the repos, I'm seeing the > following oops when mounting xfs. rc2-ish kernels seem to be fine: > > [ 64.669633] [ cut here ] > [ 64.670008] kernel BUG at drivers/block/virtio_blk.c:172! Hmm, that's:

Re: [PATCH v2 4/6] hw_random: fix unregister race.

2014-10-30 Thread Rusty Russell
Herbert Xu writes: > On Thu, Sep 18, 2014 at 08:37:45PM +0800, Amos Kong wrote: >> From: Rusty Russell >> >> The previous patch added one potential problem: we can still be >> reading from a hwrng when it's unregistered. Add a wait for zero >> in the hwrng

Re: [PATCH] virtio_ccw: remove unsued variable

2014-10-30 Thread Rusty Russell
vice *vcdev = dev_get_drvdata(&cdev->dev); >> >int i; >> >struct virtqueue *vq; >> > - struct virtio_driver *drv; >> > >> >if (!vcdev) >> >return; > > *pokes Rusty* > > Do you want to send this via

Re: [PATCH RFC 4/4] virtio_net: bigger header when VERSION_1 is set

2014-10-27 Thread Rusty Russell
"Michael S. Tsirkin" writes: > With VERSION_1 virtio_net uses same header size > whether mergeable buffers are enabled or not. > > Signed-off-by: Michael S. Tsirkin These two are great too, thanks: Acked-by: Rusty Russell Cheers, Rusty. > --- > drivers/net/vi

Re: [PATCH] virtio_blk: fix race at module removal

2014-10-27 Thread Rusty Russell
Ming Lei writes: > On Fri, Oct 24, 2014 at 12:12 AM, Michael S. Tsirkin wrote: >> If a device appears while module is being removed, >> driver will get a callback after we've given up >> on the major number. >> >> In theory this means this major number can get reused >> by something else, resulti

Re: [PATCH RFC 2/4] virtio_net: get rid of virtio_net_hdr/skb_vnet_hdr

2014-10-27 Thread Rusty Russell
instead. > > This way we can also remove struct skb_vnet_hdr. Yes, this is definitely a win. Acked-by: Rusty Russell Thanks, Rusty. > > Signed-off-by: Michael S. Tsirkin > --- > drivers/net/virtio_net.c | 88 > ++-- > 1 file cha

Re: [PATCH RFC 1/4] virtio_net: pass vi around

2014-10-27 Thread Rusty Russell
"Michael S. Tsirkin" writes: > Too many places poke at [rs]q->vq->vdev->priv just to get > the the vi structure. Let's just pass the pointer around: seems > cleaner, and might even be faster. Agreed, it's neater. Acked-by: Rusty Russell Thanks, Rusty.

Re: [PATCH 2/2] virtio_balloon: free some memory from balloon on OOM

2014-10-19 Thread Rusty Russell
sion from host. > > Signed-off-by: Raushaniya Maksudova > Signed-off-by: Denis V. Lunev > CC: Rusty Russell > CC: Michael S. Tsirkin > --- > drivers/virtio/virtio_balloon.c | 52 > + > include/uapi/linux/virtio_ball

Re: [PATCH v2 3/6] hw_random: use reference counts on each struct hwrng.

2014-10-19 Thread Rusty Russell
Amos Kong writes: > From: Rusty Russell > > current_rng holds one reference, and we bump it every time we want > to do a read from it. > > This means we only hold the rng_mutex to grab or drop a reference, > so accessing /sys/devices/virtual/misc/hw_random/rng_current doesn

Re: [PATCH v2 3/6] hw_random: use reference counts on each struct hwrng.

2014-10-19 Thread Rusty Russell
the problem that the hwrng_fillfn thread was accessing current_rng without a lock, which could change (eg. to NULL) underneath it. v3: initialize kref (thanks Amos Kong) v2: fix missing put_rng() on exit path (thanks Amos Kong) Signed-off-by: Rusty Russell diff --git a/drivers/char/hw_random/core

[PULL] More virtio fun

2014-10-16 Thread Rusty Russell
The following changes since commit 7ec62d421bdf29cb31101ae2689f7f3a9906289a: Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs (2014-09-10 14:04:17 -0700) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linu

Re: [PATCH] virtio_balloon: Convert "vballon" kthread into a workqueue

2014-10-14 Thread Rusty Russell
Petr Mladek writes: > Workqueues have clean and rich API for all basic operations. The code is > usually > easier and better readable. It can be easily tuned for the given purpose. OK, sure. > -static void fill_balloon(struct virtio_balloon *vb, size_t num) > +static void fill_balloon(struct vi

Re: [PATCH 2/2] virtio_balloon: free some memory from baloon on OOM

2014-10-14 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Tue, Oct 14, 2014 at 10:14:05AM +1030, Rusty Russell wrote: >> "Michael S. Tsirkin" writes: >> >> > On Mon, Oct 13, 2014 at 04:02:52PM +1030, Rusty Russell wrote: >> >> "Denis V. Lunev" wri

Re: [PATCH net-next RFC 1/3] virtio: support for urgent descriptors

2014-10-14 Thread Rusty Russell
Jason Wang writes: > Below should be useful for some experiments Jason is doing. > I thought I'd send it out for early review/feedback. > > event idx feature allows us to defer interrupts until > a specific # of descriptors were used. > Sometimes it might be useful to get an interrupt after > a sp

Re: [PATCH 1/3] virtio_net: pass well-formed sgs to virtqueue_add_*()

2014-10-13 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Fri, Sep 05, 2014 at 12:40:50PM +0200, Paolo Bonzini wrote: >> Il 03/09/2014 06:29, Rusty Russell ha scritto: >> > + sg_init_table(rq->sg, MAX_SKB_FRAGS + 2); >> >> I think 2 is enough here. That said... >>

Re: [PATCH 2/2] virtio_balloon: free some memory from baloon on OOM

2014-10-13 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Mon, Oct 13, 2014 at 04:02:52PM +1030, Rusty Russell wrote: >> "Denis V. Lunev" writes: >> > From: Raushaniya Maksudova >> > >> > Excessive virtio_balloon inflation can cause invocation of OOM-killer,

Re: [PATCH v4 04/25] virtio: defer config changed notifications

2014-10-13 Thread Rusty Russell
"Michael S. Tsirkin" writes: > Defer config changed notifications that arrive during > probe/scan/freeze/restore. > > This will allow drivers to set DRIVER_OK earlier, without worrying about > racing with config change interrupts. > > This change will also benefit old hypervisors (before 2009) > t

Re: [PATCH v3 10/25] virtio: add API to enable VQs early

2014-10-12 Thread Rusty Russell
"Michael S. Tsirkin" writes: > virtio spec 0.9.X requires DRIVER_OK to be set before > VQs are used, but some drivers use VQs before probe > function returns. > Since DRIVER_OK is set after probe, this violates the spec. > > Even though under virtio 1.0 transitional devices support this > behaviou

Re: BUG_ON in virtio-ring.c

2014-10-12 Thread Rusty Russell
Alexey Lapitsky writes: > Hi, > > I'm hitting this bug with both ext4 and btrfs. > > Here's an example of the backtrace: > https://gist.github.com/vzctl/e888a821333979120932 > > I tried raising this BUG only for direct ring and it solved the problem: > > - BUG_ON(total_sg > vq->vring.num);

  1   2   3   4   5   6   7   8   9   10   >