[PATCH v6 00/10] Introduce the microvm machine type

Sergio Lopez posted 10 patches 4 years, 6 months ago
Test docker-mingw@fedora passed
Test checkpatch failed
Test docker-quick@centos7 failed
Test docker-clang@ubuntu failed
Test asan failed
Test FreeBSD passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20191004093752.16564-1-slp@redhat.com
Maintainers: Richard Henderson <rth@twiddle.net>, Anthony Perard <anthony.perard@citrix.com>, Laszlo Ersek <lersek@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, "Philippe Mathieu-Daudé" <philmd@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Paul Durrant <paul@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, Eduardo Habkost <ehabkost@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Igor Mammedov <imammedo@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>
There is a newer version of this series
docs/microvm.rst                 |  98 ++++
default-configs/i386-softmmu.mak |   1 +
include/hw/i386/microvm.h        |  83 ++++
include/hw/i386/pc.h             |  28 +-
include/hw/i386/x86.h            |  94 ++++
include/hw/nvram/fw_cfg.h        |  42 ++
include/hw/virtio/virtio-mmio.h  |  73 +++
hw/acpi/cpu_hotplug.c            |  10 +-
hw/i386/acpi-build.c             |  29 +-
hw/i386/amd_iommu.c              |   3 +-
hw/i386/intel_iommu.c            |   3 +-
hw/i386/microvm.c                | 574 ++++++++++++++++++++++
hw/i386/pc.c                     | 780 +++---------------------------
hw/i386/pc_piix.c                |  46 +-
hw/i386/pc_q35.c                 |  38 +-
hw/i386/pc_sysfw.c               |  58 +--
hw/i386/x86.c                    | 790 +++++++++++++++++++++++++++++++
hw/i386/xen/xen-hvm.c            |  23 +-
hw/intc/apic.c                   |   2 +-
hw/intc/ioapic.c                 |   2 +-
hw/nvram/fw_cfg.c                |  29 ++
hw/virtio/virtio-mmio.c          |  48 +-
.gitmodules                      |   3 +
hw/i386/Kconfig                  |   4 +
hw/i386/Makefile.objs            |   2 +
pc-bios/bios-microvm.bin         | Bin 0 -> 65536 bytes
roms/Makefile                    |   6 +
roms/qboot                       |   1 +
28 files changed, 1963 insertions(+), 907 deletions(-)
create mode 100644 docs/microvm.rst
create mode 100644 include/hw/i386/microvm.h
create mode 100644 include/hw/i386/x86.h
create mode 100644 include/hw/virtio/virtio-mmio.h
create mode 100644 hw/i386/microvm.c
create mode 100644 hw/i386/x86.c
create mode 100755 pc-bios/bios-microvm.bin
create mode 160000 roms/qboot
[PATCH v6 00/10] Introduce the microvm machine type
Posted by Sergio Lopez 4 years, 6 months ago
Microvm is a machine type inspired by Firecracker and constructed
after the its machine model.

It's a minimalist machine type without PCI nor ACPI support, designed
for short-lived guests. Microvm also establishes a baseline for
benchmarking and optimizing both QEMU and guest operating systems,
since it is optimized for both boot time and footprint.

---

Changelog
v6:
 - Some style fixes (Philippe Mathieu-Daudé)
 - Fix a documentation bug stating that LAPIC was in userspace (Paolo
   Bonzini)
 - Update Xen HVM code after X86MachineState introduction (Philippe
   Mathieu-Daudé)
 - Rename header guard from QEMU_VIRTIO_MMIO_H to HW_VIRTIO_MMIO_H
   (Philippe Mathieu-Daudé)

v5:
 - Drop unneeded "[PATCH v4 2/8] hw/i386: Factorize e820 related
   functions" (Philippe Mathieu-Daudé)
 - Drop unneeded "[PATCH v4 1/8] hw/i386: Factorize PVH related
   functions" (Stefano Garzarella)
 - Split X86MachineState introduction into smaller patches (Philippe
   Mathieu-Daudé)
 - Change option-roms to x-option-roms and kernel-cmdline to
   auto-kernel-cmdline (Paolo Bonzini)
 - Make i8259 PIT and i8254 PIC optional (Paolo Bonzini)
 - Some fixes to the documentation (Paolo Bonzini)
 - Switch documentation format from txt to rst (Peter Maydell)
 - Move NMI interface to X86_MACHINE (Philippe Mathieu-Daudé, Paolo
   Bonzini)

v4:
 - This is a complete rewrite of the whole patchset, with a focus on
   reusing as much existing code as possible to ease the maintenance burden
   and making the machine type as compatible as possible by default. As
   a result, the number of lines dedicated specifically to microvm is
   383 (code lines measured by "cloc") and, with the default
   configuration, it's now able to boot both PVH ELF images and
   bzImages with either SeaBIOS or qboot.

v3:
  - Add initrd support (thanks Stefano).

v2:
  - Drop "[PATCH 1/4] hw/i386: Factorize CPU routine".
  - Simplify machine definition (thanks Eduardo).
  - Remove use of unneeded NUMA-related callbacks (thanks Eduardo).
  - Add a patch to factorize PVH-related functions.
  - Replace use of Linux's Zero Page with PVH (thanks Maran and Paolo).

---
Sergio Lopez (10):
  hw/virtio: Factorize virtio-mmio headers
  hw/i386/pc: rename functions shared with non-PC machines
  hw/i386/pc: move shared x86 functions to x86.c and export them
  hw/i386: split PCMachineState deriving X86MachineState from it
  hw/i386: make x86.c independent from PCMachineState
  fw_cfg: add "modify" functions for all types
  hw/intc/apic: reject pic ints if isa_pic == NULL
  roms: add microvm-bios (qboot) as binary and git submodule
  docs/microvm.rst: document the new microvm machine type
  hw/i386: Introduce the microvm machine type

 docs/microvm.rst                 |  98 ++++
 default-configs/i386-softmmu.mak |   1 +
 include/hw/i386/microvm.h        |  83 ++++
 include/hw/i386/pc.h             |  28 +-
 include/hw/i386/x86.h            |  94 ++++
 include/hw/nvram/fw_cfg.h        |  42 ++
 include/hw/virtio/virtio-mmio.h  |  73 +++
 hw/acpi/cpu_hotplug.c            |  10 +-
 hw/i386/acpi-build.c             |  29 +-
 hw/i386/amd_iommu.c              |   3 +-
 hw/i386/intel_iommu.c            |   3 +-
 hw/i386/microvm.c                | 574 ++++++++++++++++++++++
 hw/i386/pc.c                     | 780 +++---------------------------
 hw/i386/pc_piix.c                |  46 +-
 hw/i386/pc_q35.c                 |  38 +-
 hw/i386/pc_sysfw.c               |  58 +--
 hw/i386/x86.c                    | 790 +++++++++++++++++++++++++++++++
 hw/i386/xen/xen-hvm.c            |  23 +-
 hw/intc/apic.c                   |   2 +-
 hw/intc/ioapic.c                 |   2 +-
 hw/nvram/fw_cfg.c                |  29 ++
 hw/virtio/virtio-mmio.c          |  48 +-
 .gitmodules                      |   3 +
 hw/i386/Kconfig                  |   4 +
 hw/i386/Makefile.objs            |   2 +
 pc-bios/bios-microvm.bin         | Bin 0 -> 65536 bytes
 roms/Makefile                    |   6 +
 roms/qboot                       |   1 +
 28 files changed, 1963 insertions(+), 907 deletions(-)
 create mode 100644 docs/microvm.rst
 create mode 100644 include/hw/i386/microvm.h
 create mode 100644 include/hw/i386/x86.h
 create mode 100644 include/hw/virtio/virtio-mmio.h
 create mode 100644 hw/i386/microvm.c
 create mode 100644 hw/i386/x86.c
 create mode 100755 pc-bios/bios-microvm.bin
 create mode 160000 roms/qboot

-- 
2.21.0


Re: [PATCH v6 00/10] Introduce the microvm machine type
Posted by no-reply@patchew.org 4 years, 6 months ago
Patchew URL: https://patchew.org/QEMU/20191004093752.16564-1-slp@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 ===

qemu-system-x86_64: missing kernel image file name, required by microvm
Broken pipe
/tmp/qemu-test/src/tests/libqtest.c:140: kill_qemu() tried to terminate QEMU process but encountered exit status 1 (expected 0)
ERROR - too few tests run (expected 7, got 4)
make: *** [check-qtest-x86_64] Error 1
make: *** Waiting for unfinished jobs....
  TEST    iotest-qcow2: 159
  TEST    iotest-qcow2: 161
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=479a42ee8d764327bfb3924069c8e2dc', '-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-0dfb_dst/src/docker-src.2019-10-04-13.10.50.4894:/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=479a42ee8d764327bfb3924069c8e2dc
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-0dfb_dst/src'
make: *** [docker-run-test-quick@centos7] Error 2

real    10m42.831s
user    0m8.500s


The full log is available at
http://patchew.org/logs/20191004093752.16564-1-slp@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
Re: [PATCH v6 00/10] Introduce the microvm machine type
Posted by Paolo Bonzini 4 years, 6 months ago
On 04/10/19 19:21, no-reply@patchew.org wrote:
> qemu-system-x86_64: missing kernel image file name, required by microvm
> Broken pipe
> /tmp/qemu-test/src/tests/libqtest.c:140: kill_qemu() tried to terminate QEMU process but encountered exit status 1 (expected 0)
> ERROR - too few tests run (expected 7, got 4)
> make: *** [check-qtest-x86_64] Error 1
> make: *** Waiting for unfinished jobs....
>   TEST    iotest-qcow2: 159
>   TEST    iotest-qcow2: 161
> ---
>     raise CalledProcessError(retcode, cmd)

I think this needs some kind of blacklisting?

Paolo

Re: [PATCH v6 00/10] Introduce the microvm machine type
Posted by Sergio Lopez 4 years, 6 months ago
Paolo Bonzini <pbonzini@redhat.com> writes:

> On 04/10/19 19:21, no-reply@patchew.org wrote:
>> qemu-system-x86_64: missing kernel image file name, required by microvm
>> Broken pipe
>> /tmp/qemu-test/src/tests/libqtest.c:140: kill_qemu() tried to terminate QEMU process but encountered exit status 1 (expected 0)
>> ERROR - too few tests run (expected 7, got 4)
>> make: *** [check-qtest-x86_64] Error 1
>> make: *** Waiting for unfinished jobs....
>>   TEST    iotest-qcow2: 159
>>   TEST    iotest-qcow2: 161
>> ---
>>     raise CalledProcessError(retcode, cmd)
>
> I think this needs some kind of blacklisting?

I solved this issue by allowing a microvm machine to be started without
a kernel filename (now that we always rely on a FW, we can do that ;-)

Cheers,
Sergio.
Re: [PATCH v6 00/10] Introduce the microvm machine type
Posted by Michael S. Tsirkin 4 years, 6 months ago
On Fri, Oct 04, 2019 at 11:37:42AM +0200, Sergio Lopez wrote:
> Microvm is a machine type inspired by Firecracker and constructed
> after the its machine model.
> 
> It's a minimalist machine type without PCI nor ACPI support, designed
> for short-lived guests. Microvm also establishes a baseline for
> benchmarking and optimizing both QEMU and guest operating systems,
> since it is optimized for both boot time and footprint.
> 
> ---
> 
> Changelog
> v6:
>  - Some style fixes (Philippe Mathieu-Daudé)
>  - Fix a documentation bug stating that LAPIC was in userspace (Paolo
>    Bonzini)
>  - Update Xen HVM code after X86MachineState introduction (Philippe
>    Mathieu-Daudé)
>  - Rename header guard from QEMU_VIRTIO_MMIO_H to HW_VIRTIO_MMIO_H
>    (Philippe Mathieu-Daudé)
> 
> v5:
>  - Drop unneeded "[PATCH v4 2/8] hw/i386: Factorize e820 related
>    functions" (Philippe Mathieu-Daudé)
>  - Drop unneeded "[PATCH v4 1/8] hw/i386: Factorize PVH related
>    functions" (Stefano Garzarella)
>  - Split X86MachineState introduction into smaller patches (Philippe
>    Mathieu-Daudé)
>  - Change option-roms to x-option-roms and kernel-cmdline to
>    auto-kernel-cmdline (Paolo Bonzini)
>  - Make i8259 PIT and i8254 PIC optional (Paolo Bonzini)
>  - Some fixes to the documentation (Paolo Bonzini)
>  - Switch documentation format from txt to rst (Peter Maydell)
>  - Move NMI interface to X86_MACHINE (Philippe Mathieu-Daudé, Paolo
>    Bonzini)
> 
> v4:
>  - This is a complete rewrite of the whole patchset, with a focus on
>    reusing as much existing code as possible to ease the maintenance burden
>    and making the machine type as compatible as possible by default. As
>    a result, the number of lines dedicated specifically to microvm is
>    383 (code lines measured by "cloc") and, with the default
>    configuration, it's now able to boot both PVH ELF images and
>    bzImages with either SeaBIOS or qboot.
> 
> v3:
>   - Add initrd support (thanks Stefano).
> 
> v2:
>   - Drop "[PATCH 1/4] hw/i386: Factorize CPU routine".
>   - Simplify machine definition (thanks Eduardo).
>   - Remove use of unneeded NUMA-related callbacks (thanks Eduardo).
>   - Add a patch to factorize PVH-related functions.
>   - Replace use of Linux's Zero Page with PVH (thanks Maran and Paolo).
> 
> ---
> Sergio Lopez (10):
>   hw/virtio: Factorize virtio-mmio headers
>   hw/i386/pc: rename functions shared with non-PC machines
>   hw/i386/pc: move shared x86 functions to x86.c and export them
>   hw/i386: split PCMachineState deriving X86MachineState from it
>   hw/i386: make x86.c independent from PCMachineState
>   fw_cfg: add "modify" functions for all types
>   hw/intc/apic: reject pic ints if isa_pic == NULL
>   roms: add microvm-bios (qboot) as binary and git submodule
>   docs/microvm.rst: document the new microvm machine type
>   hw/i386: Introduce the microvm machine type
> 
>  docs/microvm.rst                 |  98 ++++
>  default-configs/i386-softmmu.mak |   1 +
>  include/hw/i386/microvm.h        |  83 ++++
>  include/hw/i386/pc.h             |  28 +-
>  include/hw/i386/x86.h            |  94 ++++
>  include/hw/nvram/fw_cfg.h        |  42 ++
>  include/hw/virtio/virtio-mmio.h  |  73 +++
>  hw/acpi/cpu_hotplug.c            |  10 +-
>  hw/i386/acpi-build.c             |  29 +-
>  hw/i386/amd_iommu.c              |   3 +-
>  hw/i386/intel_iommu.c            |   3 +-
>  hw/i386/microvm.c                | 574 ++++++++++++++++++++++
>  hw/i386/pc.c                     | 780 +++---------------------------
>  hw/i386/pc_piix.c                |  46 +-
>  hw/i386/pc_q35.c                 |  38 +-
>  hw/i386/pc_sysfw.c               |  58 +--
>  hw/i386/x86.c                    | 790 +++++++++++++++++++++++++++++++
>  hw/i386/xen/xen-hvm.c            |  23 +-
>  hw/intc/apic.c                   |   2 +-
>  hw/intc/ioapic.c                 |   2 +-
>  hw/nvram/fw_cfg.c                |  29 ++
>  hw/virtio/virtio-mmio.c          |  48 +-
>  .gitmodules                      |   3 +
>  hw/i386/Kconfig                  |   4 +
>  hw/i386/Makefile.objs            |   2 +
>  pc-bios/bios-microvm.bin         | Bin 0 -> 65536 bytes
>  roms/Makefile                    |   6 +
>  roms/qboot                       |   1 +

So I guess we want to add new files for x86 machines MAINTAINERS entry.

Otherwise looks good.
Which tree is this going to be merged through? Mine?


>  28 files changed, 1963 insertions(+), 907 deletions(-)
>  create mode 100644 docs/microvm.rst
>  create mode 100644 include/hw/i386/microvm.h
>  create mode 100644 include/hw/i386/x86.h
>  create mode 100644 include/hw/virtio/virtio-mmio.h
>  create mode 100644 hw/i386/microvm.c
>  create mode 100644 hw/i386/x86.c
>  create mode 100755 pc-bios/bios-microvm.bin
>  create mode 160000 roms/qboot
> 
> -- 
> 2.21.0

Re: [PATCH v6 00/10] Introduce the microvm machine type
Posted by Michael S. Tsirkin 4 years, 6 months ago
On Fri, Oct 04, 2019 at 11:37:42AM +0200, Sergio Lopez wrote:
> Microvm is a machine type inspired by Firecracker and constructed
> after the its machine model.
> 
> It's a minimalist machine type without PCI nor ACPI support, designed
> for short-lived guests. Microvm also establishes a baseline for
> benchmarking and optimizing both QEMU and guest operating systems,
> since it is optimized for both boot time and footprint.

Pls take a look at patchew warnings and errors.
Both coding style issues and test failures need to be
addressed somehow I think.

> ---
> 
> Changelog
> v6:
>  - Some style fixes (Philippe Mathieu-Daudé)
>  - Fix a documentation bug stating that LAPIC was in userspace (Paolo
>    Bonzini)
>  - Update Xen HVM code after X86MachineState introduction (Philippe
>    Mathieu-Daudé)
>  - Rename header guard from QEMU_VIRTIO_MMIO_H to HW_VIRTIO_MMIO_H
>    (Philippe Mathieu-Daudé)
> 
> v5:
>  - Drop unneeded "[PATCH v4 2/8] hw/i386: Factorize e820 related
>    functions" (Philippe Mathieu-Daudé)
>  - Drop unneeded "[PATCH v4 1/8] hw/i386: Factorize PVH related
>    functions" (Stefano Garzarella)
>  - Split X86MachineState introduction into smaller patches (Philippe
>    Mathieu-Daudé)
>  - Change option-roms to x-option-roms and kernel-cmdline to
>    auto-kernel-cmdline (Paolo Bonzini)
>  - Make i8259 PIT and i8254 PIC optional (Paolo Bonzini)
>  - Some fixes to the documentation (Paolo Bonzini)
>  - Switch documentation format from txt to rst (Peter Maydell)
>  - Move NMI interface to X86_MACHINE (Philippe Mathieu-Daudé, Paolo
>    Bonzini)
> 
> v4:
>  - This is a complete rewrite of the whole patchset, with a focus on
>    reusing as much existing code as possible to ease the maintenance burden
>    and making the machine type as compatible as possible by default. As
>    a result, the number of lines dedicated specifically to microvm is
>    383 (code lines measured by "cloc") and, with the default
>    configuration, it's now able to boot both PVH ELF images and
>    bzImages with either SeaBIOS or qboot.
> 
> v3:
>   - Add initrd support (thanks Stefano).
> 
> v2:
>   - Drop "[PATCH 1/4] hw/i386: Factorize CPU routine".
>   - Simplify machine definition (thanks Eduardo).
>   - Remove use of unneeded NUMA-related callbacks (thanks Eduardo).
>   - Add a patch to factorize PVH-related functions.
>   - Replace use of Linux's Zero Page with PVH (thanks Maran and Paolo).
> 
> ---
> Sergio Lopez (10):
>   hw/virtio: Factorize virtio-mmio headers
>   hw/i386/pc: rename functions shared with non-PC machines
>   hw/i386/pc: move shared x86 functions to x86.c and export them
>   hw/i386: split PCMachineState deriving X86MachineState from it
>   hw/i386: make x86.c independent from PCMachineState
>   fw_cfg: add "modify" functions for all types
>   hw/intc/apic: reject pic ints if isa_pic == NULL
>   roms: add microvm-bios (qboot) as binary and git submodule
>   docs/microvm.rst: document the new microvm machine type
>   hw/i386: Introduce the microvm machine type
> 
>  docs/microvm.rst                 |  98 ++++
>  default-configs/i386-softmmu.mak |   1 +
>  include/hw/i386/microvm.h        |  83 ++++
>  include/hw/i386/pc.h             |  28 +-
>  include/hw/i386/x86.h            |  94 ++++
>  include/hw/nvram/fw_cfg.h        |  42 ++
>  include/hw/virtio/virtio-mmio.h  |  73 +++
>  hw/acpi/cpu_hotplug.c            |  10 +-
>  hw/i386/acpi-build.c             |  29 +-
>  hw/i386/amd_iommu.c              |   3 +-
>  hw/i386/intel_iommu.c            |   3 +-
>  hw/i386/microvm.c                | 574 ++++++++++++++++++++++
>  hw/i386/pc.c                     | 780 +++---------------------------
>  hw/i386/pc_piix.c                |  46 +-
>  hw/i386/pc_q35.c                 |  38 +-
>  hw/i386/pc_sysfw.c               |  58 +--
>  hw/i386/x86.c                    | 790 +++++++++++++++++++++++++++++++
>  hw/i386/xen/xen-hvm.c            |  23 +-
>  hw/intc/apic.c                   |   2 +-
>  hw/intc/ioapic.c                 |   2 +-
>  hw/nvram/fw_cfg.c                |  29 ++
>  hw/virtio/virtio-mmio.c          |  48 +-
>  .gitmodules                      |   3 +
>  hw/i386/Kconfig                  |   4 +
>  hw/i386/Makefile.objs            |   2 +
>  pc-bios/bios-microvm.bin         | Bin 0 -> 65536 bytes
>  roms/Makefile                    |   6 +
>  roms/qboot                       |   1 +
>  28 files changed, 1963 insertions(+), 907 deletions(-)
>  create mode 100644 docs/microvm.rst
>  create mode 100644 include/hw/i386/microvm.h
>  create mode 100644 include/hw/i386/x86.h
>  create mode 100644 include/hw/virtio/virtio-mmio.h
>  create mode 100644 hw/i386/microvm.c
>  create mode 100644 hw/i386/x86.c
>  create mode 100755 pc-bios/bios-microvm.bin
>  create mode 160000 roms/qboot
> 
> -- 
> 2.21.0

Re: [PATCH v6 00/10] Introduce the microvm machine type
Posted by Sergio Lopez 4 years, 6 months ago
Michael S. Tsirkin <mst@redhat.com> writes:

> On Fri, Oct 04, 2019 at 11:37:42AM +0200, Sergio Lopez wrote:
>> Microvm is a machine type inspired by Firecracker and constructed
>> after the its machine model.
>> 
>> It's a minimalist machine type without PCI nor ACPI support, designed
>> for short-lived guests. Microvm also establishes a baseline for
>> benchmarking and optimizing both QEMU and guest operating systems,
>> since it is optimized for both boot time and footprint.
>
> Pls take a look at patchew warnings and errors.
> Both coding style issues and test failures need to be
> addressed somehow I think.

I've fixed the issue with the test suite, but I'm not sure what to do
about the coding style errors. Every one of them (except perhaps one at
xen-hvm.c) comes from code I've moved from pc.c to x86.c. I'd say fixing
those are outside the scope of the corresponding patches, but please
correct me if I'm wrong.

On the other hand, I haven't touched MAINTAINERS, because I'm not sure
about the actual policies that apply while doing so. Should I add the
new files to it?

Thanks,
Sergio.

>> ---
>> 
>> Changelog
>> v6:
>>  - Some style fixes (Philippe Mathieu-Daudé)
>>  - Fix a documentation bug stating that LAPIC was in userspace (Paolo
>>    Bonzini)
>>  - Update Xen HVM code after X86MachineState introduction (Philippe
>>    Mathieu-Daudé)
>>  - Rename header guard from QEMU_VIRTIO_MMIO_H to HW_VIRTIO_MMIO_H
>>    (Philippe Mathieu-Daudé)
>> 
>> v5:
>>  - Drop unneeded "[PATCH v4 2/8] hw/i386: Factorize e820 related
>>    functions" (Philippe Mathieu-Daudé)
>>  - Drop unneeded "[PATCH v4 1/8] hw/i386: Factorize PVH related
>>    functions" (Stefano Garzarella)
>>  - Split X86MachineState introduction into smaller patches (Philippe
>>    Mathieu-Daudé)
>>  - Change option-roms to x-option-roms and kernel-cmdline to
>>    auto-kernel-cmdline (Paolo Bonzini)
>>  - Make i8259 PIT and i8254 PIC optional (Paolo Bonzini)
>>  - Some fixes to the documentation (Paolo Bonzini)
>>  - Switch documentation format from txt to rst (Peter Maydell)
>>  - Move NMI interface to X86_MACHINE (Philippe Mathieu-Daudé, Paolo
>>    Bonzini)
>> 
>> v4:
>>  - This is a complete rewrite of the whole patchset, with a focus on
>>    reusing as much existing code as possible to ease the maintenance burden
>>    and making the machine type as compatible as possible by default. As
>>    a result, the number of lines dedicated specifically to microvm is
>>    383 (code lines measured by "cloc") and, with the default
>>    configuration, it's now able to boot both PVH ELF images and
>>    bzImages with either SeaBIOS or qboot.
>> 
>> v3:
>>   - Add initrd support (thanks Stefano).
>> 
>> v2:
>>   - Drop "[PATCH 1/4] hw/i386: Factorize CPU routine".
>>   - Simplify machine definition (thanks Eduardo).
>>   - Remove use of unneeded NUMA-related callbacks (thanks Eduardo).
>>   - Add a patch to factorize PVH-related functions.
>>   - Replace use of Linux's Zero Page with PVH (thanks Maran and Paolo).
>> 
>> ---
>> Sergio Lopez (10):
>>   hw/virtio: Factorize virtio-mmio headers
>>   hw/i386/pc: rename functions shared with non-PC machines
>>   hw/i386/pc: move shared x86 functions to x86.c and export them
>>   hw/i386: split PCMachineState deriving X86MachineState from it
>>   hw/i386: make x86.c independent from PCMachineState
>>   fw_cfg: add "modify" functions for all types
>>   hw/intc/apic: reject pic ints if isa_pic == NULL
>>   roms: add microvm-bios (qboot) as binary and git submodule
>>   docs/microvm.rst: document the new microvm machine type
>>   hw/i386: Introduce the microvm machine type
>> 
>>  docs/microvm.rst                 |  98 ++++
>>  default-configs/i386-softmmu.mak |   1 +
>>  include/hw/i386/microvm.h        |  83 ++++
>>  include/hw/i386/pc.h             |  28 +-
>>  include/hw/i386/x86.h            |  94 ++++
>>  include/hw/nvram/fw_cfg.h        |  42 ++
>>  include/hw/virtio/virtio-mmio.h  |  73 +++
>>  hw/acpi/cpu_hotplug.c            |  10 +-
>>  hw/i386/acpi-build.c             |  29 +-
>>  hw/i386/amd_iommu.c              |   3 +-
>>  hw/i386/intel_iommu.c            |   3 +-
>>  hw/i386/microvm.c                | 574 ++++++++++++++++++++++
>>  hw/i386/pc.c                     | 780 +++---------------------------
>>  hw/i386/pc_piix.c                |  46 +-
>>  hw/i386/pc_q35.c                 |  38 +-
>>  hw/i386/pc_sysfw.c               |  58 +--
>>  hw/i386/x86.c                    | 790 +++++++++++++++++++++++++++++++
>>  hw/i386/xen/xen-hvm.c            |  23 +-
>>  hw/intc/apic.c                   |   2 +-
>>  hw/intc/ioapic.c                 |   2 +-
>>  hw/nvram/fw_cfg.c                |  29 ++
>>  hw/virtio/virtio-mmio.c          |  48 +-
>>  .gitmodules                      |   3 +
>>  hw/i386/Kconfig                  |   4 +
>>  hw/i386/Makefile.objs            |   2 +
>>  pc-bios/bios-microvm.bin         | Bin 0 -> 65536 bytes
>>  roms/Makefile                    |   6 +
>>  roms/qboot                       |   1 +
>>  28 files changed, 1963 insertions(+), 907 deletions(-)
>>  create mode 100644 docs/microvm.rst
>>  create mode 100644 include/hw/i386/microvm.h
>>  create mode 100644 include/hw/i386/x86.h
>>  create mode 100644 include/hw/virtio/virtio-mmio.h
>>  create mode 100644 hw/i386/microvm.c
>>  create mode 100644 hw/i386/x86.c
>>  create mode 100755 pc-bios/bios-microvm.bin
>>  create mode 160000 roms/qboot
>> 
>> -- 
>> 2.21.0

Re: [PATCH v6 00/10] Introduce the microvm machine type
Posted by Philippe Mathieu-Daudé 4 years, 6 months ago
On 10/7/19 3:44 PM, Sergio Lopez wrote:
> Michael S. Tsirkin <mst@redhat.com> writes:
> 
>> On Fri, Oct 04, 2019 at 11:37:42AM +0200, Sergio Lopez wrote:
>>> Microvm is a machine type inspired by Firecracker and constructed
>>> after the its machine model.
>>>
>>> It's a minimalist machine type without PCI nor ACPI support, designed
>>> for short-lived guests. Microvm also establishes a baseline for
>>> benchmarking and optimizing both QEMU and guest operating systems,
>>> since it is optimized for both boot time and footprint.
>>
>> Pls take a look at patchew warnings and errors.
>> Both coding style issues and test failures need to be
>> addressed somehow I think.
> 
> I've fixed the issue with the test suite, but I'm not sure what to do
> about the coding style errors. Every one of them (except perhaps one at
> xen-hvm.c) comes from code I've moved from pc.c to x86.c. I'd say fixing
> those are outside the scope of the corresponding patches, but please
> correct me if I'm wrong.

What makes reviews easier for me is to split in 2 patches: 1 fixing the 
lines I'm going to move, then the patch that simply move.

You can add checkpatch as a pre-commit hook:
http://blog.vmsplice.net/2011/03/how-to-automatically-run-checkpatchpl.html

In a temporary branch, git mv/commit will call checkpatch and display 
warnings; discard your commit and fix the warnings in the original code.

> On the other hand, I haven't touched MAINTAINERS, because I'm not sure
> about the actual policies that apply while doing so. Should I add the
> new files to it?

The new "hw/virtio/virtio-mmio.h" is covered by the "virtio" section:

F: hw/*/virtio*
F: include/hw/virtio/

Now I think the MicroVM files deserve an entry, probably with Paolo/you 
listed:

- docs/microvm.rst
- hw/i386/microvm.c
- include/hw/i386/microvm.h
- pc-bios/bios-microvm.bin

>>> ---
>>>
>>> Changelog
>>> v6:
>>>   - Some style fixes (Philippe Mathieu-Daudé)
>>>   - Fix a documentation bug stating that LAPIC was in userspace (Paolo
>>>     Bonzini)
>>>   - Update Xen HVM code after X86MachineState introduction (Philippe
>>>     Mathieu-Daudé)
>>>   - Rename header guard from QEMU_VIRTIO_MMIO_H to HW_VIRTIO_MMIO_H
>>>     (Philippe Mathieu-Daudé)
>>>
>>> v5:
>>>   - Drop unneeded "[PATCH v4 2/8] hw/i386: Factorize e820 related
>>>     functions" (Philippe Mathieu-Daudé)
>>>   - Drop unneeded "[PATCH v4 1/8] hw/i386: Factorize PVH related
>>>     functions" (Stefano Garzarella)
>>>   - Split X86MachineState introduction into smaller patches (Philippe
>>>     Mathieu-Daudé)
>>>   - Change option-roms to x-option-roms and kernel-cmdline to
>>>     auto-kernel-cmdline (Paolo Bonzini)
>>>   - Make i8259 PIT and i8254 PIC optional (Paolo Bonzini)
>>>   - Some fixes to the documentation (Paolo Bonzini)
>>>   - Switch documentation format from txt to rst (Peter Maydell)
>>>   - Move NMI interface to X86_MACHINE (Philippe Mathieu-Daudé, Paolo
>>>     Bonzini)
>>>
>>> v4:
>>>   - This is a complete rewrite of the whole patchset, with a focus on
>>>     reusing as much existing code as possible to ease the maintenance burden
>>>     and making the machine type as compatible as possible by default. As
>>>     a result, the number of lines dedicated specifically to microvm is
>>>     383 (code lines measured by "cloc") and, with the default
>>>     configuration, it's now able to boot both PVH ELF images and
>>>     bzImages with either SeaBIOS or qboot.
>>>
>>> v3:
>>>    - Add initrd support (thanks Stefano).
>>>
>>> v2:
>>>    - Drop "[PATCH 1/4] hw/i386: Factorize CPU routine".
>>>    - Simplify machine definition (thanks Eduardo).
>>>    - Remove use of unneeded NUMA-related callbacks (thanks Eduardo).
>>>    - Add a patch to factorize PVH-related functions.
>>>    - Replace use of Linux's Zero Page with PVH (thanks Maran and Paolo).
>>>
>>> ---
>>> Sergio Lopez (10):
>>>    hw/virtio: Factorize virtio-mmio headers
>>>    hw/i386/pc: rename functions shared with non-PC machines
>>>    hw/i386/pc: move shared x86 functions to x86.c and export them
>>>    hw/i386: split PCMachineState deriving X86MachineState from it
>>>    hw/i386: make x86.c independent from PCMachineState
>>>    fw_cfg: add "modify" functions for all types
>>>    hw/intc/apic: reject pic ints if isa_pic == NULL
>>>    roms: add microvm-bios (qboot) as binary and git submodule
>>>    docs/microvm.rst: document the new microvm machine type
>>>    hw/i386: Introduce the microvm machine type
>>>
>>>   docs/microvm.rst                 |  98 ++++
>>>   default-configs/i386-softmmu.mak |   1 +
>>>   include/hw/i386/microvm.h        |  83 ++++
>>>   include/hw/i386/pc.h             |  28 +-
>>>   include/hw/i386/x86.h            |  94 ++++
>>>   include/hw/nvram/fw_cfg.h        |  42 ++
>>>   include/hw/virtio/virtio-mmio.h  |  73 +++
>>>   hw/acpi/cpu_hotplug.c            |  10 +-
>>>   hw/i386/acpi-build.c             |  29 +-
>>>   hw/i386/amd_iommu.c              |   3 +-
>>>   hw/i386/intel_iommu.c            |   3 +-
>>>   hw/i386/microvm.c                | 574 ++++++++++++++++++++++
>>>   hw/i386/pc.c                     | 780 +++---------------------------
>>>   hw/i386/pc_piix.c                |  46 +-
>>>   hw/i386/pc_q35.c                 |  38 +-
>>>   hw/i386/pc_sysfw.c               |  58 +--
>>>   hw/i386/x86.c                    | 790 +++++++++++++++++++++++++++++++
>>>   hw/i386/xen/xen-hvm.c            |  23 +-
>>>   hw/intc/apic.c                   |   2 +-
>>>   hw/intc/ioapic.c                 |   2 +-
>>>   hw/nvram/fw_cfg.c                |  29 ++
>>>   hw/virtio/virtio-mmio.c          |  48 +-
>>>   .gitmodules                      |   3 +
>>>   hw/i386/Kconfig                  |   4 +
>>>   hw/i386/Makefile.objs            |   2 +
>>>   pc-bios/bios-microvm.bin         | Bin 0 -> 65536 bytes
>>>   roms/Makefile                    |   6 +
>>>   roms/qboot                       |   1 +
>>>   28 files changed, 1963 insertions(+), 907 deletions(-)
>>>   create mode 100644 docs/microvm.rst
>>>   create mode 100644 include/hw/i386/microvm.h
>>>   create mode 100644 include/hw/i386/x86.h
>>>   create mode 100644 include/hw/virtio/virtio-mmio.h
>>>   create mode 100644 hw/i386/microvm.c
>>>   create mode 100644 hw/i386/x86.c
>>>   create mode 100755 pc-bios/bios-microvm.bin
>>>   create mode 160000 roms/qboot
>>>
>>> -- 
>>> 2.21.0
> 

Re: [PATCH v6 00/10] Introduce the microvm machine type
Posted by Michael S. Tsirkin 4 years, 6 months ago
On Mon, Oct 07, 2019 at 03:44:40PM +0200, Sergio Lopez wrote:
> 
> Michael S. Tsirkin <mst@redhat.com> writes:
> 
> > On Fri, Oct 04, 2019 at 11:37:42AM +0200, Sergio Lopez wrote:
> >> Microvm is a machine type inspired by Firecracker and constructed
> >> after the its machine model.
> >> 
> >> It's a minimalist machine type without PCI nor ACPI support, designed
> >> for short-lived guests. Microvm also establishes a baseline for
> >> benchmarking and optimizing both QEMU and guest operating systems,
> >> since it is optimized for both boot time and footprint.
> >
> > Pls take a look at patchew warnings and errors.
> > Both coding style issues and test failures need to be
> > addressed somehow I think.
> 
> I've fixed the issue with the test suite, but I'm not sure what to do
> about the coding style errors. Every one of them (except perhaps one at
> xen-hvm.c) comes from code I've moved from pc.c to x86.c. I'd say fixing
> those are outside the scope of the corresponding patches, but please
> correct me if I'm wrong.

Yea if you refactor code you have to kick it into shape
at the same time. Can be a separate patch to ease review.

> On the other hand, I haven't touched MAINTAINERS, because I'm not sure
> about the actual policies that apply while doing so. Should I add the
> new files to it?
> 
> Thanks,
> Sergio.
> 
> >> ---
> >> 
> >> Changelog
> >> v6:
> >>  - Some style fixes (Philippe Mathieu-Daudé)
> >>  - Fix a documentation bug stating that LAPIC was in userspace (Paolo
> >>    Bonzini)
> >>  - Update Xen HVM code after X86MachineState introduction (Philippe
> >>    Mathieu-Daudé)
> >>  - Rename header guard from QEMU_VIRTIO_MMIO_H to HW_VIRTIO_MMIO_H
> >>    (Philippe Mathieu-Daudé)
> >> 
> >> v5:
> >>  - Drop unneeded "[PATCH v4 2/8] hw/i386: Factorize e820 related
> >>    functions" (Philippe Mathieu-Daudé)
> >>  - Drop unneeded "[PATCH v4 1/8] hw/i386: Factorize PVH related
> >>    functions" (Stefano Garzarella)
> >>  - Split X86MachineState introduction into smaller patches (Philippe
> >>    Mathieu-Daudé)
> >>  - Change option-roms to x-option-roms and kernel-cmdline to
> >>    auto-kernel-cmdline (Paolo Bonzini)
> >>  - Make i8259 PIT and i8254 PIC optional (Paolo Bonzini)
> >>  - Some fixes to the documentation (Paolo Bonzini)
> >>  - Switch documentation format from txt to rst (Peter Maydell)
> >>  - Move NMI interface to X86_MACHINE (Philippe Mathieu-Daudé, Paolo
> >>    Bonzini)
> >> 
> >> v4:
> >>  - This is a complete rewrite of the whole patchset, with a focus on
> >>    reusing as much existing code as possible to ease the maintenance burden
> >>    and making the machine type as compatible as possible by default. As
> >>    a result, the number of lines dedicated specifically to microvm is
> >>    383 (code lines measured by "cloc") and, with the default
> >>    configuration, it's now able to boot both PVH ELF images and
> >>    bzImages with either SeaBIOS or qboot.
> >> 
> >> v3:
> >>   - Add initrd support (thanks Stefano).
> >> 
> >> v2:
> >>   - Drop "[PATCH 1/4] hw/i386: Factorize CPU routine".
> >>   - Simplify machine definition (thanks Eduardo).
> >>   - Remove use of unneeded NUMA-related callbacks (thanks Eduardo).
> >>   - Add a patch to factorize PVH-related functions.
> >>   - Replace use of Linux's Zero Page with PVH (thanks Maran and Paolo).
> >> 
> >> ---
> >> Sergio Lopez (10):
> >>   hw/virtio: Factorize virtio-mmio headers
> >>   hw/i386/pc: rename functions shared with non-PC machines
> >>   hw/i386/pc: move shared x86 functions to x86.c and export them
> >>   hw/i386: split PCMachineState deriving X86MachineState from it
> >>   hw/i386: make x86.c independent from PCMachineState
> >>   fw_cfg: add "modify" functions for all types
> >>   hw/intc/apic: reject pic ints if isa_pic == NULL
> >>   roms: add microvm-bios (qboot) as binary and git submodule
> >>   docs/microvm.rst: document the new microvm machine type
> >>   hw/i386: Introduce the microvm machine type
> >> 
> >>  docs/microvm.rst                 |  98 ++++
> >>  default-configs/i386-softmmu.mak |   1 +
> >>  include/hw/i386/microvm.h        |  83 ++++
> >>  include/hw/i386/pc.h             |  28 +-
> >>  include/hw/i386/x86.h            |  94 ++++
> >>  include/hw/nvram/fw_cfg.h        |  42 ++
> >>  include/hw/virtio/virtio-mmio.h  |  73 +++
> >>  hw/acpi/cpu_hotplug.c            |  10 +-
> >>  hw/i386/acpi-build.c             |  29 +-
> >>  hw/i386/amd_iommu.c              |   3 +-
> >>  hw/i386/intel_iommu.c            |   3 +-
> >>  hw/i386/microvm.c                | 574 ++++++++++++++++++++++
> >>  hw/i386/pc.c                     | 780 +++---------------------------
> >>  hw/i386/pc_piix.c                |  46 +-
> >>  hw/i386/pc_q35.c                 |  38 +-
> >>  hw/i386/pc_sysfw.c               |  58 +--
> >>  hw/i386/x86.c                    | 790 +++++++++++++++++++++++++++++++
> >>  hw/i386/xen/xen-hvm.c            |  23 +-
> >>  hw/intc/apic.c                   |   2 +-
> >>  hw/intc/ioapic.c                 |   2 +-
> >>  hw/nvram/fw_cfg.c                |  29 ++
> >>  hw/virtio/virtio-mmio.c          |  48 +-
> >>  .gitmodules                      |   3 +
> >>  hw/i386/Kconfig                  |   4 +
> >>  hw/i386/Makefile.objs            |   2 +
> >>  pc-bios/bios-microvm.bin         | Bin 0 -> 65536 bytes
> >>  roms/Makefile                    |   6 +
> >>  roms/qboot                       |   1 +
> >>  28 files changed, 1963 insertions(+), 907 deletions(-)
> >>  create mode 100644 docs/microvm.rst
> >>  create mode 100644 include/hw/i386/microvm.h
> >>  create mode 100644 include/hw/i386/x86.h
> >>  create mode 100644 include/hw/virtio/virtio-mmio.h
> >>  create mode 100644 hw/i386/microvm.c
> >>  create mode 100644 hw/i386/x86.c
> >>  create mode 100755 pc-bios/bios-microvm.bin
> >>  create mode 160000 roms/qboot
> >> 
> >> -- 
> >> 2.21.0
> 



Re: [PATCH v6 00/10] Introduce the microvm machine type
Posted by Eduardo Habkost 4 years, 6 months ago
On Wed, Oct 09, 2019 at 03:21:46PM -0400, Michael S. Tsirkin wrote:
> On Mon, Oct 07, 2019 at 03:44:40PM +0200, Sergio Lopez wrote:
> > 
> > Michael S. Tsirkin <mst@redhat.com> writes:
> > 
> > > On Fri, Oct 04, 2019 at 11:37:42AM +0200, Sergio Lopez wrote:
> > >> Microvm is a machine type inspired by Firecracker and constructed
> > >> after the its machine model.
> > >> 
> > >> It's a minimalist machine type without PCI nor ACPI support, designed
> > >> for short-lived guests. Microvm also establishes a baseline for
> > >> benchmarking and optimizing both QEMU and guest operating systems,
> > >> since it is optimized for both boot time and footprint.
> > >
> > > Pls take a look at patchew warnings and errors.
> > > Both coding style issues and test failures need to be
> > > addressed somehow I think.
> > 
> > I've fixed the issue with the test suite, but I'm not sure what to do
> > about the coding style errors. Every one of them (except perhaps one at
> > xen-hvm.c) comes from code I've moved from pc.c to x86.c. I'd say fixing
> > those are outside the scope of the corresponding patches, but please
> > correct me if I'm wrong.
> 
> Yea if you refactor code you have to kick it into shape
> at the same time. Can be a separate patch to ease review.

I don't think it is reasonable to require code to be 100%
CODING_STYLE-compliant before being moved to a new file.  We can
still encourage cleaning it up, of course, but I don't see the
benefit of making it a requirement.

-- 
Eduardo

Re: [PATCH v6 00/10] Introduce the microvm machine type
Posted by no-reply@patchew.org 4 years, 6 months ago
Patchew URL: https://patchew.org/QEMU/20191004093752.16564-1-slp@redhat.com/



Hi,

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

Type: series
Message-id: 20191004093752.16564-1-slp@redhat.com
Subject: [PATCH v6 00/10] Introduce the microvm machine type

=== 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 ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]         patchew/20191004171204.21040-1-eric.auger@redhat.com -> patchew/20191004171204.21040-1-eric.auger@redhat.com
Switched to a new branch 'test'
82de93f hw/i386: Introduce the microvm machine type
fda0032 docs/microvm.rst: document the new microvm machine type
8dc483d roms: add microvm-bios (qboot) as binary and git submodule
16f12bc hw/intc/apic: reject pic ints if isa_pic == NULL
22f8cab fw_cfg: add "modify" functions for all types
7cdaa3f hw/i386: make x86.c independent from PCMachineState
052084d hw/i386: split PCMachineState deriving X86MachineState from it
afc0d5a hw/i386/pc: move shared x86 functions to x86.c and export them
9c1dc683 hw/i386/pc: rename functions shared with non-PC machines
bd6947a hw/virtio: Factorize virtio-mmio headers

=== OUTPUT BEGIN ===
1/10 Checking commit bd6947a2e366 (hw/virtio: Factorize virtio-mmio headers)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#77: 
new file mode 100644

total: 0 errors, 1 warnings, 131 lines checked

Patch 1/10 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
2/10 Checking commit 9c1dc683f829 (hw/i386/pc: rename functions shared with non-PC machines)
3/10 Checking commit afc0d5a54977 (hw/i386/pc: move shared x86 functions to x86.c and export them)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#749: 
new file mode 100644

WARNING: Block comments use a leading /* on a separate line
#809: FILE: hw/i386/x86.c:56:
+/* Calculates initial APIC ID for a specific CPU index

WARNING: Block comments use a leading /* on a separate line
#866: FILE: hw/i386/x86.c:113:
+    /* Calculates the limit to CPU APIC ID values

WARNING: Block comments should align the * on each line
#913: FILE: hw/i386/x86.c:160:
+         * -smp hasn't been parsed after it
+        */

WARNING: line over 80 characters
#926: FILE: hw/i386/x86.c:173:
+        ms->possible_cpus->cpus[i].arch_id = x86_cpu_apic_id_from_index(pcms, i);

ERROR: spaces required around that '+' (ctx:VxV)
#1087: FILE: hw/i386/x86.c:334:
+    cmdline_size = (strlen(kernel_cmdline)+16) & ~15;
                                           ^

ERROR: do not use assignment in if condition
#1091: FILE: hw/i386/x86.c:338:
+    if (!f || !(kernel_size = get_file_size(f)) ||

ERROR: if this code is redundant consider removing it
#1100: FILE: hw/i386/x86.c:347:
+#if 0

ERROR: spaces required around that '+' (ctx:VxV)
#1101: FILE: hw/i386/x86.c:348:
+    fprintf(stderr, "header magic: %#x\n", ldl_p(header+0x202));
                                                        ^

ERROR: spaces required around that '+' (ctx:VxV)
#1103: FILE: hw/i386/x86.c:350:
+    if (ldl_p(header+0x202) == 0x53726448) {
                     ^

ERROR: spaces required around that '+' (ctx:VxV)
#1104: FILE: hw/i386/x86.c:351:
+        protocol = lduw_p(header+0x206);
                                 ^

ERROR: if this code is redundant consider removing it
#1194: FILE: hw/i386/x86.c:441:
+#if 0

ERROR: spaces required around that '+' (ctx:VxV)
#1206: FILE: hw/i386/x86.c:453:
+        lduw_p(header+0x236) & XLF_CAN_BE_LOADED_ABOVE_4G) {
                      ^

ERROR: spaces required around that '+' (ctx:VxV)
#1225: FILE: hw/i386/x86.c:472:
+        initrd_max = ldl_p(header+0x22c);
                                  ^

ERROR: spaces required around that '+' (ctx:VxV)
#1235: FILE: hw/i386/x86.c:482:
+    fw_cfg_add_i32(fw_cfg, FW_CFG_CMDLINE_SIZE, strlen(kernel_cmdline)+1);
                                                                       ^

ERROR: spaces required around that '+' (ctx:VxV)
#1239: FILE: hw/i386/x86.c:486:
+        stl_p(header+0x228, cmdline_addr);
                     ^

ERROR: spaces required around that '+' (ctx:VxV)
#1241: FILE: hw/i386/x86.c:488:
+        stw_p(header+0x20, 0xA33F);
                     ^

ERROR: spaces required around that '+' (ctx:VxV)
#1242: FILE: hw/i386/x86.c:489:
+        stw_p(header+0x22, cmdline_addr-real_addr);
                     ^

ERROR: spaces required around that '-' (ctx:VxV)
#1242: FILE: hw/i386/x86.c:489:
+        stw_p(header+0x22, cmdline_addr-real_addr);
                                        ^

ERROR: consider using qemu_strtol in preference to strtol
#1258: FILE: hw/i386/x86.c:505:
+            video_mode = strtol(vmode, NULL, 0);

ERROR: spaces required around that '+' (ctx:VxV)
#1260: FILE: hw/i386/x86.c:507:
+        stw_p(header+0x1fa, video_mode);
                     ^

WARNING: Block comments use a leading /* on a separate line
#1264: FILE: hw/i386/x86.c:511:
+    /* High nybble = B reserved for QEMU; low nybble is revision number.

WARNING: Block comments use * on subsequent lines
#1265: FILE: hw/i386/x86.c:512:
+    /* High nybble = B reserved for QEMU; low nybble is revision number.
+       If this code is substantially changed, you may want to consider

WARNING: Block comments use a trailing */ on a separate line
#1266: FILE: hw/i386/x86.c:513:
+       incrementing the revision. */

ERROR: code indent should never use tabs
#1272: FILE: hw/i386/x86.c:519:
+        header[0x211] |= 0x80;^I/* CAN_USE_HEAP */$

ERROR: spaces required around that '+' (ctx:VxV)
#1273: FILE: hw/i386/x86.c:520:
+        stw_p(header+0x224, cmdline_addr-real_addr-0x200);
                     ^

ERROR: spaces required around that '-' (ctx:VxV)
#1273: FILE: hw/i386/x86.c:520:
+        stw_p(header+0x224, cmdline_addr-real_addr-0x200);
                                         ^

ERROR: spaces required around that '-' (ctx:VxV)
#1273: FILE: hw/i386/x86.c:520:
+        stw_p(header+0x224, cmdline_addr-real_addr-0x200);
                                                   ^

ERROR: spaces required around that '-' (ctx:VxV)
#1305: FILE: hw/i386/x86.c:552:
+        initrd_addr = (initrd_max-initrd_size) & ~4095;
                                  ^

ERROR: spaces required around that '+' (ctx:VxV)
#1311: FILE: hw/i386/x86.c:558:
+        stl_p(header+0x218, initrd_addr);
                     ^

ERROR: spaces required around that '+' (ctx:VxV)
#1312: FILE: hw/i386/x86.c:559:
+        stl_p(header+0x21c, initrd_size);
                     ^

ERROR: spaces required around that '+' (ctx:VxV)
#1320: FILE: hw/i386/x86.c:567:
+    setup_size = (setup_size+1)*512;
                             ^

ERROR: spaces required around that '*' (ctx:VxV)
#1320: FILE: hw/i386/x86.c:567:
+    setup_size = (setup_size+1)*512;
                                ^

ERROR: spaces required around that '+' (ctx:VxV)
#1358: FILE: hw/i386/x86.c:605:
+        stq_p(header+0x250, prot_addr + setup_data_offset);
                     ^

total: 26 errors, 8 warnings, 1430 lines checked

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

4/10 Checking commit 052084dca6ed (hw/i386: split PCMachineState deriving X86MachineState from it)
WARNING: Block comments use a leading /* on a separate line
#880: FILE: hw/i386/pc_q35.c:158:
+        x86ms->max_ram_below_4g = 1ULL << 32; /* default: 4G */;

WARNING: line over 80 characters
#1103: FILE: hw/i386/x86.c:420:
+                initrd_max = x86ms->below_4g_mem_size - pcmc->acpi_data_size - 1;

WARNING: line over 80 characters
#1232: FILE: hw/i386/xen/xen-hvm.c:204:
+                                                    X86_MACHINE_MAX_RAM_BELOW_4G,

WARNING: Block comments use a leading /* on a separate line
#1435: FILE: include/hw/i386/x86.h:61:
+    /* Address space used by IOAPIC device. All IOAPIC interrupts

WARNING: Block comments use a trailing */ on a separate line
#1436: FILE: include/hw/i386/x86.h:62:
+     * will be translated to MSI messages in the address space. */

total: 0 errors, 5 warnings, 1296 lines checked

Patch 4/10 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
5/10 Checking commit 7cdaa3f2e445 (hw/i386: make x86.c independent from PCMachineState)
WARNING: line over 80 characters
#178: FILE: hw/i386/x86.c:173:
+        ms->possible_cpus->cpus[i].arch_id = x86_cpu_apic_id_from_index(x86ms, i);

total: 0 errors, 1 warnings, 220 lines checked

Patch 5/10 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
6/10 Checking commit 22f8cab11248 (fw_cfg: add "modify" functions for all types)
7/10 Checking commit 16f12bca2dce (hw/intc/apic: reject pic ints if isa_pic == NULL)
8/10 Checking commit 8dc483dafc50 (roms: add microvm-bios (qboot) as binary and git submodule)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#29: 
new file mode 100755

total: 0 errors, 1 warnings, 28 lines checked

Patch 8/10 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
9/10 Checking commit fda00320f641 (docs/microvm.rst: document the new microvm machine type)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#13: 
new file mode 100644

total: 0 errors, 1 warnings, 98 lines checked

Patch 9/10 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
10/10 Checking commit 82de93f5898c (hw/i386: Introduce the microvm machine type)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#55: 
new file mode 100644

total: 0 errors, 1 warnings, 678 lines checked

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

Test command exited with code: 1


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