summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohamed Mediouni <mohamed@unpredictable.fr>2026-08-12 10:28:10 +0200
committerMichael Tokarev <mjt@tls.msk.ru>2026-08-24 10:51:38 +0300
commitfd87e7a8c544007beac5d8e69171aa7a6931f071 (patch)
treef382b77b02c152eb924069c59c27836673f87940
parent793bc2f82f90bc533f1d293f5219bad89c566055 (diff)
downloadqemu-fd87e7a8c544007beac5d8e69171aa7a6931f071.tar.gz
qemu-fd87e7a8c544007beac5d8e69171aa7a6931f071.zip
hw/i386: fw_cfg: do not set VMX feature control on WHPX
Hyper-V doesn't allow setting this bit on build 26100. Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr> Link: https://lore.kernel.org/r/20260812082814.27217-3-mohamed@unpredictable.fr Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> (cherry picked from commit 32452bac6d991e9778dd7a9fb2b3eed3a2b23d71) Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
-rw-r--r--hw/i386/fw_cfg.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c
index d422302c1c..5903994a7c 100644
--- a/hw/i386/fw_cfg.c
+++ b/hw/i386/fw_cfg.c
@@ -13,6 +13,8 @@
*/
#include "qemu/osdep.h"
+#include "system/mshv.h"
+#include "system/whpx.h"
#include "system/numa.h"
#include "hw/acpi/acpi.h"
#include "hw/acpi/aml-build.h"
@@ -182,8 +184,15 @@ void fw_cfg_build_feature_control(MachineState *ms, FWCfgState *fw_cfg)
uint64_t *val;
cpu_x86_cpuid(env, 1, 0, &unused, &unused, &ecx, &edx);
- if (ecx & CPUID_EXT_VMX) {
- feature_control_bits |= FEATURE_CONTROL_VMXON_ENABLED_OUTSIDE_SMX;
+
+ /*
+ * Hyper-V in 26100 disallows this bit to be set.
+ * Otherwise a #GP gets raised.
+ */
+ if (!(whpx_enabled())) {
+ if (ecx & CPUID_EXT_VMX) {
+ feature_control_bits |= FEATURE_CONTROL_VMXON_ENABLED_OUTSIDE_SMX;
+ }
}
if ((edx & (CPUID_EXT2_MCE | CPUID_EXT2_MCA)) ==