All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL 0/4] xen queue 2020-10-20
@ 2020-10-20 10:02 Anthony PERARD via
  2020-10-20 10:02 ` [PULL 1/4] xen: xenguest is not used so is not needed Anthony PERARD via
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Anthony PERARD via @ 2020-10-20 10:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Anthony PERARD

The following changes since commit d76f4f97eb2772bf85fe286097183d0c7db19ae8:

  Merge remote-tracking branch 'remotes/cschoenebeck/tags/pull-9p-20201019' into staging (2020-10-19 14:39:27 +0100)

are available in the Git repository at:

  https://xenbits.xen.org/git-http/people/aperard/qemu-dm.git tags/pull-xen-20201020

for you to fetch changes up to 8959e0a63a3a681a31ff8397d9345a88e6d905bf:

  hw/xen: Set suppress-vmdesc for Xen machines (2020-10-19 16:33:28 +0100)

----------------------------------------------------------------
Xen queue

* cleanup patches.
* improve xen backend setup performance when other xen guests are
  running/booting.
* improve xen guest migration when running in a stubdomain.

----------------------------------------------------------------
Eduardo Habkost (1):
      xen: Rename XENBACKEND_DEVICE to XENBACKEND

Jason Andryuk (1):
      hw/xen: Set suppress-vmdesc for Xen machines

Michael Tokarev (1):
      xen: xenguest is not used so is not needed

Paul Durrant (1):
      xen-bus: reduce scope of backend watch

 configure                           |  4 ++--
 hw/i386/pc_piix.c                   |  4 ++--
 hw/i386/xen/xen_platform.c          |  2 --
 hw/xen/xen-backend.c                | 11 ++++++++++
 hw/xen/xen-bus.c                    | 40 +++++++++++++++++++++++++++++--------
 include/hw/xen/xen-backend.h        |  1 +
 include/hw/xen/xen-bus.h            |  3 ++-
 include/hw/xen/xen-legacy-backend.h |  2 +-
 8 files changed, 51 insertions(+), 16 deletions(-)


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

* [PULL 1/4] xen: xenguest is not used so is not needed
  2020-10-20 10:02 [PULL 0/4] xen queue 2020-10-20 Anthony PERARD via
@ 2020-10-20 10:02 ` Anthony PERARD via
  2020-10-20 10:02 ` [PULL 2/4] xen: Rename XENBACKEND_DEVICE to XENBACKEND Anthony PERARD via
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Anthony PERARD via @ 2020-10-20 10:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Michael Tokarev, Anthony PERARD

From: Michael Tokarev <mjt@tls.msk.ru>

There's no references in only file which includes xenguest.h
to any xen definitions. And there's no references to -lxenguest
in qemu, either. Drop it.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
Message-Id: <20200727140048.19779-1-mjt@msgid.tls.msk.ru>
[perard: rebased]
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 configure                  | 4 ++--
 hw/i386/xen/xen_platform.c | 2 --
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/configure b/configure
index a73fb8756ef1..e6754c1e872c 100755
--- a/configure
+++ b/configure
@@ -2532,7 +2532,7 @@ if test "$xen" != "disabled" ; then
     xen_ctrl_version="$(printf '%d%02d%02d' \
       $($pkg_config --modversion xencontrol | sed 's/\./ /g') )"
     xen=enabled
-    xen_pc="xencontrol xenstore xenguest xenforeignmemory xengnttab"
+    xen_pc="xencontrol xenstore xenforeignmemory xengnttab"
     xen_pc="$xen_pc xenevtchn xendevicemodel"
     if $pkg_config --exists xentoolcore; then
       xen_pc="$xen_pc xentoolcore"
@@ -2541,7 +2541,7 @@ if test "$xen" != "disabled" ; then
     xen_libs="$($pkg_config --libs $xen_pc)"
   else
 
-    xen_libs="-lxenstore -lxenctrl -lxenguest"
+    xen_libs="-lxenstore -lxenctrl"
     xen_stable_libs="-lxenforeignmemory -lxengnttab -lxenevtchn"
 
     # First we test whether Xen headers and libraries are available.
diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c
index e9601031bfd9..7c4db35debbd 100644
--- a/hw/i386/xen/xen_platform.c
+++ b/hw/i386/xen/xen_platform.c
@@ -37,8 +37,6 @@
 #include "sysemu/block-backend.h"
 #include "qemu/error-report.h"
 #include "qemu/module.h"
-
-#include <xenguest.h>
 #include "qom/object.h"
 
 //#define DEBUG_PLATFORM
-- 
Anthony PERARD



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

* [PULL 2/4] xen: Rename XENBACKEND_DEVICE to XENBACKEND
  2020-10-20 10:02 [PULL 0/4] xen queue 2020-10-20 Anthony PERARD via
  2020-10-20 10:02 ` [PULL 1/4] xen: xenguest is not used so is not needed Anthony PERARD via
@ 2020-10-20 10:02 ` Anthony PERARD via
  2020-10-20 10:02 ` [PULL 3/4] xen-bus: reduce scope of backend watch Anthony PERARD via
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Anthony PERARD via @ 2020-10-20 10:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Eduardo Habkost, Anthony PERARD

From: Eduardo Habkost <ehabkost@redhat.com>

Make the type checking macro name consistent with the TYPE_*
constant.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
Message-Id: <20200902224311.1321159-58-ehabkost@redhat.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 include/hw/xen/xen-legacy-backend.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/hw/xen/xen-legacy-backend.h b/include/hw/xen/xen-legacy-backend.h
index ba7a3c59bbcc..be281e1f38eb 100644
--- a/include/hw/xen/xen-legacy-backend.h
+++ b/include/hw/xen/xen-legacy-backend.h
@@ -11,7 +11,7 @@
 #define TYPE_XENBACKEND "xen-backend"
 
 typedef struct XenLegacyDevice XenLegacyDevice;
-DECLARE_INSTANCE_CHECKER(XenLegacyDevice, XENBACKEND_DEVICE,
+DECLARE_INSTANCE_CHECKER(XenLegacyDevice, XENBACKEND,
                          TYPE_XENBACKEND)
 
 /* variables */
-- 
Anthony PERARD



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

* [PULL 3/4] xen-bus: reduce scope of backend watch
  2020-10-20 10:02 [PULL 0/4] xen queue 2020-10-20 Anthony PERARD via
  2020-10-20 10:02 ` [PULL 1/4] xen: xenguest is not used so is not needed Anthony PERARD via
  2020-10-20 10:02 ` [PULL 2/4] xen: Rename XENBACKEND_DEVICE to XENBACKEND Anthony PERARD via
@ 2020-10-20 10:02 ` Anthony PERARD via
  2020-10-20 10:02 ` [PULL 4/4] hw/xen: Set suppress-vmdesc for Xen machines Anthony PERARD via
  2020-10-20 11:04 ` [PULL 0/4] xen queue 2020-10-20 Peter Maydell
  4 siblings, 0 replies; 6+ messages in thread
From: Anthony PERARD via @ 2020-10-20 10:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Paul Durrant, Anthony PERARD

From: Paul Durrant <pdurrant@amazon.com>

Currently a single watch on /local/domain/X/backend is registered by each
QEMU process running in service domain X (where X is usually 0). The purpose
of this watch is to ensure that QEMU is notified when the Xen toolstack
creates a new device backend area.
Such a backend area is specific to a single frontend area created for a
specific guest domain and, since each QEMU process is also created to service
a specfic guest domain, it is unnecessary and inefficient to notify all QEMU
processes.
Only the QEMU process associated with the same guest domain need
receive the notification. This patch re-factors the watch registration code
such that notifications are targetted appropriately.

Reported-by: Jerome Leseinne <jerome.leseinne@gmail.com>
Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
Message-Id: <20201001081500.1026-1-paul@xen.org>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 hw/xen/xen-backend.c         | 11 ++++++++++
 hw/xen/xen-bus.c             | 40 ++++++++++++++++++++++++++++--------
 include/hw/xen/xen-backend.h |  1 +
 include/hw/xen/xen-bus.h     |  3 ++-
 4 files changed, 46 insertions(+), 9 deletions(-)

diff --git a/hw/xen/xen-backend.c b/hw/xen/xen-backend.c
index 10199fb58d10..5b0fb76eaeb3 100644
--- a/hw/xen/xen-backend.c
+++ b/hw/xen/xen-backend.c
@@ -41,6 +41,12 @@ static void xen_backend_table_add(XenBackendImpl *impl)
     g_hash_table_insert(xen_backend_table_get(), (void *)impl->type, impl);
 }
 
+static const char **xen_backend_table_keys(unsigned int *count)
+{
+    return (const char **)g_hash_table_get_keys_as_array(
+        xen_backend_table_get(), count);
+}
+
 static const XenBackendImpl *xen_backend_table_lookup(const char *type)
 {
     return g_hash_table_lookup(xen_backend_table_get(), type);
@@ -70,6 +76,11 @@ void xen_backend_register(const XenBackendInfo *info)
     xen_backend_table_add(impl);
 }
 
+const char **xen_backend_get_types(unsigned int *count)
+{
+    return xen_backend_table_keys(count);
+}
+
 static QLIST_HEAD(, XenBackendInstance) backend_list;
 
 static void xen_backend_list_add(XenBackendInstance *backend)
diff --git a/hw/xen/xen-bus.c b/hw/xen/xen-bus.c
index 9ce1c9540b9e..8c588920d9fc 100644
--- a/hw/xen/xen-bus.c
+++ b/hw/xen/xen-bus.c
@@ -430,7 +430,15 @@ static void xen_bus_unrealize(BusState *bus)
     trace_xen_bus_unrealize();
 
     if (xenbus->backend_watch) {
-        xen_bus_remove_watch(xenbus, xenbus->backend_watch, NULL);
+        unsigned int i;
+
+        for (i = 0; i < xenbus->backend_types; i++) {
+            if (xenbus->backend_watch[i]) {
+                xen_bus_remove_watch(xenbus, xenbus->backend_watch[i], NULL);
+            }
+        }
+
+        g_free(xenbus->backend_watch);
         xenbus->backend_watch = NULL;
     }
 
@@ -446,8 +454,11 @@ static void xen_bus_unrealize(BusState *bus)
 
 static void xen_bus_realize(BusState *bus, Error **errp)
 {
+    char *key = g_strdup_printf("%u", xen_domid);
     XenBus *xenbus = XEN_BUS(bus);
     unsigned int domid;
+    const char **type;
+    unsigned int i;
     Error *local_err = NULL;
 
     trace_xen_bus_realize();
@@ -469,19 +480,32 @@ static void xen_bus_realize(BusState *bus, Error **errp)
 
     module_call_init(MODULE_INIT_XEN_BACKEND);
 
-    xenbus->backend_watch =
-        xen_bus_add_watch(xenbus, "", /* domain root node */
-                          "backend", xen_bus_backend_changed, &local_err);
-    if (local_err) {
-        /* This need not be treated as a hard error so don't propagate */
-        error_reportf_err(local_err,
-                          "failed to set up enumeration watch: ");
+    type = xen_backend_get_types(&xenbus->backend_types);
+    xenbus->backend_watch = g_new(XenWatch *, xenbus->backend_types);
+
+    for (i = 0; i < xenbus->backend_types; i++) {
+        char *node = g_strdup_printf("backend/%s", type[i]);
+
+        xenbus->backend_watch[i] =
+            xen_bus_add_watch(xenbus, node, key, xen_bus_backend_changed,
+                              &local_err);
+        if (local_err) {
+            /* This need not be treated as a hard error so don't propagate */
+            error_reportf_err(local_err,
+                              "failed to set up '%s' enumeration watch: ",
+                              type[i]);
+        }
+
+        g_free(node);
     }
 
+    g_free(type);
+    g_free(key);
     return;
 
 fail:
     xen_bus_unrealize(bus);
+    g_free(key);
 }
 
 static void xen_bus_unplug_request(HotplugHandler *hotplug,
diff --git a/include/hw/xen/xen-backend.h b/include/hw/xen/xen-backend.h
index 010d71263876..aac2fd454d44 100644
--- a/include/hw/xen/xen-backend.h
+++ b/include/hw/xen/xen-backend.h
@@ -31,6 +31,7 @@ void xen_backend_set_device(XenBackendInstance *backend,
 XenDevice *xen_backend_get_device(XenBackendInstance *backend);
 
 void xen_backend_register(const XenBackendInfo *info);
+const char **xen_backend_get_types(unsigned int *nr);
 
 void xen_backend_device_create(XenBus *xenbus, const char *type,
                                const char *name, QDict *opts, Error **errp);
diff --git a/include/hw/xen/xen-bus.h b/include/hw/xen/xen-bus.h
index 3df696136f7b..6bdbf3ff8220 100644
--- a/include/hw/xen/xen-bus.h
+++ b/include/hw/xen/xen-bus.h
@@ -66,7 +66,8 @@ struct XenBus {
     domid_t backend_id;
     struct xs_handle *xsh;
     XenWatchList *watch_list;
-    XenWatch *backend_watch;
+    unsigned int backend_types;
+    XenWatch **backend_watch;
     QLIST_HEAD(, XenDevice) inactive_devices;
 };
 
-- 
Anthony PERARD



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

* [PULL 4/4] hw/xen: Set suppress-vmdesc for Xen machines
  2020-10-20 10:02 [PULL 0/4] xen queue 2020-10-20 Anthony PERARD via
                   ` (2 preceding siblings ...)
  2020-10-20 10:02 ` [PULL 3/4] xen-bus: reduce scope of backend watch Anthony PERARD via
@ 2020-10-20 10:02 ` Anthony PERARD via
  2020-10-20 11:04 ` [PULL 0/4] xen queue 2020-10-20 Peter Maydell
  4 siblings, 0 replies; 6+ messages in thread
From: Anthony PERARD via @ 2020-10-20 10:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Jason Andryuk, Anthony PERARD

From: Jason Andryuk <jandryuk@gmail.com>

xen-save-devices-state doesn't currently generate a vmdesc, so restore
always triggers "Expected vmdescription section, but got 0".  This is
not a problem when restore comes from a file.  However, when QEMU runs
in a linux stubdom and comes over a console, EOF is not received.  This
causes a delay restoring - though it does restore.

Setting suppress-vmdesc skips looking for the vmdesc during restore and
avoids the wait.

The other approach would be generate a vmdesc in qemu_save_device_state.
Since COLO shared that function, and the vmdesc is just discarded on
restore, we choose to skip it.

Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
Message-Id: <20201013190506.3325-1-jandryuk@gmail.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 hw/i386/pc_piix.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 3c2ae0612b23..0cf22a57ad14 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -987,7 +987,7 @@ static void xenfv_4_2_machine_options(MachineClass *m)
     pc_i440fx_4_2_machine_options(m);
     m->desc = "Xen Fully-virtualized PC";
     m->max_cpus = HVM_MAX_VCPUS;
-    m->default_machine_opts = "accel=xen";
+    m->default_machine_opts = "accel=xen,suppress-vmdesc=on";
 }
 
 DEFINE_PC_MACHINE(xenfv_4_2, "xenfv-4.2", pc_xen_hvm_init,
@@ -999,7 +999,7 @@ static void xenfv_3_1_machine_options(MachineClass *m)
     m->desc = "Xen Fully-virtualized PC";
     m->alias = "xenfv";
     m->max_cpus = HVM_MAX_VCPUS;
-    m->default_machine_opts = "accel=xen";
+    m->default_machine_opts = "accel=xen,suppress-vmdesc=on";
 }
 
 DEFINE_PC_MACHINE(xenfv, "xenfv-3.1", pc_xen_hvm_init,
-- 
Anthony PERARD



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

* Re: [PULL 0/4] xen queue 2020-10-20
  2020-10-20 10:02 [PULL 0/4] xen queue 2020-10-20 Anthony PERARD via
                   ` (3 preceding siblings ...)
  2020-10-20 10:02 ` [PULL 4/4] hw/xen: Set suppress-vmdesc for Xen machines Anthony PERARD via
@ 2020-10-20 11:04 ` Peter Maydell
  4 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2020-10-20 11:04 UTC (permalink / raw)
  To: Anthony PERARD; +Cc: QEMU Developers

On Tue, 20 Oct 2020 at 11:02, Anthony PERARD <anthony.perard@citrix.com> wrote:
>
> The following changes since commit d76f4f97eb2772bf85fe286097183d0c7db19ae8:
>
>   Merge remote-tracking branch 'remotes/cschoenebeck/tags/pull-9p-20201019' into staging (2020-10-19 14:39:27 +0100)
>
> are available in the Git repository at:
>
>   https://xenbits.xen.org/git-http/people/aperard/qemu-dm.git tags/pull-xen-20201020
>
> for you to fetch changes up to 8959e0a63a3a681a31ff8397d9345a88e6d905bf:
>
>   hw/xen: Set suppress-vmdesc for Xen machines (2020-10-19 16:33:28 +0100)
>
> ----------------------------------------------------------------
> Xen queue
>
> * cleanup patches.
> * improve xen backend setup performance when other xen guests are
>   running/booting.
> * improve xen guest migration when running in a stubdomain.
>


Applied, thanks.

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

-- PMM


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

end of thread, other threads:[~2020-10-20 11:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-20 10:02 [PULL 0/4] xen queue 2020-10-20 Anthony PERARD via
2020-10-20 10:02 ` [PULL 1/4] xen: xenguest is not used so is not needed Anthony PERARD via
2020-10-20 10:02 ` [PULL 2/4] xen: Rename XENBACKEND_DEVICE to XENBACKEND Anthony PERARD via
2020-10-20 10:02 ` [PULL 3/4] xen-bus: reduce scope of backend watch Anthony PERARD via
2020-10-20 10:02 ` [PULL 4/4] hw/xen: Set suppress-vmdesc for Xen machines Anthony PERARD via
2020-10-20 11:04 ` [PULL 0/4] xen queue 2020-10-20 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.