All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL 0/6] Kraxel 20220719 patches
@ 2022-07-19 15:22 Gerd Hoffmann
  2022-07-19 15:22 ` [PULL 1/6] dbus-display: fix test race when initializing p2p connection Gerd Hoffmann
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Gerd Hoffmann @ 2022-07-19 15:22 UTC (permalink / raw)
  To: qemu-devel
  Cc: Marc-André Lureau, Marcel Apfelbaum, Michael S. Tsirkin,
	Sergio Lopez, Markus Armbruster, Gerd Hoffmann, Eduardo Habkost,
	Eric Blake, Paolo Bonzini, Richard Henderson

The following changes since commit 782378973121addeb11b13fd12a6ac2e69faa33f:

  Merge tag 'pull-target-arm-20220718' of https://git.linaro.org/people/pmaydell/qemu-arm into staging (2022-07-18 16:29:32 +0100)

are available in the Git repository at:

  https://gitlab.com/kraxel/qemu.git tags/kraxel-20220719-pull-request

for you to fetch changes up to c34a933802071aae5288e0aa3792756312e3da34:

  gtk: Add show_tabs=on|off command line option. (2022-07-19 14:36:42 +0200)

----------------------------------------------------------------
ui: dbus-display fix, new gtk config options.
usb: xhci fix, doc updates.
microvm: no pcie io reservations.

----------------------------------------------------------------

Felix xq Queißner (1):
  gtk: Add show_tabs=on|off command line option.

Gerd Hoffmann (3):
  microvm: turn off io reservations for pcie root ports
  usb: document guest-reset and guest-reset-all
  usb: document pcap (aka usb traffic capture)

Marc-André Lureau (1):
  dbus-display: fix test race when initializing p2p connection

Mauro Matteo Cascella (1):
  usb/hcd-xhci: check slotid in xhci_wakeup_endpoint()

 hw/i386/microvm.c           | 11 ++++++++++
 hw/usb/hcd-xhci.c           |  3 ++-
 ui/dbus.c                   |  4 +++-
 ui/gtk.c                    |  4 ++++
 docs/system/devices/usb.rst | 41 +++++++++++++++++++++++++++++++++++++
 qapi/ui.json                |  7 ++++++-
 qemu-options.hx             |  6 +++++-
 7 files changed, 72 insertions(+), 4 deletions(-)

-- 
2.36.1



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PULL 1/6] dbus-display: fix test race when initializing p2p connection
  2022-07-19 15:22 [PULL 0/6] Kraxel 20220719 patches Gerd Hoffmann
@ 2022-07-19 15:22 ` Gerd Hoffmann
  2022-07-19 15:22 ` [PULL 2/6] microvm: turn off io reservations for pcie root ports Gerd Hoffmann
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Gerd Hoffmann @ 2022-07-19 15:22 UTC (permalink / raw)
  To: qemu-devel
  Cc: Marc-André Lureau, Marcel Apfelbaum, Michael S. Tsirkin,
	Sergio Lopez, Markus Armbruster, Gerd Hoffmann, Eduardo Habkost,
	Eric Blake, Paolo Bonzini, Richard Henderson, Robinson, Cole

From: Marc-André Lureau <marcandre.lureau@redhat.com>

The D-Bus connection starts processing messages before QEMU has the time
to set the object manager server. This is causing dbus-display-test to
fail randomly with:

ERROR:../tests/qtest/dbus-display-test.c:68:test_dbus_display_vm:
assertion failed
(qemu_dbus_display1_vm_get_name(QEMU_DBUS_DISPLAY1_VM(vm)) ==
"dbus-test"): (NULL == "dbus-test") ERROR

Use the delayed message processing flag and method to avoid that
situation.

(the bus connection doesn't need a fix, as the initialization is done
synchronously)

Reported-by: Robinson, Cole <crobinso@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Tested-by: Cole Robinson <crobinso@redhat.com>
Message-Id: <20220609152647.870373-1-marcandre.lureau@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/dbus.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ui/dbus.c b/ui/dbus.c
index 7a87612379e8..32d88dc94a7e 100644
--- a/ui/dbus.c
+++ b/ui/dbus.c
@@ -268,6 +268,7 @@ dbus_display_add_client_ready(GObject *source_object,
     }
 
     g_dbus_object_manager_server_set_connection(dbus_display->server, conn);
+    g_dbus_connection_start_message_processing(conn);
 }
 
 
@@ -300,7 +301,8 @@ dbus_display_add_client(int csock, Error **errp)
 
     g_dbus_connection_new(G_IO_STREAM(conn),
                           guid,
-                          G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER,
+                          G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER |
+                          G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING,
                           NULL,
                           dbus_display->add_client_cancellable,
                           dbus_display_add_client_ready,
-- 
2.36.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PULL 2/6] microvm: turn off io reservations for pcie root ports
  2022-07-19 15:22 [PULL 0/6] Kraxel 20220719 patches Gerd Hoffmann
  2022-07-19 15:22 ` [PULL 1/6] dbus-display: fix test race when initializing p2p connection Gerd Hoffmann
@ 2022-07-19 15:22 ` Gerd Hoffmann
  2022-07-19 15:22 ` [PULL 3/6] usb/hcd-xhci: check slotid in xhci_wakeup_endpoint() Gerd Hoffmann
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Gerd Hoffmann @ 2022-07-19 15:22 UTC (permalink / raw)
  To: qemu-devel
  Cc: Marc-André Lureau, Marcel Apfelbaum, Michael S. Tsirkin,
	Sergio Lopez, Markus Armbruster, Gerd Hoffmann, Eduardo Habkost,
	Eric Blake, Paolo Bonzini, Richard Henderson

The pcie host bridge has no io window on microvm,
so io reservations will not work.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-Id: <20220701091516.43489-1-kraxel@redhat.com>
---
 hw/i386/microvm.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c
index 754f1d0593e5..dc929727dcbc 100644
--- a/hw/i386/microvm.c
+++ b/hw/i386/microvm.c
@@ -631,6 +631,14 @@ static void microvm_machine_initfn(Object *obj)
     qemu_register_powerdown_notifier(&mms->powerdown_req);
 }
 
+GlobalProperty microvm_properties[] = {
+    /*
+     * pcie host bridge (gpex) on microvm has no io address window,
+     * so reserving io space is not going to work.  Turn it off.
+     */
+    { "pcie-root-port", "io-reserve", "0" },
+};
+
 static void microvm_class_init(ObjectClass *oc, void *data)
 {
     X86MachineClass *x86mc = X86_MACHINE_CLASS(oc);
@@ -707,6 +715,9 @@ static void microvm_class_init(ObjectClass *oc, void *data)
         "Set off to disable adding virtio-mmio devices to the kernel cmdline");
 
     machine_class_allow_dynamic_sysbus_dev(mc, TYPE_RAMFB_DEVICE);
+
+    compat_props_add(mc->compat_props, microvm_properties,
+                     G_N_ELEMENTS(microvm_properties));
 }
 
 static const TypeInfo microvm_machine_info = {
-- 
2.36.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PULL 3/6] usb/hcd-xhci: check slotid in xhci_wakeup_endpoint()
  2022-07-19 15:22 [PULL 0/6] Kraxel 20220719 patches Gerd Hoffmann
  2022-07-19 15:22 ` [PULL 1/6] dbus-display: fix test race when initializing p2p connection Gerd Hoffmann
  2022-07-19 15:22 ` [PULL 2/6] microvm: turn off io reservations for pcie root ports Gerd Hoffmann
@ 2022-07-19 15:22 ` Gerd Hoffmann
  2022-07-19 15:22 ` [PULL 4/6] usb: document guest-reset and guest-reset-all Gerd Hoffmann
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Gerd Hoffmann @ 2022-07-19 15:22 UTC (permalink / raw)
  To: qemu-devel
  Cc: Marc-André Lureau, Marcel Apfelbaum, Michael S. Tsirkin,
	Sergio Lopez, Markus Armbruster, Gerd Hoffmann, Eduardo Habkost,
	Eric Blake, Paolo Bonzini, Richard Henderson,
	Mauro Matteo Cascella, Soul Chen

From: Mauro Matteo Cascella <mcascell@redhat.com>

This prevents an OOB read (followed by an assertion failure in
xhci_kick_ep) when slotid > xhci->numslots.

Reported-by: Soul Chen <soulchen8650@gmail.com>
Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com>
Message-Id: <20220705174734.2348829-1-mcascell@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/hcd-xhci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 0cd0a5e54027..296cc6c8e694 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -3269,7 +3269,8 @@ static void xhci_wakeup_endpoint(USBBus *bus, USBEndpoint *ep,
 
     DPRINTF("%s\n", __func__);
     slotid = ep->dev->addr;
-    if (slotid == 0 || !xhci->slots[slotid-1].enabled) {
+    if (slotid == 0 || slotid > xhci->numslots ||
+        !xhci->slots[slotid - 1].enabled) {
         DPRINTF("%s: oops, no slot for dev %d\n", __func__, ep->dev->addr);
         return;
     }
-- 
2.36.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PULL 4/6] usb: document guest-reset and guest-reset-all
  2022-07-19 15:22 [PULL 0/6] Kraxel 20220719 patches Gerd Hoffmann
                   ` (2 preceding siblings ...)
  2022-07-19 15:22 ` [PULL 3/6] usb/hcd-xhci: check slotid in xhci_wakeup_endpoint() Gerd Hoffmann
@ 2022-07-19 15:22 ` Gerd Hoffmann
  2022-07-19 15:22 ` [PULL 5/6] usb: document pcap (aka usb traffic capture) Gerd Hoffmann
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Gerd Hoffmann @ 2022-07-19 15:22 UTC (permalink / raw)
  To: qemu-devel
  Cc: Marc-André Lureau, Marcel Apfelbaum, Michael S. Tsirkin,
	Sergio Lopez, Markus Armbruster, Gerd Hoffmann, Eduardo Habkost,
	Eric Blake, Paolo Bonzini, Richard Henderson,
	Michal Prívozník

Suggested-by: Michal Prívozník <mprivozn@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Message-Id: <20220711094437.3995927-2-kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 docs/system/devices/usb.rst | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/docs/system/devices/usb.rst b/docs/system/devices/usb.rst
index 872d9167589b..18e7c8b4d716 100644
--- a/docs/system/devices/usb.rst
+++ b/docs/system/devices/usb.rst
@@ -353,3 +353,32 @@ and also assign it to the correct USB bus in QEMU like this:
         -device usb-ehci,id=ehci                             \\
         -device usb-host,bus=usb-bus.0,hostbus=3,hostport=1  \\
         -device usb-host,bus=ehci.0,hostbus=1,hostport=1
+
+``usb-host`` properties for reset behavior
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The ``guest-reset`` and ``guest-reset-all`` properties control
+whenever the guest is allowed to reset the physical usb device on the
+host.  There are three cases:
+
+``guest-reset=false``
+  The guest is not allowed to reset the (physical) usb device.
+
+``guest-reset=true,guest-resets-all=false``
+  The guest is allowed to reset the device when it is not yet
+  initialized (aka no usb bus address assigned).  Usually this results
+  in one guest reset being allowed.  This is the default behavior.
+
+``guest-reset=true,guest-resets-all=true``
+  The guest is allowed to reset the device as it pleases.
+
+The reason for this existing are broken usb devices.  In theory one
+should be able to reset (and re-initialize) usb devices at any time.
+In practice that may result in shitty usb device firmware crashing and
+the device not responding any more until you power-cycle (aka un-plug
+and re-plug) it.
+
+What works best pretty much depends on the behavior of the specific
+usb device at hand, so it's a trial-and-error game.  If the default
+doesn't work, try another option and see whenever the situation
+improves.
-- 
2.36.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PULL 5/6] usb: document pcap (aka usb traffic capture)
  2022-07-19 15:22 [PULL 0/6] Kraxel 20220719 patches Gerd Hoffmann
                   ` (3 preceding siblings ...)
  2022-07-19 15:22 ` [PULL 4/6] usb: document guest-reset and guest-reset-all Gerd Hoffmann
@ 2022-07-19 15:22 ` Gerd Hoffmann
  2022-07-19 15:22 ` [PULL 6/6] gtk: Add show_tabs=on|off command line option Gerd Hoffmann
  2022-07-19 19:20 ` [PULL 0/6] Kraxel 20220719 patches Peter Maydell
  6 siblings, 0 replies; 8+ messages in thread
From: Gerd Hoffmann @ 2022-07-19 15:22 UTC (permalink / raw)
  To: qemu-devel
  Cc: Marc-André Lureau, Marcel Apfelbaum, Michael S. Tsirkin,
	Sergio Lopez, Markus Armbruster, Gerd Hoffmann, Eduardo Habkost,
	Eric Blake, Paolo Bonzini, Richard Henderson

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-Id: <20220711094437.3995927-3-kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 docs/system/devices/usb.rst | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/docs/system/devices/usb.rst b/docs/system/devices/usb.rst
index 18e7c8b4d716..f39a88f080ff 100644
--- a/docs/system/devices/usb.rst
+++ b/docs/system/devices/usb.rst
@@ -382,3 +382,15 @@ What works best pretty much depends on the behavior of the specific
 usb device at hand, so it's a trial-and-error game.  If the default
 doesn't work, try another option and see whenever the situation
 improves.
+
+record usb transfers
+^^^^^^^^^^^^^^^^^^^^
+
+All usb devices have support for recording the usb traffic.  This can
+be enabled using the ``pcap=<file>`` property, for example:
+
+``-device usb-mouse,pcap=mouse.pcap``
+
+The pcap files are compatible with the linux kernels usbmon.  Many
+tools, including ``wireshark``, can decode and inspect these trace
+files.
-- 
2.36.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PULL 6/6] gtk: Add show_tabs=on|off command line option.
  2022-07-19 15:22 [PULL 0/6] Kraxel 20220719 patches Gerd Hoffmann
                   ` (4 preceding siblings ...)
  2022-07-19 15:22 ` [PULL 5/6] usb: document pcap (aka usb traffic capture) Gerd Hoffmann
@ 2022-07-19 15:22 ` Gerd Hoffmann
  2022-07-19 19:20 ` [PULL 0/6] Kraxel 20220719 patches Peter Maydell
  6 siblings, 0 replies; 8+ messages in thread
From: Gerd Hoffmann @ 2022-07-19 15:22 UTC (permalink / raw)
  To: qemu-devel
  Cc: Marc-André Lureau, Marcel Apfelbaum, Michael S. Tsirkin,
	Sergio Lopez, Markus Armbruster, Gerd Hoffmann, Eduardo Habkost,
	Eric Blake, Paolo Bonzini, Richard Henderson,
	Felix xq Queißner, Thomas Huth, Hanna Reitz

From: Felix xq Queißner <xq@random-projects.net>

The patch adds "show_tabs" command line option for GTK ui similar to
"grab_on_hover". This option allows tabbed view mode to not have to be
enabled by hand at each start of the VM.

Signed-off-by: Felix "xq" Queißner <xq@random-projects.net>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220712133753.18937-1-xq@random-projects.net>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/gtk.c        | 4 ++++
 qapi/ui.json    | 7 ++++++-
 qemu-options.hx | 6 +++++-
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/ui/gtk.c b/ui/gtk.c
index 2a791dd2aa04..1467b8c7d7f0 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -2390,6 +2390,10 @@ static void gtk_display_init(DisplayState *ds, DisplayOptions *opts)
         opts->u.gtk.grab_on_hover) {
         gtk_menu_item_activate(GTK_MENU_ITEM(s->grab_on_hover_item));
     }
+    if (opts->u.gtk.has_show_tabs &&
+        opts->u.gtk.show_tabs) {
+        gtk_menu_item_activate(GTK_MENU_ITEM(s->show_tabs_item));
+    }
     gd_clipboard_init(s);
 }
 
diff --git a/qapi/ui.json b/qapi/ui.json
index 413371d5e8bf..cf58ab4283da 100644
--- a/qapi/ui.json
+++ b/qapi/ui.json
@@ -1195,12 +1195,17 @@
 #               assuming the guest will resize the display to match
 #               the window size then.  Otherwise it defaults to "off".
 #               Since 3.1
+# @show-tabs:   Display the tab bar for switching between the various graphical
+#               interfaces (e.g. VGA and virtual console character devices)
+#               by default.
+#               Since 7.1
 #
 # Since: 2.12
 ##
 { 'struct'  : 'DisplayGTK',
   'data'    : { '*grab-on-hover' : 'bool',
-                '*zoom-to-fit'   : 'bool'  } }
+                '*zoom-to-fit'   : 'bool',
+                '*show-tabs'     : 'bool'  } }
 
 ##
 # @DisplayEGLHeadless:
diff --git a/qemu-options.hx b/qemu-options.hx
index 377d22fbd82f..79e00916a11f 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -1938,7 +1938,7 @@ DEF("display", HAS_ARG, QEMU_OPTION_display,
 #endif
 #if defined(CONFIG_GTK)
     "-display gtk[,full-screen=on|off][,gl=on|off][,grab-on-hover=on|off]\n"
-    "            [,show-cursor=on|off][,window-close=on|off]\n"
+    "            [,show-tabs=on|off][,show-cursor=on|off][,window-close=on|off]\n"
 #endif
 #if defined(CONFIG_VNC)
     "-display vnc=<display>[,<optargs>]\n"
@@ -2023,6 +2023,10 @@ SRST
 
         ``grab-on-hover=on|off`` : Grab keyboard input on mouse hover
 
+        ``show-tabs=on|off`` : Display the tab bar for switching between the
+                               various graphical interfaces (e.g. VGA and
+                               virtual console character devices) by default.
+
         ``show-cursor=on|off`` :  Force showing the mouse cursor
 
         ``window-close=on|off`` : Allow to quit qemu with window close button
-- 
2.36.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PULL 0/6] Kraxel 20220719 patches
  2022-07-19 15:22 [PULL 0/6] Kraxel 20220719 patches Gerd Hoffmann
                   ` (5 preceding siblings ...)
  2022-07-19 15:22 ` [PULL 6/6] gtk: Add show_tabs=on|off command line option Gerd Hoffmann
@ 2022-07-19 19:20 ` Peter Maydell
  6 siblings, 0 replies; 8+ messages in thread
From: Peter Maydell @ 2022-07-19 19:20 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: qemu-devel, Marc-André Lureau, Marcel Apfelbaum,
	Michael S. Tsirkin, Sergio Lopez, Markus Armbruster,
	Eduardo Habkost, Eric Blake, Paolo Bonzini, Richard Henderson

On Tue, 19 Jul 2022 at 16:28, Gerd Hoffmann <kraxel@redhat.com> wrote:
>
> The following changes since commit 782378973121addeb11b13fd12a6ac2e69faa33f:
>
>   Merge tag 'pull-target-arm-20220718' of https://git.linaro.org/people/pmaydell/qemu-arm into staging (2022-07-18 16:29:32 +0100)
>
> are available in the Git repository at:
>
>   https://gitlab.com/kraxel/qemu.git tags/kraxel-20220719-pull-request
>
> for you to fetch changes up to c34a933802071aae5288e0aa3792756312e3da34:
>
>   gtk: Add show_tabs=on|off command line option. (2022-07-19 14:36:42 +0200)
>
> ----------------------------------------------------------------
> ui: dbus-display fix, new gtk config options.
> usb: xhci fix, doc updates.
> microvm: no pcie io reservations.
>


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/7.1
for any user-visible changes.

-- PMM


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-07-19 19:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-19 15:22 [PULL 0/6] Kraxel 20220719 patches Gerd Hoffmann
2022-07-19 15:22 ` [PULL 1/6] dbus-display: fix test race when initializing p2p connection Gerd Hoffmann
2022-07-19 15:22 ` [PULL 2/6] microvm: turn off io reservations for pcie root ports Gerd Hoffmann
2022-07-19 15:22 ` [PULL 3/6] usb/hcd-xhci: check slotid in xhci_wakeup_endpoint() Gerd Hoffmann
2022-07-19 15:22 ` [PULL 4/6] usb: document guest-reset and guest-reset-all Gerd Hoffmann
2022-07-19 15:22 ` [PULL 5/6] usb: document pcap (aka usb traffic capture) Gerd Hoffmann
2022-07-19 15:22 ` [PULL 6/6] gtk: Add show_tabs=on|off command line option Gerd Hoffmann
2022-07-19 19:20 ` [PULL 0/6] Kraxel 20220719 patches Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.