[PATCH 0/3] x86: Support compiling out userspace I/O (iopl and ioperm)

2013-10-22 Thread Josh Triplett
This patch series makes it possible to compile out the iopl and ioperm system calls, which allow privileged processes to request permission to directly poke I/O ports from userspace. Nothing on a modern Linux system uses these calls anymore, and anything new should be using /dev/port instead, or

[PATCH 2/3] x86: tss: Eliminate fragile calculation of TSS segment limit

2013-10-22 Thread Josh Triplett
__set_tss_desc has a complex calculation of the TSS segment limit, duplicating the quirky details of the I/O bitmap array length, and requiring a complex comment to explain. Replace that calculation with a simpler one based on the offsetof the stack field that follows the array. That then

[PATCH 3/3] x86: Support compiling out userspace I/O (iopl and ioperm)

2013-10-22 Thread Josh Triplett
On the vast majority of modern systems, no processes will use the userspsace I/O syscalls, iopl and ioperm. Add a new config option, CONFIG_X86_IOPORT, to support configuring them out of the kernel entirely. Since these syscalls only exist to support rare legacy userspace programs, X86_IOPORT

Re: [virtio-net] BUG: sleeping function called from invalid context at kernel/mutex.c:616

2013-10-22 Thread Jason Wang
On 10/20/2013 10:34 AM, Fengguang Wu wrote: Greetings, I got the below dmesg and the first bad commit is commit 3ab098df35f8b98b6553edc2e40234af512ba877 Author: Jason Wang jasow...@redhat.com Date: Tue Oct 15 11:18:58 2013 +0800 virtio-net: don't respond to cpu hotplug notifier if

[PATCH RFC 4/7] virtio_blk: use dummy virtqueue_notify() to detect host kick error

2013-10-22 Thread Heinz Graalfs
Deleting the disk and partitions in virtblk_remove() via del_gendisk() causes never ending waits when trying to synch dirty inode pages. A dummy virtqueue_notify() in virtblk_remove() is used to detect a host notification error, latter occurs when block device was hot-unplugged. When the dummy

[PATCH RFC 0/7] virtio: avoid various hang situations during hot-unplug

2013-10-22 Thread Heinz Graalfs
Hi, this patch-set tries to solve various hang situations when virtio devices (network or block) are hot-unplugged from a KVM guest. On System z there exists no handshake mechanism between host and guest when a device is hot-unplugged. The device is removed and no further I/O is possible. The

[PATCH RFC 7/7] virtio_blk: trigger IO errors in case virtqueue is broken

2013-10-22 Thread Heinz Graalfs
In case the virtqueue is flagged as broken, IO errors are triggered for current request queue entries. Signed-off-by: Heinz Graalfs graa...@linux.vnet.ibm.com --- drivers/block/virtio_blk.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/drivers/block/virtio_blk.c

[PATCH RFC 6/7] virtio_blk: set request queue as dying in case virtqueue is broken

2013-10-22 Thread Heinz Graalfs
The request queue should be flagged as QUEUE_FLAG_DYING in case the host kick failed for a new virtqueue request. Signed-off-by: Heinz Graalfs graa...@linux.vnet.ibm.com --- drivers/block/virtio_blk.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git

[PATCH RFC 2/7] s390/virtio_ccw: set virtqueue as broken if host notify failed

2013-10-22 Thread Heinz Graalfs
Set the current virtqueue as broken if the appropriate host kick failed (e.g. if the device was hot-unplugged via host means). This error info can be exploited at various other places where a host kick is triggered. Signed-off-by: Heinz Graalfs graa...@linux.vnet.ibm.com ---

[PATCH RFC 1/7] virtio_ring: add new functions virtqueue{_set_broken()/_is_broken()}

2013-10-22 Thread Heinz Graalfs
This patch adds 2 new functions: virtqueue_set_broken(): to be called when a virtqueue kick operation fails. virtqueue_is_broken(): can be called to query the virtqueue state after a host was kicked. Signed-off-by: Heinz Graalfs graa...@linux.vnet.ibm.com --- drivers/virtio/virtio_ring.c | 16

[PATCH RFC 3/7] virtio_net: avoid cpu_relax() call loop in case virtqueue is broken

2013-10-22 Thread Heinz Graalfs
A virtqueue_kick() call to notify a host might fail in case the network device was hot-unplugged. Spinning for a response for a VIRTIO_NET_CTRL_VLAN_DEL command response will end up in a never ending loop waiting for a response. This patch avoids the cpu_relax() loop in case the virtqueue is

QueuePFN peculiarity in virtio-mmio

2013-10-22 Thread Laszlo Ersek
Hi, Appendix X: virtio-mmio in the virtio spec says • 0x040 | RW | QueuePFN [...] When the Guest stops using the queue it must write zero (0x0) to this register. [...] and Virtqueue Configuration [...] 2. Check if the queue is not already in use: read

Re: QueuePFN peculiarity in virtio-mmio

2013-10-22 Thread Laszlo Ersek
My apologies, I used Anthony's previous (now obsolete) email. Updated it now keeping full context below. Sorry. On 10/22/13 19:49, Laszlo Ersek wrote: Hi, Appendix X: virtio-mmio in the virtio spec says • 0x040 | RW | QueuePFN [...] When the Guest stops using the queue it must

Re: [edk2] QueuePFN peculiarity in virtio-mmio

2013-10-22 Thread Laszlo Ersek
On 10/22/13 19:55, Laszlo Ersek wrote: The question arises because Olivier has posted a series to edk2-devel that adds virtio-mmio support to TianoCore, and Mark tested it (using OVMF) with a Linux guest and found problems. Namely, OVMF itself can drive the virtio devices via virtio-mmio, but

Re: [PATCH RFC 1/7] virtio_ring: add new functions virtqueue{_set_broken()/_is_broken()}

2013-10-22 Thread Rusty Russell
Heinz Graalfs graa...@linux.vnet.ibm.com writes: This patch adds 2 new functions: virtqueue_set_broken(): to be called when a virtqueue kick operation fails. virtqueue_is_broken(): can be called to query the virtqueue state after a host was kicked. Signed-off-by: Heinz Graalfs

Re: [PATCH RFC 4/7] virtio_blk: use dummy virtqueue_notify() to detect host kick error

2013-10-22 Thread Rusty Russell
Heinz Graalfs graa...@linux.vnet.ibm.com writes: Deleting the disk and partitions in virtblk_remove() via del_gendisk() causes never ending waits when trying to synch dirty inode pages. A dummy virtqueue_notify() in virtblk_remove() is used to detect a host notification error, latter occurs

Re: 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