qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] ca1020: vhost: check for vhost_ops before usi


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] ca1020: vhost: check for vhost_ops before using.
Date: Wed, 10 Aug 2016 11:00:03 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: ca10203cde7cf37623e0e77da1696ba1fbce5d84
      
https://github.com/qemu/qemu/commit/ca10203cde7cf37623e0e77da1696ba1fbce5d84
  Author: Ilya Maximets <address@hidden>
  Date:   2016-08-10 (Wed, 10 Aug 2016)

  Changed paths:
    M hw/net/vhost_net.c

  Log Message:
  -----------
  vhost: check for vhost_ops before using.

'vhost_set_vring_enable()' tries to call function using pointer to
'vhost_ops' which can be already zeroized in 'vhost_dev_cleanup()'
while vhost disconnection.

Fix that by checking 'vhost_ops' before using. This fixes QEMU crash
on calling 'ethtool -L eth0 combined 2' if vhost disconnected.

Signed-off-by: Ilya Maximets <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: ca525ce5618bea94db0d8fa3fde0b3066f8cd3f0
      
https://github.com/qemu/qemu/commit/ca525ce5618bea94db0d8fa3fde0b3066f8cd3f0
  Author: Prerna Saxena <address@hidden>
  Date:   2016-08-10 (Wed, 10 Aug 2016)

  Changed paths:
    M docs/specs/vhost-user.txt
    M hw/virtio/vhost-user.c

  Log Message:
  -----------
  vhost-user: Introduce a new protocol feature REPLY_ACK.

This introduces the VHOST_USER_PROTOCOL_F_REPLY_ACK.

If negotiated, client applications should send a u64 payload in
response to any message that contains the "need_reply" bit set
on the message flags. Setting the payload to "zero" indicates the
command finished successfully. Likewise, setting it to "non-zero"
indicates an error.

Currently implemented only for SET_MEM_TABLE.

Reviewed-by: Marc-André Lureau <address@hidden>
Signed-off-by: Prerna Saxena <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 28ed5ef16384f12500abd3647973ee21b03cbe23
      
https://github.com/qemu/qemu/commit/28ed5ef16384f12500abd3647973ee21b03cbe23
  Author: Prerna Saxena <address@hidden>
  Date:   2016-08-10 (Wed, 10 Aug 2016)

  Changed paths:
    M hw/virtio/vhost-user.c

  Log Message:
  -----------
  vhost-user: Attempt to fix a race with set_mem_table.

The set_mem_table command currently does not seek a reply. Hence, there is
no easy way for a remote application to notify to QEMU when it finished
setting up memory, or if there were errors doing so.

As an example:
(1) Qemu sends a SET_MEM_TABLE to the backend (eg, a vhost-user net
application). SET_MEM_TABLE does not require a reply according to the spec.
(2) Qemu commits the memory to the guest.
(3) Guest issues an I/O operation over a new memory region which was configured 
on (1).
(4) The application has not yet remapped the memory, but it sees the I/O 
request.
(5) The application cannot satisfy the request because it does not know about 
those GPAs.

While a guaranteed fix would require a protocol extension (committed 
separately),
a best-effort workaround for existing applications is to send a GET_FEATURES
message before completing the vhost_user_set_mem_table() call.
Since GET_FEATURES requires a reply, an application that processes vhost-user
messages synchronously would probably have completed the SET_MEM_TABLE before 
replying.

Signed-off-by: Prerna Saxena <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: d08306dc42ea599ffcf8aad056fa9c23acfbe230
      
https://github.com/qemu/qemu/commit/d08306dc42ea599ffcf8aad056fa9c23acfbe230
  Author: Peter Maydell <address@hidden>
  Date:   2016-08-10 (Wed, 10 Aug 2016)

  Changed paths:
    M docs/specs/vhost-user.txt
    M hw/net/vhost_net.c
    M hw/virtio/vhost-user.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

virtio/vhost: fixes

some bugfixes for virtio/vhost

Signed-off-by: Michael S. Tsirkin <address@hidden>

# gpg: Signature made Wed 10 Aug 2016 16:16:22 BST
# gpg:                using RSA key 0x281F0DB8D28D5469
# gpg: Good signature from "Michael S. Tsirkin <address@hidden>"
# gpg:                 aka "Michael S. Tsirkin <address@hidden>"
# Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
#      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469

* remotes/mst/tags/for_upstream:
  vhost-user: Attempt to fix a race with set_mem_table.
  vhost-user: Introduce a new protocol feature REPLY_ACK.
  vhost: check for vhost_ops before using.

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/4b3e5c06a152...d08306dc42ea

reply via email to

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