From: Xin Tong <trent.tong@gmail.com>
To: QEMU Developers <qemu-devel@nongnu.org>
Subject: [Qemu-devel] X86 cpuid reported feature
Date: Fri, 6 Feb 2015 10:54:49 -0800 [thread overview]
Message-ID: <CA+JLOitG15LYfBjqMO1h0vOMKyvsaNtz23_ci4VJKh91ihzttA@mail.gmail.com> (raw)
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;
}
reply other threads:[~2015-02-06 18:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CA+JLOitG15LYfBjqMO1h0vOMKyvsaNtz23_ci4VJKh91ihzttA@mail.gmail.com \
--to=trent.tong@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).