mbox series

[v1,0/4] add guest-loader (for direct Xen boot)

Message ID 20201021170842.25762-1-alex.bennee@linaro.org
Headers show
Series add guest-loader (for direct Xen boot) | expand

Message

Alex Bennée Oct. 21, 2020, 5:08 p.m. UTC
Hi,

This is a refinement of the Xen loader I posted a few weeks ago.
Rather than complicate the generic loader with extra options I went
for the more expedient approach of adding a completely new device
called the guest-loader. As it didn't need to deal with any of the
subtleties of the generic-loader it also worked out somewhat simpler.

Instead of allowing the user to hand hack FDT blobs we simply add
syntactic sugar that understands the difference between a kernel and
initrd. This could be expanded in future if we want although at the
moment I don't know what else you would add.

The new syntax is now simpler:

  -device guest-loader,addr=0x42000000,kernel=Image,bootargs="console=hvc0 earlyprintk=xen" \
  -device guest-loader,addr=0x47000000,initrd=rootfs.cpio

So any objections? It would be nice to get in this cycle but we only
have a week left until soft-freeze.

Alex Bennée (4):
  hw/board: promote fdt from ARM VirtMachineState to MachineState
  hw/riscv: migrate fdt field to generic MachineState
  device_tree: add qemu_fdt_setprop_string_array helper
  hw/core: implement a guest-loader to support static hypervisor guests

 hw/core/guest-loader.h       |  34 ++++
 include/hw/arm/virt.h        |   1 -
 include/hw/boards.h          |   1 +
 include/hw/riscv/virt.h      |   1 -
 include/sysemu/device_tree.h |  17 ++
 hw/arm/virt.c                | 322 ++++++++++++++++++-----------------
 hw/core/guest-loader.c       | 140 +++++++++++++++
 hw/riscv/virt.c              |  18 +-
 softmmu/device_tree.c        |  26 +++
 hw/core/meson.build          |   2 +
 10 files changed, 398 insertions(+), 164 deletions(-)
 create mode 100644 hw/core/guest-loader.h
 create mode 100644 hw/core/guest-loader.c

Comments

no-reply@patchew.org Oct. 21, 2020, 5:18 p.m. UTC | #1
Patchew URL: https://patchew.org/QEMU/20201021170842.25762-1-alex.bennee@linaro.org/



Hi,

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

Type: series
Message-id: 20201021170842.25762-1-alex.bennee@linaro.org
Subject: [PATCH  v1 0/4] add guest-loader (for direct Xen boot)

=== 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
 - [tag update]      patchew/20201020153935.54315-1-thuth@redhat.com -> patchew/20201020153935.54315-1-thuth@redhat.com
 - [tag update]      patchew/20201021045149.1582203-1-richard.henderson@linaro.org -> patchew/20201021045149.1582203-1-richard.henderson@linaro.org
 * [new tag]         patchew/20201021170842.25762-1-alex.bennee@linaro.org -> patchew/20201021170842.25762-1-alex.bennee@linaro.org
Switched to a new branch 'test'
a5415a9 hw/core: implement a guest-loader to support static hypervisor guests
7bb03f4 device_tree: add qemu_fdt_setprop_string_array helper
017ee63 hw/riscv: migrate fdt field to generic MachineState
72e9417 hw/board: promote fdt from ARM VirtMachineState to MachineState

=== OUTPUT BEGIN ===
1/4 Checking commit 72e941735a6d (hw/board: promote fdt from ARM VirtMachineState to MachineState)
2/4 Checking commit 017ee63de267 (hw/riscv: migrate fdt field to generic MachineState)
3/4 Checking commit 7bb03f4d1faf (device_tree: add qemu_fdt_setprop_string_array helper)
WARNING: line over 80 characters
#63: FILE: softmmu/device_tree.c:406:
+int qemu_fdt_setprop_string_array(void *fdt, const char *node_path, const char *prop,

total: 0 errors, 1 warnings, 61 lines checked

Patch 3/4 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
4/4 Checking commit a5415a96f77f (hw/core: implement a guest-loader to support static hypervisor guests)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#21: 
new file mode 100644

WARNING: line over 80 characters
#67: FILE: hw/core/guest-loader.c:42:
+static void loader_insert_platform_data(GuestLoaderState *s, int size, Error **errp)

ERROR: Don't use '#' flag of printf format ('%#') in format strings, use '0x' prefix instead
#71: FILE: hw/core/guest-loader.c:46:
+    g_autofree char *node = g_strdup_printf("/chosen/module@%#08lx", s->addr);

WARNING: line over 80 characters
#85: FILE: hw/core/guest-loader.c:60:
+            (fdt, node, "compatible", (char **) &compat, ARRAY_SIZE(compat)) < 0) {

ERROR: "foo * bar" should be "foo *bar"
#95: FILE: hw/core/guest-loader.c:70:
+        const char * compat[2] = { "multiboot,module", "multiboot,ramdisk" };

WARNING: line over 80 characters
#97: FILE: hw/core/guest-loader.c:72:
+            (fdt, node, "compatible", (char **) &compat, ARRAY_SIZE(compat)) < 0) {

WARNING: line over 80 characters
#112: FILE: hw/core/guest-loader.c:87:
+        error_setg(errp, "Cannot specify a kernel and initrd in the same stanza");

total: 2 errors, 5 warnings, 182 lines checked

Patch 4/4 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/20201021170842.25762-1-alex.bennee@linaro.org/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com