Hi!

Building a minmal qemu for microvm (the idea is to have small footprint
binary for fastest loading and being light on resources).  It ends up
with:

 cc -m64 @qemu-system-x86_64.rsp
ld: libqemu-x86_64-softmmu.a.p/target_i386_kvm_kvm.c.o: in function `hyperv_init_vcpu': target/i386/kvm/kvm.c:1757:(.text+0x5d83): undefined reference to `hyperv_is_synic_enabled' ld: libqemu-x86_64-softmmu.a.p/hw_i386_x86-common.c.o: in function `x86_bios_rom_reload': hw/i386/x86-common.c:1104:(.text+0x240d): undefined reference to `x86_firmware_configure'
 collect2: error: ld returned 1 exit status

The build is done with the devices file:

 CONFIG_PCI_DEVICES=n
 CONFIG_MICROVM=y
 CONFIG_VIRTIO_BLK=y
 CONFIG_VIRTIO_SERIAL=y
 CONFIG_VIRTIO_INPUT=y
 CONFIG_VIRTIO_INPUT_HOST=y
 CONFIG_VHOST_USER_INPUT=y
 CONFIG_VIRTIO_NET=y
 CONFIG_VIRTIO_SCSI=y
 CONFIG_VIRTIO_RNG=y
 CONFIG_VIRTIO_CRYPTO=y
 CONFIG_VIRTIO_BALLOON=y
 CONFIG_VIRTIO_GPU=y
 CONFIG_VHOST_USER_GPU=y

and with these confiure options:

 ../../configure ${common_configure_opts} \
               --without-default-features \
               --target-list=x86_64-softmmu --enable-kvm --disable-tcg \
               --enable-pixman --enable-vnc \
               --enable-virtfs \
               --enable-linux-aio --enable-linux-io-uring \
               --enable-numa \
               --enable-attr \
               --enable-coroutine-pool \
               --audio-drv-list="" \
               --without-default-devices \
               --with-devices-x86_64=microvm \
               --enable-vhost-kernel --enable-vhost-net \
               --enable-vhost-vdpa \
               --enable-vhost-user --enable-vhost-user-blk-server \
               --enable-vhost-crypto \
               --enable-seccomp \



For the first one, hyperv_is_synic_enabled() - it looks like the whole
hyperv thing in target/i386/kvm/kvm.c should have #ifdef CONFIG_HYPERV
guard - not just the call to hyperv_is_synic_enabled() but whole
hyperv_init_vcpu() and related callsite, because hyperv_is_synic_enabled
is only included when CONFIG_HYPERV=1.  There are hyperv stubs - just a
few of them, - maybe it's better to actually #ifdef in the actual code
which call hyperv functions?

For the second, it looks like it's been added when adding confidential
guest support.  This code, too, looks like it should be conditional on
CONFIG_X86_FW_OVMF, like pc_sysfw_ovmf.c, - or alternatively,
x86_firmware_configure should be included in stubs.

Overall, I'm seeing less and less reasons to continue building and
shipping this light microvm binary.

Thanks,

/mjt

Reply via email to