On Mon, Aug 24, 2015 at 11:17:04AM +0200, Peter Lieven wrote: > this patch adds a probe that lists all enforceable and migrateable > CPU models to the -cpu help output. The idea is to know a priory > which CPU modules can be exposed to the user without loosing any > feature flags. > > Signed-off-by: Peter Lieven <p...@kamp.de> [...] > +/* > + * Check if the CPU Definition is enforcable on the current host CPU > + * and contains no unmigratable flags. > + * > + * Returns: true if the CPU can be enforced and migrated. > + */ > +static bool x86_cpu_enforce_and_migratable(X86CPUDefinition *def) > +{ > + int i; > + for (i = 0; i < ARRAY_SIZE(feature_word_info); i++) { > + FeatureWordInfo *fw = &feature_word_info[i]; > + uint32_t eax, ebx, ecx, edx, host; > + host_cpuid(fw->cpuid_eax, 0, &eax, &ebx, &ecx, &edx);
This isn't how you check if the CPU model can run in "enforce" mode. Please read x86_cpu_filter_features(). Also, you can't tell if a CPU model is runnable in enforce mode unless you know what's the accelerator being used (see x86_cpu_filter_features()). How do you suggest we show accelerator-specific information in help output? -- Eduardo