[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-commits] [qemu/qemu] 51a81a: virtio-net: calculating proper msix v
From: |
Peter Maydell |
Subject: |
[Qemu-commits] [qemu/qemu] 51a81a: virtio-net: calculating proper msix vectors on init |
Date: |
Tue, 16 Mar 2021 05:31:33 -0700 |
Branch: refs/heads/master
Home: https://github.com/qemu/qemu
Commit: 51a81a2118df0c70988f00d61647da9e298483a4
https://github.com/qemu/qemu/commit/51a81a2118df0c70988f00d61647da9e298483a4
Author: Jason Wang <jasowang@redhat.com>
Date: 2021-03-15 (Mon, 15 Mar 2021)
Changed paths:
M hw/core/machine.c
M hw/virtio/virtio-net-pci.c
Log Message:
-----------
virtio-net: calculating proper msix vectors on init
Currently, the default msix vectors for virtio-net-pci is 3 which is
obvious not suitable for multiqueue guest, so we depends on the user
or management tools to pass a correct vectors parameter. In fact, we
can simplifying this by calculating the number of vectors on realize.
Consider we have N queues, the number of vectors needed is 2*N + 2
(#queue pairs + plus one config interrupt and control vq). We didn't
check whether or not host support control vq because it was added
unconditionally by qemu to avoid breaking legacy guests such as Minix.
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Commit: 26d0586fc931dd541d5c040c5e3b2a7bb183f96c
https://github.com/qemu/qemu/commit/26d0586fc931dd541d5c040c5e3b2a7bb183f96c
Author: Bin Meng <bin.meng@windriver.com>
Date: 2021-03-15 (Mon, 15 Mar 2021)
Changed paths:
M net/net.c
Log Message:
-----------
net: Fix build error when DEBUG_NET is on
"qemu-common.h" should be included to provide the forward declaration
of qemu_hexdump() when DEBUG_NET is on.
Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Commit: e73b4317b7b7a9d67368387c2f4fbfba6c43e39f
https://github.com/qemu/qemu/commit/e73b4317b7b7a9d67368387c2f4fbfba6c43e39f
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: 2021-03-15 (Mon, 15 Mar 2021)
Changed paths:
M net/net.c
Log Message:
-----------
net: validate that ids are well formed
When a network or network device is created from the command line or HMP,
QemuOpts ensures that the id passes the id_wellformed check. However,
QMP skips this:
$ qemu-system-x86_64 -qmp stdio -S -nic user,id=123/456
qemu-system-x86_64: -nic user,id=123/456: Parameter id expects an identifier
Identifiers consist of letters, digits, -, ., _, starting with a letter.
$ qemu-system-x86_64 -qmp stdio -S
{"execute":"qmp_capabilities"}
{"return": {}}
{"execute":"netdev_add", "arguments": {"type": "user", "id": "123/456"}}
{"return": {}}
After:
$ qemu-system-x86_64 -qmp stdio -S
{"execute":"qmp_capabilities"}
{"return": {}}
{"execute":"netdev_add", "arguments": {"type": "user", "id": "123/456"}}
{"error": {"class": "GenericError", "desc": "Parameter "id" expects an
identifier"}}
Validity checks should be performed always at the bottom of the call chain,
because QMP skips all the steps above. At the same time we know that every
call chain should go through either QMP or (for legacy) through QemuOpts.
Because the id for -net and -nic is automatically generated and not
well-formed by design, just add the check to QMP.
Cc: Jason Wang <jasowang@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Commit: 3de46e6fc489c52c9431a8a832ad8170a7569bd8
https://github.com/qemu/qemu/commit/3de46e6fc489c52c9431a8a832ad8170a7569bd8
Author: Jason Wang <jasowang@redhat.com>
Date: 2021-03-15 (Mon, 15 Mar 2021)
Changed paths:
M hw/net/e1000.c
Log Message:
-----------
e1000: fail early for evil descriptor
During procss_tx_desc(), driver can try to chain data descriptor with
legacy descriptor, when will lead underflow for the following
calculation in process_tx_desc() for bytes:
if (tp->size + bytes > msh)
bytes = msh - tp->size;
This will lead a infinite loop. So check and fail early if tp->size if
greater or equal to msh.
Reported-by: Alexander Bulekov <alxndr@bu.edu>
Reported-by: Cheolwoo Myung <cwmyung@snu.ac.kr>
Reported-by: Ruhr-University Bochum <bugs-syssec@rub.de>
Cc: Prasad J Pandit <ppandit@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Jason Wang <jasowang@redhat.com>
Commit: 705df5466c98f3efdd2b68d3b31dad86858acad7
https://github.com/qemu/qemu/commit/705df5466c98f3efdd2b68d3b31dad86858acad7
Author: Jason Wang <jasowang@redhat.com>
Date: 2021-03-15 (Mon, 15 Mar 2021)
Changed paths:
M include/net/net.h
M include/net/queue.h
M net/net.c
M net/queue.c
Log Message:
-----------
net: introduce qemu_receive_packet()
Some NIC supports loopback mode and this is done by calling
nc->info->receive() directly which in fact suppresses the effort of
reentrancy check that is done in qemu_net_queue_send().
Unfortunately we can't use qemu_net_queue_send() here since for
loopback there's no sender as peer, so this patch introduce a
qemu_receive_packet() which is used for implementing loopback mode
for a NIC with this check.
NIC that supports loopback mode will be converted to this helper.
This is intended to address CVE-2021-3416.
Cc: Prasad J Pandit <ppandit@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Jason Wang <jasowang@redhat.com>
Commit: 1caff0340f49c93d535c6558a5138d20d475315c
https://github.com/qemu/qemu/commit/1caff0340f49c93d535c6558a5138d20d475315c
Author: Jason Wang <jasowang@redhat.com>
Date: 2021-03-15 (Mon, 15 Mar 2021)
Changed paths:
M hw/net/e1000.c
Log Message:
-----------
e1000: switch to use qemu_receive_packet() for loopback
This patch switches to use qemu_receive_packet() which can detect
reentrancy and return early.
This is intended to address CVE-2021-3416.
Cc: Prasad J Pandit <ppandit@redhat.com>
Cc: qemu-stable@nongnu.org
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Commit: 331d2ac9ea307c990dc86e6493e8f0c48d14bb33
https://github.com/qemu/qemu/commit/331d2ac9ea307c990dc86e6493e8f0c48d14bb33
Author: Jason Wang <jasowang@redhat.com>
Date: 2021-03-15 (Mon, 15 Mar 2021)
Changed paths:
M hw/net/dp8393x.c
Log Message:
-----------
dp8393x: switch to use qemu_receive_packet() for loopback packet
This patch switches to use qemu_receive_packet() which can detect
reentrancy and return early.
This is intended to address CVE-2021-3416.
Cc: Prasad J Pandit <ppandit@redhat.com>
Cc: qemu-stable@nongnu.org
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com
Signed-off-by: Jason Wang <jasowang@redhat.com>
Commit: 26194a58f4eb83c5bdf4061a1628508084450ba1
https://github.com/qemu/qemu/commit/26194a58f4eb83c5bdf4061a1628508084450ba1
Author: Jason Wang <jasowang@redhat.com>
Date: 2021-03-15 (Mon, 15 Mar 2021)
Changed paths:
M hw/net/msf2-emac.c
Log Message:
-----------
msf2-mac: switch to use qemu_receive_packet() for loopback
This patch switches to use qemu_receive_packet() which can detect
reentrancy and return early.
This is intended to address CVE-2021-3416.
Cc: Prasad J Pandit <ppandit@redhat.com>
Cc: qemu-stable@nongnu.org
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Commit: 8c92060d3c0248bd4d515719a35922cd2391b9b4
https://github.com/qemu/qemu/commit/8c92060d3c0248bd4d515719a35922cd2391b9b4
Author: Jason Wang <jasowang@redhat.com>
Date: 2021-03-15 (Mon, 15 Mar 2021)
Changed paths:
M hw/net/sungem.c
Log Message:
-----------
sungem: switch to use qemu_receive_packet() for loopback
This patch switches to use qemu_receive_packet() which can detect
reentrancy and return early.
This is intended to address CVE-2021-3416.
Cc: Prasad J Pandit <ppandit@redhat.com>
Cc: qemu-stable@nongnu.org
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Commit: 8c552542b81e56ff532dd27ec6e5328954bdda73
https://github.com/qemu/qemu/commit/8c552542b81e56ff532dd27ec6e5328954bdda73
Author: Jason Wang <jasowang@redhat.com>
Date: 2021-03-15 (Mon, 15 Mar 2021)
Changed paths:
M hw/net/net_tx_pkt.c
Log Message:
-----------
tx_pkt: switch to use qemu_receive_packet_iov() for loopback
This patch switches to use qemu_receive_receive_iov() which can detect
reentrancy and return early.
This is intended to address CVE-2021-3416.
Cc: Prasad J Pandit <ppandit@redhat.com>
Cc: qemu-stable@nongnu.org
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Commit: 5311fb805a4403bba024e83886fa0e7572265de4
https://github.com/qemu/qemu/commit/5311fb805a4403bba024e83886fa0e7572265de4
Author: Alexander Bulekov <alxndr@bu.edu>
Date: 2021-03-15 (Mon, 15 Mar 2021)
Changed paths:
M hw/net/rtl8139.c
Log Message:
-----------
rtl8139: switch to use qemu_receive_packet() for loopback
This patch switches to use qemu_receive_packet() which can detect
reentrancy and return early.
This is intended to address CVE-2021-3416.
Cc: Prasad J Pandit <ppandit@redhat.com>
Cc: qemu-stable@nongnu.org
Buglink: https://bugs.launchpad.net/qemu/+bug/1910826
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Commit: 99ccfaa1edafd79f7a3a0ff7b58ae4da7c514928
https://github.com/qemu/qemu/commit/99ccfaa1edafd79f7a3a0ff7b58ae4da7c514928
Author: Alexander Bulekov <alxndr@bu.edu>
Date: 2021-03-15 (Mon, 15 Mar 2021)
Changed paths:
M hw/net/pcnet.c
Log Message:
-----------
pcnet: switch to use qemu_receive_packet() for loopback
This patch switches to use qemu_receive_packet() which can detect
reentrancy and return early.
This is intended to address CVE-2021-3416.
Cc: Prasad J Pandit <ppandit@redhat.com>
Cc: qemu-stable@nongnu.org
Buglink: https://bugs.launchpad.net/qemu/+bug/1917085
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Commit: e73adfbeec9d4e008630c814759052ed945c3fed
https://github.com/qemu/qemu/commit/e73adfbeec9d4e008630c814759052ed945c3fed
Author: Alexander Bulekov <alxndr@bu.edu>
Date: 2021-03-15 (Mon, 15 Mar 2021)
Changed paths:
M hw/net/cadence_gem.c
Log Message:
-----------
cadence_gem: switch to use qemu_receive_packet() for loopback
This patch switches to use qemu_receive_packet() which can detect
reentrancy and return early.
This is intended to address CVE-2021-3416.
Cc: Prasad J Pandit <ppandit@redhat.com>
Cc: qemu-stable@nongnu.org
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Commit: 37cee01784ff0df13e5209517e1b3594a5e792d1
https://github.com/qemu/qemu/commit/37cee01784ff0df13e5209517e1b3594a5e792d1
Author: Alexander Bulekov <alxndr@bu.edu>
Date: 2021-03-15 (Mon, 15 Mar 2021)
Changed paths:
M hw/net/lan9118.c
Log Message:
-----------
lan9118: switch to use qemu_receive_packet() for loopback
This patch switches to use qemu_receive_packet() which can detect
reentrancy and return early.
This is intended to address CVE-2021-3416.
Cc: Prasad J Pandit <ppandit@redhat.com>
Cc: qemu-stable@nongnu.org
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Commit: 3aa1b7af0f5fbfdf1b4759658e1445bda680b40d
https://github.com/qemu/qemu/commit/3aa1b7af0f5fbfdf1b4759658e1445bda680b40d
Author: Cornelia Huck <cohuck@redhat.com>
Date: 2021-03-15 (Mon, 15 Mar 2021)
Changed paths:
M hw/rdma/vmw/pvrdma.h
M hw/rdma/vmw/pvrdma_cmd.c
M hw/rdma/vmw/pvrdma_dev_ring.c
M hw/rdma/vmw/pvrdma_dev_ring.h
M hw/rdma/vmw/pvrdma_main.c
R include/standard-headers/drivers/infiniband/hw/vmw_pvrdma/pvrdma_ring.h
M scripts/update-linux-headers.sh
Log Message:
-----------
pvrdma: wean code off pvrdma_ring.h kernel header
The pvrdma code relies on the pvrdma_ring.h kernel header for some
basic ring buffer handling. The content of that header isn't very
exciting, but contains some (q)atomic_*() invocations that (a)
cause manual massaging when doing a headers update, and (b) are
an indication that we probably should not be importing that header
at all.
Let's reimplement the ring buffer handling directly in the pvrdma
code instead. This arguably also improves readability of the code.
Importing the header can now be dropped.
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Yuval Shaia <yuval.shaia.ml@gmail.com>
Tested-by: Yuval Shaia <yuval.shaia.ml@gmail.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Commit: d32ad10a14d46dfe9304e3ed5858a11dcd5c71a0
https://github.com/qemu/qemu/commit/d32ad10a14d46dfe9304e3ed5858a11dcd5c71a0
Author: Alexey Kirillov <lekiravi@yandex-team.ru>
Date: 2021-03-15 (Mon, 15 Mar 2021)
Changed paths:
M include/net/net.h
M net/l2tpv3.c
M net/net.c
M net/netmap.c
M net/slirp.c
M net/socket.c
M net/tap-win32.c
M net/tap.c
M net/vde.c
M net/vhost-user.c
M net/vhost-vdpa.c
M qapi/net.json
Log Message:
-----------
qapi: net: Add query-netdev command
The query-netdev command is used to get the configuration of the current
network device backends (netdevs).
This is the QMP analog of the HMP command "info network" but only for
netdevs (i.e. excluding NIC and hubports).
The query-netdev command returns an array of objects of the NetdevInfo
type, which are an extension of Netdev type. It means that response can
be used for netdev-add after small modification. This can be useful for
recreate the same netdev configuration.
Information about the network device is filled in when it is created or
modified and is available through the NetClientState->stored_config.
Signed-off-by: Alexey Kirillov <lekiravi@yandex-team.ru>
Acked-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Commit: 3c3b656885473ef0d699290ba966177f17839aa5
https://github.com/qemu/qemu/commit/3c3b656885473ef0d699290ba966177f17839aa5
Author: Alexey Kirillov <lekiravi@yandex-team.ru>
Date: 2021-03-15 (Mon, 15 Mar 2021)
Changed paths:
M tests/qtest/meson.build
A tests/qtest/test-query-netdev.c
Log Message:
-----------
tests: Add tests for query-netdev command
A simply qtest that checks for correct number of netdevs in the response
of the query-netdev.
Signed-off-by: Alexey Kirillov <lekiravi@yandex-team.ru>
Acked-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Commit: 59b5437eb732d6b103a9bc279c3482c834d1eff9
https://github.com/qemu/qemu/commit/59b5437eb732d6b103a9bc279c3482c834d1eff9
Author: Alexey Kirillov <lekiravi@yandex-team.ru>
Date: 2021-03-15 (Mon, 15 Mar 2021)
Changed paths:
M hw/net/xen_nic.c
M include/net/net.h
M net/l2tpv3.c
M net/net.c
M net/slirp.c
M net/socket.c
M net/tap-win32.c
M net/tap.c
M net/vde.c
M net/vhost-user.c
M net/vhost-vdpa.c
Log Message:
-----------
net: Move NetClientState.info_str to dynamic allocations
The info_str field of the NetClientState structure is static and has a size
of 256 bytes. This amount is often unclaimed, and the field itself is used
exclusively for HMP "info network".
The patch translates info_str to dynamic memory allocation.
This action is also allows us to painlessly discard usage of this field
for backend devices.
Signed-off-by: Alexey Kirillov <lekiravi@yandex-team.ru>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Commit: a0724776c5a98a08fc946bb5a4ad16410ca64c0e
https://github.com/qemu/qemu/commit/a0724776c5a98a08fc946bb5a4ad16410ca64c0e
Author: Alexey Kirillov <lekiravi@yandex-team.ru>
Date: 2021-03-15 (Mon, 15 Mar 2021)
Changed paths:
A include/qapi/hmp-output-visitor.h
M net/net.c
A qapi/hmp-output-visitor.c
M qapi/meson.build
Log Message:
-----------
hmp: Use QAPI NetdevInfo in hmp_info_network
Replace usage of legacy field info_str of NetClientState for backend
network devices with QAPI NetdevInfo stored_config that already used
in QMP query-netdev.
This change increases the detail of the "info network" output and takes
a more general approach to composing the output.
NIC and hubports still use legacy info_str field.
Signed-off-by: Alexey Kirillov <lekiravi@yandex-team.ru>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Commit: f2e8319d456724c3d8514d943dc4607e2f08e88a
https://github.com/qemu/qemu/commit/f2e8319d456724c3d8514d943dc4607e2f08e88a
Author: Alexey Kirillov <lekiravi@yandex-team.ru>
Date: 2021-03-15 (Mon, 15 Mar 2021)
Changed paths:
M net/l2tpv3.c
M net/slirp.c
M net/socket.c
M net/tap-win32.c
M net/tap.c
M net/vde.c
M net/vhost-user.c
M net/vhost-vdpa.c
Log Message:
-----------
net: Do not fill legacy info_str for backends
As we use QAPI NetClientState->stored_config to store and get information
about backend network devices, we can drop fill of legacy field info_str
for them.
We still use info_str field for NIC and hubports, so we can not completely
remove it.
Signed-off-by: Alexey Kirillov <lekiravi@yandex-team.ru>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Commit: 6e31b3a5c34c6e5be7ef60773e607f189eaa15f3
https://github.com/qemu/qemu/commit/6e31b3a5c34c6e5be7ef60773e607f189eaa15f3
Author: Peter Maydell <peter.maydell@linaro.org>
Date: 2021-03-16 (Tue, 16 Mar 2021)
Changed paths:
M hw/core/machine.c
M hw/net/cadence_gem.c
M hw/net/dp8393x.c
M hw/net/e1000.c
M hw/net/lan9118.c
M hw/net/msf2-emac.c
M hw/net/net_tx_pkt.c
M hw/net/pcnet.c
M hw/net/rtl8139.c
M hw/net/sungem.c
M hw/net/xen_nic.c
M hw/rdma/vmw/pvrdma.h
M hw/rdma/vmw/pvrdma_cmd.c
M hw/rdma/vmw/pvrdma_dev_ring.c
M hw/rdma/vmw/pvrdma_dev_ring.h
M hw/rdma/vmw/pvrdma_main.c
M hw/virtio/virtio-net-pci.c
M include/net/net.h
M include/net/queue.h
A include/qapi/hmp-output-visitor.h
R include/standard-headers/drivers/infiniband/hw/vmw_pvrdma/pvrdma_ring.h
M net/l2tpv3.c
M net/net.c
M net/netmap.c
M net/queue.c
M net/slirp.c
M net/socket.c
M net/tap-win32.c
M net/tap.c
M net/vde.c
M net/vhost-user.c
M net/vhost-vdpa.c
A qapi/hmp-output-visitor.c
M qapi/meson.build
M qapi/net.json
M scripts/update-linux-headers.sh
M tests/qtest/meson.build
A tests/qtest/test-query-netdev.c
Log Message:
-----------
Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into
staging
# gpg: Signature made Mon 15 Mar 2021 08:42:25 GMT
# gpg: using RSA key EF04965B398D6211
# gpg: Good signature from "Jason Wang (Jason Wang on RedHat)
<jasowang@redhat.com>" [marginal]
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg: It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 215D 46F4 8246 689E C77F 3562 EF04 965B 398D 6211
* remotes/jasowang/tags/net-pull-request:
net: Do not fill legacy info_str for backends
hmp: Use QAPI NetdevInfo in hmp_info_network
net: Move NetClientState.info_str to dynamic allocations
tests: Add tests for query-netdev command
qapi: net: Add query-netdev command
pvrdma: wean code off pvrdma_ring.h kernel header
lan9118: switch to use qemu_receive_packet() for loopback
cadence_gem: switch to use qemu_receive_packet() for loopback
pcnet: switch to use qemu_receive_packet() for loopback
rtl8139: switch to use qemu_receive_packet() for loopback
tx_pkt: switch to use qemu_receive_packet_iov() for loopback
sungem: switch to use qemu_receive_packet() for loopback
msf2-mac: switch to use qemu_receive_packet() for loopback
dp8393x: switch to use qemu_receive_packet() for loopback packet
e1000: switch to use qemu_receive_packet() for loopback
net: introduce qemu_receive_packet()
e1000: fail early for evil descriptor
net: validate that ids are well formed
net: Fix build error when DEBUG_NET is on
virtio-net: calculating proper msix vectors on init
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
# Conflicts:
# hw/core/machine.c
Compare: https://github.com/qemu/qemu/compare/2615a5e433ae...6e31b3a5c34c