qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 764256: hw/net/vmxnet3: Log guest-triggerable


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 764256: hw/net/vmxnet3: Log guest-triggerable errors using...
Date: Mon, 10 Jan 2022 08:09:12 -0800

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: 764256cd1a83786dd24de437ecea4760a46b42a2
      
https://github.com/qemu/qemu/commit/764256cd1a83786dd24de437ecea4760a46b42a2
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2022-01-10 (Mon, 10 Jan 2022)

  Changed paths:
    M hw/net/vmxnet3.c

  Log Message:
  -----------
  hw/net/vmxnet3: Log guest-triggerable errors using LOG_GUEST_ERROR

The "Interrupt Cause" register (VMXNET3_REG_ICR) is read-only.
Write accesses are ignored. Log them with as LOG_GUEST_ERROR
instead of aborting:

  [R +0.239743] writeq 0xe0002031 0x46291a5a55460800
  ERROR:hw/net/vmxnet3.c:1819:vmxnet3_io_bar1_write: code should not be reached
  Thread 1 "qemu-system-i38" received signal SIGABRT, Aborted.
  (gdb) bt
  #3  0x74c397d3 in __GI_abort () at abort.c:79
  #4  0x76d3cd4c in g_assertion_message (domain=<optimized out>, 
file=<optimized out>, line=<optimized out>, func=<optimized out>, 
message=<optimized out>) at ../glib/gtestutils.c:3223
  #5  0x76d9d45f in g_assertion_message_expr
      (domain=0x0, file=0x59fc2e53 "hw/net/vmxnet3.c", line=1819, 
func=0x59fc11e0 <__func__.vmxnet3_io_bar1_write> "vmxnet3_io_bar1_write", 
expr=<optimized out>)
      at ../glib/gtestutils.c:3249
  #6  0x57e80a3a in vmxnet3_io_bar1_write (opaque=0x62814100, addr=56, val=70, 
size=4) at hw/net/vmxnet3.c:1819
  #7  0x58c2d894 in memory_region_write_accessor (mr=0x62816b90, addr=56, 
value=0x7fff9450, size=4, shift=0, mask=4294967295, attrs=...) at 
softmmu/memory.c:492
  #8  0x58c2d1d2 in access_with_adjusted_size (addr=56, value=0x7fff9450, 
size=1, access_size_min=4, access_size_max=4, access_fn=
      0x58c2d290 <memory_region_write_accessor>, mr=0x62816b90, attrs=...) at 
softmmu/memory.c:554
  #9  0x58c2bae7 in memory_region_dispatch_write (mr=0x62816b90, addr=56, 
data=70, op=MO_8, attrs=...) at softmmu/memory.c:1504
  #10 0x58bfd034 in flatview_write_continue (fv=0x606000181700, 
addr=0xe0002038, attrs=..., ptr=0x7fffb9e0, len=1, addr1=56, l=1, mr=0x62816b90)
      at softmmu/physmem.c:2782
  #11 0x58beba00 in flatview_write (fv=0x606000181700, addr=0xe0002031, 
attrs=..., buf=0x7fffb9e0, len=8) at softmmu/physmem.c:2822
  #12 0x58beb589 in address_space_write (as=0x608000015f20, addr=0xe0002031, 
attrs=..., buf=0x7fffb9e0, len=8) at softmmu/physmem.c:2914

Reported-by: Dike <dike199774@qq.com>
Reported-by: Duhao <504224090@qq.com>
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=2032932
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>


  Commit: fa1afc1bbdf33a26fed853ee74413880fc86402e
      
https://github.com/qemu/qemu/commit/fa1afc1bbdf33a26fed853ee74413880fc86402e
  Author: Peter Foley <pefoley@google.com>
  Date:   2022-01-10 (Mon, 10 Jan 2022)

  Changed paths:
    M net/tap.c

  Log Message:
  -----------
  net/tap: Set return code on failure

Match the other error handling in this function.

Fixes: e7b347d0bf6 ("net: detect errors from probing vnet hdr flag for TAP 
devices")

Reviewed-by: Patrick Venture <venture@google.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Peter Foley <pefoley@google.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>


  Commit: 7a6713d042495cee11e0d858b24aa30d19453335
      
https://github.com/qemu/qemu/commit/7a6713d042495cee11e0d858b24aa30d19453335
  Author: Peter Foley <pefoley@google.com>
  Date:   2022-01-10 (Mon, 10 Jan 2022)

  Changed paths:
    M net/tap-linux.c

  Log Message:
  -----------
  net: Fix uninitialized data usage

e.g.
1109 15:16:20.151506 Uninitialized bytes in ioctl_common_pre at offset 0 inside 
[0x7ffc516af9b8, 4)
 1109 15:16:20.151659 ==588974==WARNING: MemorySanitizer: 
use-of-uninitialized-value
 1109 15:16:20.312923     #0 0x5639b88acb21 in tap_probe_vnet_hdr_len 
third_party/qemu/net/tap-linux.c:183:9
 1109 15:16:20.312952     #1 0x5639b88afd66 in net_tap_fd_init 
third_party/qemu/net/tap.c:409:9
 1109 15:16:20.312954     #2 0x5639b88b2d1b in net_init_tap_one 
third_party/qemu/net/tap.c:681:19
 1109 15:16:20.312956     #3 0x5639b88b16a8 in net_init_tap 
third_party/qemu/net/tap.c:912:13
 1109 15:16:20.312957     #4 0x5639b8890175 in net_client_init1 
third_party/qemu/net/net.c:1110:9
 1109 15:16:20.312958     #5 0x5639b888f912 in net_client_init 
third_party/qemu/net/net.c:1208:15
 1109 15:16:20.312960     #6 0x5639b8894aa5 in net_param_nic 
third_party/qemu/net/net.c:1588:11
 1109 15:16:20.312961     #7 0x5639b900cd18 in qemu_opts_foreach 
third_party/qemu/util/qemu-option.c:1135:14
 1109 15:16:20.312962     #8 0x5639b889393c in net_init_clients 
third_party/qemu/net/net.c:1612:9
 1109 15:16:20.312964     #9 0x5639b717aaf3 in qemu_create_late_backends 
third_party/qemu/softmmu/vl.c:1962:5
 1109 15:16:20.312965     #10 0x5639b717aaf3 in qemu_init 
third_party/qemu/softmmu/vl.c:3694:5
 1109 15:16:20.312967     #11 0x5639b71083b8 in main 
third_party/qemu/softmmu/main.c:49:5
 1109 15:16:20.312968     #12 0x7f464de1d8d2 in __libc_start_main 
(/usr/grte/v5/lib64/libc.so.6+0x628d2)
 1109 15:16:20.312969     #13 0x5639b6bbd389 in _start 
/usr/grte/v5/debug-src/src/csu/../sysdeps/x86_64/start.S:120
 1109 15:16:20.312970
 1109 15:16:20.312975   Uninitialized value was stored to memory at
 1109 15:16:20.313393     #0 0x5639b88acbee in tap_probe_vnet_hdr_len 
third_party/qemu/net/tap-linux.c
 1109 15:16:20.313396     #1 0x5639b88afd66 in net_tap_fd_init 
third_party/qemu/net/tap.c:409:9
 1109 15:16:20.313398     #2 0x5639b88b2d1b in net_init_tap_one 
third_party/qemu/net/tap.c:681:19
 1109 15:16:20.313399     #3 0x5639b88b16a8 in net_init_tap 
third_party/qemu/net/tap.c:912:13
 1109 15:16:20.313400     #4 0x5639b8890175 in net_client_init1 
third_party/qemu/net/net.c:1110:9
 1109 15:16:20.313401     #5 0x5639b888f912 in net_client_init 
third_party/qemu/net/net.c:1208:15
 1109 15:16:20.313403     #6 0x5639b8894aa5 in net_param_nic 
third_party/qemu/net/net.c:1588:11
 1109 15:16:20.313404     #7 0x5639b900cd18 in qemu_opts_foreach 
third_party/qemu/util/qemu-option.c:1135:14
 1109 15:16:20.313405     #8 0x5639b889393c in net_init_clients 
third_party/qemu/net/net.c:1612:9
 1109 15:16:20.313407     #9 0x5639b717aaf3 in qemu_create_late_backends 
third_party/qemu/softmmu/vl.c:1962:5
 1109 15:16:20.313408     #10 0x5639b717aaf3 in qemu_init 
third_party/qemu/softmmu/vl.c:3694:5
 1109 15:16:20.313409     #11 0x5639b71083b8 in main 
third_party/qemu/softmmu/main.c:49:5
 1109 15:16:20.313410     #12 0x7f464de1d8d2 in __libc_start_main 
(/usr/grte/v5/lib64/libc.so.6+0x628d2)
 1109 15:16:20.313412     #13 0x5639b6bbd389 in _start 
/usr/grte/v5/debug-src/src/csu/../sysdeps/x86_64/start.S:120
 1109 15:16:20.313413
 1109 15:16:20.313417   Uninitialized value was stored to memory at
 1109 15:16:20.313791     #0 0x5639b88affbd in net_tap_fd_init 
third_party/qemu/net/tap.c:400:26
 1109 15:16:20.313826     #1 0x5639b88b2d1b in net_init_tap_one 
third_party/qemu/net/tap.c:681:19
 1109 15:16:20.313829     #2 0x5639b88b16a8 in net_init_tap 
third_party/qemu/net/tap.c:912:13
 1109 15:16:20.313831     #3 0x5639b8890175 in net_client_init1 
third_party/qemu/net/net.c:1110:9
 1109 15:16:20.313836     #4 0x5639b888f912 in net_client_init 
third_party/qemu/net/net.c:1208:15
 1109 15:16:20.313838     #5 0x5639b8894aa5 in net_param_nic 
third_party/qemu/net/net.c:1588:11
 1109 15:16:20.313839     #6 0x5639b900cd18 in qemu_opts_foreach 
third_party/qemu/util/qemu-option.c:1135:14
 1109 15:16:20.313841     #7 0x5639b889393c in net_init_clients 
third_party/qemu/net/net.c:1612:9
 1109 15:16:20.313843     #8 0x5639b717aaf3 in qemu_create_late_backends 
third_party/qemu/softmmu/vl.c:1962:5
 1109 15:16:20.313844     #9 0x5639b717aaf3 in qemu_init 
third_party/qemu/softmmu/vl.c:3694:5
 1109 15:16:20.313845     #10 0x5639b71083b8 in main 
third_party/qemu/softmmu/main.c:49:5
 1109 15:16:20.313846     #11 0x7f464de1d8d2 in __libc_start_main 
(/usr/grte/v5/lib64/libc.so.6+0x628d2)
 1109 15:16:20.313847     #12 0x5639b6bbd389 in _start 
/usr/grte/v5/debug-src/src/csu/../sysdeps/x86_64/start.S:120
 1109 15:16:20.313849
 1109 15:16:20.313851   Uninitialized value was created by an allocation of 
'ifr' in the stack frame of function 'tap_probe_vnet_hdr'
 1109 15:16:20.313855     #0 0x5639b88ac680 in tap_probe_vnet_hdr 
third_party/qemu/net/tap-linux.c:151
 1109 15:16:20.313856
 1109 15:16:20.313878 SUMMARY: MemorySanitizer: use-of-uninitialized-value 
third_party/qemu/net/tap-linux.c:183:9 in tap_probe_vnet_hdr_len

Fixes: dc69004c7d8 ("net: move tap_probe_vnet_hdr() to tap-linux.c")
Reviewed-by: Hao Wu <wuhaotsh@google.com>
Reviewed-by: Patrick Venture <venture@google.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Peter Foley <pefoley@google.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>


  Commit: 7f1af57911acd09638a4f747ea255200b205b618
      
https://github.com/qemu/qemu/commit/7f1af57911acd09638a4f747ea255200b205b618
  Author: Zhang Chen <chen.zhang@intel.com>
  Date:   2022-01-10 (Mon, 10 Jan 2022)

  Changed paths:
    M net/colo-compare.c

  Log Message:
  -----------
  net/colo-compare.c: Optimize compare order for performance

COLO-compare use the glib function g_queue_find_custom to dump
another VM's networking packet to compare. But this function always
start find from the queue->head(here is the newest packet), It will
reduce the success rate of comparison. So this patch reversed
the order of the queues for performance.

Signed-off-by: Zhang Chen <chen.zhang@intel.com>
Reported-by: leirao <lei.rao@intel.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>


  Commit: 8d3f141daae4aab2e29c32f14c9f42d4e378669e
      
https://github.com/qemu/qemu/commit/8d3f141daae4aab2e29c32f14c9f42d4e378669e
  Author: Zhang Chen <chen.zhang@intel.com>
  Date:   2022-01-10 (Mon, 10 Jan 2022)

  Changed paths:
    M net/colo-compare.c

  Log Message:
  -----------
  net/colo-compare.c: Update the default value comments

Make the comments consistent with the REGULAR_PACKET_CHECK_MS.

Signed-off-by: Zhang Chen <chen.zhang@intel.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>


  Commit: 87cdf8b56cab6aef1eeb15adb593d13a4c39fe89
      
https://github.com/qemu/qemu/commit/87cdf8b56cab6aef1eeb15adb593d13a4c39fe89
  Author: Rao Lei <lei.rao@intel.com>
  Date:   2022-01-10 (Mon, 10 Jan 2022)

  Changed paths:
    M net/filter-mirror.c

  Log Message:
  -----------
  net/filter: Optimize filter_send to coroutine

This patch is to improve the logic of QEMU main thread sleep code in
qemu_chr_write_buffer() where it can be blocked and can't run other
coroutines during COLO IO stress test.

Our approach is to put filter_send() in a coroutine. In this way,
filter_send() will call qemu_coroutine_yield() in qemu_co_sleep_ns(),
so that it can be scheduled out and QEMU main thread has opportunity to
run other tasks.

Signed-off-by: Lei Rao <lei.rao@intel.com>
Signed-off-by: Zhang Chen <chen.zhang@intel.com>
Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>
Reviewed-by: Zhang Chen <chen.zhang@intel.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>


  Commit: f88001a01816c0bb0934b1c398a9499463fa9795
      
https://github.com/qemu/qemu/commit/f88001a01816c0bb0934b1c398a9499463fa9795
  Author: Vladislav Yaroshchuk <yaroshchuk2000@gmail.com>
  Date:   2022-01-10 (Mon, 10 Jan 2022)

  Changed paths:
    M meson.build
    M meson_options.txt
    M scripts/meson-buildoptions.sh

  Log Message:
  -----------
  net/vmnet: add vmnet dependency and customizable option

Signed-off-by: Vladislav Yaroshchuk <yaroshchuk2000@gmail.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>


  Commit: 87d2002ad5917f20cc8138d576b140e9bec527e6
      
https://github.com/qemu/qemu/commit/87d2002ad5917f20cc8138d576b140e9bec527e6
  Author: Vladislav Yaroshchuk <yaroshchuk2000@gmail.com>
  Date:   2022-01-10 (Mon, 10 Jan 2022)

  Changed paths:
    M net/clients.h
    M net/meson.build
    M net/net.c
    A net/vmnet-bridged.m
    A net/vmnet-common.m
    A net/vmnet-host.c
    A net/vmnet-shared.c
    A net/vmnet_int.h
    M qapi/net.json

  Log Message:
  -----------
  net/vmnet: add vmnet backends to qapi/net

The vmnet framework is an API for virtual machines to read and write
packets.

The API allows a Guest OS interface to be in host mode or shared
mode. Interfaces in host mode can communicate with the native host
system and other interfaces running in host mode. In shared mode, the
network interface can send and receive packets to the Internet, the
native host, and other interfaces running in sharing mode.

Create separate netdevs for each vmnet operating mode:

- vmnet-host
- vmnet-shared
- vmnet-bridged

Signed-off-by: Vladislav Yaroshchuk <yaroshchuk2000@gmail.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>


  Commit: 43a22911b4cb42ffa6a2a6abf40cebf354cefdc7
      
https://github.com/qemu/qemu/commit/43a22911b4cb42ffa6a2a6abf40cebf354cefdc7
  Author: Vladislav Yaroshchuk <yaroshchuk2000@gmail.com>
  Date:   2022-01-10 (Mon, 10 Jan 2022)

  Changed paths:
    M net/vmnet-common.m
    M net/vmnet-shared.c
    M net/vmnet_int.h

  Log Message:
  -----------
  net/vmnet: implement shared mode (vmnet-shared)

Interaction with vmnet.framework in different modes
differs only on configuration stage, so we can create
common `send`, `receive`, etc. procedures and reuse them.

vmnet.framework supports iov, but writing more than
one iov into vmnet interface fails with
'VMNET_INVALID_ARGUMENT'. Collecting provided iovs into
one and passing it to vmnet works fine. That's the
reason why receive_iov() left unimplemented. But it still
works with good enough performance having .receive()
implemented only.

Also, there is no way to unsubscribe from vmnet packages
receiving except registering and unregistering event
callback or simply drop packages just ignoring and
not processing them when related flag is set. Here we do
using the second way.

Signed-off-by: Phillip Tennen <phillip@axleos.com>
Signed-off-by: Vladislav Yaroshchuk <yaroshchuk2000@gmail.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>


  Commit: a48c6dabe2eea58d7f8b732009c3cd1db482a937
      
https://github.com/qemu/qemu/commit/a48c6dabe2eea58d7f8b732009c3cd1db482a937
  Author: Vladislav Yaroshchuk <yaroshchuk2000@gmail.com>
  Date:   2022-01-10 (Mon, 10 Jan 2022)

  Changed paths:
    M net/vmnet-host.c

  Log Message:
  -----------
  net/vmnet: implement host mode (vmnet-host)

Signed-off-by: Vladislav Yaroshchuk <yaroshchuk2000@gmail.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>


  Commit: c869f8d25192d325c017ed2b44a8a85fbaf3db0a
      
https://github.com/qemu/qemu/commit/c869f8d25192d325c017ed2b44a8a85fbaf3db0a
  Author: Vladislav Yaroshchuk <yaroshchuk2000@gmail.com>
  Date:   2022-01-10 (Mon, 10 Jan 2022)

  Changed paths:
    M net/vmnet-bridged.m

  Log Message:
  -----------
  net/vmnet: implement bridged mode (vmnet-bridged)

Signed-off-by: Vladislav Yaroshchuk <yaroshchuk2000@gmail.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>


  Commit: e67c0249a036a344b617bbdb049902898fb3cd81
      
https://github.com/qemu/qemu/commit/e67c0249a036a344b617bbdb049902898fb3cd81
  Author: Vladislav Yaroshchuk <yaroshchuk2000@gmail.com>
  Date:   2022-01-10 (Mon, 10 Jan 2022)

  Changed paths:
    M qemu-options.hx

  Log Message:
  -----------
  net/vmnet: update qemu-options.hx

Signed-off-by: Vladislav Yaroshchuk <yaroshchuk2000@gmail.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>


  Commit: 5136cc6d3b8b74f4fa572f0874656947a401330e
      
https://github.com/qemu/qemu/commit/5136cc6d3b8b74f4fa572f0874656947a401330e
  Author: Vladislav Yaroshchuk <yaroshchuk2000@gmail.com>
  Date:   2022-01-10 (Mon, 10 Jan 2022)

  Changed paths:
    M MAINTAINERS

  Log Message:
  -----------
  net/vmnet: update MAINTAINERS list

Signed-off-by: Vladislav Yaroshchuk <yaroshchuk2000@gmail.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>


  Commit: 27042fa8560bc88bba4268cb8273f91ba09e3e92
      
https://github.com/qemu/qemu/commit/27042fa8560bc88bba4268cb8273f91ba09e3e92
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2022-01-10 (Mon, 10 Jan 2022)

  Changed paths:
    M MAINTAINERS
    M hw/net/vmxnet3.c
    M meson.build
    M meson_options.txt
    M net/clients.h
    M net/colo-compare.c
    M net/filter-mirror.c
    M net/meson.build
    M net/net.c
    M net/tap-linux.c
    M net/tap.c
    A net/vmnet-bridged.m
    A net/vmnet-common.m
    A net/vmnet-host.c
    A net/vmnet-shared.c
    A net/vmnet_int.h
    M qapi/net.json
    M qemu-options.hx
    M scripts/meson-buildoptions.sh

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into 
staging

# gpg: Signature made Mon 10 Jan 2022 03:31:23 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/vmnet: update MAINTAINERS list
  net/vmnet: update qemu-options.hx
  net/vmnet: implement bridged mode (vmnet-bridged)
  net/vmnet: implement host mode (vmnet-host)
  net/vmnet: implement shared mode (vmnet-shared)
  net/vmnet: add vmnet backends to qapi/net
  net/vmnet: add vmnet dependency and customizable option
  net/filter: Optimize filter_send to coroutine
  net/colo-compare.c: Update the default value comments
  net/colo-compare.c: Optimize compare order for performance
  net: Fix uninitialized data usage
  net/tap: Set return code on failure
  hw/net/vmxnet3: Log guest-triggerable errors using LOG_GUEST_ERROR

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/de3f5223fa4c...27042fa8560b



reply via email to

[Prev in Thread] Current Thread [Next in Thread]