2019-05-27 08:55:05 +02:00
|
|
|
|
2010-01-18 19:14:55 +05:30
|
|
|
|
|
|
|
|
|
2011-01-31 13:06:37 +05:30
|
|
|
|
|
|
|
|
|
2007-10-22 11:03:39 +10:00
|
|
|
|
2009-12-21 21:36:04 +05:30
|
|
|
|
2009-12-21 22:36:21 +05:30
|
|
|
|
2011-09-22 23:44:23 +05:30
|
|
|
|
2009-12-21 21:36:04 +05:30
|
|
|
|
2007-10-22 11:03:39 +10:00
|
|
|
|
2011-09-14 13:06:41 +05:30
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
2012-08-09 21:30:39 +09:00
|
|
|
|
|
|
|
|
|
2022-11-22 14:46:43 +01:00
|
|
|
|
2007-10-22 11:03:39 +10:00
|
|
|
|
2010-01-18 19:15:05 +05:30
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
|
|
|
|
|
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.
percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.
http://userweb.kernel.org/~tj/misc/slabh-sweep.py
The script does the followings.
* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.
* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.
* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.
The conversion was done in the following steps.
1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.
2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.
3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.
4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.
5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.
6. percpu.h was updated not to include slab.h.
7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).
* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig
8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.
Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.
Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-24 17:04:11 +09:00
|
|
|
|
2010-01-18 19:15:05 +05:30
|
|
|
|
2007-10-22 11:03:39 +10:00
|
|
|
|
|
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
2011-07-03 13:35:48 -04:00
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
2025-02-12 12:48:41 +01:00
|
|
|
|
2011-02-01 09:31:25 +05:30
|
|
|
|
2007-10-22 11:03:39 +10:00
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
2021-10-19 15:01:44 +08:00
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
2010-01-18 19:15:05 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 22:36:21 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-02 18:11:49 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:05 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-11-22 14:46:43 +01:00
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:05 +05:30
|
|
|
|
2023-06-20 16:37:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-08 16:13:59 +09:30
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:05 +05:30
|
|
|
|
2010-01-18 19:15:09 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-06 02:05:08 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:09 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-11-22 14:46:43 +01:00
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:01 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-14 13:46:42 +10:30
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-14 13:46:42 +10:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-09-22 10:51:15 -07:00
|
|
|
|
2010-01-18 19:15:01 +05:30
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-02 18:11:49 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-05 10:45:49 +10:30
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-29 16:30:07 +05:30
|
|
|
|
2013-03-29 16:30:08 +05:30
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
2016-12-05 21:39:42 +02:00
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-30 08:04:15 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
2009-12-21 21:36:04 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
2011-09-14 13:06:46 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:07 +05:30
|
|
|
|
2010-01-18 19:15:00 +05:30
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:07 +05:30
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:01 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-22 11:03:39 +10:00
|
|
|
|
2010-01-18 19:15:12 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-19 22:15:50 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:07 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 22:36:21 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-09-14 13:06:46 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:09 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
2009-12-21 21:36:04 +05:30
|
|
|
|
2010-09-02 18:20:59 +05:30
|
|
|
|
2009-12-21 21:36:04 +05:30
|
|
|
|
|
|
|
|
|
2010-09-02 18:38:29 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:57:40 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-02 18:47:52 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
2010-05-19 22:15:50 -06:00
|
|
|
|
|
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
|
|
|
|
|
2009-11-26 11:25:38 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:00 +05:30
|
|
|
|
2007-10-22 11:03:39 +10:00
|
|
|
|
2010-01-18 19:15:05 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:09 +05:30
|
|
|
|
2010-01-18 19:15:05 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:09 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:05 +05:30
|
|
|
|
2010-01-18 19:15:09 +05:30
|
|
|
|
2010-01-18 19:15:05 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-02 18:20:58 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-29 14:16:13 +09:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-02 18:20:58 +05:30
|
|
|
|
2013-07-29 14:16:13 +09:30
|
|
|
|
|
|
|
|
|
2010-09-02 18:20:58 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:12 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:12 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
2010-01-18 19:15:12 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-30 16:46:10 -07:00
|
|
|
|
2014-10-07 16:39:42 +02:00
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:01 +05:30
|
|
|
|
2012-12-14 13:46:42 +10:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:01 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-04-20 19:54:23 +03:00
|
|
|
|
2012-12-14 13:46:42 +10:30
|
|
|
|
2010-01-18 19:15:01 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
|
|
|
|
|
2012-12-14 13:46:42 +10:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-02-21 17:06:51 -08:00
|
|
|
|
2010-01-18 19:15:01 +05:30
|
|
|
|
|
|
|
|
|
2012-12-14 13:46:42 +10:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
2012-12-14 13:46:42 +10:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-04-20 19:54:23 +03:00
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
virtio: virtio_console: fix DMA memory allocation for rproc serial
Since commit 086d08725d34 ("remoteproc: create vdev subdevice with
specific dma memory pool"), every remoteproc has a DMA subdevice
("remoteprocX#vdevYbuffer") for each virtio device, which inherits
DMA capabilities from the corresponding platform device. This allowed
to associate different DMA pools with each vdev, and required from
virtio drivers to perform DMA operations with the parent device
(vdev->dev.parent) instead of grandparent (vdev->dev.parent->parent).
virtio_rpmsg_bus was already changed in the same merge cycle with
commit d999b622fcfb ("rpmsg: virtio: allocate buffer from parent"),
but virtio_console did not. In fact, operations using the grandparent
worked fine while the grandparent was the platform device, but since
commit c774ad010873 ("remoteproc: Fix and restore the parenting
hierarchy for vdev") this was changed, and now the grandparent device
is the remoteproc device without any DMA capabilities.
So, starting v5.8-rc1 the following warning is observed:
[ 2.483925] ------------[ cut here ]------------
[ 2.489148] WARNING: CPU: 3 PID: 101 at kernel/dma/mapping.c:427 0x80e7eee8
[ 2.489152] Modules linked in: virtio_console(+)
[ 2.503737] virtio_rpmsg_bus rpmsg_core
[ 2.508903]
[ 2.528898] <Other modules, stack and call trace here>
[ 2.913043]
[ 2.914907] ---[ end trace 93ac8746beab612c ]---
[ 2.920102] virtio-ports vport1p0: Error allocating inbufs
kernel/dma/mapping.c:427 is:
WARN_ON_ONCE(!dev->coherent_dma_mask);
obviously because the grandparent now is remoteproc dev without any
DMA caps:
[ 3.104943] Parent: remoteproc0#vdev1buffer, grandparent: remoteproc0
Fix this the same way as it was for virtio_rpmsg_bus, using just the
parent device (vdev->dev.parent, "remoteprocX#vdevYbuffer") for DMA
operations.
This also allows now to reserve DMA pools/buffers for rproc serial
via Device Tree.
Fixes: c774ad010873 ("remoteproc: Fix and restore the parenting hierarchy for vdev")
Cc: stable@vger.kernel.org # 5.1+
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Alexander Lobakin <alobakin@pm.me>
Date: Thu, 5 Nov 2020 11:10:24 +0800
Link: https://lore.kernel.org/r/AOKowLclCbOCKxyiJ71WeNyuAAj2q8EUtxrXbyky5E@cp7-web-042.plabs.ch
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-04 15:31:36 +00:00
|
|
|
|
|
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
virtio: virtio_console: fix DMA memory allocation for rproc serial
Since commit 086d08725d34 ("remoteproc: create vdev subdevice with
specific dma memory pool"), every remoteproc has a DMA subdevice
("remoteprocX#vdevYbuffer") for each virtio device, which inherits
DMA capabilities from the corresponding platform device. This allowed
to associate different DMA pools with each vdev, and required from
virtio drivers to perform DMA operations with the parent device
(vdev->dev.parent) instead of grandparent (vdev->dev.parent->parent).
virtio_rpmsg_bus was already changed in the same merge cycle with
commit d999b622fcfb ("rpmsg: virtio: allocate buffer from parent"),
but virtio_console did not. In fact, operations using the grandparent
worked fine while the grandparent was the platform device, but since
commit c774ad010873 ("remoteproc: Fix and restore the parenting
hierarchy for vdev") this was changed, and now the grandparent device
is the remoteproc device without any DMA capabilities.
So, starting v5.8-rc1 the following warning is observed:
[ 2.483925] ------------[ cut here ]------------
[ 2.489148] WARNING: CPU: 3 PID: 101 at kernel/dma/mapping.c:427 0x80e7eee8
[ 2.489152] Modules linked in: virtio_console(+)
[ 2.503737] virtio_rpmsg_bus rpmsg_core
[ 2.508903]
[ 2.528898] <Other modules, stack and call trace here>
[ 2.913043]
[ 2.914907] ---[ end trace 93ac8746beab612c ]---
[ 2.920102] virtio-ports vport1p0: Error allocating inbufs
kernel/dma/mapping.c:427 is:
WARN_ON_ONCE(!dev->coherent_dma_mask);
obviously because the grandparent now is remoteproc dev without any
DMA caps:
[ 3.104943] Parent: remoteproc0#vdev1buffer, grandparent: remoteproc0
Fix this the same way as it was for virtio_rpmsg_bus, using just the
parent device (vdev->dev.parent, "remoteprocX#vdevYbuffer") for DMA
operations.
This also allows now to reserve DMA pools/buffers for rproc serial
via Device Tree.
Fixes: c774ad010873 ("remoteproc: Fix and restore the parenting hierarchy for vdev")
Cc: stable@vger.kernel.org # 5.1+
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Alexander Lobakin <alobakin@pm.me>
Date: Thu, 5 Nov 2020 11:10:24 +0800
Link: https://lore.kernel.org/r/AOKowLclCbOCKxyiJ71WeNyuAAj2q8EUtxrXbyky5E@cp7-web-042.plabs.ch
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-04 15:31:36 +00:00
|
|
|
|
|
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:01 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:03 +05:30
|
|
|
|
2011-09-14 13:06:42 +05:30
|
|
|
|
2010-01-18 19:15:03 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-09-14 13:06:43 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:03 +05:30
|
|
|
|
2021-05-25 20:56:22 +08:00
|
|
|
|
2010-01-18 19:15:03 +05:30
|
|
|
|
2011-09-14 13:06:46 +05:30
|
|
|
|
2010-01-18 19:15:03 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:02 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:12 +05:30
|
|
|
|
2010-01-18 19:15:02 +05:30
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:12 +05:30
|
|
|
|
2010-01-18 19:15:07 +05:30
|
|
|
|
2010-01-18 19:15:02 +05:30
|
|
|
|
|
|
|
|
|
2013-03-20 15:44:29 +10:30
|
|
|
|
2010-04-12 16:18:32 +03:00
|
|
|
|
2012-12-10 09:45:12 +10:30
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:12 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 22:15:30 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-09-14 13:06:45 +05:30
|
|
|
|
2009-12-21 22:15:30 +05:30
|
|
|
|
2011-03-04 14:04:33 +10:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-09-14 13:06:45 +05:30
|
|
|
|
2009-12-21 22:15:30 +05:30
|
|
|
|
2011-09-14 13:06:44 +05:30
|
|
|
|
2010-02-12 10:32:18 +05:30
|
|
|
|
2011-09-14 13:06:46 +05:30
|
|
|
|
2011-09-14 13:06:45 +05:30
|
|
|
|
2011-09-14 13:06:44 +05:30
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
2010-02-12 10:32:18 +05:30
|
|
|
|
2011-09-14 13:06:45 +05:30
|
|
|
|
|
|
|
|
|
2009-12-21 22:15:30 +05:30
|
|
|
|
2011-09-14 13:06:44 +05:30
|
|
|
|
2010-02-12 10:32:18 +05:30
|
|
|
|
2011-09-14 13:06:44 +05:30
|
|
|
|
2009-12-21 22:15:30 +05:30
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:12 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-12 10:32:18 +05:30
|
|
|
|
2011-09-14 13:06:43 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:12 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-19 22:15:46 -06:00
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-24 10:36:51 +05:30
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
2010-05-19 22:15:46 -06:00
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
2010-05-19 22:15:46 -06:00
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
2013-03-29 16:30:08 +05:30
|
|
|
|
2016-08-30 08:04:15 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-04-12 16:18:32 +03:00
|
|
|
|
2013-10-29 09:40:39 +10:30
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
2016-08-30 08:04:15 -07:00
|
|
|
|
2013-03-29 16:30:08 +05:30
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-19 22:15:46 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-02 18:11:42 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-19 22:15:46 -06:00
|
|
|
|
|
|
|
|
|
2012-08-09 21:30:39 +09:00
|
|
|
|
2010-05-19 22:15:50 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-14 13:46:42 +10:30
|
|
|
|
2010-05-19 22:15:50 -06:00
|
|
|
|
|
|
|
|
|
2011-03-04 14:04:33 +10:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-14 13:46:42 +10:30
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
2010-05-19 22:15:50 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-09 21:30:39 +09:00
|
|
|
|
|
|
|
|
|
2012-12-14 13:46:42 +10:30
|
|
|
|
2009-12-21 17:28:51 +05:30
|
|
|
|
|
|
|
|
|
2012-10-16 23:56:15 +10:30
|
|
|
|
2010-05-19 22:15:50 -06:00
|
|
|
|
2009-12-21 17:28:51 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-19 22:15:50 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-20 15:44:29 +10:30
|
|
|
|
2009-12-21 17:28:51 +05:30
|
|
|
|
|
|
|
|
|
2010-04-12 16:18:32 +03:00
|
|
|
|
2009-12-21 17:28:51 +05:30
|
|
|
|
2012-10-16 23:56:15 +10:30
|
|
|
|
2010-04-08 09:46:16 -06:00
|
|
|
|
2010-05-19 22:15:50 -06:00
|
|
|
|
2009-12-21 17:28:51 +05:30
|
|
|
|
|
|
|
|
|
2012-10-16 23:56:15 +10:30
|
|
|
|
2010-05-19 22:15:50 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-10-20 13:45:43 +10:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-19 22:15:50 -06:00
|
|
|
|
2013-10-29 09:40:39 +10:30
|
|
|
|
|
|
|
|
|
2009-12-21 17:28:51 +05:30
|
|
|
|
2010-05-19 22:15:50 -06:00
|
|
|
|
|
|
|
|
|
2011-09-14 13:06:46 +05:30
|
|
|
|
|
|
|
|
|
2010-05-19 22:15:50 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-04-08 09:46:16 -06:00
|
|
|
|
2009-12-21 17:28:51 +05:30
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:12 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-06 08:36:57 +01:00
|
|
|
|
2014-12-01 13:31:45 +02:00
|
|
|
|
2010-01-18 19:15:12 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:26:45 +05:30
|
|
|
|
2010-01-18 19:15:12 +05:30
|
|
|
|
2009-12-21 21:26:45 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-06 08:36:57 +01:00
|
|
|
|
2014-12-01 13:31:45 +02:00
|
|
|
|
2009-12-21 21:26:45 +05:30
|
|
|
|
2010-01-18 19:15:12 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:36:04 +05:30
|
|
|
|
2010-01-18 19:15:12 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:26:45 +05:30
|
|
|
|
2010-01-18 19:15:12 +05:30
|
|
|
|
2010-01-18 19:15:02 +05:30
|
|
|
|
|
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
2010-05-19 22:15:49 -06:00
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
2010-09-02 18:11:43 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-19 22:15:49 -06:00
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
|
|
|
|
|
2010-05-19 22:15:50 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-27 13:24:40 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-19 22:15:50 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-29 14:23:21 +09:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-09-14 13:06:41 +05:30
|
|
|
|
|
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-29 14:23:21 +09:30
|
|
|
|
2010-09-02 18:11:45 +05:30
|
|
|
|
|
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-09 21:31:00 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-14 13:46:42 +10:30
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
2010-05-19 22:15:50 -06:00
|
|
|
|
2012-12-14 13:46:42 +10:30
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
2010-09-14 13:26:16 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
|
|
|
|
|
2010-05-19 22:15:50 -06:00
|
|
|
|
|
|
|
|
|
2012-08-09 21:31:00 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-19 22:15:50 -06:00
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
|
|
|
|
|
2018-04-20 19:54:23 +03:00
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-14 13:46:42 +10:30
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-10-20 13:45:43 +10:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-14 13:46:42 +10:30
|
|
|
|
|
|
|
|
|
2010-05-19 22:15:50 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
2010-05-19 22:15:50 -06:00
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-09 21:30:39 +09:00
|
|
|
|
|
|
|
|
|
2012-08-09 21:31:20 +09:00
|
|
|
|
2012-08-09 21:30:39 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-09 21:30:50 +09:00
|
|
|
|
2012-08-09 21:30:39 +09:00
|
|
|
|
2012-08-09 21:31:20 +09:00
|
|
|
|
2012-08-09 21:30:39 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-20 17:58:16 +02:00
|
|
|
|
2012-08-09 21:30:39 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-09 21:30:50 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-02-02 07:05:05 -05:00
|
|
|
|
2012-08-09 21:30:50 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-08 19:59:02 -08:00
|
|
|
|
2014-02-02 07:05:05 -05:00
|
|
|
|
2025-01-08 19:59:02 -08:00
|
|
|
|
2012-08-09 21:30:50 +09:00
|
|
|
|
|
|
|
|
|
2012-08-09 21:30:39 +09:00
|
|
|
|
2012-08-09 21:30:50 +09:00
|
|
|
|
|
|
|
|
|
2012-08-09 21:30:39 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-14 13:46:42 +10:30
|
|
|
|
2012-08-09 21:30:39 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-11-15 13:30:32 +00:00
|
|
|
|
2012-08-09 21:30:39 +09:00
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-23 11:30:49 +09:30
|
|
|
|
2019-11-15 13:30:32 +00:00
|
|
|
|
fs/pipe: add simpler helpers for common cases
The fix to atomically read the pipe head and tail state when not holding
the pipe mutex has caused a number of headaches due to the size change
of the involved types.
It turns out that we don't have _that_ many places that access these
fields directly and were affected, but we have more than we strictly
should have, because our low-level helper functions have been designed
to have intimate knowledge of how the pipes work.
And as a result, that random noise of direct 'pipe->head' and
'pipe->tail' accesses makes it harder to pinpoint any actual potential
problem spots remaining.
For example, we didn't have a "is the pipe full" helper function, but
instead had a "given these pipe buffer indexes and this pipe size, is
the pipe full". That's because some low-level pipe code does actually
want that much more complicated interface.
But most other places literally just want a "is the pipe full" helper,
and not having it meant that those places ended up being unnecessarily
much too aware of this all.
It would have been much better if only the very core pipe code that
cared had been the one aware of this all.
So let's fix it - better late than never. This just introduces the
trivial wrappers for "is this pipe full or empty" and to get how many
pipe buffers are used, so that instead of writing
if (pipe_full(pipe->head, pipe->tail, pipe->max_usage))
the places that literally just want to know if a pipe is full can just
say
if (pipe_is_full(pipe))
instead. The existing trivial cases were converted with a 'sed' script.
This cuts down on the places that access pipe->head and pipe->tail
directly outside of the pipe code (and core splice code) quite a lot.
The splice code in particular still revels in doing the direct low-level
accesses, and the fuse fuse_dev_splice_write() code also seems a bit
unnecessarily eager to go very low-level, but it's at least a bit better
than it used to be.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2025-03-06 18:25:35 -10:00
|
|
|
|
2013-07-23 11:30:49 +09:30
|
|
|
|
2013-07-23 11:30:49 +09:30
|
|
|
|
2012-08-09 21:31:00 +09:00
|
|
|
|
|
|
|
|
|
2013-07-23 11:30:49 +09:30
|
|
|
|
2012-08-09 21:31:00 +09:00
|
|
|
|
fs/pipe: add simpler helpers for common cases
The fix to atomically read the pipe head and tail state when not holding
the pipe mutex has caused a number of headaches due to the size change
of the involved types.
It turns out that we don't have _that_ many places that access these
fields directly and were affected, but we have more than we strictly
should have, because our low-level helper functions have been designed
to have intimate knowledge of how the pipes work.
And as a result, that random noise of direct 'pipe->head' and
'pipe->tail' accesses makes it harder to pinpoint any actual potential
problem spots remaining.
For example, we didn't have a "is the pipe full" helper function, but
instead had a "given these pipe buffer indexes and this pipe size, is
the pipe full". That's because some low-level pipe code does actually
want that much more complicated interface.
But most other places literally just want a "is the pipe full" helper,
and not having it meant that those places ended up being unnecessarily
much too aware of this all.
It would have been much better if only the very core pipe code that
cared had been the one aware of this all.
So let's fix it - better late than never. This just introduces the
trivial wrappers for "is this pipe full or empty" and to get how many
pipe buffers are used, so that instead of writing
if (pipe_full(pipe->head, pipe->tail, pipe->max_usage))
the places that literally just want to know if a pipe is full can just
say
if (pipe_is_full(pipe))
instead. The existing trivial cases were converted with a 'sed' script.
This cuts down on the places that access pipe->head and pipe->tail
directly outside of the pipe code (and core splice code) quite a lot.
The splice code in particular still revels in doing the direct low-level
accesses, and the fuse fuse_dev_splice_write() code also seems a bit
unnecessarily eager to go very low-level, but it's at least a bit better
than it used to be.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2025-03-06 18:25:35 -10:00
|
|
|
|
2019-11-15 13:30:32 +00:00
|
|
|
|
2019-11-30 14:12:13 -08:00
|
|
|
|
2013-07-23 11:30:49 +09:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-14 13:46:42 +10:30
|
|
|
|
2012-08-09 21:30:39 +09:00
|
|
|
|
|
|
|
|
|
2019-11-15 13:30:32 +00:00
|
|
|
|
2012-12-14 13:46:42 +10:30
|
|
|
|
2012-08-09 21:31:20 +09:00
|
|
|
|
2012-08-09 21:30:39 +09:00
|
|
|
|
2013-07-23 11:30:49 +09:30
|
|
|
|
2012-08-09 21:30:39 +09:00
|
|
|
|
2012-12-14 13:46:42 +10:30
|
|
|
|
2012-08-09 21:30:39 +09:00
|
|
|
|
2012-10-15 09:57:33 +02:00
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
2012-08-09 21:30:39 +09:00
|
|
|
|
2013-07-23 11:30:49 +09:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-09 21:30:39 +09:00
|
|
|
|
|
|
|
|
|
2017-07-03 06:39:46 -04:00
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
|
|
|
|
|
2017-07-03 06:39:46 -04:00
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-02 18:11:44 +05:30
|
|
|
|
|
|
|
|
|
2018-02-11 14:34:03 -08:00
|
|
|
|
2010-09-02 18:11:44 +05:30
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
2010-09-16 14:43:08 +05:30
|
|
|
|
2018-02-11 14:34:03 -08:00
|
|
|
|
2010-05-19 22:15:50 -06:00
|
|
|
|
2018-02-11 14:34:03 -08:00
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
2018-02-11 14:34:03 -08:00
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-02 18:38:29 +05:30
|
|
|
|
|
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 22:15:30 +05:30
|
|
|
|
2009-11-26 11:25:38 +05:30
|
|
|
|
|
|
|
|
|
2009-12-21 22:15:30 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-19 22:15:50 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
2010-09-02 18:38:29 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-02 18:11:48 +05:30
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
2013-07-29 14:16:13 +09:30
|
|
|
|
2010-09-02 18:20:58 +05:30
|
|
|
|
2013-07-29 14:17:13 +09:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-02 18:11:48 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
2009-11-26 11:25:38 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-15 12:00:15 +09:30
|
|
|
|
2010-09-02 18:11:48 +05:30
|
|
|
|
2009-11-26 11:25:38 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-19 22:15:50 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-16 14:43:09 +05:30
|
|
|
|
|
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-02 18:11:48 +05:30
|
|
|
|
2010-09-02 18:38:29 +05:30
|
|
|
|
2010-09-02 18:11:48 +05:30
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
|
|
|
|
|
2010-09-02 18:47:52 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-09 21:30:39 +09:00
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
|
|
|
|
|
2010-09-02 18:47:52 +05:30
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
|
|
|
|
|
2010-01-18 19:14:55 +05:30
|
|
|
|
|
|
|
|
|
2007-10-22 11:03:39 +10:00
|
|
|
|
2010-01-18 19:14:55 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-08-16 19:31:57 +02:00
|
|
|
|
2010-01-18 19:14:55 +05:30
|
|
|
|
2023-12-06 08:36:57 +01:00
|
|
|
|
2007-10-22 11:03:39 +10:00
|
|
|
|
2010-01-18 19:15:00 +05:30
|
|
|
|
2012-12-14 13:46:42 +10:30
|
|
|
|
2017-02-01 00:02:27 -08:00
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:05 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-19 22:15:47 -06:00
|
|
|
|
2007-10-22 11:03:39 +10:00
|
|
|
|
2017-02-01 00:02:27 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-22 11:03:39 +10:00
|
|
|
|
|
|
|
|
|
2010-01-18 19:14:55 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-22 11:03:39 +10:00
|
|
|
|
2010-01-18 19:15:12 +05:30
|
|
|
|
|
|
|
|
|
2010-01-18 19:14:55 +05:30
|
|
|
|
2023-12-06 08:36:57 +01:00
|
|
|
|
2007-10-22 11:03:39 +10:00
|
|
|
|
2010-01-18 19:15:00 +05:30
|
|
|
|
2007-10-22 11:03:39 +10:00
|
|
|
|
2010-01-18 19:15:05 +05:30
|
|
|
|
|
|
|
|
|
2010-05-19 22:15:47 -06:00
|
|
|
|
2010-01-18 19:15:00 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-06 08:36:57 +01:00
|
|
|
|
2007-10-22 11:03:39 +10:00
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:08 +05:30
|
|
|
|
2008-11-25 13:36:26 +01:00
|
|
|
|
2010-01-18 19:15:08 +05:30
|
|
|
|
2008-11-25 13:36:26 +01:00
|
|
|
|
2010-03-19 17:36:44 +05:30
|
|
|
|
2010-05-06 02:05:08 +05:30
|
|
|
|
2010-03-19 17:36:44 +05:30
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:08 +05:30
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-06 02:05:08 +05:30
|
|
|
|
2008-11-25 13:36:26 +01:00
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:05 +05:30
|
|
|
|
2008-06-20 15:24:15 +02:00
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:05 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-06-20 15:24:15 +02:00
|
|
|
|
2010-01-18 19:15:08 +05:30
|
|
|
|
2008-11-25 13:36:26 +01:00
|
|
|
|
2008-06-20 15:24:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
2009-11-28 12:20:26 +05:30
|
|
|
|
2010-01-18 19:14:56 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-08 16:13:59 +09:30
|
|
|
|
2010-01-18 19:15:10 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-11-22 14:46:43 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:10 +05:30
|
|
|
|
2022-11-22 14:46:43 +01:00
|
|
|
|
2010-01-18 19:15:10 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-18 16:35:23 +05:30
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:10 +05:30
|
|
|
|
2022-11-22 14:46:43 +01:00
|
|
|
|
2010-01-18 19:15:10 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-11-26 11:25:38 +05:30
|
|
|
|
2010-01-18 19:15:10 +05:30
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:10 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:57:40 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-08-02 16:51:08 +05:30
|
|
|
|
2009-12-21 21:57:40 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-11-30 21:41:28 -05:00
|
|
|
|
2009-12-21 22:36:21 +05:30
|
|
|
|
2018-07-13 00:39:56 +03:00
|
|
|
|
2009-12-21 22:36:21 +05:30
|
|
|
|
2018-07-13 00:39:56 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-02-12 12:48:41 +01:00
|
|
|
|
2018-07-13 00:39:56 +03:00
|
|
|
|
2009-12-21 22:36:21 +05:30
|
|
|
|
2018-07-13 00:39:56 +03:00
|
|
|
|
|
|
|
|
|
2009-12-21 22:36:21 +05:30
|
|
|
|
2018-11-30 21:41:28 -05:00
|
|
|
|
2009-12-21 22:36:21 +05:30
|
|
|
|
2010-05-06 02:05:08 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
virtio_console: allocate inbufs in add_port() only if it is needed
When we hot unplug a virtserialport and then try to hot plug again,
it fails:
(qemu) chardev-add socket,id=serial0,path=/tmp/serial0,server,nowait
(qemu) device_add virtserialport,bus=virtio-serial0.0,nr=2,\
chardev=serial0,id=serial0,name=serial0
(qemu) device_del serial0
(qemu) device_add virtserialport,bus=virtio-serial0.0,nr=2,\
chardev=serial0,id=serial0,name=serial0
kernel error:
virtio-ports vport2p2: Error allocating inbufs
qemu error:
virtio-serial-bus: Guest failure in adding port 2 for device \
virtio-serial0.0
This happens because buffers for the in_vq are allocated when the port is
added but are not released when the port is unplugged.
They are only released when virtconsole is removed (see a7a69ec0d8e4)
To avoid the problem and to be symmetric, we could allocate all the buffers
in init_vqs() as they are released in remove_vqs(), but it sounds like
a waste of memory.
Rather than that, this patch changes add_port() logic to ignore ENOSPC
error in fill_queue(), which means queue has already been filled.
Fixes: a7a69ec0d8e4 ("virtio_console: free buffers after reset")
Cc: mst@redhat.com
Cc: stable@vger.kernel.org
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-11-14 13:25:48 +01:00
|
|
|
|
2010-05-19 22:15:48 -06:00
|
|
|
|
|
|
|
|
|
virtio_console: allocate inbufs in add_port() only if it is needed
When we hot unplug a virtserialport and then try to hot plug again,
it fails:
(qemu) chardev-add socket,id=serial0,path=/tmp/serial0,server,nowait
(qemu) device_add virtserialport,bus=virtio-serial0.0,nr=2,\
chardev=serial0,id=serial0,name=serial0
(qemu) device_del serial0
(qemu) device_add virtserialport,bus=virtio-serial0.0,nr=2,\
chardev=serial0,id=serial0,name=serial0
kernel error:
virtio-ports vport2p2: Error allocating inbufs
qemu error:
virtio-serial-bus: Guest failure in adding port 2 for device \
virtio-serial0.0
This happens because buffers for the in_vq are allocated when the port is
added but are not released when the port is unplugged.
They are only released when virtconsole is removed (see a7a69ec0d8e4)
To avoid the problem and to be symmetric, we could allocate all the buffers
in init_vqs() as they are released in remove_vqs(), but it sounds like
a waste of memory.
Rather than that, this patch changes add_port() logic to ignore ENOSPC
error in fill_queue(), which means queue has already been filled.
Fixes: a7a69ec0d8e4 ("virtio_console: free buffers after reset")
Cc: mst@redhat.com
Cc: stable@vger.kernel.org
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-11-14 13:25:48 +01:00
|
|
|
|
2010-05-19 22:15:48 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-04-20 19:54:23 +03:00
|
|
|
|
2010-05-19 22:15:48 -06:00
|
|
|
|
virtio_console: allocate inbufs in add_port() only if it is needed
When we hot unplug a virtserialport and then try to hot plug again,
it fails:
(qemu) chardev-add socket,id=serial0,path=/tmp/serial0,server,nowait
(qemu) device_add virtserialport,bus=virtio-serial0.0,nr=2,\
chardev=serial0,id=serial0,name=serial0
(qemu) device_del serial0
(qemu) device_add virtserialport,bus=virtio-serial0.0,nr=2,\
chardev=serial0,id=serial0,name=serial0
kernel error:
virtio-ports vport2p2: Error allocating inbufs
qemu error:
virtio-serial-bus: Guest failure in adding port 2 for device \
virtio-serial0.0
This happens because buffers for the in_vq are allocated when the port is
added but are not released when the port is unplugged.
They are only released when virtconsole is removed (see a7a69ec0d8e4)
To avoid the problem and to be symmetric, we could allocate all the buffers
in init_vqs() as they are released in remove_vqs(), but it sounds like
a waste of memory.
Rather than that, this patch changes add_port() logic to ignore ENOSPC
error in fill_queue(), which means queue has already been filled.
Fixes: a7a69ec0d8e4 ("virtio_console: free buffers after reset")
Cc: mst@redhat.com
Cc: stable@vger.kernel.org
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-11-14 13:25:48 +01:00
|
|
|
|
2010-05-19 22:15:48 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
virtio_console: allocate inbufs in add_port() only if it is needed
When we hot unplug a virtserialport and then try to hot plug again,
it fails:
(qemu) chardev-add socket,id=serial0,path=/tmp/serial0,server,nowait
(qemu) device_add virtserialport,bus=virtio-serial0.0,nr=2,\
chardev=serial0,id=serial0,name=serial0
(qemu) device_del serial0
(qemu) device_add virtserialport,bus=virtio-serial0.0,nr=2,\
chardev=serial0,id=serial0,name=serial0
kernel error:
virtio-ports vport2p2: Error allocating inbufs
qemu error:
virtio-serial-bus: Guest failure in adding port 2 for device \
virtio-serial0.0
This happens because buffers for the in_vq are allocated when the port is
added but are not released when the port is unplugged.
They are only released when virtconsole is removed (see a7a69ec0d8e4)
To avoid the problem and to be symmetric, we could allocate all the buffers
in init_vqs() as they are released in remove_vqs(), but it sounds like
a waste of memory.
Rather than that, this patch changes add_port() logic to ignore ENOSPC
error in fill_queue(), which means queue has already been filled.
Fixes: a7a69ec0d8e4 ("virtio_console: free buffers after reset")
Cc: mst@redhat.com
Cc: stable@vger.kernel.org
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-11-14 13:25:48 +01:00
|
|
|
|
2010-05-19 22:15:48 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-02 18:47:52 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-19 22:15:48 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-02-21 16:37:42 -08:00
|
|
|
|
2010-05-19 22:15:48 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-02 18:38:29 +05:30
|
|
|
|
2010-05-19 22:15:48 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-02 18:47:52 +05:30
|
|
|
|
2010-05-19 22:15:48 -06:00
|
|
|
|
2010-05-06 02:05:08 +05:30
|
|
|
|
2019-03-19 11:34:06 +05:30
|
|
|
|
2010-05-06 02:05:08 +05:30
|
|
|
|
2010-05-19 22:15:48 -06:00
|
|
|
|
2011-09-14 13:06:46 +05:30
|
|
|
|
2010-05-19 22:15:48 -06:00
|
|
|
|
2010-05-19 22:15:50 -06:00
|
|
|
|
|
|
|
|
|
2010-05-19 22:15:48 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-02 18:20:59 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-19 22:15:48 -06:00
|
|
|
|
|
|
|
|
|
2010-09-02 18:20:59 +05:30
|
|
|
|
2010-05-19 22:15:48 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-02 18:20:59 +05:30
|
|
|
|
2010-05-19 22:15:48 -06:00
|
|
|
|
2023-06-20 16:37:58 +02:00
|
|
|
|
2010-05-19 22:15:48 -06:00
|
|
|
|
2013-02-12 16:24:59 +10:30
|
|
|
|
2010-05-19 22:15:48 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-19 22:15:50 -06:00
|
|
|
|
2010-05-19 22:15:48 -06:00
|
|
|
|
|
|
|
|
|
virtio_console: allocate inbufs in add_port() only if it is needed
When we hot unplug a virtserialport and then try to hot plug again,
it fails:
(qemu) chardev-add socket,id=serial0,path=/tmp/serial0,server,nowait
(qemu) device_add virtserialport,bus=virtio-serial0.0,nr=2,\
chardev=serial0,id=serial0,name=serial0
(qemu) device_del serial0
(qemu) device_add virtserialport,bus=virtio-serial0.0,nr=2,\
chardev=serial0,id=serial0,name=serial0
kernel error:
virtio-ports vport2p2: Error allocating inbufs
qemu error:
virtio-serial-bus: Guest failure in adding port 2 for device \
virtio-serial0.0
This happens because buffers for the in_vq are allocated when the port is
added but are not released when the port is unplugged.
They are only released when virtconsole is removed (see a7a69ec0d8e4)
To avoid the problem and to be symmetric, we could allocate all the buffers
in init_vqs() as they are released in remove_vqs(), but it sounds like
a waste of memory.
Rather than that, this patch changes add_port() logic to ignore ENOSPC
error in fill_queue(), which means queue has already been filled.
Fixes: a7a69ec0d8e4 ("virtio_console: free buffers after reset")
Cc: mst@redhat.com
Cc: stable@vger.kernel.org
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-11-14 13:25:48 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-19 22:15:48 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-18 19:19:14 +10:30
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-19 22:15:48 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-16 16:04:10 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-02-10 11:59:45 +02:00
|
|
|
|
2021-02-16 16:04:10 +01:00
|
|
|
|
|
|
|
|
|
2010-05-19 22:15:48 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-20 16:37:58 +02:00
|
|
|
|
2010-05-19 22:15:48 -06:00
|
|
|
|
2010-09-02 18:20:59 +05:30
|
|
|
|
2010-05-19 22:15:48 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
drivers/char: Eliminate use after free
In each case, the first argument to send_control_msg or __send_control_msg,
respectively, has either not been successfully allocated or has been freed
at the point of the call. In the first case, the first argument, port, is
only used to access the portdev and id fields, in order to call
__send_control_msg. Thus it seems possible instead to call
__send_control_msg directly. In the second case, the call to
__send_control_msg is moved up to a place where it seems like the first
argument, portdev, has been initialized sufficiently to make the call to
__send_control_msg meaningful.
This has only been compile tested.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@free@
expression E;
position p;
@@
kfree@p(E)
@@
expression free.E, subE<=free.E, E1;
position free.p;
@@
kfree@p(E)
...
(
subE = E1
|
* E
)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-05-15 11:45:53 +02:00
|
|
|
|
2010-05-19 22:15:48 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-02 18:38:29 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-22 16:58:27 +05:30
|
|
|
|
|
|
|
|
|
2013-07-29 14:23:46 +09:30
|
|
|
|
2011-12-22 16:58:27 +05:30
|
|
|
|
|
|
|
|
|
2016-10-11 12:05:15 +01:00
|
|
|
|
2011-12-22 16:58:27 +05:30
|
|
|
|
2013-07-29 14:23:46 +09:30
|
|
|
|
|
|
|
|
|
2016-10-11 12:05:15 +01:00
|
|
|
|
2011-12-22 16:58:27 +05:30
|
|
|
|
|
|
|
|
|
2010-09-02 18:38:29 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 22:27:31 +05:30
|
|
|
|
2010-09-02 18:38:29 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-29 14:24:15 +09:30
|
|
|
|
2010-05-27 13:24:39 +05:30
|
|
|
|
2010-09-02 18:47:54 +05:30
|
|
|
|
|
|
|
|
|
2013-07-29 14:21:32 +09:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-27 13:24:39 +05:30
|
|
|
|
2013-07-29 14:24:15 +09:30
|
|
|
|
2010-05-27 13:24:39 +05:30
|
|
|
|
2009-12-21 22:27:31 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-11-22 14:46:43 +01:00
|
|
|
|
2009-12-21 22:27:31 +05:30
|
|
|
|
|
|
|
|
|
2011-12-22 16:58:27 +05:30
|
|
|
|
2010-02-12 10:32:15 +05:30
|
|
|
|
2010-09-02 18:38:29 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 22:27:31 +05:30
|
|
|
|
2013-07-29 14:20:29 +09:30
|
|
|
|
2023-06-20 16:37:58 +02:00
|
|
|
|
2013-07-29 14:20:29 +09:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-07 15:54:17 +09:30
|
|
|
|
2013-07-29 14:20:29 +09:30
|
|
|
|
2010-09-02 18:38:29 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 22:27:31 +05:30
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
2014-12-01 13:17:40 +02:00
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:57:40 +05:30
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-12-01 13:17:40 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-12-01 13:17:40 +02:00
|
|
|
|
2010-05-19 22:15:48 -06:00
|
|
|
|
|
|
|
|
|
2010-05-19 22:15:49 -06:00
|
|
|
|
|
|
|
|
|
2010-05-19 22:15:48 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-12-01 13:17:40 +02:00
|
|
|
|
2016-12-05 21:39:42 +02:00
|
|
|
|
2010-05-19 22:15:48 -06:00
|
|
|
|
2014-12-01 13:17:40 +02:00
|
|
|
|
|
|
|
|
|
2016-12-05 21:39:42 +02:00
|
|
|
|
2010-05-19 22:15:48 -06:00
|
|
|
|
|
|
|
|
|
2014-12-01 13:17:40 +02:00
|
|
|
|
2010-05-19 22:15:48 -06:00
|
|
|
|
|
|
|
|
|
2010-09-02 18:38:29 +05:30
|
|
|
|
2010-05-19 22:15:48 -06:00
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-09-22 23:44:23 +05:30
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-06 02:05:09 +05:30
|
|
|
|
|
|
|
|
|
2025-03-22 01:29:54 +01:00
|
|
|
|
2025-03-24 15:42:46 +01:00
|
|
|
|
2010-05-06 02:05:09 +05:30
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
2010-05-06 02:05:09 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-22 01:29:54 +01:00
|
|
|
|
|
|
|
|
|
2010-05-06 02:05:09 +05:30
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-06 02:05:09 +05:30
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
2014-12-01 13:17:40 +02:00
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
2010-05-19 22:15:50 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-02 18:47:52 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-29 14:25:38 +09:30
|
|
|
|
2010-09-02 18:47:52 +05:30
|
|
|
|
2013-07-29 14:25:38 +09:30
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
2009-12-21 21:57:40 +05:30
|
|
|
|
2011-09-14 13:06:40 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:57:40 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-17 20:29:44 -05:00
|
|
|
|
|
|
|
|
|
2009-12-21 21:57:40 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-03-19 17:36:43 +05:30
|
|
|
|
2009-12-21 21:57:40 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-03-19 17:36:43 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:57:40 +05:30
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-29 16:30:07 +05:30
|
|
|
|
2010-04-12 16:18:32 +03:00
|
|
|
|
2013-03-29 16:30:07 +05:30
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
2021-05-25 20:56:22 +08:00
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
2014-12-01 13:17:40 +02:00
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
2013-03-29 16:30:07 +05:30
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
2013-03-29 16:30:07 +05:30
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
2018-04-20 20:24:23 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-31 13:06:36 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-04-20 20:24:23 +03:00
|
|
|
|
|
|
|
|
|
2011-01-31 13:06:36 +05:30
|
|
|
|
2018-04-20 20:24:23 +03:00
|
|
|
|
2011-01-31 13:06:36 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-04-20 20:24:23 +03:00
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
2018-04-20 20:24:23 +03:00
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
2011-09-14 13:06:43 +05:30
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
2009-12-21 22:15:30 +05:30
|
|
|
|
2013-03-18 19:19:14 +10:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 22:15:30 +05:30
|
|
|
|
2013-03-18 19:19:14 +10:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 22:15:30 +05:30
|
|
|
|
2013-03-18 19:19:14 +10:30
|
|
|
|
|
|
|
|
|
2009-12-21 22:15:30 +05:30
|
|
|
|
|
|
|
|
|
2013-07-29 14:25:38 +09:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
2009-12-21 21:49:30 +05:30
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 22:22:08 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-19 22:15:48 -06:00
|
|
|
|
2015-03-05 10:45:49 +10:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-19 23:37:46 +02:00
|
|
|
|
2010-05-06 02:05:07 +05:30
|
|
|
|
2015-03-05 10:45:49 +10:30
|
|
|
|
2010-05-06 02:05:08 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-05 10:45:49 +10:30
|
|
|
|
2013-10-14 18:11:51 +10:30
|
|
|
|
|
|
|
|
|
2010-05-06 02:05:08 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-06 02:05:07 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-06 02:05:08 +05:30
|
|
|
|
2010-05-06 02:05:07 +05:30
|
|
|
|
2009-12-21 22:22:08 +05:30
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:11 +05:30
|
|
|
|
|
|
|
|
|
2024-07-08 09:48:06 +02:00
|
|
|
|
2010-01-18 19:15:11 +05:30
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
2010-01-18 19:15:11 +05:30
|
|
|
|
|
|
|
|
|
2016-12-05 21:39:42 +02:00
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
2010-01-18 19:15:11 +05:30
|
|
|
|
2026-02-21 16:37:42 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-02-21 20:03:00 -08:00
|
|
|
|
2024-07-08 09:48:06 +02:00
|
|
|
|
2010-01-18 19:15:11 +05:30
|
|
|
|
2010-11-06 10:06:50 +01:00
|
|
|
|
2010-01-18 19:15:11 +05:30
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-08 09:48:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
2010-01-18 19:15:11 +05:30
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
2024-07-08 09:48:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-08 09:48:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:11 +05:30
|
|
|
|
2024-07-08 09:48:14 +02:00
|
|
|
|
2010-01-18 19:15:11 +05:30
|
|
|
|
2010-11-06 10:06:50 +01:00
|
|
|
|
2010-01-18 19:15:11 +05:30
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
2010-01-18 19:15:11 +05:30
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:11 +05:30
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-08 09:48:06 +02:00
|
|
|
|
2010-01-18 19:15:11 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-11-06 10:06:50 +01:00
|
|
|
|
2010-01-18 19:15:11 +05:30
|
|
|
|
|
|
|
|
|
2024-07-08 09:48:06 +02:00
|
|
|
|
2010-01-18 19:15:11 +05:30
|
|
|
|
2010-11-06 10:06:50 +01:00
|
|
|
|
2010-01-18 19:15:11 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:36:04 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-22 16:58:27 +05:30
|
|
|
|
|
|
|
|
|
2018-04-20 20:24:23 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-09 21:18:16 +08:00
|
|
|
|
2018-04-20 20:24:23 +03:00
|
|
|
|
2011-12-22 16:58:27 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-04-20 20:51:18 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-10-05 03:04:10 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-04-20 20:51:18 +03:00
|
|
|
|
2021-10-13 06:55:44 -04:00
|
|
|
|
2018-04-20 20:51:18 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:07 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:07 +05:30
|
|
|
|
2012-11-19 13:22:51 -05:00
|
|
|
|
2010-01-18 19:15:07 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
2011-09-22 23:44:23 +05:30
|
|
|
|
2015-02-11 15:01:14 +10:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-12 16:23:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-02-21 16:37:42 -08:00
|
|
|
|
2010-01-18 19:15:07 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:36:04 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-12 16:24:59 +10:30
|
|
|
|
2009-12-21 21:36:04 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
2016-12-05 21:39:42 +02:00
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-10-14 18:11:51 +10:30
|
|
|
|
|
|
|
|
|
2016-12-05 21:39:42 +02:00
|
|
|
|
2021-10-19 15:01:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-04-20 21:00:13 +03:00
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
2015-03-05 10:45:49 +10:30
|
|
|
|
2015-03-05 10:45:30 +10:30
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
2013-03-29 16:30:07 +05:30
|
|
|
|
2013-03-29 16:30:08 +05:30
|
|
|
|
2024-09-16 14:16:44 -04:00
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
2024-09-16 14:16:44 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
virtio_console: allocate inbufs in add_port() only if it is needed
When we hot unplug a virtserialport and then try to hot plug again,
it fails:
(qemu) chardev-add socket,id=serial0,path=/tmp/serial0,server,nowait
(qemu) device_add virtserialport,bus=virtio-serial0.0,nr=2,\
chardev=serial0,id=serial0,name=serial0
(qemu) device_del serial0
(qemu) device_add virtserialport,bus=virtio-serial0.0,nr=2,\
chardev=serial0,id=serial0,name=serial0
kernel error:
virtio-ports vport2p2: Error allocating inbufs
qemu error:
virtio-serial-bus: Guest failure in adding port 2 for device \
virtio-serial0.0
This happens because buffers for the in_vq are allocated when the port is
added but are not released when the port is unplugged.
They are only released when virtconsole is removed (see a7a69ec0d8e4)
To avoid the problem and to be symmetric, we could allocate all the buffers
in init_vqs() as they are released in remove_vqs(), but it sounds like
a waste of memory.
Rather than that, this patch changes add_port() logic to ignore ENOSPC
error in fill_queue(), which means queue has already been filled.
Fixes: a7a69ec0d8e4 ("virtio_console: free buffers after reset")
Cc: mst@redhat.com
Cc: stable@vger.kernel.org
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-11-14 13:25:48 +01:00
|
|
|
|
|
|
|
|
|
2010-02-12 10:32:17 +05:30
|
|
|
|
|
|
|
|
|
2018-04-20 21:00:13 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
virtio_console: allocate inbufs in add_port() only if it is needed
When we hot unplug a virtserialport and then try to hot plug again,
it fails:
(qemu) chardev-add socket,id=serial0,path=/tmp/serial0,server,nowait
(qemu) device_add virtserialport,bus=virtio-serial0.0,nr=2,\
chardev=serial0,id=serial0,name=serial0
(qemu) device_del serial0
(qemu) device_add virtserialport,bus=virtio-serial0.0,nr=2,\
chardev=serial0,id=serial0,name=serial0
kernel error:
virtio-ports vport2p2: Error allocating inbufs
qemu error:
virtio-serial-bus: Guest failure in adding port 2 for device \
virtio-serial0.0
This happens because buffers for the in_vq are allocated when the port is
added but are not released when the port is unplugged.
They are only released when virtconsole is removed (see a7a69ec0d8e4)
To avoid the problem and to be symmetric, we could allocate all the buffers
in init_vqs() as they are released in remove_vqs(), but it sounds like
a waste of memory.
Rather than that, this patch changes add_port() logic to ignore ENOSPC
error in fill_queue(), which means queue has already been filled.
Fixes: a7a69ec0d8e4 ("virtio_console: free buffers after reset")
Cc: mst@redhat.com
Cc: stable@vger.kernel.org
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-11-14 13:25:48 +01:00
|
|
|
|
2010-02-12 10:32:17 +05:30
|
|
|
|
2010-05-19 22:15:49 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 21:03:25 +05:30
|
|
|
|
|
|
|
|
|
2010-09-02 18:11:49 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-19 22:15:48 -06:00
|
|
|
|
|
|
|
|
|
2011-09-22 23:44:23 +05:30
|
|
|
|
2007-10-22 11:03:39 +10:00
|
|
|
|
|
|
|
|
|
2009-12-21 21:36:04 +05:30
|
|
|
|
|
|
|
|
|
2007-10-22 11:03:39 +10:00
|
|
|
|
2010-01-18 19:15:07 +05:30
|
|
|
|
2007-10-22 11:03:39 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-01 22:09:50 +02:00
|
|
|
|
2007-10-22 11:03:39 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 11:09:33 +00:00
|
|
|
|
2007-10-22 11:03:39 +10:00
|
|
|
|
2020-07-01 22:09:50 +02:00
|
|
|
|
2008-11-25 13:36:26 +01:00
|
|
|
|
2010-05-19 22:15:46 -06:00
|
|
|
|
2008-11-25 13:36:26 +01:00
|
|
|
|
|
|
|
|
|
2020-07-01 22:09:50 +02:00
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 11:09:33 +00:00
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
2020-07-01 22:09:50 +02:00
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
|
|
|
|
|
2013-09-17 09:25:23 +09:30
|
|
|
|
2011-12-22 16:58:28 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-10-13 06:55:44 -04:00
|
|
|
|
2011-12-22 16:58:28 +05:30
|
|
|
|
2017-03-29 23:22:04 +03:00
|
|
|
|
|
|
|
|
|
2011-12-22 16:58:28 +05:30
|
|
|
|
2015-03-05 10:45:49 +10:30
|
|
|
|
2012-01-06 16:19:08 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-29 23:22:04 +03:00
|
|
|
|
|
|
|
|
|
2011-12-22 16:58:28 +05:30
|
|
|
|
|
|
|
|
|
2012-01-06 16:19:08 +05:30
|
|
|
|
|
|
|
|
|
2011-12-22 16:58:28 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-10-15 10:22:32 +10:30
|
|
|
|
|
|
|
|
|
2011-12-22 16:58:28 +05:30
|
|
|
|
2013-03-29 16:30:07 +05:30
|
|
|
|
2011-12-22 16:58:28 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-04-25 14:40:39 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-22 16:58:28 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-22 11:03:39 +10:00
|
|
|
|
2008-11-25 13:36:26 +01:00
|
|
|
|
|
|
|
|
|
2007-10-22 11:03:39 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-12 10:32:16 +05:30
|
|
|
|
2009-12-21 22:22:08 +05:30
|
|
|
|
2013-09-17 09:25:23 +09:30
|
|
|
|
2011-12-22 16:58:28 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-22 11:03:39 +10:00
|
|
|
|
|
|
|
|
|
2012-12-21 15:12:08 -08:00
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-16 12:20:03 -07:00
|
|
|
|
2007-10-22 11:03:39 +10:00
|
|
|
|
2009-12-21 21:36:04 +05:30
|
|
|
|
|
|
|
|
|
2023-06-20 16:37:58 +02:00
|
|
|
|
|
|
|
|
|
2009-12-21 21:36:04 +05:30
|
|
|
|
2009-12-21 22:36:21 +05:30
|
|
|
|
|
|
|
|
|
2010-01-18 19:15:05 +05:30
|
|
|
|
2010-09-02 18:11:49 +05:30
|
|
|
|
2010-01-18 19:15:05 +05:30
|
|
|
|
2012-09-01 23:49:37 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-09-01 23:49:37 +04:00
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
|
|
|
|
|
2012-09-01 23:49:37 +04:00
|
|
|
|
2014-07-27 07:30:01 +09:30
|
|
|
|
2023-06-20 16:37:58 +02:00
|
|
|
|
2012-09-01 23:49:37 +04:00
|
|
|
|
2007-10-22 11:03:39 +10:00
|
|
|
|
2010-02-12 10:32:16 +05:30
|
|
|
|
2022-03-16 12:20:03 -07:00
|
|
|
|
2010-02-12 10:32:16 +05:30
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
|
|
|
|
|
2010-02-12 10:32:16 +05:30
|
|
|
|
2012-12-14 14:40:51 +10:30
|
|
|
|
2010-02-12 10:32:16 +05:30
|
|
|
|
2023-06-20 16:37:58 +02:00
|
|
|
|
2014-07-27 07:30:01 +09:30
|
|
|
|
2010-02-12 10:32:16 +05:30
|
|
|
|
2022-03-16 12:20:03 -07:00
|
|
|
|
|
|
|
|
|
2007-10-22 11:03:39 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|