I am wondering why QEMU requires host CPU to support a feature for a emulated CPU to support the same feature. say i want to support intel transactional memory. I put the CPUID_7_0_EBX_RTM flag in the haswell cpu feature list. However, why do i need to put the same flag into TCG_7_0_EBX_FEATURES in order to make sure its not filtered out. I do not think we need RTM on the host to support RTM on the guest.
Thanks, Xin /* * Filters CPU feature words based on host availability of each feature. * * Returns: 0 if all flags are supported by the host, non-zero otherwise. */ static int x86_cpu_filter_features(X86CPU *cpu) { CPUX86State *env = &cpu->env; FeatureWord w; int rv = 0; for (w = 0; w < FEATURE_WORDS; w++) { uint32_t host_feat = x86_cpu_get_supported_feature_word(w, cpu->migratable); uint32_t requested_features = env->features[w]; env->features[w] &= host_feat; cpu->filtered_features[w] = requested_features & ~env->features[w]; if (cpu->filtered_features[w]) { if (cpu->check_cpuid || cpu->enforce_cpuid) { report_unavailable_features(w, cpu->filtered_features[w]); } rv = 1; } } return rv; }