[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PULL 13/18] hw/core: implement a guest-loader to support static hyp
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PULL 13/18] hw/core: implement a guest-loader to support static hypervisor guests |
Date: |
Mon, 15 Mar 2021 17:51:00 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 |
On 3/15/21 5:44 PM, Philippe Mathieu-Daudé wrote:
> On 3/15/21 5:16 PM, Christian Borntraeger wrote:
>>
>>
>> On 08.03.21 14:50, Alex Bennée wrote:
>>> Hypervisors, 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
>>>
>>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>>> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
>>> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>>> Message-Id: <20210303173642.3805-5-alex.bennee@linaro.org>
>>>
>>
>> This now results in
>>
>> /usr/bin/ld: libcommon.fa.p/hw_core_guest-loader.c.o: in function
>> `loader_insert_platform_data':
>> build/../hw/core/guest-loader.c:56: undefined reference to
>> `qemu_fdt_add_subnode'
>> /usr/bin/ld: build/../hw/core/guest-loader.c:57: undefined reference
>> to `qemu_fdt_setprop'
>> /usr/bin/ld: build/../hw/core/guest-loader.c:61: undefined reference
>> to `qemu_fdt_setprop_string_array'
>> /usr/bin/ld: build/../hw/core/guest-loader.c:68: undefined reference
>> to `qemu_fdt_setprop_string'
>> /usr/bin/ld: build/../hw/core/guest-loader.c:74: undefined reference
>> to `qemu_fdt_setprop_string_array'
>> collect2: error: ld returned 1 exit status
>> ninja: build stopped: subcommand failed.
>>
>> when building s390-softmmu on s390 with --disable-fdt, which was in my
>> build script.
>>
>
> Oops. Quick fix:
>
> -- >8 --
> diff --git a/hw/core/meson.build b/hw/core/meson.build
> index 9cd72edf513..5827996206e 100644
> --- a/hw/core/meson.build
> +++ b/hw/core/meson.build
> @@ -37,7 +37,7 @@
> 'clock-vmstate.c',
> ))
>
> -softmmu_ss.add(when: 'CONFIG_TCG', if_true: files('guest-loader.c'))
> +softmmu_ss.add(when: ['CONFIG_TCG', fdt], if_true: files('guest-loader.c'))
>
> specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: files(
> 'machine-qmp-cmds.c',
>
> ---
>
> But better is a Kconfig entry to be able to deselect this
> device.
-- >8 --
diff --git a/hw/core/Kconfig b/hw/core/Kconfig
index fdf03514d7d..9397503656d 100644
--- a/hw/core/Kconfig
+++ b/hw/core/Kconfig
@@ -11,6 +11,11 @@ config GENERIC_LOADER
bool
default y
+config GUEST_LOADER
+ bool
+ default y
+ depends on TCG
+
config OR_IRQ
bool
diff --git a/hw/core/meson.build b/hw/core/meson.build
index 9cd72edf513..59f1605bb07 100644
--- a/hw/core/meson.build
+++ b/hw/core/meson.build
@@ -16,6 +16,7 @@
common_ss.add(files('cpu.c'))
common_ss.add(when: 'CONFIG_FITLOADER', if_true: files('loader-fit.c'))
common_ss.add(when: 'CONFIG_GENERIC_LOADER', if_true:
files('generic-loader.c'))
+common_ss.add(when: ['CONFIG_GUEST_LOADER', fdt], if_true:
files('guest-loader.c'))
common_ss.add(when: 'CONFIG_OR_IRQ', if_true: files('or-irq.c'))
common_ss.add(when: 'CONFIG_PLATFORM_BUS', if_true:
files('platform-bus.c'))
common_ss.add(when: 'CONFIG_PTIMER', if_true: files('ptimer.c'))
@@ -37,8 +38,6 @@
'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',
---
- [PULL 07/18] gitlab-ci.yml: Add jobs to test CFI flags, (continued)
- [PULL 07/18] gitlab-ci.yml: Add jobs to test CFI flags, Alex Bennée, 2021/03/08
- [PULL 06/18] gitlab-ci.yml: Allow custom # of parallel linkers, Alex Bennée, 2021/03/08
- [PULL 11/18] hw/riscv: migrate fdt field to generic MachineState, Alex Bennée, 2021/03/08
- [PULL 14/18] docs: move generic-loader documentation into the main manual, Alex Bennée, 2021/03/08
- [PULL 08/18] tests/docker: Use --arch-only when building Debian cross image, Alex Bennée, 2021/03/08
- [PULL 09/18] .editorconfig: update the automatic mode setting for Emacs, Alex Bennée, 2021/03/08
- [PULL 10/18] hw/board: promote fdt from ARM VirtMachineState to MachineState, Alex Bennée, 2021/03/08
- [PULL 13/18] hw/core: implement a guest-loader to support static hypervisor guests, Alex Bennée, 2021/03/08
- Re: [PULL 13/18] hw/core: implement a guest-loader to support static hypervisor guests, Christian Borntraeger, 2021/03/15
[PULL 16/18] tests/avocado: add boot_xen tests, Alex Bennée, 2021/03/08
[PULL 12/18] device_tree: add qemu_fdt_setprop_string_array helper, Alex Bennée, 2021/03/08
[PULL 15/18] docs: add some documentation for the guest-loader, Alex Bennée, 2021/03/08
[PULL 17/18] semihosting: Move include/hw/semihosting/ -> include/semihosting/, Alex Bennée, 2021/03/08
[PULL 18/18] semihosting: Move hw/semihosting/ -> semihosting/, Alex Bennée, 2021/03/08
Re: [PULL 00/18] testing, docs, semihosting move and guest-loader, no-reply, 2021/03/08