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

[QEMU][PATCH v3 04/12] xen_arm: Add "accel = xen" and drop extra interface openings


  • To: <qemu-devel@xxxxxxxxxx>
  • From: Vikram Garhwal <vikram.garhwal@xxxxxxx>
  • Date: Wed, 25 Jan 2023 00:43:49 -0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=nongnu.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/6RMYIuXur/hQizPdgkR79Juo1RH5cFqlOnZ0Xl8lqo=; b=gnf3Dn4Wk+B3G4Iz1BSqftFRfMkfnbb3ZWoUhPtRJfjktF9tiaW1hHhomY19+lu5H8C1KBIcr3oXhmuN8K0E+teANIjx5O93BwXqdnzOexzaLe31Hl5ESzp9MlttjqeNppvOj+Q7IJm4JvVBpgKv5ddClOLTLGVcNxn4j6r/rCw0IG5HfgfjUqFssnj0MUxCMhG+7T+qwNW+9N4UYA37Jsm4jCpd2/kzCtR7jgEQhIYLX3Wkvk6X97qYcB0H94edxntwdXsOAN7awuskVb8HbgmYl1RUIyde0yb6OeaSrz0fY5F50cv1v5Vt3YwHlyD2gXNrRGJvq/rjEDYDruOnaQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lZKJ+r++xbLiJS/zYGFJP+fHkvEOBIMEkKfYQoukd5vtKLjDV4CJX2Z4fLEIGpzy0BqIKu6gKqYeHieGF1N1aoczy+XCEJZ0S5f3DXVN+ICaoVlK+Kvqtcc+CKbKNjTDuNYq4B07NxrnFnpbPYtdTXCqKOwb8NSat/wk8IQv6VzILXZIh0zr56et1eP7soRtwCb02QHA+p+ouIlXDFl6H1pvCyyknsv17aHYdXMfGLR12rzhK3/oEamKnieSEtjKbSvQu6H3PYp8pJfYJI/J8ftrzIse3zrn0z0GJ/uwS/yQiEbZqxLFx+3Y4/k7CvyGARSvkReOLrLRO+/r9OpLAA==
  • Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, <vikram.garhwal@xxxxxxx>, <stefano.stabellini@xxxxxxx>, <alex.bennee@xxxxxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, Peter Maydell <peter.maydell@xxxxxxxxxx>, "open list:ARM TCG CPUs" <qemu-arm@xxxxxxxxxx>
  • Delivery-date: Wed, 25 Jan 2023 08:46:49 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

In order to use virtio backends we need to make sure that Xen accelerator
is enabled (xen_enabled() returns true) as the memory/cache systems
check for xen_enabled() to perform specific actions. Without that
the xen-mapcache (which is needed for mapping guest memory) is not in use.

Also drop extra interface opening as this is already done in xen-all.c
(so drop xen_init_ioreq() completely) and skip virtio/tpm initialization
if device emulation is not available.

Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>
Signed-off-by: Vikram Garhwal <vikram.garhwal@xxxxxxx>
Reviewed-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>
---
 hw/arm/xen_arm.c | 29 ++---------------------------
 1 file changed, 2 insertions(+), 27 deletions(-)

diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
index fde919df29..4ac425a3c5 100644
--- a/hw/arm/xen_arm.c
+++ b/hw/arm/xen_arm.c
@@ -137,30 +137,6 @@ void qmp_xen_set_global_dirty_log(bool enable, Error 
**errp)
 {
 }
 
-static int xen_init_ioreq(XenIOState *state, unsigned int max_cpus)
-{
-    xen_dmod = xendevicemodel_open(0, 0);
-    xen_xc = xc_interface_open(0, 0, 0);
-
-    if (xen_xc == NULL) {
-        perror("xen: can't open xen interface\n");
-        return -1;
-    }
-
-    xen_fmem = xenforeignmemory_open(0, 0);
-    if (xen_fmem == NULL) {
-        perror("xen: can't open xen fmem interface\n");
-        xc_interface_close(xen_xc);
-        return -1;
-    }
-
-    xen_register_ioreq(state, max_cpus, xen_memory_listener);
-
-    xenstore_record_dm_state(xenstore, "running");
-
-    return 0;
-}
-
 static void xen_enable_tpm(void)
 {
 #ifdef CONFIG_TPM
@@ -198,9 +174,7 @@ static void xen_arm_init(MachineState *machine)
 
     xen_init_ram(machine);
 
-    if (xen_init_ioreq(xam->state, machine->smp.cpus)) {
-        return;
-    }
+    xen_register_ioreq(xam->state, machine->smp.cpus, xen_memory_listener);
 
     xen_create_virtio_mmio_devices(xam);
 
@@ -218,6 +192,7 @@ static void xen_arm_machine_class_init(ObjectClass *oc, 
void *data)
     mc->max_cpus = 1;
     /* Set explicitly here to make sure that real ram_size is passed */
     mc->default_ram_size = 0;
+    mc->default_machine_opts = "accel=xen";
 
     machine_class_allow_dynamic_sysbus_dev(mc, TYPE_TPM_TIS_SYSBUS);
 }
-- 
2.17.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.