From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Jiri Denemark" <jdenemar@redhat.com>,
"Andreas Färber" <afaerber@suse.de>,
"Igor Mammedov" <imammedo@redhat.com>,
libvir-list@redhat.com
Subject: [Qemu-devel] [PATCH v2 3/6] target-i386: Define CPUID filtering functions before x86_cpu_list()
Date: Mon, 6 Jun 2016 17:05:40 -0300 [thread overview]
Message-ID: <1465243543-889-4-git-send-email-ehabkost@redhat.com> (raw)
In-Reply-To: <1465243543-889-1-git-send-email-ehabkost@redhat.com>
Just move code to another place so the it can be reused by the
query-cpu-definitions code.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
target-i386/cpu.c | 68 +++++++++++++++++++++++++++----------------------------
1 file changed, 34 insertions(+), 34 deletions(-)
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index bd815f3..f455d3d 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -2018,6 +2018,40 @@ static void x86_cpu_parse_featurestr(CPUState *cs, char *features,
}
}
+/*
+ * 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]) {
+ rv = 1;
+ }
+ }
+
+ return rv;
+}
+
+static void x86_cpu_report_filtered_features(X86CPU *cpu)
+{
+ FeatureWord w;
+
+ for (w = 0; w < FEATURE_WORDS; w++) {
+ report_unavailable_features(w, cpu->filtered_features[w]);
+ }
+}
+
/* Print all cpuid feature names in featureset
*/
static void listflags(FILE *f, fprintf_function print, const char **featureset)
@@ -2147,40 +2181,6 @@ static uint32_t x86_cpu_get_supported_feature_word(FeatureWord w,
return r;
}
-/*
- * 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]) {
- rv = 1;
- }
- }
-
- return rv;
-}
-
-static void x86_cpu_report_filtered_features(X86CPU *cpu)
-{
- FeatureWord w;
-
- for (w = 0; w < FEATURE_WORDS; w++) {
- report_unavailable_features(w, cpu->filtered_features[w]);
- }
-}
-
static void x86_cpu_apply_props(X86CPU *cpu, PropValue *props)
{
PropValue *pv;
--
2.5.5
next prev parent reply other threads:[~2016-06-06 20:06 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-06 20:05 [Qemu-devel] [PATCH v2 0/6] Add runnability info to query-cpu-definitions Eduardo Habkost
2016-06-06 20:05 ` [Qemu-devel] [PATCH v2 1/6] target-i386: List CPU models using subclass list Eduardo Habkost
2016-06-06 20:05 ` [Qemu-devel] [PATCH v2 2/6] target-i386: Move warning code outside x86_cpu_filter_features() Eduardo Habkost
2016-06-06 20:05 ` Eduardo Habkost [this message]
2016-06-06 20:05 ` [Qemu-devel] [PATCH v2 4/6] qmp: Add runnability information to query-cpu-definitions Eduardo Habkost
2016-06-09 13:54 ` Jiri Denemark
2016-06-09 13:57 ` Eduardo Habkost
2016-06-22 9:00 ` Markus Armbruster
2016-06-22 17:15 ` Eduardo Habkost
2016-06-23 7:10 ` Markus Armbruster
2016-06-06 20:05 ` [Qemu-devel] [PATCH v2 5/6] target-i386: Use "-" instead of "_" on all feature names Eduardo Habkost
2016-06-06 20:05 ` [Qemu-devel] [PATCH v2 6/6] target-i386: Return runnability information on query-cpu-definitions Eduardo Habkost
2016-06-20 20:09 ` [Qemu-devel] [PATCH v2 0/6] Add runnability info to query-cpu-definitions Eduardo Habkost
2016-06-21 13:16 ` Jiri Denemark
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=1465243543-889-4-git-send-email-ehabkost@redhat.com \
--to=ehabkost@redhat.com \
--cc=afaerber@suse.de \
--cc=imammedo@redhat.com \
--cc=jdenemar@redhat.com \
--cc=libvir-list@redhat.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).