- 26 4月, 2018 5 次提交
-
-
由 Michael S. Tsirkin 提交于
When out of memory and we can't add ctrl vq buffers, probe fails. Unfortunately the error handling is out of spec: it calls del_vqs without bothering to reset the device first. To fix, call the full cleanup function in this case. Cc: stable@vger.kernel.org Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
-
由 Michael S. Tsirkin 提交于
Will make it reusable for error handling. Cc: stable@vger.kernel.org Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
-
由 Michael S. Tsirkin 提交于
We now cleanup all VQs on device removal - no need to handle the control VQ specially. Cc: stable@vger.kernel.org Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
-
由 Michael S. Tsirkin 提交于
Console driver is out of spec. The spec says: A driver MUST NOT decrement the available idx on a live virtqueue (ie. there is no way to “unexpose” buffers). and it does exactly that by trying to detach unused buffers without doing a device reset first. Defer detaching the buffers until device unplug. Of course this means we might get an interrupt for a vq without an attached port now. Handle that by discarding the consumed buffer. Reported-by: NTiwei Bie <tiwei.bie@intel.com> Fixes: b3258ff1 ("virtio: Decrement avail idx on buffer detach") Cc: stable@vger.kernel.org Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
-
由 Michael S. Tsirkin 提交于
an allocated buffer doesn't need to be tied to a vq - only vq->vdev is ever used. Pass the function the just what it needs - the vdev. Cc: stable@vger.kernel.org Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
-
- 12 2月, 2018 1 次提交
-
-
由 Linus Torvalds 提交于
This is the mindless scripted replacement of kernel use of POLL* variables as described by Al, done by this script: for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'` for f in $L; do sed -i "-es/^\([^\"]*\)\(\<POLL$V\>\)/\\1E\\2/" $f; done done with de-mangling cleanups yet to come. NOTE! On almost all architectures, the EPOLL* constants have the same values as the POLL* constants do. But they keyword here is "almost". For various bad reasons they aren't the same, and epoll() doesn't actually work quite correctly in some cases due to this on Sparc et al. The next patch from Al will sort out the final differences, and we should be all done. Scripted-by: NAl Viro <viro@zeniv.linux.org.uk> Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
-
- 29 11月, 2017 1 次提交
-
-
由 Al Viro 提交于
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
-
- 01 9月, 2017 1 次提交
-
-
由 Christoph Hellwig 提交于
This flag was never implemented or used. Signed-off-by: NChristoph Hellwig <hch@lst.de> Reviewed-by: NRobin Murphy <robin.murphy@arm.com>
-
- 28 8月, 2017 1 次提交
-
-
由 Arvind Yadav 提交于
attribute_group are not supposed to change at runtime. All functions working with attribute_group provided by <linux/sysfs.h> work with const attribute_group. So mark the non-const structs as const. Signed-off-by: NArvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 24 8月, 2017 1 次提交
-
-
由 Juergen Gross 提交于
Lguest seems to be rather unused these days. It has seen only patches ensuring it still builds the last two years and its official state is "Odd Fixes". Remove it in order to be able to clean up the paravirt code. Signed-off-by: NJuergen Gross <jgross@suse.com> Acked-by: NRusty Russell <rusty@rustcorp.com.au> Acked-by: NThomas Gleixner <tglx@linutronix.de> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: boris.ostrovsky@oracle.com Cc: lguest@lists.ozlabs.org Cc: rusty@rustcorp.com.au Cc: xen-devel@lists.xenproject.org Link: http://lkml.kernel.org/r/20170816173157.8633-3-jgross@suse.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
-
- 03 5月, 2017 1 次提交
-
-
由 Michael S. Tsirkin 提交于
We are going to add more parameters to find_vqs, let's wrap the call so we don't need to tweak all drivers every time. Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
-
- 07 4月, 2017 1 次提交
-
-
由 Michael S. Tsirkin 提交于
We try to disable callbacks on c_ivq even without multiport even though that vq is not initialized in this configuration. Fixes: c743d09d ("virtio: console: Disable callbacks for virtqueues at start of S4 freeze") Suggested-by: NMike Galbraith <efault@gmx.de> Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
-
- 17 3月, 2017 1 次提交
-
-
由 Joe Perches 提交于
To enable eventual removal of pr_warning This makes pr_warn use consistent for drivers/char Prior to this patch, there were 1 use of pr_warning and 40 uses of pr_warn in drivers/char Signed-off-by: NJoe Perches <joe@perches.com> Reviewed-by: NAmit Shah <amit@kernel.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 02 3月, 2017 1 次提交
-
-
由 Omar Sandoval 提交于
put_chars() stuffs the buffer it gets into an sg, but that buffer may be on the stack. This breaks with CONFIG_VMAP_STACK=y (for me, it manifested as printks getting turned into NUL bytes). Signed-off-by: NOmar Sandoval <osandov@fb.com> Signed-off-by: NMichael S. Tsirkin <mst@redhat.com> Reviewed-by: NAmit Shah <amit.shah@redhat.com>
-
- 28 2月, 2017 1 次提交
-
-
由 Christoph Hellwig 提交于
Add a struct irq_affinity pointer to the find_vqs methods, which if set is used to tell the PCI layer to create the MSI-X vectors for our I/O virtqueues with the proper affinity from the start. Compared to after the fact affinity hints this gives us an instantly working setup and allows to allocate the irq descritors node-local and avoid interconnect traffic. Last but not least this will allow blk-mq queues are created based on the interrupt affinity for storage drivers. Signed-off-by: NChristoph Hellwig <hch@lst.de> Reviewed-by: NJason Wang <jasowang@redhat.com> Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
-
- 20 1月, 2017 1 次提交
-
-
由 G. Campana 提交于
Using control_work instead of config_work as the 3rd argument to container_of results in an invalid portdev pointer. Indeed, the work structure is initialized as below: INIT_WORK(&portdev->config_work, &config_work_handler); It leads to a crash when portdev->vdev is dereferenced later. This bug is triggered when the guest uses a virtio-console without multiport feature and receives a config_changed virtio interrupt. Signed-off-by: NG. Campana <gcampana@quarkslab.com> Reviewed-by: NAmit Shah <amit.shah@redhat.com> Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
-
- 15 12月, 2016 1 次提交
-
-
由 Michael S. Tsirkin 提交于
struct ports_device includes a config field including the whole virtio_console_config, but only max_nr_ports in there is ever updated or used. The rest is unused and in fact does not even mirror the device config. Drop everything except max_nr_ports, saving some memory. Signed-off-by: NMichael S. Tsirkin <mst@redhat.com> Reviewed-by: NJason Wang <jasowang@redhat.com>
-
- 31 10月, 2016 1 次提交
-
-
由 Matt Redfearn 提交于
Commit c6017e79 ("virtio: console: add locks around buffer removal in port unplug path") added locking around the freeing of buffers in the vq. However, when free_buf() is called with can_sleep = true and rproc is enabled, it calls dma_free_coherent() directly, requiring interrupts to be enabled. Currently a WARNING is triggered due to the spin locking around free_buf, with a call stack like this: WARNING: CPU: 3 PID: 121 at ./include/linux/dma-mapping.h:433 free_buf+0x1a8/0x288 Call Trace: [<8040c538>] show_stack+0x74/0xc0 [<80757240>] dump_stack+0xd0/0x110 [<80430d98>] __warn+0xfc/0x130 [<80430ee0>] warn_slowpath_null+0x2c/0x3c [<807e7c6c>] free_buf+0x1a8/0x288 [<807ea590>] remove_port_data+0x50/0xac [<807ea6a0>] unplug_port+0xb4/0x1bc [<807ea858>] virtcons_remove+0xb0/0xfc [<807b6734>] virtio_dev_remove+0x58/0xc0 [<807f918c>] __device_release_driver+0xac/0x134 [<807f924c>] device_release_driver+0x38/0x50 [<807f7edc>] bus_remove_device+0xfc/0x130 [<807f4b74>] device_del+0x17c/0x21c [<807f4c38>] device_unregister+0x24/0x38 [<807b6b50>] unregister_virtio_device+0x28/0x44 Fix this by restructuring the loops to allow the locks to only be taken where it is necessary to protect the vqs, and release it while the buffer is being freed. Fixes: c6017e79 ("virtio: console: add locks around buffer removal in port unplug path") Cc: stable@vger.kernel.org Signed-off-by: NMatt Redfearn <matt.redfearn@imgtec.com> Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
-
- 12 10月, 2016 1 次提交
-
-
由 Masahiro Yamada 提交于
Kernel source files need not include <linux/kconfig.h> explicitly because the top Makefile forces to include it with: -include $(srctree)/include/linux/kconfig.h This commit removes explicit includes except the following: * arch/s390/include/asm/facilities_src.h * tools/testing/radix-tree/linux/kernel.h These two are used for host programs. Link: http://lkml.kernel.org/r/1473656164-11929-1-git-send-email-yamada.masahiro@socionext.comSigned-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: NAndrew Morton <akpm@linux-foundation.org> Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
-
- 06 10月, 2016 1 次提交
-
-
由 Miklos Szeredi 提交于
Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com> Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
-
- 10 9月, 2016 1 次提交
-
-
由 Andy Lutomirski 提交于
virtio_console uses a small DMA buffer for control requests. Move that buffer into heap memory. Doing virtio DMA on the stack is normally okay on non-DMA-API virtio systems (which is currently most of them), but it breaks completely if the stack is virtually mapped. Tested by typing both directions using picocom aimed at /dev/hvc0. Signed-off-by: NAndy Lutomirski <luto@kernel.org> Signed-off-by: NMichael S. Tsirkin <mst@redhat.com> Reviewed-by: NAmit Shah <amit.shah@redhat.com>
-
- 08 9月, 2016 1 次提交
-
-
由 Andy Lutomirski 提交于
virtio_console uses a small DMA buffer for control requests. Move that buffer into heap memory. Doing virtio DMA on the stack is normally okay on non-DMA-API virtio systems (which is currently most of them), but it breaks completely if the stack is virtually mapped (CONFIG_VMAP_STACK=y). Tested by typing both directions using picocom aimed at /dev/hvc0. Signed-off-by: NAndy Lutomirski <luto@kernel.org> Reviewed-by: NAmit Shah <amit.shah@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: virtualization@lists.linux-foundation.org Link: http://lkml.kernel.org/r/0afe68f9b4be6c95af9e7672b07acd0274c26dfe.1472569320.git.luto@kernel.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
-
- 25 5月, 2015 1 次提交
-
-
由 Dan Carpenter 提交于
My static checker complains that this sprintf() can overflow but really it can't. Just silence the warning by using snprintf(). Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com> Reviewed-by: NAmit Shah <amit.shah@redhat.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 03 4月, 2015 1 次提交
-
-
由 Joe Perches 提交于
Use the normal return values for bool functions Signed-off-by: NJoe Perches <joe@perches.com> Reviewed-by: NAmit Shah <amit.shah@redhat.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 05 3月, 2015 2 次提交
-
-
由 Michael S. Tsirkin 提交于
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. Signed-off-by: NMichael S. Tsirkin <mst@redhat.com> Reviewed-by: NAmit Shah <amit.shah@redhat.com> Signed-off-by: NRusty Russell <rusty@rustcorp.com.au> Cc: stable@kernel.org
-
由 Michael S. Tsirkin 提交于
when multiport is off, we don't initialize config work, but we then cancel uninitialized control_work on freeze. Signed-off-by: NMichael S. Tsirkin <mst@redhat.com> Reviewed-by: NAmit Shah <amit.shah@redhat.com> Signed-off-by: NRusty Russell <rusty@rustcorp.com.au> Cc: stable@kernel.org
-
- 11 2月, 2015 1 次提交
-
-
由 Rusty Russell 提交于
Strictly, it's only needed when we have features (size or multiport). Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
-
- 04 2月, 2015 1 次提交
-
-
由 Michael S. Tsirkin 提交于
Some devices might not implement config space access (e.g. remoteproc used not to - before 3.9). virtio/console needs config space access so make it fail gracefully if not there. Signed-off-by: NMichael S. Tsirkin <mst@redhat.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 21 1月, 2015 1 次提交
-
-
由 Michael S. Tsirkin 提交于
Some devices might not implement config space access (e.g. remoteproc used not to - before 3.9). virtio/console needs config space access so make it fail gracefully if not there. Signed-off-by: NMichael S. Tsirkin <mst@redhat.com> Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
-
- 09 12月, 2014 4 次提交
-
-
由 Michael S. Tsirkin 提交于
CHECK drivers/char/virtio_console.c drivers/char/virtio_console.c:687:36: warning: incorrect type in argument 1 (different address spaces) drivers/char/virtio_console.c:687:36: expected void [noderef] <asn:1>*to drivers/char/virtio_console.c:687:36: got char *out_buf drivers/char/virtio_console.c:790:35: warning: incorrect type in argument 2 (different address spaces) drivers/char/virtio_console.c:790:35: expected char *out_buf drivers/char/virtio_console.c:790:35: got char [noderef] <asn:1>*ubuf fill_readbuf is reused with both kernel and userspace pointers, depending on value of to_user flag. Tag address parameter as __user, and cast to/from regular pointer type when we know it's safe. Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
-
由 Michael S. Tsirkin 提交于
Core activates this bit automatically now, drop it from drivers that set it explicitly. Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
-
由 Michael S. Tsirkin 提交于
Pretty straight-forward, just use accessors for all fields. Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
-
由 Michael S. Tsirkin 提交于
It seemed like a good idea to use bitmap for features in struct virtio_device, but it's actually a pain, and seems to become even more painful when we get more than 32 feature bits. Just change it to a u32 for now. Based on patch by Rusty. Suggested-by: NDavid Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: NRusty Russell <rusty@rustcorp.com.au> Signed-off-by: NCornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: NMichael S. Tsirkin <mst@redhat.com> Reviewed-by: NCornelia Huck <cornelia.huck@de.ibm.com>
-
- 13 11月, 2014 1 次提交
-
-
由 Cornelia Huck 提交于
Commit f5866db6 (virtio_console: enable VQs early) tried to make sure that DRIVER_OK was set when virtio_console started using its virtqueues. Doing this in add_port(), however, means that we try to set DRIVER_OK again when when a port is dynamically added after the probe function is done. Let's move virtio_device_ready() to the probe function just before trying to use the virtqueues instead. This is fine as nothing can fail inbetween. Reported-by: NThomas Graf <tgraf@suug.ch> Reviewed-by: NMichael S. Tsirkin <mst@redhat.com> Signed-off-by: NCornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
-
- 15 10月, 2014 2 次提交
-
-
由 Michael S. Tsirkin 提交于
virtio spec requires drivers to set DRIVER_OK before using VQs. This is set automatically after resume returns, virtio console violated this rule by adding inbufs, which causes the VQ to be used directly within restore. To fix, call virtio_device_ready before using VQs. Signed-off-by: NMichael S. Tsirkin <mst@redhat.com> Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
-
由 Michael S. Tsirkin 提交于
virtio spec requires drivers to set DRIVER_OK before using VQs. This is set automatically after probe returns, virtio console violated this rule by adding inbufs, which causes the VQ to be used directly within probe. To fix, call virtio_device_ready before using VQs. Signed-off-by: NMichael S. Tsirkin <mst@redhat.com> Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
-
- 27 7月, 2014 1 次提交
-
-
由 Fabian Frederick 提交于
Fix checkpatch warning: WARNING: debugfs_remove_recursive(NULL) is safe this check is probably not required Cc: Arnd Bergmann <arnd@arndb.de> Cc: virtualization@lists.linux-foundation.org Reviewed-by: NAmit Shah <amit.shah@redhat.com> Signed-off-by: NFabian Frederick <fabf@skynet.be> Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
-
- 02 4月, 2014 1 次提交
-
-
由 Al Viro 提交于
all pipe_buffer_operations have the same instances of those... Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
-
- 10 2月, 2014 1 次提交
-
-
由 Al Viro 提交于
While we are at it, don't do kmap() under kmap_atomic(), *especially* for a page we'd allocated with GFP_KERNEL. It's spelled "page_address", and had that been more than that, we'd have a real trouble - kmap_high() can block, and doing that while holding kmap_atomic() is a Bad Idea(tm). Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
-
- 29 10月, 2013 1 次提交
-
-
由 Heinz Graalfs 提交于
If virtqueue_get_buf() returns with a NULL pointer it should be verified if the virtqueue is broken, in order to avoid loop calling cpu_relax(). Signed-off-by: NHeinz Graalfs <graalfs@linux.vnet.ibm.com> Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
-