[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v1 15/15] i386/xen: Initialize XenBus and legacy backends fro
From: |
David Woodhouse |
Subject: |
[RFC PATCH v1 15/15] i386/xen: Initialize XenBus and legacy backends from pc_init1() |
Date: |
Tue, 10 Jan 2023 12:37:54 +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 b48047f50c..5678112dc2 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -57,6 +57,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"
@@ -157,6 +161,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.35.3
- Re: [PATCH v6 23/51] i386/xen: implement HYPERVISOR_event_channel_op, (continued)
- [PATCH v6 31/51] hw/xen: Implement EVTCHNOP_bind_virq, David Woodhouse, 2023/01/10
- [PATCH v6 01/51] include: import Xen public headers to include/standard-headers/, David Woodhouse, 2023/01/10
- [RFC PATCH v1 00/15] Xen PV backend support for KVM/Xen guests, David Woodhouse, 2023/01/10
- [RFC PATCH v1 11/15] hw/xen: Map guest XENSTORE_PFN grant in emulated Xenstore, David Woodhouse, 2023/01/10
- [RFC PATCH v1 08/15] hw/xen: Use XEN_PAGE_SIZE in PV backend drivers, David Woodhouse, 2023/01/10
- [RFC PATCH v1 05/15] hw/xen: Add foreignmem operations to allow redirection to internal emulation, David Woodhouse, 2023/01/10
- [RFC PATCH v1 10/15] hw/xen: Build PV backend drivers for XENFV_MACHINE, David Woodhouse, 2023/01/10
- [RFC PATCH v1 09/15] hw/xen: Rename xen_common.h to xen_native.h, David Woodhouse, 2023/01/10
- [RFC PATCH v1 15/15] i386/xen: Initialize XenBus and legacy backends from pc_init1(),
David Woodhouse <=
- [RFC PATCH v1 14/15] hw/xen: Remove old version of Xen headers, David Woodhouse, 2023/01/10
- [RFC PATCH v1 12/15] hw/xen: Add backend implementation of grant table operations, David Woodhouse, 2023/01/10
- [RFC PATCH v1 04/15] hw/xen: Pass grant ref to gnttab unmap, David Woodhouse, 2023/01/10
- [RFC PATCH v1 13/15] hw/xen: Implement soft reset for emulated gnttab, David Woodhouse, 2023/01/10
- [RFC PATCH v1 07/15] hw/xen: Move xenstore_store_pv_console_info to xen_console.c, David Woodhouse, 2023/01/10
- [RFC PATCH v1 03/15] hw/xen: Add gnttab operations to allow redirection to internal emulation, David Woodhouse, 2023/01/10
- [RFC PATCH v1 06/15] hw/xen: Add xenstore operations to allow redirection to internal emulation, David Woodhouse, 2023/01/10
- [RFC PATCH v1 01/15] hw/xen: Add evtchn operations to allow redirection to internal emulation, David Woodhouse, 2023/01/10
- [RFC PATCH v1 02/15] hw/xen: Add emulated evtchn ops, David Woodhouse, 2023/01/10
- Re: [RFC PATCH v1 00/15] Xen PV backend support for KVM/Xen guests, Joao Martins, 2023/01/10