[PATCH 0/3] qemu: Relax hyperv features validation
*** BLURB HERE *** Michal Prívozník (3): qemuxmlconfdata: Switch some hyperv tests from i440fx to q35 qemu: Skip validation of VIR_DOMAIN_HYPERV_SYNIC on i440fx qemu_validate: Drop VIR_DOMAIN_HYPERV_STIMER dependency on VIR_DOMAIN_HYPERV_VPINDEX src/qemu/qemu_validate.c | 9 +++++-- .../hyperv-host-model.x86_64-latest.args | 9 +++++-- .../hyperv-host-model.x86_64-latest.xml | 24 ++++++++++++++++--- tests/qemuxmlconfdata/hyperv-host-model.xml | 4 ++-- .../qemuxmlconfdata/hyperv.x86_64-latest.args | 9 +++++-- .../qemuxmlconfdata/hyperv.x86_64-latest.xml | 24 ++++++++++++++++--- tests/qemuxmlconfdata/hyperv.xml | 4 ++-- 7 files changed, 67 insertions(+), 16 deletions(-) -- 2.52.0
From: Michal Privoznik <mprivozn@redhat.com> There is an issue with synic and vpindex enlightenments (fixed in next commit) which manifests itself only on (some) i440fx machine types. Switch affected tests to q35. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- .../hyperv-host-model.x86_64-latest.args | 9 +++++-- .../hyperv-host-model.x86_64-latest.xml | 24 ++++++++++++++++--- tests/qemuxmlconfdata/hyperv-host-model.xml | 4 ++-- .../qemuxmlconfdata/hyperv.x86_64-latest.args | 9 +++++-- .../qemuxmlconfdata/hyperv.x86_64-latest.xml | 24 ++++++++++++++++--- tests/qemuxmlconfdata/hyperv.xml | 4 ++-- 6 files changed, 60 insertions(+), 14 deletions(-) diff --git a/tests/qemuxmlconfdata/hyperv-host-model.x86_64-latest.args b/tests/qemuxmlconfdata/hyperv-host-model.x86_64-latest.args index 58502ff51e..d6682f002c 100644 --- a/tests/qemuxmlconfdata/hyperv-host-model.x86_64-latest.args +++ b/tests/qemuxmlconfdata/hyperv-host-model.x86_64-latest.args @@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -name guest=QEMUGuest1,debug-threads=on \ -S \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ --machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=on \ +-machine q35,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=on \ -accel tcg \ -cpu 'qemu64,hv-time=on,hv-relaxed=on,hv-vapic=on,hv-spinlocks=0xfff,hv-vpindex=on,hv-runtime=on,hv-synic=on,hv-stimer=on,hv-stimer-direct=on,hv-reset=on,hv-vendor-id=Linux KVM Hv,hv-frequencies=on,hv-reenlightenment=on,hv-tlbflush=on,hv-tlbflush-direct=on,hv-tlbflush-ext=on,hv-ipi=on,hv-avic=on,hv-emsr-bitmap=on,hv-xmm-input=on' \ -m size=219136k \ @@ -26,7 +26,12 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ +-device '{"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}' \ +-device '{"driver":"pcie-pci-bridge","id":"pci.2","bus":"pci.1","addr":"0x0"}' \ +-device '{"driver":"pcie-root-port","port":9,"chassis":3,"id":"pci.3","bus":"pcie.0","addr":"0x1.0x1"}' \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.2","addr":"0x1"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ +-global ICH9-LPC.noreboot=off \ +-watchdog-action reset \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/hyperv-host-model.x86_64-latest.xml b/tests/qemuxmlconfdata/hyperv-host-model.x86_64-latest.xml index 453a43b3c9..537680817f 100644 --- a/tests/qemuxmlconfdata/hyperv-host-model.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/hyperv-host-model.x86_64-latest.xml @@ -5,7 +5,7 @@ <currentMemory unit='KiB'>219100</currentMemory> <vcpu placement='static'>6</vcpu> <os> - <type arch='x86_64' machine='pc'>hvm</type> + <type arch='x86_64' machine='q35'>hvm</type> <boot dev='network'/> </os> <features> @@ -22,12 +22,30 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='usb' index='0' model='piix3-uhci'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/> + </controller> + <controller type='pci' index='0' model='pcie-root'/> + <controller type='pci' index='1' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='1' port='0x8'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/> + </controller> + <controller type='pci' index='2' model='pcie-to-pci-bridge'> + <model name='pcie-pci-bridge'/> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </controller> + <controller type='pci' index='3' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='3' port='0x9'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> + <controller type='sata' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> </controller> - <controller type='pci' index='0' model='pci-root'/> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> + <watchdog model='itco' action='reset'/> <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/hyperv-host-model.xml b/tests/qemuxmlconfdata/hyperv-host-model.xml index fae00d86dd..6095ac6fd8 100644 --- a/tests/qemuxmlconfdata/hyperv-host-model.xml +++ b/tests/qemuxmlconfdata/hyperv-host-model.xml @@ -5,7 +5,7 @@ <currentMemory unit='KiB'>219100</currentMemory> <vcpu placement='static'>6</vcpu> <os> - <type arch='x86_64' machine='pc'>hvm</type> + <type arch='x86_64' machine='q35'>hvm</type> <boot dev='network'/> </os> <features> @@ -19,7 +19,7 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='usb' index='0'/> - <controller type='pci' index='0' model='pci-root'/> + <controller type='pci' index='0' model='pcie-root'/> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <memballoon model='none'/> diff --git a/tests/qemuxmlconfdata/hyperv.x86_64-latest.args b/tests/qemuxmlconfdata/hyperv.x86_64-latest.args index ea4b77de74..2c9716ed93 100644 --- a/tests/qemuxmlconfdata/hyperv.x86_64-latest.args +++ b/tests/qemuxmlconfdata/hyperv.x86_64-latest.args @@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -name guest=QEMUGuest1,debug-threads=on \ -S \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ --machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=on \ +-machine q35,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=on \ -accel tcg \ -cpu 'qemu64,hv-time=on,hv-relaxed=on,hv-vapic=on,hv-spinlocks=0x80000000,hv-vpindex=on,hv-runtime=on,hv-synic=on,hv-stimer=on,hv-reset=on,hv-vendor-id=KVM Hv,hv-frequencies=on,hv-reenlightenment=on,hv-tlbflush=on,hv-tlbflush-direct=on,hv-tlbflush-ext=on,hv-ipi=on,hv-evmcs=on,hv-avic=on,hv-emsr-bitmap=on,hv-xmm-input=on' \ -m size=219136k \ @@ -26,7 +26,12 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ +-device '{"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}' \ +-device '{"driver":"pcie-pci-bridge","id":"pci.2","bus":"pci.1","addr":"0x0"}' \ +-device '{"driver":"pcie-root-port","port":9,"chassis":3,"id":"pci.3","bus":"pcie.0","addr":"0x1.0x1"}' \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.2","addr":"0x1"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ +-global ICH9-LPC.noreboot=off \ +-watchdog-action reset \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/hyperv.x86_64-latest.xml b/tests/qemuxmlconfdata/hyperv.x86_64-latest.xml index fdcab661a6..156bbfff21 100644 --- a/tests/qemuxmlconfdata/hyperv.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/hyperv.x86_64-latest.xml @@ -5,7 +5,7 @@ <currentMemory unit='KiB'>219100</currentMemory> <vcpu placement='static'>6</vcpu> <os> - <type arch='x86_64' machine='pc'>hvm</type> + <type arch='x86_64' machine='q35'>hvm</type> <boot dev='network'/> </os> <features> @@ -45,12 +45,30 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='usb' index='0' model='piix3-uhci'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/> + </controller> + <controller type='pci' index='0' model='pcie-root'/> + <controller type='pci' index='1' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='1' port='0x8'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/> + </controller> + <controller type='pci' index='2' model='pcie-to-pci-bridge'> + <model name='pcie-pci-bridge'/> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </controller> + <controller type='pci' index='3' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='3' port='0x9'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> + <controller type='sata' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> </controller> - <controller type='pci' index='0' model='pci-root'/> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> + <watchdog model='itco' action='reset'/> <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/hyperv.xml b/tests/qemuxmlconfdata/hyperv.xml index 9a47dd0ec8..2a7d082153 100644 --- a/tests/qemuxmlconfdata/hyperv.xml +++ b/tests/qemuxmlconfdata/hyperv.xml @@ -5,7 +5,7 @@ <currentMemory unit='KiB'>219100</currentMemory> <vcpu placement='static'>6</vcpu> <os> - <type arch='x86_64' machine='pc'>hvm</type> + <type arch='x86_64' machine='q35'>hvm</type> <boot dev='network'/> </os> <features> @@ -42,7 +42,7 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='usb' index='0'/> - <controller type='pci' index='0' model='pci-root'/> + <controller type='pci' index='0' model='pcie-root'/> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <memballoon model='none'/> -- 2.52.0
On Tue, Jan 06, 2026 at 03:25:16PM +0100, Michal Privoznik via Devel wrote:
From: Michal Privoznik <mprivozn@redhat.com>
There is an issue with synic and vpindex enlightenments (fixed in next commit) which manifests itself only on (some) i440fx machine types. Switch affected tests to q35.
It also affects q35 machine types at the same version number, as both rely on the "pc_compat_3_0" array that defines the compat properties for x86. With upstream QEMU this change should not matter as we require QEMU >= 5.2.0 and so can assume a bare 'pc' will resolve to a new enough version, and 'q35' will do likewise. With RHEL-9 downstream QEMU, a bare 'pc' will resolve to older affected version (rhel-7.6.0), but does that actually affect the unit tests ? IIUC, we should be using our mocked capabilities and so not see a problem ?
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- .../hyperv-host-model.x86_64-latest.args | 9 +++++-- .../hyperv-host-model.x86_64-latest.xml | 24 ++++++++++++++++--- tests/qemuxmlconfdata/hyperv-host-model.xml | 4 ++-- .../qemuxmlconfdata/hyperv.x86_64-latest.args | 9 +++++-- .../qemuxmlconfdata/hyperv.x86_64-latest.xml | 24 ++++++++++++++++--- tests/qemuxmlconfdata/hyperv.xml | 4 ++-- 6 files changed, 60 insertions(+), 14 deletions(-)
diff --git a/tests/qemuxmlconfdata/hyperv-host-model.x86_64-latest.args b/tests/qemuxmlconfdata/hyperv-host-model.x86_64-latest.args index 58502ff51e..d6682f002c 100644 --- a/tests/qemuxmlconfdata/hyperv-host-model.x86_64-latest.args +++ b/tests/qemuxmlconfdata/hyperv-host-model.x86_64-latest.args @@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -name guest=QEMUGuest1,debug-threads=on \ -S \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ --machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=on \ +-machine q35,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=on \ -accel tcg \ -cpu 'qemu64,hv-time=on,hv-relaxed=on,hv-vapic=on,hv-spinlocks=0xfff,hv-vpindex=on,hv-runtime=on,hv-synic=on,hv-stimer=on,hv-stimer-direct=on,hv-reset=on,hv-vendor-id=Linux KVM Hv,hv-frequencies=on,hv-reenlightenment=on,hv-tlbflush=on,hv-tlbflush-direct=on,hv-tlbflush-ext=on,hv-ipi=on,hv-avic=on,hv-emsr-bitmap=on,hv-xmm-input=on' \ -m size=219136k \ @@ -26,7 +26,12 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ +-device '{"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}' \ +-device '{"driver":"pcie-pci-bridge","id":"pci.2","bus":"pci.1","addr":"0x0"}' \ +-device '{"driver":"pcie-root-port","port":9,"chassis":3,"id":"pci.3","bus":"pcie.0","addr":"0x1.0x1"}' \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.2","addr":"0x1"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ +-global ICH9-LPC.noreboot=off \ +-watchdog-action reset \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/hyperv-host-model.x86_64-latest.xml b/tests/qemuxmlconfdata/hyperv-host-model.x86_64-latest.xml index 453a43b3c9..537680817f 100644 --- a/tests/qemuxmlconfdata/hyperv-host-model.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/hyperv-host-model.x86_64-latest.xml @@ -5,7 +5,7 @@ <currentMemory unit='KiB'>219100</currentMemory> <vcpu placement='static'>6</vcpu> <os> - <type arch='x86_64' machine='pc'>hvm</type> + <type arch='x86_64' machine='q35'>hvm</type> <boot dev='network'/> </os> <features> @@ -22,12 +22,30 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='usb' index='0' model='piix3-uhci'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/> + </controller> + <controller type='pci' index='0' model='pcie-root'/> + <controller type='pci' index='1' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='1' port='0x8'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/> + </controller> + <controller type='pci' index='2' model='pcie-to-pci-bridge'> + <model name='pcie-pci-bridge'/> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </controller> + <controller type='pci' index='3' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='3' port='0x9'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> + <controller type='sata' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> </controller> - <controller type='pci' index='0' model='pci-root'/> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> + <watchdog model='itco' action='reset'/> <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/hyperv-host-model.xml b/tests/qemuxmlconfdata/hyperv-host-model.xml index fae00d86dd..6095ac6fd8 100644 --- a/tests/qemuxmlconfdata/hyperv-host-model.xml +++ b/tests/qemuxmlconfdata/hyperv-host-model.xml @@ -5,7 +5,7 @@ <currentMemory unit='KiB'>219100</currentMemory> <vcpu placement='static'>6</vcpu> <os> - <type arch='x86_64' machine='pc'>hvm</type> + <type arch='x86_64' machine='q35'>hvm</type> <boot dev='network'/> </os> <features> @@ -19,7 +19,7 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='usb' index='0'/> - <controller type='pci' index='0' model='pci-root'/> + <controller type='pci' index='0' model='pcie-root'/> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <memballoon model='none'/> diff --git a/tests/qemuxmlconfdata/hyperv.x86_64-latest.args b/tests/qemuxmlconfdata/hyperv.x86_64-latest.args index ea4b77de74..2c9716ed93 100644 --- a/tests/qemuxmlconfdata/hyperv.x86_64-latest.args +++ b/tests/qemuxmlconfdata/hyperv.x86_64-latest.args @@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -name guest=QEMUGuest1,debug-threads=on \ -S \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ --machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=on \ +-machine q35,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=on \ -accel tcg \ -cpu 'qemu64,hv-time=on,hv-relaxed=on,hv-vapic=on,hv-spinlocks=0x80000000,hv-vpindex=on,hv-runtime=on,hv-synic=on,hv-stimer=on,hv-reset=on,hv-vendor-id=KVM Hv,hv-frequencies=on,hv-reenlightenment=on,hv-tlbflush=on,hv-tlbflush-direct=on,hv-tlbflush-ext=on,hv-ipi=on,hv-evmcs=on,hv-avic=on,hv-emsr-bitmap=on,hv-xmm-input=on' \ -m size=219136k \ @@ -26,7 +26,12 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ +-device '{"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}' \ +-device '{"driver":"pcie-pci-bridge","id":"pci.2","bus":"pci.1","addr":"0x0"}' \ +-device '{"driver":"pcie-root-port","port":9,"chassis":3,"id":"pci.3","bus":"pcie.0","addr":"0x1.0x1"}' \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.2","addr":"0x1"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ +-global ICH9-LPC.noreboot=off \ +-watchdog-action reset \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/hyperv.x86_64-latest.xml b/tests/qemuxmlconfdata/hyperv.x86_64-latest.xml index fdcab661a6..156bbfff21 100644 --- a/tests/qemuxmlconfdata/hyperv.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/hyperv.x86_64-latest.xml @@ -5,7 +5,7 @@ <currentMemory unit='KiB'>219100</currentMemory> <vcpu placement='static'>6</vcpu> <os> - <type arch='x86_64' machine='pc'>hvm</type> + <type arch='x86_64' machine='q35'>hvm</type> <boot dev='network'/> </os> <features> @@ -45,12 +45,30 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='usb' index='0' model='piix3-uhci'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/> + </controller> + <controller type='pci' index='0' model='pcie-root'/> + <controller type='pci' index='1' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='1' port='0x8'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/> + </controller> + <controller type='pci' index='2' model='pcie-to-pci-bridge'> + <model name='pcie-pci-bridge'/> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </controller> + <controller type='pci' index='3' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='3' port='0x9'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> + <controller type='sata' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> </controller> - <controller type='pci' index='0' model='pci-root'/> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> + <watchdog model='itco' action='reset'/> <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxmlconfdata/hyperv.xml b/tests/qemuxmlconfdata/hyperv.xml index 9a47dd0ec8..2a7d082153 100644 --- a/tests/qemuxmlconfdata/hyperv.xml +++ b/tests/qemuxmlconfdata/hyperv.xml @@ -5,7 +5,7 @@ <currentMemory unit='KiB'>219100</currentMemory> <vcpu placement='static'>6</vcpu> <os> - <type arch='x86_64' machine='pc'>hvm</type> + <type arch='x86_64' machine='q35'>hvm</type> <boot dev='network'/> </os> <features> @@ -42,7 +42,7 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='usb' index='0'/> - <controller type='pci' index='0' model='pci-root'/> + <controller type='pci' index='0' model='pcie-root'/> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <memballoon model='none'/> -- 2.52.0
With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
From: Michal Privoznik <mprivozn@redhat.com> Turns out, that synic hyperv enlightenment not always requires vpindex. Some (older) machine types (e.g. pc-i440fx-3.0, pc-i440fx-rhel7.6.0) can run with synic enabled and vpindex disabled. This is because they did enable 'x-hv-synic-kvm-only' CPU property, but starting from QEMU commit v3.1.0-rc0~44^2~9 the property is disabled by default. To avoid parsing machine type version, let's just skip this dependency validation for all i440fx machine types with a note to remove the limitation once affected machine types go out of support. Now, q35 has this dependency, although it might be not visible at the first glance. Inside of target/i386/kvm/kvm.c there's kvm_hyperv_properties[] array declared and in there HYPERV_FEAT_SYNIC doesn't have any .dependencies set. But looking couple of pages down at kvm_hyperv_expand_features() function, there's the following check: /* Additional dependencies not covered by kvm_hyperv_properties[] */ if (hyperv_feat_enabled(cpu, HYPERV_FEAT_SYNIC) && !cpu->hyperv_synic_kvm_only && !hyperv_feat_enabled(cpu, HYPERV_FEAT_VPINDEX)) { error_setg(errp, "Hyper-V %s requires Hyper-V %s", kvm_hyperv_properties[HYPERV_FEAT_SYNIC].desc, kvm_hyperv_properties[HYPERV_FEAT_VPINDEX].desc); return false; } And as noted above, 'hyperv_synic_kvm_only' is false by default. Resolves: https://gitlab.com/libvirt/libvirt/-/issues/837 Resolves: https://issues.redhat.com/browse/RHEL-138689 Fixes: 1822d030c32d9857020ee8385b0a8808a29a472f Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/qemu/qemu_validate.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index da08fd17cd..a8b1029d0c 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -112,7 +112,13 @@ qemuValidateDomainDefHypervFeatures(const virDomainDef *def) return -1; } - CHECK_HV_FEAT(VIR_DOMAIN_HYPERV_SYNIC, VIR_DOMAIN_HYPERV_VPINDEX); + if (!qemuDomainIsI440FX(def)) { + /* Some i440fx machine types don't have this dependency and unless we + * want to parse machine type version (we do not), just skip this + * check. The worst that'll happen is QEMU will error out later. + * TODO: Remove once pc-i440fx-3.0 is no longer supported. */ + CHECK_HV_FEAT(VIR_DOMAIN_HYPERV_SYNIC, VIR_DOMAIN_HYPERV_VPINDEX); + } if (def->hyperv.features[VIR_DOMAIN_HYPERV_STIMER] == VIR_TRISTATE_SWITCH_ON) { if (!virDomainDefHasTimer(def, VIR_DOMAIN_TIMER_NAME_HYPERVCLOCK)) { -- 2.52.0
On Tue, Jan 06, 2026 at 03:25:17PM +0100, Michal Privoznik via Devel wrote:
From: Michal Privoznik <mprivozn@redhat.com>
Turns out, that synic hyperv enlightenment not always requires vpindex. Some (older) machine types (e.g. pc-i440fx-3.0, pc-i440fx-rhel7.6.0) can run with synic enabled and vpindex disabled. This is because they did enable 'x-hv-synic-kvm-only' CPU property, but starting from QEMU commit v3.1.0-rc0~44^2~9 the property is disabled by default.
To avoid parsing machine type version, let's just skip this dependency validation for all i440fx machine types with a note to remove the limitation once affected machine types go out of support.
pc-q35-3.0 has the same behaviour as pc-i440fx-3.0, so it isn't accurate to say the problem is specific to i440fx. That is only the case in RHEL downstream since it strips out upstream machine types and none of RHEL q35 machine types in RHEL-9 are old enough to be affected.
Now, q35 has this dependency, although it might be not visible at the first glance. Inside of target/i386/kvm/kvm.c there's kvm_hyperv_properties[] array declared and in there HYPERV_FEAT_SYNIC doesn't have any .dependencies set. But looking couple of pages down at kvm_hyperv_expand_features() function, there's the following check:
/* Additional dependencies not covered by kvm_hyperv_properties[] */ if (hyperv_feat_enabled(cpu, HYPERV_FEAT_SYNIC) && !cpu->hyperv_synic_kvm_only && !hyperv_feat_enabled(cpu, HYPERV_FEAT_VPINDEX)) { error_setg(errp, "Hyper-V %s requires Hyper-V %s", kvm_hyperv_properties[HYPERV_FEAT_SYNIC].desc, kvm_hyperv_properties[HYPERV_FEAT_VPINDEX].desc); return false; }
And as noted above, 'hyperv_synic_kvm_only' is false by default.
Resolves: https://gitlab.com/libvirt/libvirt/-/issues/837 Resolves: https://issues.redhat.com/browse/RHEL-138689 Fixes: 1822d030c32d9857020ee8385b0a8808a29a472f Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/qemu/qemu_validate.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index da08fd17cd..a8b1029d0c 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -112,7 +112,13 @@ qemuValidateDomainDefHypervFeatures(const virDomainDef *def) return -1; }
- CHECK_HV_FEAT(VIR_DOMAIN_HYPERV_SYNIC, VIR_DOMAIN_HYPERV_VPINDEX); + if (!qemuDomainIsI440FX(def)) { + /* Some i440fx machine types don't have this dependency and unless we + * want to parse machine type version (we do not), just skip this + * check. The worst that'll happen is QEMU will error out later. + * TODO: Remove once pc-i440fx-3.0 is no longer supported. */ + CHECK_HV_FEAT(VIR_DOMAIN_HYPERV_SYNIC, VIR_DOMAIN_HYPERV_VPINDEX); + }
I think we need to remove this check entirely until we can depend on a QEMU upstream version that drops the -3.0 machine types. This happened in the QEMU 10.1.0 release which started automatically removing versioned machine types that were >= 18 versions / 6 years old. With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
On 1/6/26 15:39, Daniel P. Berrangé wrote:
On Tue, Jan 06, 2026 at 03:25:17PM +0100, Michal Privoznik via Devel wrote:
From: Michal Privoznik <mprivozn@redhat.com>
Turns out, that synic hyperv enlightenment not always requires vpindex. Some (older) machine types (e.g. pc-i440fx-3.0, pc-i440fx-rhel7.6.0) can run with synic enabled and vpindex disabled. This is because they did enable 'x-hv-synic-kvm-only' CPU property, but starting from QEMU commit v3.1.0-rc0~44^2~9 the property is disabled by default.
To avoid parsing machine type version, let's just skip this dependency validation for all i440fx machine types with a note to remove the limitation once affected machine types go out of support.
pc-q35-3.0 has the same behaviour as pc-i440fx-3.0, so it isn't accurate to say the problem is specific to i440fx. That is only the case in RHEL downstream since it strips out upstream machine types and none of RHEL q35 machine types in RHEL-9 are old enough to be affected.
Aaagrh. You're right.
Now, q35 has this dependency, although it might be not visible at the first glance. Inside of target/i386/kvm/kvm.c there's kvm_hyperv_properties[] array declared and in there HYPERV_FEAT_SYNIC doesn't have any .dependencies set. But looking couple of pages down at kvm_hyperv_expand_features() function, there's the following check:
/* Additional dependencies not covered by kvm_hyperv_properties[] */ if (hyperv_feat_enabled(cpu, HYPERV_FEAT_SYNIC) && !cpu->hyperv_synic_kvm_only && !hyperv_feat_enabled(cpu, HYPERV_FEAT_VPINDEX)) { error_setg(errp, "Hyper-V %s requires Hyper-V %s", kvm_hyperv_properties[HYPERV_FEAT_SYNIC].desc, kvm_hyperv_properties[HYPERV_FEAT_VPINDEX].desc); return false; }
And as noted above, 'hyperv_synic_kvm_only' is false by default.
Resolves: https://gitlab.com/libvirt/libvirt/-/issues/837 Resolves: https://issues.redhat.com/browse/RHEL-138689 Fixes: 1822d030c32d9857020ee8385b0a8808a29a472f Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/qemu/qemu_validate.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index da08fd17cd..a8b1029d0c 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -112,7 +112,13 @@ qemuValidateDomainDefHypervFeatures(const virDomainDef *def) return -1; }
- CHECK_HV_FEAT(VIR_DOMAIN_HYPERV_SYNIC, VIR_DOMAIN_HYPERV_VPINDEX); + if (!qemuDomainIsI440FX(def)) { + /* Some i440fx machine types don't have this dependency and unless we + * want to parse machine type version (we do not), just skip this + * check. The worst that'll happen is QEMU will error out later. + * TODO: Remove once pc-i440fx-3.0 is no longer supported. */ + CHECK_HV_FEAT(VIR_DOMAIN_HYPERV_SYNIC, VIR_DOMAIN_HYPERV_VPINDEX); + }
I think we need to remove this check entirely until we can depend on a QEMU upstream version that drops the -3.0 machine types. This happened in the QEMU 10.1.0 release which started automatically removing versioned machine types that were >= 18 versions / 6 years old.
Yeah. But bumping min QEMU version in libvirt to 10.1.0 is in far future. So removing this check makes only sense. Will post v2 shortly. Michal
From: Michal Privoznik <mprivozn@redhat.com> The original commit (v11.9.0-rc1~84) added a dependency checking of VIR_DOMAIN_HYPERV_STIMER on VIR_DOMAIN_HYPERV_VPINDEX (meaning, if stimer is on then vpindex must also be on). It justified this by citing QEMU documentation: Per QEMU documentation (docs/system/i386/hyperv.rst): ``hv-stimer`` Enables Hyper-V synthetic timers. <snip/> Requires: ``hv-vpindex``, ``hv-synic``, ``hv-time`` While the documentation is almost correct (see previous commit when it's incorrect), the code express no dependency on vpindex (kvm_hyperv_properties[] array from target/i386/kvm/kvm.c): [HYPERV_FEAT_STIMER] = { .desc = "synthetic timers (hv-stimer)", .flags = { {.func = HV_CPUID_FEATURES, .reg = R_EAX, .bits = HV_SYNTIMERS_AVAILABLE} }, .dependencies = BIT(HYPERV_FEAT_SYNIC) | BIT(HYPERV_FEAT_TIME) }, If transitivity is taken into account then the documentation is of course correct (minus that one aforementioned special case). Well, there's no need for us to implement transitional checks. VIR_DOMAIN_HYPERV_STIMER requires VIR_DOMAIN_HYPERV_SYNIC and whether that requires VIR_DOMAIN_HYPERV_VPINDEX is another question. Just drop the transitive check. Resolves: https://gitlab.com/libvirt/libvirt/-/issues/837 Resolves: https://issues.redhat.com/browse/RHEL-138689 Fixes: da261327ea94300d1aa2d3b76ba9dcd4de6160f6 Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/qemu/qemu_validate.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index a8b1029d0c..ed746ba8dc 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -130,7 +130,6 @@ qemuValidateDomainDefHypervFeatures(const virDomainDef *def) } } - CHECK_HV_FEAT(VIR_DOMAIN_HYPERV_STIMER, VIR_DOMAIN_HYPERV_VPINDEX); CHECK_HV_FEAT(VIR_DOMAIN_HYPERV_STIMER, VIR_DOMAIN_HYPERV_SYNIC); CHECK_HV_FEAT(VIR_DOMAIN_HYPERV_TLBFLUSH, VIR_DOMAIN_HYPERV_VPINDEX); -- 2.52.0
On Tue, Jan 06, 2026 at 03:25:18PM +0100, Michal Privoznik via Devel wrote:
From: Michal Privoznik <mprivozn@redhat.com>
The original commit (v11.9.0-rc1~84) added a dependency checking of VIR_DOMAIN_HYPERV_STIMER on VIR_DOMAIN_HYPERV_VPINDEX (meaning, if stimer is on then vpindex must also be on). It justified this by citing QEMU documentation:
Per QEMU documentation (docs/system/i386/hyperv.rst):
``hv-stimer`` Enables Hyper-V synthetic timers. <snip/>
Requires: ``hv-vpindex``, ``hv-synic``, ``hv-time``
While the documentation is almost correct (see previous commit when it's incorrect), the code express no dependency on vpindex (kvm_hyperv_properties[] array from target/i386/kvm/kvm.c):
[HYPERV_FEAT_STIMER] = { .desc = "synthetic timers (hv-stimer)", .flags = { {.func = HV_CPUID_FEATURES, .reg = R_EAX, .bits = HV_SYNTIMERS_AVAILABLE} }, .dependencies = BIT(HYPERV_FEAT_SYNIC) | BIT(HYPERV_FEAT_TIME) },
If transitivity is taken into account then the documentation is of course correct (minus that one aforementioned special case). Well, there's no need for us to implement transitional checks. VIR_DOMAIN_HYPERV_STIMER requires VIR_DOMAIN_HYPERV_SYNIC and whether that requires VIR_DOMAIN_HYPERV_VPINDEX is another question.
Just drop the transitive check.
Resolves: https://gitlab.com/libvirt/libvirt/-/issues/837 Resolves: https://issues.redhat.com/browse/RHEL-138689 Fixes: da261327ea94300d1aa2d3b76ba9dcd4de6160f6 Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/qemu/qemu_validate.c | 1 - 1 file changed, 1 deletion(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
participants (3)
-
Daniel P. Berrangé -
Michal Privoznik -
Michal Prívozník