mbox series

[v3,00/22] microvm: add acpi support

Message ID 20200520132003.9492-1-kraxel@redhat.com (mailing list archive)
Headers show
Series microvm: add acpi support | expand

Message

Gerd Hoffmann May 20, 2020, 1:19 p.m. UTC
I know that not supporting ACPI in microvm is intentional.  If you still
don't want ACPI this is perfectly fine, you can use the usual -no-acpi
switch to toggle ACPI support.

These are the advantages you are going to loose then:

  (1) virtio-mmio device discovery without command line hacks (tweaking
      the command line is a problem when not using direct kernel boot).
  (2) Better IO-APIC support, we can use IRQ lines 16-23.
  (3) ACPI power button (aka powerdown request) works.
  (4) machine poweroff (aka S5 state) works.

Together with seabios patches for virtio-mmio support this allows to
boot standard fedora images (cloud, coreos, workstation live) with the
microvm machine type.

git branch for testing (including updated seabios):
	https://git.kraxel.org/cgit/qemu/log/?h=sirius/microvm

changes in v2:
  * some acpi cleanups are an separate patch series now.
  * switched to hw reduced acpi & generic event device.
  * misc fixes here and there.

changes in v3:
  * depeds on "[PATCH v6 00/16] acpi: i386 tweaks" series.
  * renamed qboot to qboot.bin
  * updated seabios to master branch snapshot.
    - this version boots fine with rtc=off
  * generic event device tweaks (Igor's comments).
  * make SMP work.
  * add RfC patches to turn off acpi by default for microvm.
  * misc fixes here and there.

cheers,
  Gerd

Gerd Hoffmann (22):
  microvm: name qboot binary qboot.bin
  [testing] seabios: update submodule to master snapshot
  [testing] seabios: update config & build rules
  [testing] seabios: update binaries to master snapshot
  acpi: make build_madt() more generic.
  acpi: create acpi-common.c and move madt code
  acpi: madt: skip pci override on pci-less systems.
  acpi: fadt: add hw-reduced sleep register support
  acpi: ged: rename event memory region
  acpi: ged: add control regs
  acpi: ged: add x86 device variant.
  acpi: move acpi_dsdt_add_power_button() to ged
  x86: coldplug cpus
  microvm: use 2G split unconditionally
  microvm: make virtio irq base runtime configurable
  microvm/acpi: add minimal acpi support
  microvm/acpi: add acpi_dsdt_add_virtio() for x86
  microvm/acpi: use GSI 16-23 for virtio
  microvm/acpi: use seabios with acpi=on
  microvm/acpi: disable virtio-mmio cmdline hack
  [RfC] acpi: add per machine type acpi default
  [RfC] acpi: flip default to off for microvm

 hw/i386/acpi-common.h                  |  15 ++
 hw/i386/acpi-microvm.h                 |   6 +
 include/hw/acpi/acpi-defs.h            |   2 +
 include/hw/acpi/generic_event_device.h |  14 +-
 include/hw/i386/microvm.h              |  11 +-
 include/hw/i386/x86.h                  |   1 +
 hw/acpi/aml-build.c                    |   4 +-
 hw/acpi/generic_event_device.c         |  68 ++++++-
 hw/arm/virt-acpi-build.c               |   8 -
 hw/i386/acpi-build.c                   | 126 +------------
 hw/i386/acpi-common.c                  | 156 +++++++++++++++++
 hw/i386/acpi-microvm.c                 | 234 +++++++++++++++++++++++++
 hw/i386/generic_event_device_x86.c     |  36 ++++
 hw/i386/microvm.c                      |  78 ++++++---
 hw/i386/x86.c                          |  32 +++-
 hw/i386/Kconfig                        |   1 +
 hw/i386/Makefile.objs                  |   3 +
 pc-bios/bios-256k.bin                  | Bin 262144 -> 262144 bytes
 pc-bios/bios-microvm.bin               | Bin 65536 -> 131072 bytes
 pc-bios/bios.bin                       | Bin 131072 -> 131072 bytes
 pc-bios/qboot.bin                      | Bin 0 -> 65536 bytes
 roms/Makefile                          |  11 +-
 roms/config.seabios-128k               |   3 +
 roms/config.seabios-microvm            |  26 +++
 roms/seabios                           |   2 +-
 25 files changed, 664 insertions(+), 173 deletions(-)
 create mode 100644 hw/i386/acpi-common.h
 create mode 100644 hw/i386/acpi-microvm.h
 create mode 100644 hw/i386/acpi-common.c
 create mode 100644 hw/i386/acpi-microvm.c
 create mode 100644 hw/i386/generic_event_device_x86.c
 create mode 100644 pc-bios/qboot.bin
 create mode 100644 roms/config.seabios-microvm

Comments

no-reply@patchew.org May 20, 2020, 3:46 p.m. UTC | #1
Patchew URL: https://patchew.org/QEMU/20200520132003.9492-1-kraxel@redhat.com/



Hi,

This series failed the docker-quick@centos7 build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1
=== TEST SCRIPT END ===

  CC      aarch64-softmmu/hw/arm/integratorcp.o
  CC      x86_64-softmmu/hw/i386/kvm/i8254.o
/tmp/qemu-test/src/hw/i386/acpi-microvm.c: In function 'build_dsdt_microvm':
/tmp/qemu-test/src/hw/i386/acpi-microvm.c:109:5: error: implicit declaration of function 'fw_cfg_add_acpi_dsdt' [-Werror=implicit-function-declaration]
     fw_cfg_add_acpi_dsdt(sb_scope, x86ms->fw_cfg);
     ^
/tmp/qemu-test/src/hw/i386/acpi-microvm.c:109:5: error: nested extern declaration of 'fw_cfg_add_acpi_dsdt' [-Werror=nested-externs]
cc1: all warnings being treated as errors
make[1]: *** [hw/i386/acpi-microvm.o] Error 1
make[1]: *** Waiting for unfinished jobs....
  CC      aarch64-softmmu/hw/arm/mainstone.o
  CC      aarch64-softmmu/hw/arm/microbit.o
---
  CC      aarch64-softmmu/target/arm/gdbstub64.o
  CC      aarch64-softmmu/target/arm/machine.o
  CC      aarch64-softmmu/target/arm/arch_dump.o
make: *** [x86_64-softmmu/all] Error 2
make: *** Waiting for unfinished jobs....
  CC      aarch64-softmmu/target/arm/monitor.o
  CC      aarch64-softmmu/target/arm/arm-powerctl.o
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=5cfa0900fad74d3e96f029386896f751', '-u', '1001', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-612gx0r0/src/docker-src.2020-05-20-11.43.56.32095:/var/tmp/qemu:z,ro', 'qemu:centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=5cfa0900fad74d3e96f029386896f751
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-612gx0r0/src'
make: *** [docker-run-test-quick@centos7] Error 2

real    2m31.578s
user    0m8.620s


The full log is available at
http://patchew.org/logs/20200520132003.9492-1-kraxel@redhat.com/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
no-reply@patchew.org May 20, 2020, 3:50 p.m. UTC | #2
Patchew URL: https://patchew.org/QEMU/20200520132003.9492-1-kraxel@redhat.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Message-id: 20200520132003.9492-1-kraxel@redhat.com
Subject: [PATCH v3 00/22] microvm: add acpi support
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

From https://github.com/patchew-project/qemu
 * [new tag]         patchew/20200520132003.9492-1-kraxel@redhat.com -> patchew/20200520132003.9492-1-kraxel@redhat.com
Switched to a new branch 'test'
7280d50 acpi: flip default to off for microvm
0c46cb7 acpi: add per machine type acpi default
3932159 microvm/acpi: disable virtio-mmio cmdline hack
88c8990 microvm/acpi: use seabios with acpi=on
00de58b microvm/acpi: use GSI 16-23 for virtio
f442b20 microvm/acpi: add acpi_dsdt_add_virtio() for x86
50bd765 microvm/acpi: add minimal acpi support
b44d3ee2 microvm: make virtio irq base runtime configurable
8473717 microvm: use 2G split unconditionally
9a8690b x86: coldplug cpus
873496e acpi: move acpi_dsdt_add_power_button() to ged
570b71e acpi: ged: add x86 device variant.
42157e1 acpi: ged: add control regs
963229e acpi: ged: rename event memory region
ffcb835 acpi: fadt: add hw-reduced sleep register support
628859e acpi: madt: skip pci override on pci-less systems.
d7248a7 acpi: create acpi-common.c and move madt code
33254f5 acpi: make build_madt() more generic.
447375a seabios: update binaries to master snapshot
f474461 seabios: update config & build rules
583a45c seabios: update submodule to master snapshot
ce0b4a0 microvm: name qboot binary qboot.bin

=== OUTPUT BEGIN ===
1/22 Checking commit ce0b4a0ec4ce (microvm: name qboot binary qboot.bin)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#36: 
rename from pc-bios/bios-microvm.bin

total: 0 errors, 1 warnings, 35 lines checked

Patch 1/22 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
2/22 Checking commit 583a45cbd0ff (seabios: update submodule to master snapshot)
3/22 Checking commit f474461987ec (seabios: update config & build rules)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#45: 
new file mode 100644

total: 0 errors, 1 warnings, 50 lines checked

Patch 3/22 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
4/22 Checking commit 447375a74a06 (seabios: update binaries to master snapshot)
5/22 Checking commit 33254f57d62c (acpi: make build_madt() more generic.)
6/22 Checking commit d7248a7438fe (acpi: create acpi-common.c and move madt code)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#182: 
new file mode 100644

WARNING: Block comments use a leading /* on a separate line
#187: FILE: hw/i386/acpi-common.c:1:
+/* Support for generating ACPI tables and passing them to Guests

WARNING: Block comments use a leading /* on a separate line
#227: FILE: hw/i386/acpi-common.c:41:
+    /* ACPI spec says that LAPIC entry for non present

ERROR: spaces required around that '<<' (ctx:VxV)
#301: FILE: hw/i386/acpi-common.c:115:
+#define ACPI_BUILD_PCI_IRQS ((1<<5) | (1<<9) | (1<<10) | (1<<11))
                                ^

ERROR: spaces required around that '<<' (ctx:VxV)
#301: FILE: hw/i386/acpi-common.c:115:
+#define ACPI_BUILD_PCI_IRQS ((1<<5) | (1<<9) | (1<<10) | (1<<11))
                                         ^

ERROR: spaces required around that '<<' (ctx:VxV)
#301: FILE: hw/i386/acpi-common.c:115:
+#define ACPI_BUILD_PCI_IRQS ((1<<5) | (1<<9) | (1<<10) | (1<<11))
                                                  ^

ERROR: spaces required around that '<<' (ctx:VxV)
#301: FILE: hw/i386/acpi-common.c:115:
+#define ACPI_BUILD_PCI_IRQS ((1<<5) | (1<<9) | (1<<10) | (1<<11))
                                                            ^

total: 4 errors, 3 warnings, 321 lines checked

Patch 6/22 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

7/22 Checking commit 628859e5cd4e (acpi: madt: skip pci override on pci-less systems.)
WARNING: line over 80 characters
#62: FILE: hw/i386/acpi-common.c:128:
+            intsrcovr->flags  = cpu_to_le16(0xd); /* active high, level triggered */

total: 0 errors, 1 warnings, 56 lines checked

Patch 7/22 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
8/22 Checking commit ffcb8350661b (acpi: fadt: add hw-reduced sleep register support)
9/22 Checking commit 963229ef8a9a (acpi: ged: rename event memory region)
10/22 Checking commit 42157e12a08c (acpi: ged: add control regs)
11/22 Checking commit 570b71e5b8fa (acpi: ged: add x86 device variant.)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#24: 
new file mode 100644

total: 0 errors, 1 warnings, 51 lines checked

Patch 11/22 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
12/22 Checking commit 873496e2d411 (acpi: move acpi_dsdt_add_power_button() to ged)
13/22 Checking commit 9a8690b252cc (x86: coldplug cpus)
14/22 Checking commit 8473717fafed (microvm: use 2G split unconditionally)
15/22 Checking commit b44d3ee2c4d2 (microvm: make virtio irq base runtime configurable)
16/22 Checking commit 50bd7654bd78 (microvm/acpi: add minimal acpi support)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#34: 
new file mode 100644

WARNING: Block comments use a leading /* on a separate line
#39: FILE: hw/i386/acpi-microvm.c:1:
+/* Support for generating ACPI tables and passing them to Guests

WARNING: Block comments use a leading /* on a separate line
#150: FILE: hw/i386/acpi-microvm.c:112:
+    table_offsets = g_array_new(false, true /* clear */,

WARNING: Block comments use a leading /* on a separate line
#154: FILE: hw/i386/acpi-microvm.c:116:
+                             64 /* Ensure FACS is aligned */,

WARNING: Block comments use a leading /* on a separate line
#155: FILE: hw/i386/acpi-microvm.c:117:
+                             false /* high memory */);

total: 0 errors, 5 warnings, 293 lines checked

Patch 16/22 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
17/22 Checking commit f442b20044f3 (microvm/acpi: add acpi_dsdt_add_virtio() for x86)
18/22 Checking commit 00de58be2c9d (microvm/acpi: use GSI 16-23 for virtio)
19/22 Checking commit 88c8990ffa2f (microvm/acpi: use seabios with acpi=on)
20/22 Checking commit 3932159d5e0c (microvm/acpi: disable virtio-mmio cmdline hack)
21/22 Checking commit 0c46cb7b51d7 (acpi: add per machine type acpi default)
22/22 Checking commit 7280d5050ee8 (acpi: flip default to off for microvm)
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20200520132003.9492-1-kraxel@redhat.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
no-reply@patchew.org May 20, 2020, 3:51 p.m. UTC | #3
Patchew URL: https://patchew.org/QEMU/20200520132003.9492-1-kraxel@redhat.com/



Hi,

This series failed the asan build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-debug@fedora TARGET_LIST=x86_64-softmmu J=14 NETWORK=1
=== TEST SCRIPT END ===

  CC      x86_64-softmmu/hw/i386/xen/xen_pvdevice.o
  CC      x86_64-softmmu/hw/i386/xen/xen-hvm.o
  CC      x86_64-softmmu/hw/i386/xen/xen-mapcache.o
/tmp/qemu-test/src/hw/i386/acpi-microvm.c:109:5: error: implicit declaration of function 'fw_cfg_add_acpi_dsdt' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    fw_cfg_add_acpi_dsdt(sb_scope, x86ms->fw_cfg);
    ^
/tmp/qemu-test/src/hw/i386/acpi-microvm.c:109:5: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
2 errors generated.
make[1]: *** [/tmp/qemu-test/src/rules.mak:69: hw/i386/acpi-microvm.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:527: x86_64-softmmu/all] Error 2
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 664, in <module>
    sys.exit(main())
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=3620f0cf6349445fb42a098ed6ef40c8', '-u', '1001', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=x86_64-softmmu', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-lc0gao83/src/docker-src.2020-05-20-11.47.05.9825:/var/tmp/qemu:z,ro', 'qemu:fedora', '/var/tmp/qemu/run', 'test-debug']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=3620f0cf6349445fb42a098ed6ef40c8
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-lc0gao83/src'
make: *** [docker-run-test-debug@fedora] Error 2

real    3m56.264s
user    0m8.551s


The full log is available at
http://patchew.org/logs/20200520132003.9492-1-kraxel@redhat.com/testing.asan/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
no-reply@patchew.org May 20, 2020, 3:53 p.m. UTC | #4
Patchew URL: https://patchew.org/QEMU/20200520132003.9492-1-kraxel@redhat.com/



Hi,

This series failed the docker-mingw@fedora build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#! /bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-mingw@fedora J=14 NETWORK=1
=== TEST SCRIPT END ===

  CC      x86_64-softmmu/target/i386/mpx_helper.o
  CC      x86_64-softmmu/target/i386/seg_helper.o
/tmp/qemu-test/src/hw/i386/acpi-microvm.c: In function 'build_dsdt_microvm':
/tmp/qemu-test/src/hw/i386/acpi-microvm.c:109:5: error: implicit declaration of function 'fw_cfg_add_acpi_dsdt'; did you mean 'fw_cfg_add_file'? [-Werror=implicit-function-declaration]
     fw_cfg_add_acpi_dsdt(sb_scope, x86ms->fw_cfg);
     ^~~~~~~~~~~~~~~~~~~~
     fw_cfg_add_file
/tmp/qemu-test/src/hw/i386/acpi-microvm.c:109:5: error: nested extern declaration of 'fw_cfg_add_acpi_dsdt' [-Werror=nested-externs]
cc1: all warnings being treated as errors
  CC      x86_64-softmmu/target/i386/smm_helper.o
make[1]: *** [/tmp/qemu-test/src/rules.mak:69: hw/i386/acpi-microvm.o] Error 1
make[1]: *** Waiting for unfinished jobs....
  CC      aarch64-softmmu/hw/arm/digic_boards.o
  CC      aarch64-softmmu/hw/arm/exynos4_boards.o
---
  CC      aarch64-softmmu/hw/arm/vexpress.o
  CC      aarch64-softmmu/hw/arm/xilinx_zynq.o
  CC      aarch64-softmmu/hw/arm/sabrelite.o
make: *** [Makefile:527: x86_64-softmmu/all] Error 2
make: *** Waiting for unfinished jobs....
  CC      aarch64-softmmu/hw/arm/armv7m.o
  CC      aarch64-softmmu/hw/arm/exynos4210.o
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=87e79745f2ae42ae974eb9b247d4af76', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-43fhva9t/src/docker-src.2020-05-20-11.50.45.16713:/var/tmp/qemu:z,ro', 'qemu:fedora', '/var/tmp/qemu/run', 'test-mingw']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=87e79745f2ae42ae974eb9b247d4af76
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-43fhva9t/src'
make: *** [docker-run-test-mingw@fedora] Error 2

real    3m1.622s
user    0m7.423s


The full log is available at
http://patchew.org/logs/20200520132003.9492-1-kraxel@redhat.com/testing.docker-mingw@fedora/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com