microvm: add device tree support.
PATCH 1/1 microvm: add device tree support.
Allows edk2 detect virtio-mmio devices and pcie ecam. See comment in hw/i386/microvm-dt.c for more details.
Signed-off-by Gerd Hoffmann <[email protected]>
--- hw/i386/microvm-dt.h | 8 + include/hw/i386/microvm.h | 4 + hw/i386/microvm-dt.c | 341 +++++++++++++++++++++++++++++ hw/i386/microvm.c | 2 + .gitlab-ci.d/buildtest.yml | 1 - configs/targets/i386-softmmu.mak | 1 + configs/targets/x86_64-softmmu.mak | 1 + hw/i386/meson.build | 2 +- 8 files changed, 358 insertions(+), 2 deletions(-) create mode 100644 hw/i386/microvm-dt.h create mode 100644 hw/i386/microvm-dt.c
hw/i386/microvm-dt.h new file +8 -0
@@ -0,0 +1,8 @@ +#ifndef HW_I386_MICROVM_DT_H +#define HW_I386_MICROVM_DT_H + +#include "hw/i386/microvm.h" + +void dt_setup_microvm (MicrovmMachineState *mms); + +#endif
include/hw/i386/microvm.h +4 -0
@@ -104,6 +104,10 @@ struct MicrovmMachineState {Notifier machine_done;Notifier powerdown_req;struct GPEXConfig gpex; + +/* device tree */ +void *fdt; +uint32_t ioapic_phandle[2 ]; };#define TYPE_MICROVM_MACHINE MACHINE_TYPE_NAME("microvm")
hw/i386/microvm-dt.c new file +341 -0
341 lines not on this page · raw message
hw/i386/microvm.c +2 -0
@@ -28,6 +28,7 @@#include "sysemu/reset.h" #include "sysemu/runstate.h" #include "acpi-microvm.h" +#include "microvm-dt.h" #include "hw/loader.h" #include "hw/irq.h"
@@ -626,6 +627,7 @@ static void microvm_machine_done(Notifier *notifier, void *data) machine_done);acpi_setup_microvm (mms); +dt_setup_microvm (mms); }static void microvm_powerdown_req (Notifier *notifier,void *data)
.gitlab-ci.d/buildtest.yml +0 -1
@@ -575,7 +575,6 @@ build-without-default-features: CONFIGURE_ARGS: --without-default-features --disable-capstone - --disable-fdt --disable-pie --disable-qom-cast-debug --disable-slirp
configs/targets/i386-softmmu.mak +1 -0
@@ -1,3 +1,4 @@ TARGET_ARCH=i386 TARGET_SUPPORTS_MTTCG=y +TARGET_NEED_FDT=y TARGET_XML_FILES= gdb-xml/i386-32bit.xml
configs/targets/x86_64-softmmu.mak +1 -0
@@ -1,4 +1,5 @@ TARGET_ARCH=x86_64 TARGET_BASE_ARCH=i386 TARGET_SUPPORTS_MTTCG=y +TARGET_NEED_FDT=y TARGET_XML_FILES= gdb-xml/i386-64bit.xml
hw/i386/meson.build +1 -1
@@ -11,7 +11,7 @@ i386_ss.add(when: 'CONFIG_X86_IOMMU', if_true: files('x86-iommu.c'), if_false: files('x86-iommu-stub.c')) i386_ss.add(when: 'CONFIG_AMD_IOMMU', if_true: files('amd_iommu.c')) i386_ss.add(when: 'CONFIG_I440FX', if_true: files('pc_piix.c')) -i386_ss.add(when: 'CONFIG_MICROVM', if_true: files('microvm.c', 'acpi-microvm.c')) +i386_ss.add(when: 'CONFIG_MICROVM', if_true: files('microvm.c', 'acpi-microvm.c', 'microvm-dt.c')) i386_ss.add(when: 'CONFIG_Q35', if_true: files('pc_q35.c')) i386_ss.add(when: 'CONFIG_VMMOUSE', if_true: files('vmmouse.c')) i386_ss.add(when: 'CONFIG_VMPORT', if_true: files('vmport.c'))
Signature · 1 line
2.31.1
Quoted 4 lines · Gerd Hoffmann
Allows edk2 detect virtio-mmio devices and pcie ecam. See comment in
hw/i386/microvm-dt.cfor more details.Signed-off-by Gerd Hoffmann <[email protected]>
Quoted 12 lines
--- hw/i386/microvm-dt.h | 8 + include/hw/i386/microvm.h | 4 + hw/i386/microvm-dt.c | 341 +++++++++++++++++++++++++++++ hw/i386/microvm.c | 2 + .gitlab-ci.d/buildtest.yml | 1 - configs/targets/i386-softmmu.mak | 1 + configs/targets/x86_64-softmmu.mak | 1 + hw/i386/meson.build | 2 +- 8 files changed, 358 insertions(+), 2 deletions(-) create mode 100644 hw/i386/microvm-dt.h create mode 100644 hw/i386/microvm-dt.c
Reviewed-by Sergio Lopez <[email protected]>
Quoted 2 lines · Gerd Hoffmann
Allows edk2 detect virtio-mmio devices and pcie ecam. See comment in
hw/i386/microvm-dt.cfor more details.
Anyone picking this up?
Or should I do a one-patch pull request?
take care,
Gerd
Quoted 9 lines · Gerd Hoffmann
Quoted 2 lines · Gerd Hoffmann
Allows edk2 detect virtio-mmio devices and pcie ecam. See comment in
hw/i386/microvm-dt.cfor more details.Anyone picking this up?
Or should I do a one-patch pull request?take care,
Gerd
microvm is sergio and paolo ...
Signature · 1 line
MST