* [Qemu-devel] X86 cpuid reported feature
@ 2015-02-06 18:54 Xin Tong
0 siblings, 0 replies; only message in thread
From: Xin Tong @ 2015-02-06 18:54 UTC (permalink / raw)
To: QEMU Developers
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;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-02-06 18:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-06 18:54 [Qemu-devel] X86 cpuid reported feature Xin Tong
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).