cpu config: die on hotplug of non x86_64 CPUs When attempting a CPU hotplug on an architecture other than x86_64, die with a clean error instead of attempting a hotplug with a known non-working device command line. Also move the corresponding FIXME up to the error. Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
cpu config: implement is_native_arch locally for now could be a better fit in PVE::Tools, like proposed by Filip, but OTOH. Tools is already crowded as is, so wait if we need it on more places outside of qemu-server. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
cpu config: Unify the default value for 'kvm' Make the default value for 'kvm' consistent, taking into account whether the VM will run on the same CPU architecture as the host. This would be a breaking change to CPU hotplug for VMs with a different CPU architecture running on an x86_64 host, as in this case the default CPU type for CPU hotplug changes from 'kvm64' to 'qemu64'. However, CPU hotplug of non x86_64 architectures is not supported anyway, so this is not a breaking change after all. It should be noted that this change does alter the CPU hotplug behaviour when emulating an x86_64 CPU on a non-x86_64 host. This is however not officially supported in Proxmox VE. Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
prevent starting a 32-bit VM using a 64-bit OVMF BIOS Instead of starting a VM with a 32-bit CPU type and a 64-bit OVMF image, throw an error before starting the VM telling the user that OVMF is not supported on 32-bit CPU types. To obtain a list of 32-bit CPU types, refer to the builtin_x86_defs in target/i386/cpu.c of QEMU. Exclude any entries that have the long mode feature (CPUID_EXT2_LM). Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
cpuconfig: add new x86-64-vX models https://gitlab.com/x86-psABIs/x86-64-ABI/ https://lists.gnu.org/archive/html/qemu-devel/2021-06/msg01592.html " In 2020, AMD, Intel, Red Hat, and SUSE worked together to define three microarchitecture levels on top of the historical x86-64 baseline: * x86-64: original x86_64 baseline instruction set * x86-64-v2: vector instructions up to Streaming SIMD Extensions 4.2 (SSE4.2) and Supplemental Streaming SIMD Extensions 3 (SSSE3), the POPCNT instruction, and CMPXCHG16B * x86-64-v3: vector instructions up to AVX2, MOVBE, and additional bit-manipulation instructions. * x86-64-v4: vector instructions from some of the AVX-512 variants. " This patch add new builtin model derivated from qemu64 model, to be compatible between intel/amd. mandatory flags from qemu-doc generator: https://gitlab.com/qemu/qemu/-/blob/master/scripts/cpu-x86-uarch-abi.py levels = [ [ # x86-64 baseline "cmov", "cx8", "fpu", "fxsr", "mmx", "syscall", "sse", "sse2", ], [ # x86-64-v2 "cx16", "lahf-lm", "popcnt", "pni", "sse4.1", "sse4.2", "ssse3", ], [ # x86-64-v3 "avx", "avx2", "bmi1", "bmi2", "f16c", "fma", "abm", "movbe", "xsave" #missing from qemu doc currently ], [ # x86-64-v4 "avx512f", "avx512bw", "avx512cd", "avx512dq", "avx512vl", ], ] x86-64-v1 : I'm skipping it, as it's basicaly qemu64|kvm64 -vme,-cx16 for compat Opteron_G1 from 2004 so will use it as qemu64|kvm64 is higher are not working on opteron_g1 anyway x86-64-v2 : Derived from qemu, +popcnt;+pni;+sse4.1;+sse4.2;+ssse3 min intel: Nehalem min amd : Opteron_G3 x86-64-v2-AES : Derived from qemu, +aes;+popcnt;+pni;+sse4.1;+sse4.2;+ssse3 min intel: Westmere min amd : Opteron_G3 x86-64-v3 : Derived from qemu64 +aes;+popcnt;+pni;+sse4.1;+sse4.2;+ssse3;+avx;+avx2;+bmi1;+bmi2;+f16c;+fma;+abm;+movbe+xsave min intel: Haswell min amd : EPYC_v1 x86-64-v4 : Derived from qemu64 +aes;+popcnt;+pni;+sse4.1;+sse4.2;+ssse3;+avx;+avx2;+bmi1;+bmi2;+f16c;+fma;+abm;+movbe;+xsave;+avx512f;+avx512bw;+avx512cd;+avx512dq;+avx512vl min intel: Skylake min amd : EPYC_v4 Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
cpu config: fix depreacation mapping on CPU hotplug of custom types we need to do the independent of is_custom_model to ensure the reported model is understood by QEMU Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com> Reported-by: Fiona Ebner <f.ebner@proxmox.com>
cpu config: map depreacated IceLake-Client CPU type to IceLake-Server the former CPU type never existed on the market and will be dropped by QEMU 7.1, so map it to the server variant as they're pretty much identical anyway FIWCT. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
anchor CPU flag regex to avoid arbitrary flag suffixes Previously one could specify a CPU flag like 'pcidfoobar' and it would be accepted, even though we attempt to filter VM-only flags for security. AFAICT none of the flags we allow can be turned into any others just by appending text, but better safe than sorry. Reported-by: Oguz Bektas <o.bektas@proxmox.com> Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Add dot character to CPU commandline regular expression to be able to parse CPU features like "+sse4.2" correctly. Reported here: https://forum.proxmox.com/threads/zsf-snapshot-unable-to-parse-value-of-runningcpu-got-undefined-value.74094/ Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>