* [PATCH] target/i386: Fix CPU feature dependency check
@ 2022-07-08 5:42 Zhenzhong Duan
0 siblings, 0 replies; only message in thread
From: Zhenzhong Duan @ 2022-07-08 5:42 UTC (permalink / raw)
To: qemu-devel; +Cc: pbonzini, ehabkost
While in other call site "x-force-features" takes effect to keep
the CPU feature even though not supported for any reason.
This isn't consistent while expanding features, Fixed to keep user
explicitly enabled features if "x-force-features" is specified.
Fixes: 99e24dbdaa682 ("target/i386: introduce generic feature dependency mechanism")
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
---
target/i386/cpu.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 6a57ef13af86..b64c0b37f0cb 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -6206,6 +6206,9 @@ void x86_cpu_expand_features(X86CPU *cpu, Error **errp)
unavailable_features & env->user_features[d->to.index],
"This feature depends on other features that were not requested");
+ if (cpu->force_features) {
+ unavailable_features &= ~env->user_features[d->to.index];
+ }
env->features[d->to.index] &= ~unavailable_features;
}
}
--
2.25.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-07-08 5:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-08 5:42 [PATCH] target/i386: Fix CPU feature dependency check Zhenzhong Duan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).