* [PATCH for-11.0 0/2] Build fixes for minimal microvm
@ 2026-03-19 10:11 Ani Sinha
2026-03-19 10:11 ` [PATCH for-11.0 1/2] i386/pc_sysfw: stub out x86_firmware_configure Ani Sinha
2026-03-19 10:11 ` [PATCH for-11.0 2/2] i386/hyperv: add stubs for synic enablement Ani Sinha
0 siblings, 2 replies; 6+ messages in thread
From: Ani Sinha @ 2026-03-19 10:11 UTC (permalink / raw)
Cc: Ani Sinha, philmd, pbonzini, mjt, qemu-devel
Some build fixes for building a minmal qemu for microvm
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
CC: mjt@tls.msk.ru
CC: qemu-devel@nongnu.org
Ani Sinha (2):
i386/pc_sysfw: stub out x86_firmware_configure
i386/hyperv: add stubs for synic enablement
hw/i386/pc_sysfw_ovmf-stubs.c | 5 +++++
target/i386/kvm/hyperv-stub.c | 5 +++++
target/i386/kvm/hyperv.c | 9 +++++++++
target/i386/kvm/hyperv.h | 1 +
target/i386/kvm/kvm.c | 12 +++++-------
5 files changed, 25 insertions(+), 7 deletions(-)
--
2.42.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH for-11.0 1/2] i386/pc_sysfw: stub out x86_firmware_configure
2026-03-19 10:11 [PATCH for-11.0 0/2] Build fixes for minimal microvm Ani Sinha
@ 2026-03-19 10:11 ` Ani Sinha
2026-03-19 11:03 ` Ani Sinha
2026-03-19 10:11 ` [PATCH for-11.0 2/2] i386/hyperv: add stubs for synic enablement Ani Sinha
1 sibling, 1 reply; 6+ messages in thread
From: Ani Sinha @ 2026-03-19 10:11 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, Gerd Hoffmann, Paolo Bonzini,
Richard Henderson, Michael S. Tsirkin, Marcel Apfelbaum
Cc: Ani Sinha, Michael Tokarev, qemu-devel
x86_firmware_configure requires ovmf support. Add a stub for this function call
for cases where OVMF is not supported.
Reported-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Ani Sinha <anisinha@redhat.com>
---
hw/i386/pc_sysfw_ovmf-stubs.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hw/i386/pc_sysfw_ovmf-stubs.c b/hw/i386/pc_sysfw_ovmf-stubs.c
index aabe78b271..b53906a052 100644
--- a/hw/i386/pc_sysfw_ovmf-stubs.c
+++ b/hw/i386/pc_sysfw_ovmf-stubs.c
@@ -24,3 +24,8 @@ void pc_system_parse_ovmf_flash(uint8_t *flash_ptr, size_t flash_size)
{
g_assert_not_reached();
}
+
+void x86_firmware_configure(hwaddr gpa, void *ptr, int size)
+{
+ g_assert_not_reached();
+}
--
2.42.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH for-11.0 2/2] i386/hyperv: add stubs for synic enablement
2026-03-19 10:11 [PATCH for-11.0 0/2] Build fixes for minimal microvm Ani Sinha
2026-03-19 10:11 ` [PATCH for-11.0 1/2] i386/pc_sysfw: stub out x86_firmware_configure Ani Sinha
@ 2026-03-19 10:11 ` Ani Sinha
2026-03-19 10:53 ` Philippe Mathieu-Daudé
1 sibling, 1 reply; 6+ messages in thread
From: Ani Sinha @ 2026-03-19 10:11 UTC (permalink / raw)
To: Paolo Bonzini, Marcelo Tosatti
Cc: Ani Sinha, philmd, Michale Tokarev, kvm, qemu-devel
Add a new call hyperv_enable_synic() that can be called whether or not
CONFIG_HYPERV is enabled. This way genetic code in i396/kvm.c can call this
function to enable synic for hyperv. For non-hyperv cases, the stub will
be a noop.
Reported-by: Michale Tokarev <mjt@tls.msk.ru>
Signed-off-by: Ani Sinha <anisinha@redhat.com>
---
target/i386/kvm/hyperv-stub.c | 5 +++++
target/i386/kvm/hyperv.c | 9 +++++++++
target/i386/kvm/hyperv.h | 1 +
target/i386/kvm/kvm.c | 12 +++++-------
4 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/target/i386/kvm/hyperv-stub.c b/target/i386/kvm/hyperv-stub.c
index 5836f53c23..767a4c7e1a 100644
--- a/target/i386/kvm/hyperv-stub.c
+++ b/target/i386/kvm/hyperv-stub.c
@@ -61,3 +61,8 @@ uint64_t hyperv_syndbg_query_options(void)
{
return 0;
}
+
+int hyperv_enable_synic(X86CPU *cpu)
+{
+ return 0;
+}
diff --git a/target/i386/kvm/hyperv.c b/target/i386/kvm/hyperv.c
index f7a81bd270..bd3c26d02b 100644
--- a/target/i386/kvm/hyperv.c
+++ b/target/i386/kvm/hyperv.c
@@ -24,6 +24,15 @@ int hyperv_x86_synic_add(X86CPU *cpu)
return 0;
}
+int hyperv_enable_synic(X86CPU *cpu)
+{
+ int ret = 0;
+ if (!hyperv_is_synic_enabled()) {
+ ret = hyperv_x86_synic_add(cpu);
+ }
+ return ret;
+}
+
/*
* All devices possibly using SynIC have to be reset before calling this to let
* them remove their SINT routes first.
diff --git a/target/i386/kvm/hyperv.h b/target/i386/kvm/hyperv.h
index e45a4512fe..a393a5d428 100644
--- a/target/i386/kvm/hyperv.h
+++ b/target/i386/kvm/hyperv.h
@@ -23,6 +23,7 @@ int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit);
#endif
int hyperv_x86_synic_add(X86CPU *cpu);
+int hyperv_enable_synic(X86CPU *cpu);
void hyperv_x86_synic_reset(X86CPU *cpu);
void hyperv_x86_synic_update(X86CPU *cpu);
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index a29f757c16..9e352882c8 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c
@@ -1754,13 +1754,11 @@ static int hyperv_init_vcpu(X86CPU *cpu)
return ret;
}
- if (!hyperv_is_synic_enabled()) {
- ret = hyperv_x86_synic_add(cpu);
- if (ret < 0) {
- error_report("failed to create HyperV SynIC: %s",
- strerror(-ret));
- return ret;
- }
+ ret = hyperv_enable_synic(cpu);
+ if (ret < 0) {
+ error_report("failed to create HyperV SynIC: %s",
+ strerror(-ret));
+ return ret;
}
}
--
2.42.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH for-11.0 2/2] i386/hyperv: add stubs for synic enablement
2026-03-19 10:11 ` [PATCH for-11.0 2/2] i386/hyperv: add stubs for synic enablement Ani Sinha
@ 2026-03-19 10:53 ` Philippe Mathieu-Daudé
2026-03-19 11:01 ` Ani Sinha
0 siblings, 1 reply; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-03-19 10:53 UTC (permalink / raw)
To: Ani Sinha, Paolo Bonzini, Marcelo Tosatti
Cc: Michale Tokarev, kvm, qemu-devel
Hi Ani,
On 19/3/26 11:11, Ani Sinha wrote:
> Add a new call hyperv_enable_synic() that can be called whether or not
> CONFIG_HYPERV is enabled. This way genetic code in i396/kvm.c can call this
> function to enable synic for hyperv. For non-hyperv cases, the stub will
> be a noop.
>
> Reported-by: Michale Tokarev <mjt@tls.msk.ru>
> Signed-off-by: Ani Sinha <anisinha@redhat.com>
> ---
> target/i386/kvm/hyperv-stub.c | 5 +++++
> target/i386/kvm/hyperv.c | 9 +++++++++
> target/i386/kvm/hyperv.h | 1 +
> target/i386/kvm/kvm.c | 12 +++++-------
> 4 files changed, 20 insertions(+), 7 deletions(-)
>
> diff --git a/target/i386/kvm/hyperv-stub.c b/target/i386/kvm/hyperv-stub.c
> index 5836f53c23..767a4c7e1a 100644
> --- a/target/i386/kvm/hyperv-stub.c
> +++ b/target/i386/kvm/hyperv-stub.c
> @@ -61,3 +61,8 @@ uint64_t hyperv_syndbg_query_options(void)
> {
> return 0;
> }
> +
> +int hyperv_enable_synic(X86CPU *cpu)
> +{
> + return 0;
> +}
> diff --git a/target/i386/kvm/hyperv.c b/target/i386/kvm/hyperv.c
> index f7a81bd270..bd3c26d02b 100644
> --- a/target/i386/kvm/hyperv.c
> +++ b/target/i386/kvm/hyperv.c
> @@ -24,6 +24,15 @@ int hyperv_x86_synic_add(X86CPU *cpu)
> return 0;
> }
>
> +int hyperv_enable_synic(X86CPU *cpu)
> +{
> + int ret = 0;
> + if (!hyperv_is_synic_enabled()) {
> + ret = hyperv_x86_synic_add(cpu);
> + }
> + return ret;
> +}
> +
> /*
> * All devices possibly using SynIC have to be reset before calling this to let
> * them remove their SINT routes first.
> diff --git a/target/i386/kvm/hyperv.h b/target/i386/kvm/hyperv.h
> index e45a4512fe..a393a5d428 100644
> --- a/target/i386/kvm/hyperv.h
> +++ b/target/i386/kvm/hyperv.h
> @@ -23,6 +23,7 @@ int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit);
> #endif
>
> int hyperv_x86_synic_add(X86CPU *cpu);
> +int hyperv_enable_synic(X86CPU *cpu);
> void hyperv_x86_synic_reset(X86CPU *cpu);
> void hyperv_x86_synic_update(X86CPU *cpu);
>
> diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
> index a29f757c16..9e352882c8 100644
> --- a/target/i386/kvm/kvm.c
> +++ b/target/i386/kvm/kvm.c
> @@ -1754,13 +1754,11 @@ static int hyperv_init_vcpu(X86CPU *cpu)
> return ret;
> }
>
> - if (!hyperv_is_synic_enabled()) {
> - ret = hyperv_x86_synic_add(cpu);
> - if (ret < 0) {
> - error_report("failed to create HyperV SynIC: %s",
> - strerror(-ret));
> - return ret;
> - }
> + ret = hyperv_enable_synic(cpu);
> + if (ret < 0) {
> + error_report("failed to create HyperV SynIC: %s",
> + strerror(-ret));
> + return ret;
> }
> }
>
Why not simply add a hyperv_is_synic_enabled() stub?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH for-11.0 2/2] i386/hyperv: add stubs for synic enablement
2026-03-19 10:53 ` Philippe Mathieu-Daudé
@ 2026-03-19 11:01 ` Ani Sinha
0 siblings, 0 replies; 6+ messages in thread
From: Ani Sinha @ 2026-03-19 11:01 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: Paolo Bonzini, Marcelo Tosatti, Michale Tokarev, kvm, qemu-devel
> On 19 Mar 2026, at 4:23 PM, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> Hi Ani,
>
> On 19/3/26 11:11, Ani Sinha wrote:
>> Add a new call hyperv_enable_synic() that can be called whether or not
>> CONFIG_HYPERV is enabled. This way genetic code in i396/kvm.c can call this
>> function to enable synic for hyperv. For non-hyperv cases, the stub will
>> be a noop.
>> Reported-by: Michale Tokarev <mjt@tls.msk.ru>
>> Signed-off-by: Ani Sinha <anisinha@redhat.com>
>> ---
>> target/i386/kvm/hyperv-stub.c | 5 +++++
>> target/i386/kvm/hyperv.c | 9 +++++++++
>> target/i386/kvm/hyperv.h | 1 +
>> target/i386/kvm/kvm.c | 12 +++++-------
>> 4 files changed, 20 insertions(+), 7 deletions(-)
>> diff --git a/target/i386/kvm/hyperv-stub.c b/target/i386/kvm/hyperv-stub.c
>> index 5836f53c23..767a4c7e1a 100644
>> --- a/target/i386/kvm/hyperv-stub.c
>> +++ b/target/i386/kvm/hyperv-stub.c
>> @@ -61,3 +61,8 @@ uint64_t hyperv_syndbg_query_options(void)
>> {
>> return 0;
>> }
>> +
>> +int hyperv_enable_synic(X86CPU *cpu)
>> +{
>> + return 0;
>> +}
>> diff --git a/target/i386/kvm/hyperv.c b/target/i386/kvm/hyperv.c
>> index f7a81bd270..bd3c26d02b 100644
>> --- a/target/i386/kvm/hyperv.c
>> +++ b/target/i386/kvm/hyperv.c
>> @@ -24,6 +24,15 @@ int hyperv_x86_synic_add(X86CPU *cpu)
>> return 0;
>> }
>> +int hyperv_enable_synic(X86CPU *cpu)
>> +{
>> + int ret = 0;
>> + if (!hyperv_is_synic_enabled()) {
>> + ret = hyperv_x86_synic_add(cpu);
>> + }
>> + return ret;
>> +}
>> +
>> /*
>> * All devices possibly using SynIC have to be reset before calling this to let
>> * them remove their SINT routes first.
>> diff --git a/target/i386/kvm/hyperv.h b/target/i386/kvm/hyperv.h
>> index e45a4512fe..a393a5d428 100644
>> --- a/target/i386/kvm/hyperv.h
>> +++ b/target/i386/kvm/hyperv.h
>> @@ -23,6 +23,7 @@ int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit);
>> #endif
>> int hyperv_x86_synic_add(X86CPU *cpu);
>> +int hyperv_enable_synic(X86CPU *cpu);
>> void hyperv_x86_synic_reset(X86CPU *cpu);
>> void hyperv_x86_synic_update(X86CPU *cpu);
>> diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
>> index a29f757c16..9e352882c8 100644
>> --- a/target/i386/kvm/kvm.c
>> +++ b/target/i386/kvm/kvm.c
>> @@ -1754,13 +1754,11 @@ static int hyperv_init_vcpu(X86CPU *cpu)
>> return ret;
>> }
>> - if (!hyperv_is_synic_enabled()) {
>> - ret = hyperv_x86_synic_add(cpu);
>> - if (ret < 0) {
>> - error_report("failed to create HyperV SynIC: %s",
>> - strerror(-ret));
>> - return ret;
>> - }
>> + ret = hyperv_enable_synic(cpu);
>> + if (ret < 0) {
>> + error_report("failed to create HyperV SynIC: %s",
>> + strerror(-ret));
>> + return ret;
>> }
>> }
>>
>
> Why not simply add a hyperv_is_synic_enabled() stub?
That would be wrong unless I assert in hyperv_is_synic_enabled() stub function which would break minimal microvms?
The other reason is I do not like hyperv_x86_synic_add() returning -ENOSYS. If hyperv is not enabled we do not need to call those functions at all.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH for-11.0 1/2] i386/pc_sysfw: stub out x86_firmware_configure
2026-03-19 10:11 ` [PATCH for-11.0 1/2] i386/pc_sysfw: stub out x86_firmware_configure Ani Sinha
@ 2026-03-19 11:03 ` Ani Sinha
0 siblings, 0 replies; 6+ messages in thread
From: Ani Sinha @ 2026-03-19 11:03 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, Gerd Hoffmann, Paolo Bonzini,
Richard Henderson, Michael Tsirkin, Marcel Apfelbaum
Cc: Michael Tokarev, qemu-devel
> On 19 Mar 2026, at 3:41 PM, Ani Sinha <anisinha@redhat.com> wrote:
>
> x86_firmware_configure requires ovmf support. Add a stub for this function call
> for cases where OVMF is not supported.
>
> Reported-by: Michael Tokarev <mjt@tls.msk.ru>
> Signed-off-by: Ani Sinha <anisinha@redhat.com>
> ---
> hw/i386/pc_sysfw_ovmf-stubs.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/hw/i386/pc_sysfw_ovmf-stubs.c b/hw/i386/pc_sysfw_ovmf-stubs.c
> index aabe78b271..b53906a052 100644
> --- a/hw/i386/pc_sysfw_ovmf-stubs.c
> +++ b/hw/i386/pc_sysfw_ovmf-stubs.c
> @@ -24,3 +24,8 @@ void pc_system_parse_ovmf_flash(uint8_t *flash_ptr, size_t flash_size)
> {
> g_assert_not_reached();
> }
> +
> +void x86_firmware_configure(hwaddr gpa, void *ptr, int size)
> +{
> + g_assert_not_reached();
> +}
This change alone won’t work for the CONFIG_PC case. I need to move x86_firmware_configure() to pc_sysfw_ovmf.c Will fix in v2 after I run my changes through CI.
> --
> 2.42.0
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-03-19 11:04 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-19 10:11 [PATCH for-11.0 0/2] Build fixes for minimal microvm Ani Sinha
2026-03-19 10:11 ` [PATCH for-11.0 1/2] i386/pc_sysfw: stub out x86_firmware_configure Ani Sinha
2026-03-19 11:03 ` Ani Sinha
2026-03-19 10:11 ` [PATCH for-11.0 2/2] i386/hyperv: add stubs for synic enablement Ani Sinha
2026-03-19 10:53 ` Philippe Mathieu-Daudé
2026-03-19 11:01 ` Ani Sinha
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox