]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
hw/arm: xenpvh: Rename xen_arm.c -> xen-pvh.c
authorEdgar E. Iglesias <edgar.iglesias@amd.com>
Fri, 16 Aug 2024 13:54:19 +0000 (15:54 +0200)
committerEdgar E. Iglesias <edgar.iglesias@amd.com>
Wed, 4 Sep 2024 14:50:43 +0000 (16:50 +0200)
Rename xen_arm.c -> xen-pvh.c to better express that this
is a PVH machine and to align with x86 HVM and future PVH
machine filenames:
hw/i386/xen/xen-hvm.c
hw/i386/xen/xen-pvh.c (in preparation)

No functional changes.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
hw/arm/meson.build
hw/arm/xen-pvh.c [new file with mode: 0644]
hw/arm/xen_arm.c [deleted file]

index 074612b40c9ea7e20d04fcd14f0f31e685cb7371..4059d0be2eaa2d955fdb4771bc8e3c601d9063e5 100644 (file)
@@ -61,7 +61,7 @@ arm_ss.add(when: 'CONFIG_FSL_IMX6UL', if_true: files('fsl-imx6ul.c', 'mcimx6ul-e
 arm_ss.add(when: 'CONFIG_NRF51_SOC', if_true: files('nrf51_soc.c'))
 arm_ss.add(when: 'CONFIG_XEN', if_true: files(
   'xen-stubs.c',
-  'xen_arm.c',
+  'xen-pvh.c',
 ))
 
 system_ss.add(when: 'CONFIG_ARM_SMMUV3', if_true: files('smmu-common.c'))
diff --git a/hw/arm/xen-pvh.c b/hw/arm/xen-pvh.c
new file mode 100644 (file)
index 0000000..04cb985
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+ * QEMU ARM Xen PVH Machine
+ *
+ * SPDX-License-Identifier: MIT
+ */
+
+#include "qemu/osdep.h"
+#include "qemu/error-report.h"
+#include "qapi/qapi-commands-migration.h"
+#include "hw/boards.h"
+#include "sysemu/sysemu.h"
+#include "hw/xen/xen-pvh-common.h"
+#include "hw/xen/arch_hvm.h"
+
+#define TYPE_XEN_ARM  MACHINE_TYPE_NAME("xenpvh")
+
+/*
+ * VIRTIO_MMIO_DEV_SIZE is imported from tools/libs/light/libxl_arm.c under Xen
+ * repository.
+ *
+ * Origin: git://xenbits.xen.org/xen.git 2128143c114c
+ */
+#define VIRTIO_MMIO_DEV_SIZE   0x200
+
+#define NR_VIRTIO_MMIO_DEVICES   \
+   (GUEST_VIRTIO_MMIO_SPI_LAST - GUEST_VIRTIO_MMIO_SPI_FIRST)
+
+static void xen_arm_instance_init(Object *obj)
+{
+    XenPVHMachineState *s = XEN_PVH_MACHINE(obj);
+
+    /* Default values.  */
+    s->cfg.ram_low = (MemMapEntry) { GUEST_RAM0_BASE, GUEST_RAM0_SIZE };
+    s->cfg.ram_high = (MemMapEntry) { GUEST_RAM1_BASE, GUEST_RAM1_SIZE };
+
+    s->cfg.virtio_mmio_num = NR_VIRTIO_MMIO_DEVICES;
+    s->cfg.virtio_mmio_irq_base = GUEST_VIRTIO_MMIO_SPI_FIRST;
+    s->cfg.virtio_mmio = (MemMapEntry) { GUEST_VIRTIO_MMIO_BASE,
+                                         VIRTIO_MMIO_DEV_SIZE };
+}
+
+static void xen_arm_machine_class_init(ObjectClass *oc, void *data)
+{
+    XenPVHMachineClass *xpc = XEN_PVH_MACHINE_CLASS(oc);
+    MachineClass *mc = MACHINE_CLASS(oc);
+
+    mc->desc = "Xen PVH ARM machine";
+
+    /*
+     * mc->max_cpus holds the MAX value allowed in the -smp command-line opts.
+     *
+     * 1. If users don't pass any -smp option:
+     *   ms->smp.cpus will default to 1.
+     *   ms->smp.max_cpus will default to 1.
+     *
+     * 2. If users pass -smp X:
+     *   ms->smp.cpus will be set to X.
+     *   ms->smp.max_cpus will also be set to X.
+     *
+     * 3. If users pass -smp X,maxcpus=Y:
+     *   ms->smp.cpus will be set to X.
+     *   ms->smp.max_cpus will be set to Y.
+     *
+     * In scenarios 2 and 3, if X or Y are set to something larger than
+     * mc->max_cpus, QEMU will bail out with an error message.
+     */
+    mc->max_cpus = GUEST_MAX_VCPUS;
+
+    /* List of supported features known to work on PVH ARM.  */
+    xpc->has_tpm = true;
+    xpc->has_virtio_mmio = true;
+
+    xen_pvh_class_setup_common_props(xpc);
+}
+
+static const TypeInfo xen_arm_machine_type = {
+    .name = TYPE_XEN_ARM,
+    .parent = TYPE_XEN_PVH_MACHINE,
+    .class_init = xen_arm_machine_class_init,
+    .instance_size = sizeof(XenPVHMachineState),
+    .instance_init = xen_arm_instance_init,
+};
+
+static void xen_arm_machine_register_types(void)
+{
+    type_register_static(&xen_arm_machine_type);
+}
+
+type_init(xen_arm_machine_register_types)
diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
deleted file mode 100644 (file)
index 04cb985..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * QEMU ARM Xen PVH Machine
- *
- * SPDX-License-Identifier: MIT
- */
-
-#include "qemu/osdep.h"
-#include "qemu/error-report.h"
-#include "qapi/qapi-commands-migration.h"
-#include "hw/boards.h"
-#include "sysemu/sysemu.h"
-#include "hw/xen/xen-pvh-common.h"
-#include "hw/xen/arch_hvm.h"
-
-#define TYPE_XEN_ARM  MACHINE_TYPE_NAME("xenpvh")
-
-/*
- * VIRTIO_MMIO_DEV_SIZE is imported from tools/libs/light/libxl_arm.c under Xen
- * repository.
- *
- * Origin: git://xenbits.xen.org/xen.git 2128143c114c
- */
-#define VIRTIO_MMIO_DEV_SIZE   0x200
-
-#define NR_VIRTIO_MMIO_DEVICES   \
-   (GUEST_VIRTIO_MMIO_SPI_LAST - GUEST_VIRTIO_MMIO_SPI_FIRST)
-
-static void xen_arm_instance_init(Object *obj)
-{
-    XenPVHMachineState *s = XEN_PVH_MACHINE(obj);
-
-    /* Default values.  */
-    s->cfg.ram_low = (MemMapEntry) { GUEST_RAM0_BASE, GUEST_RAM0_SIZE };
-    s->cfg.ram_high = (MemMapEntry) { GUEST_RAM1_BASE, GUEST_RAM1_SIZE };
-
-    s->cfg.virtio_mmio_num = NR_VIRTIO_MMIO_DEVICES;
-    s->cfg.virtio_mmio_irq_base = GUEST_VIRTIO_MMIO_SPI_FIRST;
-    s->cfg.virtio_mmio = (MemMapEntry) { GUEST_VIRTIO_MMIO_BASE,
-                                         VIRTIO_MMIO_DEV_SIZE };
-}
-
-static void xen_arm_machine_class_init(ObjectClass *oc, void *data)
-{
-    XenPVHMachineClass *xpc = XEN_PVH_MACHINE_CLASS(oc);
-    MachineClass *mc = MACHINE_CLASS(oc);
-
-    mc->desc = "Xen PVH ARM machine";
-
-    /*
-     * mc->max_cpus holds the MAX value allowed in the -smp command-line opts.
-     *
-     * 1. If users don't pass any -smp option:
-     *   ms->smp.cpus will default to 1.
-     *   ms->smp.max_cpus will default to 1.
-     *
-     * 2. If users pass -smp X:
-     *   ms->smp.cpus will be set to X.
-     *   ms->smp.max_cpus will also be set to X.
-     *
-     * 3. If users pass -smp X,maxcpus=Y:
-     *   ms->smp.cpus will be set to X.
-     *   ms->smp.max_cpus will be set to Y.
-     *
-     * In scenarios 2 and 3, if X or Y are set to something larger than
-     * mc->max_cpus, QEMU will bail out with an error message.
-     */
-    mc->max_cpus = GUEST_MAX_VCPUS;
-
-    /* List of supported features known to work on PVH ARM.  */
-    xpc->has_tpm = true;
-    xpc->has_virtio_mmio = true;
-
-    xen_pvh_class_setup_common_props(xpc);
-}
-
-static const TypeInfo xen_arm_machine_type = {
-    .name = TYPE_XEN_ARM,
-    .parent = TYPE_XEN_PVH_MACHINE,
-    .class_init = xen_arm_machine_class_init,
-    .instance_size = sizeof(XenPVHMachineState),
-    .instance_init = xen_arm_instance_init,
-};
-
-static void xen_arm_machine_register_types(void)
-{
-    type_register_static(&xen_arm_machine_type);
-}
-
-type_init(xen_arm_machine_register_types)