I've run another test after creating a custom CPU type which is host minus the specific two flags that the OP
@Kobayashi_Bairuo claimed were the source of the issue, md-clear and flush-l1d:
Code:
❯ cat /etc/pve/virtual-guest/cpu-models.conf
cpu-model: host-windows-workaround
flags -md-clear;-flush-l1d
phys-bits host
hidden 0
hv-vendor-id proxmox
reported-model host
Unfortunately, disabling
only these two flags does not result in the same improvement in my Windows guest's performance that using x86_64-v3 does, so I suspect that something in the details of OP's analysis was incorrect. (But don't misunderstand me, I definitely appreciate OP's findings!)
I'm far from certain, but I would guess that the source of the error is from attempting to directly compare the CPU flag names from /proc/cpuinfo with QEMU's supported CPU flag names as reported by
qemu-system-x86_64 -cpu help
, which seem to have slightly different spellings in many cases. For example, cpuinfo reports
md_clear
, but QEMU spells it
md-clear
. I manually compared the flags reported by cpuinfo for host, Skylake-Client-v4, and x86_64-v3, but could not clearly identify corresponding QEMU flags for a handful of my i7-14700k's cpuinfo-reported flags (
ibrs_enhanced tpr_shadow flexpriority ept ept_ad ospke
) that were not in Skylake-Client-v4, and that was before attempting to match up all the vmx flags.
A reasonably safe and proper fix that keeps nested virtualization working while fixing performance is still unclear to me at this point, and I don't love the idea of fiddling with individual CPU flags that I don't individually understand the impact of.
Skylake-Client-v4
seems to be a closer fit for my host CPU's flags than
x86_64-v3
and does still have good performance, so I guess my next step is to attempt to add on the right nested virtualization flags and see what that does.
If anyone knows...should I worry about trying to match my host's vmx flags closely, or is something simpler like
Skylake-Client-v4,+vmx
likely to be ok? There are quite a few vmx flags reported by cpuinfo for the host CPU:
Code:
processor : 27
vendor_id : GenuineIntel
cpu family : 6
model : 183
model name : Intel(R) Core(TM) i7-14700K
stepping : 1
microcode : 0x12f
cpu MHz : 4300.014
cache size : 33792 KB
physical id : 0
siblings : 28
core id : 43
cpu cores : 20
apicid : 86
initial apicid : 86
fpu : yes
fpu_exception : yes
cpuid level : 32
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves split_lock_detect user_shstk avx_vnni dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req hfi vnmi umip pku ospke waitpkg gfni vaes vpclmulqdq tme rdpid movdiri movdir64b fsrm md_clear serialize pconfig arch_lbr ibt flush_l1d arch_capabilities
vmx flags : vnmi preemption_timer posted_intr invvpid ept_x_only ept_ad ept_1gb flexpriority apicv tsc_offset vtpr mtf vapic ept vpid unrestricted_guest vapic_reg vid ple shadow_vmcs ept_mode_based_exec tsc_scaling usr_wait_pause
bugs : spectre_v1 spectre_v2 spec_store_bypass swapgs eibrs_pbrsb rfds bhi
bogomips : 6835.20
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management: