[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v7bis 15/19] i386/xen: Initialize XenBus and legacy backends
From: |
David Woodhouse |
Subject: |
[RFC PATCH v7bis 15/19] i386/xen: Initialize XenBus and legacy backends from pc_init1() |
Date: |
Mon, 16 Jan 2023 22:19:15 +0000 |
From: David Woodhouse <dwmw@amazon.co.uk>
Now that we're close to being able to use the PV backends without actual
Xen, move the bus instantiation out from xen_hvm_init_pc() to pc_init1().
However, still only do it for (xen_mode == XEN_ATTACH) (i.e. when running
on true Xen) because we don't have XenStore ops for emulation yet, and
the XenBus instantiation failure is fatal. Once we have a functional
XenStore for emulated mode, this will become (xen_mode != XEN_DISABLED).
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
hw/i386/pc_piix.c | 17 +++++++++++++++++
hw/i386/xen/xen-hvm.c | 11 -----------
2 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index df64dd8dcc..d6e61b47b4 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -59,6 +59,10 @@
#include <xen/hvm/hvm_info_table.h>
#include "hw/xen/xen_pt.h"
#endif
+#ifdef CONFIG_XENFV_MACHINE
+#include "hw/xen/xen-legacy-backend.h"
+#include "hw/xen/xen-bus.h"
+#endif
#include "migration/global_state.h"
#include "migration/misc.h"
#include "sysemu/numa.h"
@@ -170,6 +174,19 @@ static void pc_init1(MachineState *machine,
}
}
+#ifdef CONFIG_XENFV_MACHINE
+ if (xen_mode == XEN_ATTACH) {
+ /* Initialize backend core & drivers */
+ xen_bus_init();
+
+ if (xen_be_init() != 0) {
+ error_report("xen backend core setup failed");
+ exit(1);
+ }
+ xen_be_register_common();
+ }
+#endif
+
pc_machine_init_sgx_epc(pcms);
x86_cpus_init(x86ms, pcmc->default_cpu_version);
diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c
index 779d923e10..48f289f8ee 100644
--- a/hw/i386/xen/xen-hvm.c
+++ b/hw/i386/xen/xen-hvm.c
@@ -20,8 +20,6 @@
#include "hw/i386/apic-msidef.h"
#include "hw/xen/xen_native.h"
#include "hw/xen/xen_backend_ops.h"
-#include "hw/xen/xen-legacy-backend.h"
-#include "hw/xen/xen-bus.h"
#include "hw/xen/xen-x86.h"
#include "qapi/error.h"
#include "qapi/qapi-commands-migration.h"
@@ -1505,15 +1503,6 @@ void xen_hvm_init_pc(PCMachineState *pcms, MemoryRegion
**ram_memory)
QLIST_INIT(&state->dev_list);
device_listener_register(&state->device_listener);
- xen_bus_init();
-
- /* Initialize backend core & drivers */
- if (xen_be_init() != 0) {
- error_report("xen backend core setup failed");
- goto err;
- }
- xen_be_register_common();
-
QLIST_INIT(&xen_physmap);
xen_read_physmap(state);
--
2.39.0
- [RFC PATCH v7bis 00/19] Emulated Xen PV backend and PIRQ support, (continued)
- [RFC PATCH v7bis 00/19] Emulated Xen PV backend and PIRQ support, David Woodhouse, 2023/01/16
- [RFC PATCH v7bis 13/19] hw/xen: Implement soft reset for emulated gnttab, David Woodhouse, 2023/01/16
- [RFC PATCH v7bis 11/19] hw/xen: Map guest XENSTORE_PFN grant in emulated Xenstore, David Woodhouse, 2023/01/16
- [RFC PATCH v7bis 16/19] i386/xen: Implement HYPERVISOR_physdev_op, David Woodhouse, 2023/01/16
- [RFC PATCH v7bis 03/19] hw/xen: Add gnttab operations to allow redirection to internal emulation, David Woodhouse, 2023/01/16
- [RFC PATCH v7bis 05/19] hw/xen: Add foreignmem operations to allow redirection to internal emulation, David Woodhouse, 2023/01/16
- [RFC PATCH v7bis 17/19] hw/xen: Implement emulated PIRQ hypercall support, David Woodhouse, 2023/01/16
- [RFC PATCH v7bis 08/19] hw/xen: Use XEN_PAGE_SIZE in PV backend drivers, David Woodhouse, 2023/01/16
- [RFC PATCH v7bis 07/19] hw/xen: Move xenstore_store_pv_console_info to xen_console.c, David Woodhouse, 2023/01/16
- [RFC PATCH v7bis 06/19] hw/xen: Add xenstore operations to allow redirection to internal emulation, David Woodhouse, 2023/01/16
- [RFC PATCH v7bis 15/19] i386/xen: Initialize XenBus and legacy backends from pc_init1(),
David Woodhouse <=
- [RFC PATCH v7bis 12/19] hw/xen: Add backend implementation of grant table operations, David Woodhouse, 2023/01/16
- [RFC PATCH v7bis 14/19] hw/xen: Remove old version of Xen headers, David Woodhouse, 2023/01/16
- [RFC PATCH v7bis 02/19] hw/xen: Add emulated evtchn ops, David Woodhouse, 2023/01/16
- [RFC PATCH v7bis 18/19] hw/xen: Support GSI mapping to PIRQ, David Woodhouse, 2023/01/16
- [RFC PATCH v7bis 19/19] hw/xen: Support MSI mapping to PIRQ, David Woodhouse, 2023/01/16
- [RFC PATCH v7bis 04/19] hw/xen: Pass grant ref to gnttab unmap, David Woodhouse, 2023/01/16
- [RFC PATCH v7bis 09/19] hw/xen: Rename xen_common.h to xen_native.h, David Woodhouse, 2023/01/16
- [RFC PATCH v7bis 10/19] hw/xen: Build PV backend drivers for XENFV_MACHINE, David Woodhouse, 2023/01/16
- [RFC PATCH v7bis 01/19] hw/xen: Add evtchn operations to allow redirection to internal emulation, David Woodhouse, 2023/01/16
- [PATCH v7 52/51] hw/xen: Automatically add xen-platform PCI device for emulated Xen guests, David Woodhouse, 2023/01/17