add guest-loader (for direct Xen boot)
Subsystems (2)
cover add guest-loader (for direct Xen boot)
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
Signature · 1 line
2.20.1
PATCH 1/4 hw/board: promote fdt from ARM VirtMachineState to MachineState
The use of FDT's is quite common across our various platforms. To allow the generic loader to tweak it we need to make it available in the generic state. This creates the field and migrates the initial user to use the generic field. Other boards will be updated in later patches.
--- include/hw/arm/virt.h | 1 - include/hw/boards.h | 1 + hw/arm/virt.c | 322 ++++++++++++++++++++++-------------------- 3 files changed, 170 insertions(+), 154 deletions(-)
include/hw/arm/virt.h +0 -1
@@ -152,7 +152,6 @@ struct VirtMachineState {char *pciehb_nodename;const int *irqmap;int smp_cpus; -void *fdt;int fdt_size;uint32_t clock_phandle;uint32_t gic_phandle;
include/hw/boards.h +1 -0
@@ -257,6 +257,7 @@ struct MachineState {/*< public >*/ +void *fdt;char *dtb;char *dumpdtb;int phandle_start;
hw/arm/virt.c +169 -153
706 lines not on this page · raw message
Signature · 1 line
2.20.1
PATCH 2/4 hw/riscv: migrate fdt field to generic MachineState
In reply to Alex BennéeThis is a mechanical change to make the fdt available through MachineState.
--- include/hw/riscv/virt.h | 1 - hw/riscv/virt.c | 18 +++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-)
include/hw/riscv/virt.h +0 -1
@@ -41,7 +41,6 @@ struct RISCVVirtState {DeviceState *plic[VIRT_SOCKETS_MAX ];PFlashCFI01 *flash[2 ]; -void *fdt;int fdt_size; };
hw/riscv/virt.c +9 -9
@@ -194,7 +194,7 @@ static void create_fdt(RISCVVirtState *s, const struct MemmapEntry *memmap,hwaddr flashsize = virt_memmap[VIRT_FLASH ].size /2 ;hwaddr flashbase = virt_memmap[VIRT_FLASH ].base; - fdt = s->fdt =create_device_tree (&s->fdt_size); + fdt = mc->fdt =create_device_tree (&s->fdt_size);if (!fdt) {error_report ("create_device_tree() failed" );exit (1 );
@@ -434,12 +434,12 @@ static void create_fdt(RISCVVirtState *s, const struct MemmapEntry *memmap,g_free (name); name =g_strdup_printf ("/soc/flash@%" PRIx64, flashbase); -qemu_fdt_add_subnode (s->fdt, name); -qemu_fdt_setprop_string (s->fdt, name,"compatible" ,"cfi-flash" ); -qemu_fdt_setprop_sized_cells (s->fdt, name,"reg" , +qemu_fdt_add_subnode (mc->fdt, name); +qemu_fdt_setprop_string (mc->fdt, name,"compatible" ,"cfi-flash" ); +qemu_fdt_setprop_sized_cells (mc->fdt, name,"reg" ,2 , flashbase,2 , flashsize,2 , flashbase + flashsize,2 , flashsize); -qemu_fdt_setprop_cell (s->fdt, name,"bank-width" ,4 ); +qemu_fdt_setprop_cell (mc->fdt, name,"bank-width" ,4 );g_free (name); }
@@ -613,9 +613,9 @@ static void virt_machine_init(MachineState *machine)hwaddr end =riscv_load_initrd (machine->initrd_filename, machine->ram_size, kernel_entry, &start); -qemu_fdt_setprop_cell (s->fdt,"/chosen" , +qemu_fdt_setprop_cell (machine->fdt,"/chosen" ,"linux,initrd-start" , start); -qemu_fdt_setprop_cell (s->fdt,"/chosen" ,"linux,initrd-end" , +qemu_fdt_setprop_cell (machine->fdt,"/chosen" ,"linux,initrd-end" , end); } }else {
@@ -636,11 +636,11 @@ static void virt_machine_init(MachineState *machine)/* Compute the fdt load address in dram */ fdt_load_addr =riscv_load_fdt (memmap[VIRT_DRAM ].base, - machine->ram_size, s->fdt); + machine->ram_size, machine->fdt);/* load the reset vector */ riscv_setup_rom_reset_vec (start_addr, virt_memmap[VIRT_MROM ].base, virt_memmap[VIRT_MROM ].size, kernel_entry, - fdt_load_addr, s->fdt); + fdt_load_addr, machine->fdt);/* SiFive Test MMIO device */ sifive_test_create (memmap[VIRT_TEST ].base);
Signature · 1 line
2.20.1
Re: [PATCH v1 2/4] hw/riscv: migrate fdt field to generic MachineState
Quoted 5 lines · Alex Bennée
This is a mechanical change to make the fdt available through MachineState.
Signed-off-by Alex Bennée <[email protected]>
Alistair
Quoted 77 lines
--- include/hw/riscv/virt.h | 1 - hw/riscv/virt.c | 18 +++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-)include/hw/riscv/virt.h +0
-1@@ -41,7 +41,6 @@ struct RISCVVirtState {DeviceState *plic[VIRT_SOCKETS_MAX ];PFlashCFI01 *flash[2 ]; -void *fdt;int fdt_size; };hw/riscv/virt.c +9
-10@@ -194,7 +194,7 @@ static void create_fdt(RISCVVirtState *s, const struct MemmapEntry *memmap,hwaddr flashsize = virt_memmap[VIRT_FLASH ].size /2 ;hwaddr flashbase = virt_memmap[VIRT_FLASH ].base; - fdt = s->fdt =create_device_tree (&s->fdt_size); + fdt = mc->fdt =create_device_tree (&s->fdt_size);if (!fdt) {error_report ("create_device_tree() failed" );exit (1 );@@ -434,12 +434,12 @@ static void create_fdt(RISCVVirtState *s, const struct MemmapEntry *memmap,g_free (name); name =g_strdup_printf ("/soc/flash@%" PRIx64, flashbase); -qemu_fdt_add_subnode (s->fdt, name); -qemu_fdt_setprop_string (s->fdt, name,"compatible" ,"cfi-flash" ); -qemu_fdt_setprop_sized_cells (s->fdt, name,"reg" , +qemu_fdt_add_subnode (mc->fdt, name); +qemu_fdt_setprop_string (mc->fdt, name,"compatible" ,"cfi-flash" ); +qemu_fdt_setprop_sized_cells (mc->fdt, name,"reg" ,2 , flashbase,2 , flashsize,2 , flashbase + flashsize,2 , flashsize); -qemu_fdt_setprop_cell (s->fdt, name,"bank-width" ,4 ); +qemu_fdt_setprop_cell (mc->fdt, name,"bank-width" ,4 );g_free (name); }@@ -613,9 +613,9 @@ static void virt_machine_init(MachineState *machine)hwaddr end =riscv_load_initrd (machine->initrd_filename, machine->ram_size, kernel_entry, &start); -qemu_fdt_setprop_cell (s->fdt,"/chosen" , +qemu_fdt_setprop_cell (machine->fdt,"/chosen" ,"linux,initrd-start" , start); -qemu_fdt_setprop_cell (s->fdt,"/chosen" ,"linux,initrd-end" , +qemu_fdt_setprop_cell (machine->fdt,"/chosen" ,"linux,initrd-end" , end); } }else {@@ -636,11 +636,11 @@ static void virt_machine_init(MachineState *machine)/* Compute the fdt load address in dram */ fdt_load_addr =riscv_load_fdt (memmap[VIRT_DRAM ].base, - machine->ram_size, s->fdt); + machine->ram_size, machine->fdt);/* load the reset vector */ riscv_setup_rom_reset_vec (start_addr, virt_memmap[VIRT_MROM ].base, virt_memmap[VIRT_MROM ].size, kernel_entry, - fdt_load_addr, s->fdt); + fdt_load_addr, machine->fdt);/* SiFive Test MMIO device */ sifive_test_create (memmap[VIRT_TEST ].base); --2.20.1
PATCH 3/4 device_tree: add qemu_fdt_setprop_string_array helper
In reply to Alex BennéeA string array in device tree is simply a series of \0 terminated strings next to each other. As libfdt doesn't support that directly we need to build it ourselves.
--- include/sysemu/device_tree.h | 17 +++++++++++++++++ softmmu/device_tree.c | 26 ++++++++++++++++++++++++++ 2 files changed, 43 insertions(+)
include/sysemu/device_tree.h +17 -0
@@ -70,6 +70,23 @@ int qemu_fdt_setprop_u64(void *fdt, const char *node_path, const char *property, uint64_t val);int qemu_fdt_setprop_string (void *fdt,const char *node_path,const char *property,const char *string); + +/** +* qemu_fdt_setprop_string_array: set a string array property +* +* @fdt: pointer to the dt blob +* @name: node name +* @prop: property array +* @array: pointer to an array of string pointers +* @len: length of array +* +* assigns a string array to a property. This function converts and +* array of strings to a sequential string with \0 separators before +* setting the property. +*/ +int qemu_fdt_setprop_string_array (void *fdt,const char *node_path, +const char *prop,char **array,int len); +int qemu_fdt_setprop_phandle (void *fdt,const char *node_path,const char *property,const char *target_node_path);
softmmu/device_tree.c +26 -0
@@ -21,6 +21,7 @@#include "qemu/error-report.h" #include "qemu/option.h" #include "qemu/bswap.h" +#include "qemu/cutils.h" #include "sysemu/device_tree.h" #include "sysemu/sysemu.h" #include "hw/loader.h"
@@ -397,6 +398,31 @@ int qemu_fdt_setprop_string(void *fdt, const char *node_path,return r; } +/* +* libfdt doesn't allow us to add string arrays directly but they are +* test a series of null terminated strings with a length. We build +* the string up here so we can calculate the final length. +*/ +int qemu_fdt_setprop_string_array (void *fdt,const char *node_path,const char *prop, +char **array,int len) +{ +int ret, i, total_len =0 ; +char *str, *p; +for (i =0 ; i < len; i++) { + total_len +=strlen (array[i]) +1 ; + } + p = str =g_malloc0 (total_len); +for (i =0 ; i < len; i++) { +int len =strlen (array[i]) +1 ; +pstrcpy (p, len, array[i]); + p += len; + } + + ret =qemu_fdt_setprop (fdt, node_path, prop, str, total_len); +g_free (str); +return ret; +} +const void *qemu_fdt_getprop (void *fdt,const char *node_path,const char *property,int *lenp,Error **errp) {
Signature · 1 line
2.20.1
Re: [PATCH v1 3/4] device_tree: add qemu_fdt_setprop_string_array helper
Quoted 6 lines · Alex Bennée
A string array in device tree is simply a series of \0 terminated strings next to each other. As libfdt doesn't support that directly we need to build it ourselves.
Signed-off-by Alex Bennée <[email protected]>
Alistair
Quoted 81 lines
--- include/sysemu/device_tree.h | 17 +++++++++++++++++ softmmu/device_tree.c | 26 ++++++++++++++++++++++++++ 2 files changed, 43 insertions(+)include/sysemu/device_tree.h +17
-0@@ -70,6 +70,23 @@ int qemu_fdt_setprop_u64(void *fdt, const char *node_path, const char *property, uint64_t val);int qemu_fdt_setprop_string (void *fdt,const char *node_path,const char *property,const char *string); + +/** +* qemu_fdt_setprop_string_array: set a string array property +* +* @fdt: pointer to the dt blob +* @name: node name +* @prop: property array +* @array: pointer to an array of string pointers +* @len: length of array +* +* assigns a string array to a property. This function converts and +* array of strings to a sequential string with \0 separators before +* setting the property. +*/ +int qemu_fdt_setprop_string_array (void *fdt,const char *node_path, +const char *prop,char **array,int len); +int qemu_fdt_setprop_phandle (void *fdt,const char *node_path,const char *property,const char *target_node_path);softmmu/device_tree.c +26
-1@@ -21,6 +21,7 @@#include "qemu/error-report.h" #include "qemu/option.h" #include "qemu/bswap.h" +#include "qemu/cutils.h" #include "sysemu/device_tree.h" #include "sysemu/sysemu.h" #include "hw/loader.h" @@ -397,6 +398,31 @@ int qemu_fdt_setprop_string(void *fdt, const char *node_path,return r; } +/* +* libfdt doesn't allow us to add string arrays directly but they are +* test a series of null terminated strings with a length. We build +* the string up here so we can calculate the final length. +*/ +int qemu_fdt_setprop_string_array (void *fdt,const char *node_path,const char *prop, +char **array,int len) +{ +int ret, i, total_len =0 ; +char *str, *p; +for (i =0 ; i < len; i++) { + total_len +=strlen (array[i]) +1 ; + } + p = str =g_malloc0 (total_len); +for (i =0 ; i < len; i++) { +int len =strlen (array[i]) +1 ; +pstrcpy (p, len, array[i]); + p += len; + } + + ret =qemu_fdt_setprop (fdt, node_path, prop, str, total_len); +g_free (str); +return ret; +} +const void *qemu_fdt_getprop (void *fdt,const char *node_path,const char *property,int *lenp,Error **errp) { --2.20.1
PATCH 4/4 hw/core: implement a guest-loader to support static hypervisor guests
In reply to Alex BennéeHypervisors, especially type-1 ones, need the firmware/bootcode to put their initial guest somewhere in memory and pass the information to it via platform data. The guest-loader is modelled after the generic loader for exactly this sort of purpose:
$QEMU $ARGS -kernel ~/xen.git/xen/xen \
-append "dom0_mem=1G,max:1G loglvl=all guest_loglvl=all" \
-device guest-loader,addr=0x42000000,kernel=Image,bootargs="root=/dev/sda2 ro console=hvc0 earlyprintk=xen" \
-device guest-loader,addr=0x47000000,initrd=rootfs.cpio--- hw/core/guest-loader.h | 34 ++++++++++ hw/core/guest-loader.c | 140 +++++++++++++++++++++++++++++++++++++++++ hw/core/meson.build | 2 + 3 files changed, 176 insertions(+) create mode 100644 hw/core/guest-loader.h create mode 100644 hw/core/guest-loader.c
hw/core/guest-loader.h new file +34 -0
@@ -0,0 +1,34 @@ +/* +* Guest Loader +* +* Copyright (C) 2020 Linaro +* Written by Alex Bennée <[email protected]> +* (based on the generic-loader by Li Guang <[email protected]>) +* +* SPDX-License-Identifier: GPL-2.0-or-later +* +* This work is licensed under the terms of the GNU GPL, version 2 or later. +* See the COPYING file in the top-level directory. +*/ + +#ifndef GUEST_LOADER_H +#define GUEST_LOADER_H + +#include "hw/qdev-core.h" +#include "qom/object.h" + +struct GuestLoaderState { +/* <private> */ +DeviceState parent_obj; + +/* <public> */ +uint64_t addr; +char *kernel; +char *args; +char *initrd; +}; + +#define TYPE_GUEST_LOADER "guest-loader" +OBJECT_DECLARE_SIMPLE_TYPE(GuestLoaderState, GUEST_LOADER) + +#endif
hw/core/guest-loader.c new file +140 -0
140 lines not on this page · raw message
hw/core/meson.build +2 -0
@@ -37,6 +37,8 @@ softmmu_ss.add(files( 'clock-vmstate.c', )) +softmmu_ss.add(when: 'CONFIG_TCG', if_true: files('guest-loader.c')) + specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: files( 'machine-qmp-cmds.c', 'numa.c',
Signature · 1 line
2.20.1
Re: [PATCH v1 4/4] hw/core: implement a guest-loader to support static hypervisor guests
Quoted 5 lines · Alex Bennée
Hypervisors, especially type-1 ones, need the
firmware/bootcodeto put their initial guest somewhere in memory and pass the information to it via platform data. The guest-loader is modelled after the generic loader for exactly this sort of purpose:
guest as in Hypervisor guest and QEMU guest is a little confusing, but I can't think of a better name
Quoted 5 lines
$QEMU $ARGS -kernel ~/xen.git/xen/xen \
-append "dom0_mem=1G,max:1G loglvl=all guest_loglvl=all" \
-device guest-loader,addr=0x42000000,kernel=Image,bootargs="root=/dev/sda2 ro console=hvc0 earlyprintk=xen" \
-device guest-loader,addr=0x47000000,initrd=rootfs.cpioThis seems fine to me.
Do you mind writing some documentation though? The generic-loader documentation should be a good place to start.
Quoted 118 lines
Signed-off-by Alex Bennée <[email protected]>--- hw/core/guest-loader.h | 34 ++++++++++ hw/core/guest-loader.c | 140 +++++++++++++++++++++++++++++++++++++++++ hw/core/meson.build | 2 + 3 files changed, 176 insertions(+) create mode 100644 hw/core/guest-loader.h create mode 100644 hw/core/guest-loader.chw/core/guest-loader.h new file +34
-0@@ -0,0 +1,34 @@ +/* +* Guest Loader +* +* Copyright (C) 2020 Linaro +* Written by Alex Bennée <[email protected]> +* (based on the generic-loader by Li Guang <[email protected]>) +* +* SPDX-License-Identifier: GPL-2.0-or-later +* +* This work is licensed under the terms of the GNU GPL, version 2 or later. +* See the COPYING file in the top-level directory. +*/ + +#ifndef GUEST_LOADER_H +#define GUEST_LOADER_H + +#include "hw/qdev-core.h" +#include "qom/object.h" + +struct GuestLoaderState { +/* <private> */ +DeviceState parent_obj; + +/* <public> */ +uint64_t addr; +char *kernel; +char *args; +char *initrd; +}; + +#define TYPE_GUEST_LOADER "guest-loader" +OBJECT_DECLARE_SIMPLE_TYPE(GuestLoaderState, GUEST_LOADER) + +#endif hw/core/guest-loader.c new file +62
-0@@ -0,0 +1,140 @@ +/* +* Guest Loader +* +* Copyright (C) 2020 Linaro +* Written by Alex Bennée <[email protected]> +* (based on the generic-loader by Li Guang <[email protected]>) +* +* SPDX-License-Identifier: GPL-2.0-or-later +* +* This work is licensed under the terms of the GNU GPL, version 2 or later. +* See the COPYING file in the top-level directory. +*/ + +/* +* Much like the generic-loader this is treated as a special device +* inside QEMU. However unlike the generic-loader this device is used +* to load guest images for hypervisors. As part of that process the +* hypervisor needs to have platform information passed to it by the +* lower levels of the stack (e.g. firmware/bootloader). If you boot +* the hypervisor directly you use the guest-loader to load the Dom0 +* or equivalent guest images in the right place in the same way a +* boot loader would. +* +* This is only relevant for full system emulation. +*/ + +#include "qemu/osdep.h" +#include "hw/core/cpu.h" +#include "hw/sysbus.h" +#include "sysemu/dma.h" +#include "hw/loader.h" +#include "hw/qdev-properties.h" +#include "qapi/error.h" +#include "qemu/module.h" +#include "guest-loader.h" +#include "sysemu/device_tree.h" +#include "hw/boards.h" + +/* +* Insert some FDT nodes for the loaded blob. +*/ +static void loader_insert_platform_data (GuestLoaderState *s,int size,Error **errp) +{ +MachineState *machine =MACHINE (qdev_get_machine ()); +void *fdt = machine->fdt; + g_autofree char *node = g_strdup_printf("/chosen/module@%#08lx", s->addr); +uint64_t reg_attr[2 ] = {cpu_to_be64 (s->addr),cpu_to_be64 (size)}; + +if (!fdt) { +error_setg (errp,"Cannot modify FDT fields if the machine has none" ); +return ; + } + +qemu_fdt_add_subnode (fdt, node); +qemu_fdt_setprop (fdt, node,"reg" , ®_attr,sizeof (reg_attr)); + +if (s->kernel) { +const char *compat[2 ] = {"multiboot,module" ,"multiboot,kernel" }; +if (qemu_fdt_setprop_string_array + (fdt, node,"compatible" , (char **) &compat,ARRAY_SIZE (compat)) <0 ) { +error_setg (errp,"couldn't set %s/compatible" , node); +return ;
hw/core/guest-loader.c line 72
Quoted 10 lines
hw/core/guest-loader.c new file +10
-0+ } +if (s->args) { +if (qemu_fdt_setprop_string (fdt, node,"bootargs" , s->args) <0 ) { +error_setg (errp,"couldn't set %s/bootargs" , node); + } + } + }else if (s->initrd) { +const char * compat[2 ] = {"multiboot,module" ,"multiboot,ramdisk" }; +if (qemu_fdt_setprop_string_array + (fdt, node,"compatible" , (char **) &compat,ARRAY_SIZE (compat)) <0 ) {
The ( bracket should be on the previous line right?
Alistair
Quoted 85 lines
hw/core/guest-loader.c new file +68
-0+error_setg (errp,"couldn't set %s/compatible" , node); +return ; + } + } +} + +static void guest_loader_realize (DeviceState *dev,Error **errp) +{ +GuestLoaderState *s =GUEST_LOADER (dev); +char *file = s->kernel ? s->kernel : s->initrd; +int size =0 ; + +/* Perform some error checking on the user's options */ +if (s->kernel && s->initrd) { +error_setg (errp,"Cannot specify a kernel and initrd in the same stanza" ); +return ; + }else if (!s->kernel && !s->initrd) { +error_setg (errp,"Need to specify a kernel or initrd image" ); +return ; + }else if (!s->addr) { +error_setg (errp,"Need to specify the address of guest blob" ); +return ; + }else if (s->args && !s->kernel) { +error_setg (errp,"Boot args only relevant to kernel blobs" ); + } + +/* Default to the maximum size being the machine's ram size */ + size =load_image_targphys_as (file, s->addr, ram_size,NULL ); +if (size <0 ) { +error_setg (errp,"Cannot load specified image %s" , file); +return ; + } + +/* Now the image is loaded we need to update the platform data */ +loader_insert_platform_data (s, size, errp); +} + +static Property guest_loader_props[] = { +DEFINE_PROP_UINT64 ("addr" , GuestLoaderState, addr,0 ), +DEFINE_PROP_STRING ("kernel" , GuestLoaderState, kernel), +DEFINE_PROP_STRING ("bootargs" , GuestLoaderState, args), +DEFINE_PROP_STRING ("initrd" , GuestLoaderState, initrd), +DEFINE_PROP_END_OF_LIST (), +}; + +static void guest_loader_class_init (ObjectClass *klass,void *data) +{ +DeviceClass *dc =DEVICE_CLASS (klass); + + dc->realize = guest_loader_realize; +device_class_set_props (dc, guest_loader_props); + dc->desc ="Guest Loader" ; +set_bit (DEVICE_CATEGORY_MISC , dc->categories); +} + +static TypeInfo guest_loader_info = { + .name =TYPE_GUEST_LOADER , + .parent =TYPE_DEVICE , + .instance_size =sizeof (GuestLoaderState), + .class_init = guest_loader_class_init, +}; + +static void guest_loader_register_type (void ) +{ +type_register_static (&guest_loader_info); +} + +type_init (guest_loader_register_type)hw/core/meson.build +2
-1@@ -37,6 +37,8 @@ softmmu_ss.add(files( 'clock-vmstate.c', )) +softmmu_ss.add(when: 'CONFIG_TCG', if_true: files('guest-loader.c')) + specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: files( 'machine-qmp-cmds.c', 'numa.c', --2.20.1
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Type: series
Message-id: [email protected]
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/[email protected] -> patchew/[email protected] - [tag update] patchew/[email protected] -> patchew/[email protected] * [new tag] patchew/[email protected] -> patchew/[email protected]
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/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]