* [PATCH pve-qemu v2 0/2] include Hyper-V enlightenments in
@ 2026-06-01 7:08 Arthur Bied-Charreton
2026-06-01 7:08 ` [PATCH v2 1/2] build: include Hyper-V enlightenments in CPUID flags list Arthur Bied-Charreton
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Arthur Bied-Charreton @ 2026-06-01 7:08 UTC (permalink / raw)
To: pve-devel
In the context of custom CPU models, the hv-* flags are not part of the
base list at all. This means they don't show up in the selector, not
even as unsupported, making it impossible to set them without manually
editing cpu-models.conf.
Until now, this base list was generated from the '-cpu help' output at
pve-qemu-kvm build time [0].
The first patch refactors the script parsing CPU flags to additionally
include the Hyper-V enlightenments by sourcing the flags from the
qom-list-properties QMP command instead, blacklisting unwanted
properties this new source would add.
The second patch pins the resulting flag list into the repository and
fails the build on any divergence, as already done for CPU models. This
ensures flag additions/removals are surfaced for review on QEMU bumps.
[0] https://git.proxmox.com/?p=pve-qemu.git;a=blob;f=debian/rules;h=c90db29b0f03568224b1c79431bce2b753283a4d;hb=refs/heads/master#l126
Arthur Bied-Charreton (2):
build: include Hyper-V enlightenments in CPUID flags list
build: fail when recognized CPUID flags list changes
debian/parse-cpu-flags.pl | 125 +++++++-
debian/recognized-CPUID-flags-x86_64 | 430 +++++++++++++++++++++++++++
debian/rules | 6 +-
3 files changed, 547 insertions(+), 14 deletions(-)
create mode 100644 debian/recognized-CPUID-flags-x86_64
--
2.47.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 1/2] build: include Hyper-V enlightenments in CPUID flags list
2026-06-01 7:08 [PATCH pve-qemu v2 0/2] include Hyper-V enlightenments in Arthur Bied-Charreton
@ 2026-06-01 7:08 ` Arthur Bied-Charreton
2026-06-02 12:14 ` Fiona Ebner
2026-06-01 7:08 ` [PATCH v2 2/2] build: fail when recognized CPUID flags list changes Arthur Bied-Charreton
2026-06-03 7:12 ` superseded: [PATCH pve-qemu v2 0/2] include Hyper-V enlightenments in Arthur Bied-Charreton
2 siblings, 1 reply; 7+ messages in thread
From: Arthur Bied-Charreton @ 2026-06-01 7:08 UTC (permalink / raw)
To: pve-devel
... by sourcing CPU flags from qom-list-properties.
The recognized-CPUID-flags-x86_64 list is generated from QEMU's '-cpu
help' output, which does not advertise Hyper-V enlightenments. Source
the flags from the qom-list-properties QMP command instead to include
them.
Keep only boolean properties, since the custom CPU models config only
supports enable/disable. qom-list-properties also exposes boolean
properties that are neither CPUID flags nor 'hv-*' enlightenments,
exclude those with a static blacklist that must be reviewed on QEMU
bumps.
Also add a trailing newline to the generated output.
Suggested-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Arthur Bied-Charreton <a.bied-charreton@proxmox.com>
---
debian/parse-cpu-flags.pl | 125 ++++++++++++++++++++++++++++++++++----
debian/rules | 2 +-
2 files changed, 113 insertions(+), 14 deletions(-)
diff --git a/debian/parse-cpu-flags.pl b/debian/parse-cpu-flags.pl
index 1847b3e..517ee0a 100755
--- a/debian/parse-cpu-flags.pl
+++ b/debian/parse-cpu-flags.pl
@@ -1,23 +1,122 @@
#!/usr/bin/perl
-use warnings;
-use strict;
+use v5.36;
-my @flags = ();
-my $got_flags_section;
+use IPC::Open2;
+use JSON;
-while (<STDIN>) {
- if (/^\s*Recognized CPUID flags:/) {
- $got_flags_section = 1;
- next;
+my ($qemu_bin) = @ARGV;
+
+my $pid = open2(
+ my $out,
+ my $in,
+ $qemu_bin,
+ '-machine',
+ 'none',
+ '-display',
+ 'none',
+ '-S',
+ '-qmp',
+ 'stdio',
+ '-nodefaults',
+);
+
+sub qmp($cmd, %args) {
+ print $in encode_json({ execute => $cmd, %args ? (arguments => \%args) : () }), "\n";
+ while (my $line = <$out>) {
+ my $msg = decode_json($line);
+ next if $msg->{event};
+ return $msg->{return} if exists($msg->{return});
+ die "QMP error: " . encode_json($msg->{error}) if $msg->{error};
}
- next if !$got_flags_section;
+}
+
+# qemu/target/i386/cpu.c, x86_cpu_initfn()
+my $qemu_cpu_flag_alias_map = {
+ sse3 => 'pni',
+ pclmuldq => 'pclmulqdq',
+ 'sse4-1' => 'sse4.1',
+ 'sse4-2' => 'sse4.2',
+ xd => 'nx',
+ ffxsr => 'fxsr-opt',
+ i64 => 'lm',
+ ds_cpl => 'ds-cpl',
+ tsc_adjust => 'tsc-adjust',
+ fxsr_opt => 'fxsr-opt',
+ lahf_lm => 'lahf-lm',
+ cmp_legacy => 'cmp-legacy',
+ nodeid_msr => 'nodeid-msr',
+ perfctr_core => 'perfctr-core',
+ perfctr_nb => 'perfctr-nb',
+ kvm_nopiodelay => 'kvm-nopiodelay',
+ kvm_mmu => 'kvm-mmu',
+ kvm_asyncpf => 'kvm-asyncpf',
+ kvm_asyncpf_int => 'kvm-asyncpf-int',
+ kvm_steal_time => 'kvm-steal-time',
+ kvm_pv_eoi => 'kvm-pv-eoi',
+ kvm_pv_unhalt => 'kvm-pv-unhalt',
+ kvm_poll_control => 'kvm-poll-control',
+ svm_lock => 'svm-lock',
+ nrip_save => 'nrip-save',
+ tsc_scale => 'tsc-scale',
+ vmcb_clean => 'vmcb-clean',
+ pause_filter => 'pause-filter',
+ sse4_1 => 'sse4.1',
+ sse4_2 => 'sse4.2',
+ 'hv-apicv' => 'hv-avic',
+ lbr_fmt => 'lbr-fmt',
+};
+
+# Static blacklist to be reviewed on QEMU bumps.
+# Currently includes boolean properties from qom-list-properties that are neither CPUID
+# flags ('-cpu help') nor Hyper-V enlightenments ('hv-*').
+my $blacklist = {
+ check => 1,
+ 'cpuid-0xb' => 1,
+ enforce => 1,
+ 'fill-mtrr-mask' => 1,
+ 'host-cache-info' => 1,
+ 'host-phys-bits' => 1,
+ hotpluggable => 1,
+ hotplugged => 1,
+ kvm => 1,
+ 'kvm-pv-enforce-cpuid' => 1,
+ 'l3-cache' => 1,
+ 'legacy-cache' => 1,
+ 'legacy-multi-node' => 1,
+ lmce => 1,
+ migratable => 1,
+ pmu => 1,
+ realized => 1,
+ 'start-powered-off' => 1,
+ 'tcg-cpuid' => 1,
+ 'vmware-cpuid-freq' => 1,
+ 'x-amd-topoext-features-only' => 1,
+ 'x-arch-cap-always-on' => 1,
+ 'x-consistent-cache' => 1,
+ 'x-force-cpuid-0x1f' => 1,
+ 'x-force-features' => 1,
+ 'x-l1-cache-per-thread' => 1,
+ 'x-migrate-error-code' => 1,
+ 'x-migrate-smi-count' => 1,
+ 'x-pdcm-on-even-without-pmu' => 1,
+ 'x-vendor-cpuid-only' => 1,
+ 'x-vendor-cpuid-only-v2' => 1,
+ 'xen-vapic' => 1,
+};
- s/^\s+//;
+my $flags = {};
- push @flags, split(/\s+/);
+<$out>;
+qmp('qmp_capabilities');
+my $props = qmp('qom-list-properties', typename => 'host-x86_64-cpu');
+for my $qo ($props->@*) {
+ next if $qo->{type} ne 'bool' || defined($blacklist->{$qo->{name}});
+ $flags->{$qemu_cpu_flag_alias_map->{$qo->{name}} // $qo->{name}} = 1;
}
+qmp('quit');
+waitpid($pid, 0);
-die "no QEMU/KVM CPU flags detected from STDIN input" if scalar (@flags) <= 0;
+my @flags = sort keys $flags->%*;
-print join("\n", @flags) or die "$!\n";
+print join("\n", @flags) . "\n" or die "$!\n";
diff --git a/debian/rules b/debian/rules
index c90db29..b2eed71 100755
--- a/debian/rules
+++ b/debian/rules
@@ -123,7 +123,7 @@ install: build
rm -f $(destdir)/usr/lib/kvm/virtfs-proxy-helper
# CPU flags are static for QEMU version, allows avoiding more costly checks
- $(destdir)/usr/bin/qemu-system-x86_64 -cpu help | ./debian/parse-cpu-flags.pl > $(flagfile)
+ ./debian/parse-cpu-flags.pl $(destdir)/usr/bin/qemu-system-x86_64 > $(flagfile)
# Supported machine versions are static for a given QEMU binary.
$(destdir)/usr/bin/qemu-system-x86_64 -machine help | ./debian/parse-machines.pl > $(machine_file_x86_64)
--
2.47.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 2/2] build: fail when recognized CPUID flags list changes
2026-06-01 7:08 [PATCH pve-qemu v2 0/2] include Hyper-V enlightenments in Arthur Bied-Charreton
2026-06-01 7:08 ` [PATCH v2 1/2] build: include Hyper-V enlightenments in CPUID flags list Arthur Bied-Charreton
@ 2026-06-01 7:08 ` Arthur Bied-Charreton
2026-06-03 7:12 ` superseded: [PATCH pve-qemu v2 0/2] include Hyper-V enlightenments in Arthur Bied-Charreton
2 siblings, 0 replies; 7+ messages in thread
From: Arthur Bied-Charreton @ 2026-06-01 7:08 UTC (permalink / raw)
To: pve-devel
Check in the current recognized CPUID flags list and fail the build if
the list newly generated by parse-cpu-flags.pl differs from it.
This forces new or removed flags to be manually reviewed instead of
being silently picked up on QEMU bumps and mirrors the existing
approach for CPU models.
Suggested-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Arthur Bied-Charreton <a.bied-charreton@proxmox.com>
---
debian/recognized-CPUID-flags-x86_64 | 430 +++++++++++++++++++++++++++
debian/rules | 4 +
2 files changed, 434 insertions(+)
create mode 100644 debian/recognized-CPUID-flags-x86_64
diff --git a/debian/recognized-CPUID-flags-x86_64 b/debian/recognized-CPUID-flags-x86_64
new file mode 100644
index 0000000..0a0119f
--- /dev/null
+++ b/debian/recognized-CPUID-flags-x86_64
@@ -0,0 +1,430 @@
+3dnow
+3dnowext
+3dnowprefetch
+abm
+ace2
+ace2-en
+acpi
+adx
+aes
+amd-no-ssb
+amd-psfd
+amd-ssbd
+amd-stibp
+amx-avx512
+amx-bf16
+amx-bf16-alias
+amx-complex
+amx-complex-alias
+amx-fp16
+amx-fp16-alias
+amx-fp8
+amx-int8
+amx-int8-alias
+amx-movrs
+amx-tf32
+amx-tile
+apic
+apx-nci-ndd-nf
+apxf
+arat
+arch-capabilities
+arch-lbr
+auto-ibrs
+avic
+avx
+avx-ifma
+avx-ne-convert
+avx-vnni
+avx-vnni-int16
+avx-vnni-int8
+avx10
+avx10-128
+avx10-256
+avx10-512
+avx10-vnni-int
+avx2
+avx512-4fmaps
+avx512-4vnniw
+avx512-bf16
+avx512-fp16
+avx512-vp2intersect
+avx512-vpopcntdq
+avx512bitalg
+avx512bw
+avx512cd
+avx512dq
+avx512er
+avx512f
+avx512ifma
+avx512pf
+avx512vbmi
+avx512vbmi2
+avx512vl
+avx512vnni
+bhi-ctrl
+bhi-no
+bmi1
+bmi2
+bus-lock-detect
+cet-ibt
+cet-ss
+cid
+cldemote
+clflush
+clflushopt
+clwb
+clzero
+cmov
+cmp-legacy
+cmpccxadd
+core-capability
+cr8legacy
+cx16
+cx8
+dca
+ddpd-u
+de
+decodeassists
+ds
+ds-cpl
+dtes64
+eraps
+erms
+est
+extapic
+f16c
+fb-clear
+fbsdp-no
+fdp-excptn-only
+flush-l1d
+flushbyasid
+fma
+fma4
+fpu
+fred
+fs-gs-base-ns
+fsgsbase
+fsrc
+fsrm
+fsrs
+full-width-write
+fxsr
+fxsr-opt
+fzrm
+gds-no
+gfni
+gmet
+hle
+ht
+hv-avic
+hv-crash
+hv-emsr-bitmap
+hv-enforce-cpuid
+hv-evmcs
+hv-frequencies
+hv-ipi
+hv-passthrough
+hv-reenlightenment
+hv-relaxed
+hv-reset
+hv-runtime
+hv-stimer
+hv-stimer-direct
+hv-syndbg
+hv-synic
+hv-time
+hv-tlbflush
+hv-tlbflush-direct
+hv-tlbflush-ext
+hv-vapic
+hv-vpindex
+hv-xmm-input
+hypervisor
+ia64
+ibpb
+ibpb-brtype
+ibrs
+ibrs-all
+ibs
+intel-psfd
+intel-pt
+intel-pt-lip
+invpcid
+invtsc
+ipred-ctrl
+its-no
+kvm-asyncpf
+kvm-asyncpf-int
+kvm-asyncpf-vmexit
+kvm-hint-dedicated
+kvm-mmu
+kvm-msi-ext-dest-id
+kvm-nopiodelay
+kvm-poll-control
+kvm-pv-eoi
+kvm-pv-ipi
+kvm-pv-sched-yield
+kvm-pv-tlb-flush
+kvm-pv-unhalt
+kvm-steal-time
+kvmclock
+kvmclock-stable-bit
+la57
+lahf-lm
+lam
+lbrv
+lfence-always-serializing
+lkgs
+lm
+lwp
+mca
+mcdt-no
+mce
+md-clear
+mds-no
+misalignsse
+mmx
+mmxext
+monitor
+movbe
+movdir64b
+movdiri
+movrs
+mpx
+msr
+msr-imm
+mtrr
+no-nested-data-bp
+nodeid-msr
+npt
+nrip-save
+null-sel-clr-base
+nx
+osvw
+overflow-recov
+pae
+pat
+pause-filter
+pbe
+pbrsb-no
+pcid
+pclmulqdq
+pcommit
+pdcm
+pdpe1gb
+perfctr-core
+perfctr-nb
+perfmon-v2
+pfthreshold
+pge
+phe
+phe-en
+pks
+pku
+pmm
+pmm-en
+pn
+pni
+popcnt
+prefetchi
+prefetchiti
+pschange-mc-no
+psdp-no
+pse
+pse36
+rdctl-no
+rdpid
+rdrand
+rdseed
+rdtscp
+rfds-clear
+rfds-no
+rrsba-ctrl
+rsba
+rtm
+sbdr-ssdp-no
+sbpb
+sep
+serialize
+sgx
+sgx-aex-notify
+sgx-debug
+sgx-edeccssa
+sgx-exinfo
+sgx-kss
+sgx-mode64
+sgx-provisionkey
+sgx-tokenkey
+sgx1
+sgx2
+sgxlc
+sha-ni
+sha512
+skinit
+skip-l1dfl-vmentry
+sm3
+sm4
+smap
+smep
+smx
+spec-ctrl
+split-lock-detect
+srso-no
+srso-user-kernel-no
+ss
+ssb-no
+ssbd
+sse
+sse2
+sse4.1
+sse4.2
+sse4a
+ssse3
+stibp
+stibp-always-on
+succor
+svm
+svm-lock
+svme-addr-chk
+syscall
+taa-no
+tbm
+tce
+tm
+tm2
+topoext
+tsa-l1-no
+tsa-sq-no
+tsc
+tsc-adjust
+tsc-deadline
+tsc-scale
+tsx-ctrl
+tsx-ldtrk
+umip
+v-vmsave-vmload
+vaes
+verw-clear
+vgif
+virt-ssbd
+vmcb-clean
+vme
+vmx
+vmx-activity-hlt
+vmx-activity-shutdown
+vmx-activity-wait-sipi
+vmx-any-errcode
+vmx-apicv-register
+vmx-apicv-vid
+vmx-apicv-x2apic
+vmx-apicv-xapic
+vmx-cr3-load-noexit
+vmx-cr3-store-noexit
+vmx-cr8-load-exit
+vmx-cr8-store-exit
+vmx-desc-exit
+vmx-enable-user-wait-pause
+vmx-encls-exit
+vmx-entry-ia32e-mode
+vmx-entry-load-bndcfgs
+vmx-entry-load-cet
+vmx-entry-load-efer
+vmx-entry-load-fred
+vmx-entry-load-pat
+vmx-entry-load-perf-global-ctrl
+vmx-entry-load-pkrs
+vmx-entry-load-rtit-ctl
+vmx-entry-noload-debugctl
+vmx-ept
+vmx-ept-1gb
+vmx-ept-2mb
+vmx-ept-advanced-exitinfo
+vmx-ept-execonly
+vmx-eptad
+vmx-eptp-switching
+vmx-exit-ack-intr
+vmx-exit-clear-bndcfgs
+vmx-exit-clear-rtit-ctl
+vmx-exit-load-efer
+vmx-exit-load-pat
+vmx-exit-load-perf-global-ctrl
+vmx-exit-load-pkrs
+vmx-exit-nosave-debugctl
+vmx-exit-save-cet
+vmx-exit-save-efer
+vmx-exit-save-pat
+vmx-exit-save-preemption-timer
+vmx-exit-secondary-ctls
+vmx-flexpriority
+vmx-hlt-exit
+vmx-ins-outs
+vmx-intr-exit
+vmx-invept
+vmx-invept-all-context
+vmx-invept-single-context
+vmx-invept-single-context-noglobals
+vmx-invlpg-exit
+vmx-invpcid-exit
+vmx-invvpid
+vmx-invvpid-all-context
+vmx-invvpid-single-addr
+vmx-io-bitmap
+vmx-io-exit
+vmx-mbec
+vmx-monitor-exit
+vmx-movdr-exit
+vmx-msr-bitmap
+vmx-mtf
+vmx-mwait-exit
+vmx-nested-exception
+vmx-nmi-exit
+vmx-page-walk-4
+vmx-page-walk-5
+vmx-pause-exit
+vmx-ple
+vmx-pml
+vmx-posted-intr
+vmx-preemption-timer
+vmx-rdpmc-exit
+vmx-rdrand-exit
+vmx-rdseed-exit
+vmx-rdtsc-exit
+vmx-rdtscp-exit
+vmx-secondary-ctls
+vmx-shadow-vmcs
+vmx-store-lma
+vmx-true-ctls
+vmx-tsc-offset
+vmx-tsc-scaling
+vmx-unrestricted-guest
+vmx-vintr-pending
+vmx-vmfunc
+vmx-vmwrite-vmexit-fields
+vmx-vnmi
+vmx-vnmi-pending
+vmx-vpid
+vmx-wbinvd-exit
+vmx-xsaves
+vmx-zero-len-inject
+vnmi
+vpclmulqdq
+waitpkg
+wbnoinvd
+wdt
+wrmsrns
+x2apic
+xcrypt
+xcrypt-en
+xfd
+xgetbv1
+xop
+xsave
+xsavec
+xsaveerptr
+xsaveopt
+xsaves
+xstore
+xstore-en
+xtpr
+zero-fcs-fds
diff --git a/debian/rules b/debian/rules
index b2eed71..1d57a98 100755
--- a/debian/rules
+++ b/debian/rules
@@ -124,6 +124,10 @@ install: build
# CPU flags are static for QEMU version, allows avoiding more costly checks
./debian/parse-cpu-flags.pl $(destdir)/usr/bin/qemu-system-x86_64 > $(flagfile)
+ # NOTE: If the diff fails here after upgrading the QEMU submodule, check which new flags
+ # are to be picked up and which are to be excluded, adapt to other changes and commit the
+ # new expected file (and parse-cpu-flags.pl script if that changed as well).
+ diff -u $(flagfile) ./debian/recognized-CPUID-flags-x86_64
# Supported machine versions are static for a given QEMU binary.
$(destdir)/usr/bin/qemu-system-x86_64 -machine help | ./debian/parse-machines.pl > $(machine_file_x86_64)
--
2.47.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/2] build: include Hyper-V enlightenments in CPUID flags list
2026-06-01 7:08 ` [PATCH v2 1/2] build: include Hyper-V enlightenments in CPUID flags list Arthur Bied-Charreton
@ 2026-06-02 12:14 ` Fiona Ebner
2026-06-02 13:13 ` Arthur Bied-Charreton
0 siblings, 1 reply; 7+ messages in thread
From: Fiona Ebner @ 2026-06-02 12:14 UTC (permalink / raw)
To: Arthur Bied-Charreton, pve-devel
Am 01.06.26 um 9:16 AM schrieb Arthur Bied-Charreton:
> +# Static blacklist to be reviewed on QEMU bumps.
> +# Currently includes boolean properties from qom-list-properties that are neither CPUID
> +# flags ('-cpu help') nor Hyper-V enlightenments ('hv-*').
> +my $blacklist = {
Maybe {filtered,non-flag}-{,props,bools) is a more telling name?
> + check => 1,
> + 'cpuid-0xb' => 1,
> + enforce => 1,
> + 'fill-mtrr-mask' => 1,
> + 'host-cache-info' => 1,
> + 'host-phys-bits' => 1,
> + hotpluggable => 1,
> + hotplugged => 1,
> + kvm => 1,
> + 'kvm-pv-enforce-cpuid' => 1,
> + 'l3-cache' => 1,
> + 'legacy-cache' => 1,
> + 'legacy-multi-node' => 1,
> + lmce => 1,
> + migratable => 1,
> + pmu => 1,
> + realized => 1,
> + 'start-powered-off' => 1,
> + 'tcg-cpuid' => 1,
> + 'vmware-cpuid-freq' => 1,
> + 'x-amd-topoext-features-only' => 1,
> + 'x-arch-cap-always-on' => 1,
> + 'x-consistent-cache' => 1,
> + 'x-force-cpuid-0x1f' => 1,
> + 'x-force-features' => 1,
> + 'x-l1-cache-per-thread' => 1,
> + 'x-migrate-error-code' => 1,
> + 'x-migrate-smi-count' => 1,
> + 'x-pdcm-on-even-without-pmu' => 1,
> + 'x-vendor-cpuid-only' => 1,
> + 'x-vendor-cpuid-only-v2' => 1,
> + 'xen-vapic' => 1,
> +};
>
> - s/^\s+//;
> +my $flags = {};
>
> - push @flags, split(/\s+/);
> +<$out>;
Nit: Could match the beginning of the line to see that it's the single
QMP message we expect. And die if there is anything else for catching
any unexpected warnings/messages.
> +qmp('qmp_capabilities');
> +my $props = qmp('qom-list-properties', typename => 'host-x86_64-cpu');
This won't work on aarch64. There, typename should be 'max-x86_64-cpu'.
All the same flags are still present with that model, with the exception
of 'hv-syndbg'. The reason is that this depends on CONFIG_SYNDBG which
is only enabled if kvm is present (which is not when the architecture
mismatches). So either we must consider a second list just for that, or
my preferred approach, just filter that one out. It's just a special
debug flag, which devs can still turn on via args if they really need
to. For some context:
> target/i386: Exclude 'hv-syndbg' from 'hv-passthrough'
>
> Windows with Hyper-V role enabled doesn't boot with 'hv-passthrough' when
> no debugger is configured, this significantly limits the usefulness of the
> feature as there's no support for subtracting Hyper-V features from CPU
> flags at this moment (e.g. "-cpu host,hv-passthrough,-hv-syndbg" does not
> work). While this is also theoretically fixable, 'hv-syndbg' is likely
> very special and unneeded in the default set. Genuine Hyper-V doesn't seem
> to enable it either.
>
> Introduce 'skip_passthrough' flag to 'kvm_hyperv_properties' and use it as
> one-off to skip 'hv-syndbg' when enabling features in 'hv-passthrough'
> mode. Note, "-cpu host,hv-passthrough,hv-syndbg" can still be used if
> needed.
>
> As both 'hv-passthrough' and 'hv-syndbg' are debug features, the change
> should not have any effect on production environments.
Because, all flag properties are still present, I think we can just use
'max-x86_64-cpu' as the typename on x86_64 hosts too. Should there
really be an important flag missing from max-x86_64-cpu but present in
host-x86_64-cpu, we can still adapt then.
What we might want to do already is pass in the typename via ARGV and
group the filter list by typename. Then we'll have an easier time if we
need to generate flags for other archs too.
> +for my $qo ($props->@*) {
> + next if $qo->{type} ne 'bool' || defined($blacklist->{$qo->{name}});
> + $flags->{$qemu_cpu_flag_alias_map->{$qo->{name}} // $qo->{name}} = 1;
Style nit: avoid putting the big expression into the hash access, but
factor it out as a variable.
> }
> +qmp('quit');
> +waitpid($pid, 0);
>
> -die "no QEMU/KVM CPU flags detected from STDIN input" if scalar (@flags) <= 0;
> +my @flags = sort keys $flags->%*;
>
> -print join("\n", @flags) or die "$!\n";
> +print join("\n", @flags) . "\n" or die "$!\n";
The latter half of the expression is dead code.
> diff --git a/debian/rules b/debian/rules
> index c90db29..b2eed71 100755
> --- a/debian/rules
> +++ b/debian/rules
> @@ -123,7 +123,7 @@ install: build
> rm -f $(destdir)/usr/lib/kvm/virtfs-proxy-helper
>
> # CPU flags are static for QEMU version, allows avoiding more costly checks
> - $(destdir)/usr/bin/qemu-system-x86_64 -cpu help | ./debian/parse-cpu-flags.pl > $(flagfile)
> + ./debian/parse-cpu-flags.pl $(destdir)/usr/bin/qemu-system-x86_64 > $(flagfile)
>
> # Supported machine versions are static for a given QEMU binary.
> $(destdir)/usr/bin/qemu-system-x86_64 -machine help | ./debian/parse-machines.pl > $(machine_file_x86_64)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/2] build: include Hyper-V enlightenments in CPUID flags list
2026-06-02 12:14 ` Fiona Ebner
@ 2026-06-02 13:13 ` Arthur Bied-Charreton
2026-06-02 13:34 ` Fiona Ebner
0 siblings, 1 reply; 7+ messages in thread
From: Arthur Bied-Charreton @ 2026-06-02 13:13 UTC (permalink / raw)
To: Fiona Ebner; +Cc: pve-devel
On Tue, Jun 02, 2026 at 02:14:05PM +0200, Fiona Ebner wrote:
> Am 01.06.26 um 9:16 AM schrieb Arthur Bied-Charreton:
> > +# Static blacklist to be reviewed on QEMU bumps.
> > +# Currently includes boolean properties from qom-list-properties that are neither CPUID
> > +# flags ('-cpu help') nor Hyper-V enlightenments ('hv-*').
> > +my $blacklist = {
>
> Maybe {filtered,non-flag}-{,props,bools) is a more telling name?
>
ack, went with $filtered_props :)
> > + check => 1,
> > + 'cpuid-0xb' => 1,
> > + enforce => 1,
> > + 'fill-mtrr-mask' => 1,
> > + 'host-cache-info' => 1,
> > + 'host-phys-bits' => 1,
> > + hotpluggable => 1,
[...]
> > +};
> >
> > - s/^\s+//;
> > +my $flags = {};
> >
> > - push @flags, split(/\s+/);
> > +<$out>;
>
> Nit: Could match the beginning of the line to see that it's the single
> QMP message we expect. And die if there is anything else for catching
> any unexpected warnings/messages.
>
just to clarify, by beginning of the line you just mean the QMP key in
the return object right?
```
{"QMP": {"version": {"qemu": {"micro": 0, "minor": 0, "major": 11}, "package": "pve-qemu-kvm_11.0.0-4"}, "capabilities": []}}
```
or do you want to fail on new pve-qemu-kvm versions?
> > +qmp('qmp_capabilities');
> > +my $props = qmp('qom-list-properties', typename => 'host-x86_64-cpu');
>
> This won't work on aarch64. There, typename should be 'max-x86_64-cpu'.
thanks for catching that, I was not aware.
> All the same flags are still present with that model, with the exception
> of 'hv-syndbg'. The reason is that this depends on CONFIG_SYNDBG which
> is only enabled if kvm is present (which is not when the architecture
> mismatches). So either we must consider a second list just for that, or
> my preferred approach, just filter that one out. It's just a special
> debug flag, which devs can still turn on via args if they really need
> to. For some context:
>
> > target/i386: Exclude 'hv-syndbg' from 'hv-passthrough'
> >
> > Windows with Hyper-V role enabled doesn't boot with 'hv-passthrough' when
> > no debugger is configured, this significantly limits the usefulness of the
> > feature as there's no support for subtracting Hyper-V features from CPU
> > flags at this moment (e.g. "-cpu host,hv-passthrough,-hv-syndbg" does not
> > work). While this is also theoretically fixable, 'hv-syndbg' is likely
> > very special and unneeded in the default set. Genuine Hyper-V doesn't seem
> > to enable it either.
> >
> > Introduce 'skip_passthrough' flag to 'kvm_hyperv_properties' and use it as
> > one-off to skip 'hv-syndbg' when enabling features in 'hv-passthrough'
> > mode. Note, "-cpu host,hv-passthrough,hv-syndbg" can still be used if
> > needed.
> >
> > As both 'hv-passthrough' and 'hv-syndbg' are debug features, the change
> > should not have any effect on production environments.
thanks for the context! I agree with just leaving it out.
>
> Because, all flag properties are still present, I think we can just use
> 'max-x86_64-cpu' as the typename on x86_64 hosts too. Should there
> really be an important flag missing from max-x86_64-cpu but present in
> host-x86_64-cpu, we can still adapt then.
>
> What we might want to do already is pass in the typename via ARGV and
> group the filter list by typename. Then we'll have an easier time if we
> need to generate flags for other archs too.
>
yes, just tried that model, that makes sense. will implement this in v3.
> > +for my $qo ($props->@*) {
> > + next if $qo->{type} ne 'bool' || defined($blacklist->{$qo->{name}});
> > + $flags->{$qemu_cpu_flag_alias_map->{$qo->{name}} // $qo->{name}} = 1;
>
> Style nit: avoid putting the big expression into the hash access, but
> factor it out as a variable.
>
ack
> > }
> > +qmp('quit');
> > +waitpid($pid, 0);
> >
> > -die "no QEMU/KVM CPU flags detected from STDIN input" if scalar (@flags) <= 0;
> > +my @flags = sort keys $flags->%*;
> >
> > -print join("\n", @flags) or die "$!\n";
> > +print join("\n", @flags) . "\n" or die "$!\n";
>
> The latter half of the expression is dead code.
>
thanks for the heads-up :)
> > diff --git a/debian/rules b/debian/rules
> > index c90db29..b2eed71 100755
> > --- a/debian/rules
> > +++ b/debian/rules
> > @@ -123,7 +123,7 @@ install: build
> > rm -f $(destdir)/usr/lib/kvm/virtfs-proxy-helper
> >
> > # CPU flags are static for QEMU version, allows avoiding more costly checks
> > - $(destdir)/usr/bin/qemu-system-x86_64 -cpu help | ./debian/parse-cpu-flags.pl > $(flagfile)
> > + ./debian/parse-cpu-flags.pl $(destdir)/usr/bin/qemu-system-x86_64 > $(flagfile)
> >
> > # Supported machine versions are static for a given QEMU binary.
> > $(destdir)/usr/bin/qemu-system-x86_64 -machine help | ./debian/parse-machines.pl > $(machine_file_x86_64)
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/2] build: include Hyper-V enlightenments in CPUID flags list
2026-06-02 13:13 ` Arthur Bied-Charreton
@ 2026-06-02 13:34 ` Fiona Ebner
0 siblings, 0 replies; 7+ messages in thread
From: Fiona Ebner @ 2026-06-02 13:34 UTC (permalink / raw)
To: Arthur Bied-Charreton; +Cc: pve-devel
Am 02.06.26 um 3:13 PM schrieb Arthur Bied-Charreton:
> On Tue, Jun 02, 2026 at 02:14:05PM +0200, Fiona Ebner wrote:
>> Am 01.06.26 um 9:16 AM schrieb Arthur Bied-Charreton:
>>> +};
>>>
>>> - s/^\s+//;
>>> +my $flags = {};
>>>
>>> - push @flags, split(/\s+/);
>>> +<$out>;
>>
>> Nit: Could match the beginning of the line to see that it's the single
>> QMP message we expect. And die if there is anything else for catching
>> any unexpected warnings/messages.
>>
> just to clarify, by beginning of the line you just mean the QMP key in
> the return object right?
>
> ```
> {"QMP": {"version": {"qemu": {"micro": 0, "minor": 0, "major": 11}, "package": "pve-qemu-kvm_11.0.0-4"}, "capabilities": []}}
> ```
Yes, just that there's a QMP JSON info line, I would even say, the
contents don't matter too much here ^^
> or do you want to fail on new pve-qemu-kvm versions?
No.
^ permalink raw reply [flat|nested] 7+ messages in thread
* superseded: [PATCH pve-qemu v2 0/2] include Hyper-V enlightenments in
2026-06-01 7:08 [PATCH pve-qemu v2 0/2] include Hyper-V enlightenments in Arthur Bied-Charreton
2026-06-01 7:08 ` [PATCH v2 1/2] build: include Hyper-V enlightenments in CPUID flags list Arthur Bied-Charreton
2026-06-01 7:08 ` [PATCH v2 2/2] build: fail when recognized CPUID flags list changes Arthur Bied-Charreton
@ 2026-06-03 7:12 ` Arthur Bied-Charreton
2 siblings, 0 replies; 7+ messages in thread
From: Arthur Bied-Charreton @ 2026-06-03 7:12 UTC (permalink / raw)
To: pve-devel
Superseded-by: https://lore.proxmox.com/pve-devel/20260603070857.184709-1-a.bied-charreton@proxmox.com/T/#t
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-06-03 7:13 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-01 7:08 [PATCH pve-qemu v2 0/2] include Hyper-V enlightenments in Arthur Bied-Charreton
2026-06-01 7:08 ` [PATCH v2 1/2] build: include Hyper-V enlightenments in CPUID flags list Arthur Bied-Charreton
2026-06-02 12:14 ` Fiona Ebner
2026-06-02 13:13 ` Arthur Bied-Charreton
2026-06-02 13:34 ` Fiona Ebner
2026-06-01 7:08 ` [PATCH v2 2/2] build: fail when recognized CPUID flags list changes Arthur Bied-Charreton
2026-06-03 7:12 ` superseded: [PATCH pve-qemu v2 0/2] include Hyper-V enlightenments in Arthur Bied-Charreton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.