[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 10/21] target-i386: Move warning code outside x86_cpu
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [PULL 10/21] target-i386: Move warning code outside x86_cpu_filter_features() |
Date: |
Mon, 17 Oct 2016 15:51:27 -0200 |
x86_cpu_filter_features() will be reused by code that shouldn't
print any warning. Move the warning code to a new
x86_cpu_report_filtered_features() function, and call it from
x86_cpu_realizefn().
Reviewed-by: Igor Mammedov <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
---
target-i386/cpu.c | 28 +++++++++++++++++++---------
1 file changed, 19 insertions(+), 9 deletions(-)
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 61240dd..1e8127b 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -2177,9 +2177,6 @@ static int x86_cpu_filter_features(X86CPU *cpu)
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;
}
}
@@ -2187,6 +2184,15 @@ static int x86_cpu_filter_features(X86CPU *cpu)
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;
@@ -3080,12 +3086,16 @@ static void x86_cpu_realizefn(DeviceState *dev, Error
**errp)
env->cpuid_xlevel2 = env->cpuid_min_xlevel2;
}
- if (x86_cpu_filter_features(cpu) && cpu->enforce_cpuid) {
- error_setg(&local_err,
- kvm_enabled() ?
- "Host doesn't support requested features" :
- "TCG doesn't support requested features");
- goto out;
+ if (x86_cpu_filter_features(cpu) &&
+ (cpu->check_cpuid || cpu->enforce_cpuid)) {
+ x86_cpu_report_filtered_features(cpu);
+ if (cpu->enforce_cpuid) {
+ error_setg(&local_err,
+ kvm_enabled() ?
+ "Host doesn't support requested features" :
+ "TCG doesn't support requested features");
+ goto out;
+ }
}
/* On AMD CPUs, some CPUID[8000_0001].EDX bits must match the bits on
--
2.7.4
- [Qemu-devel] [PULL 01/21] tests: Add test case for x86 feature parsing compatibility, (continued)
- [Qemu-devel] [PULL 01/21] tests: Add test case for x86 feature parsing compatibility, Eduardo Habkost, 2016/10/17
- [Qemu-devel] [PULL 02/21] target-i386: List CPU models using subclass list, Eduardo Habkost, 2016/10/17
- [Qemu-devel] [PULL 03/21] target-i386: Disable VME by default with TCG, Eduardo Habkost, 2016/10/17
- [Qemu-devel] [PULL 04/21] target-i386: Register aliases for feature names with underscores, Eduardo Habkost, 2016/10/17
- [Qemu-devel] [PULL 06/21] target-i386: Remove underscores from feat_names arrays, Eduardo Habkost, 2016/10/17
- [Qemu-devel] [PULL 07/21] target-i386: Register properties for feature aliases manually, Eduardo Habkost, 2016/10/17
- [Qemu-devel] [PULL 05/21] target-i386: Make plus_features/minus_features QOM-based, Eduardo Habkost, 2016/10/17
- [Qemu-devel] [PULL 08/21] target-i386: xsave: Add FP and SSE bits to x86_ext_save_areas, Eduardo Habkost, 2016/10/17
- [Qemu-devel] [PULL 09/21] qmp: Add runnability information to query-cpu-definitions, Eduardo Habkost, 2016/10/17
- [Qemu-devel] [PULL 11/21] apic: add global apic_get_class(), Eduardo Habkost, 2016/10/17
- [Qemu-devel] [PULL 10/21] target-i386: Move warning code outside x86_cpu_filter_features(),
Eduardo Habkost <=
- [Qemu-devel] [PULL 12/21] apic: add send_msi() to APICCommonClass, Eduardo Habkost, 2016/10/17
- [Qemu-devel] [PULL 13/21] intel_iommu: pass whole remapped addresses to apic, Eduardo Habkost, 2016/10/17
- [Qemu-devel] [PULL 14/21] intel_iommu: redo configuraton check in realize, Eduardo Habkost, 2016/10/17
- [Qemu-devel] [PULL 15/21] intel_iommu: add OnOffAuto intr_eim as "eim" property, Eduardo Habkost, 2016/10/17
- [Qemu-devel] [PULL 16/21] intel_iommu: reject broken EIM, Eduardo Habkost, 2016/10/17
- [Qemu-devel] [PULL 18/21] target-i386: Unset cannot_destroy_with_object_finalize_yet, Eduardo Habkost, 2016/10/17
- [Qemu-devel] [PULL 19/21] target-i386: x86_cpu_load_features() function, Eduardo Habkost, 2016/10/17
- [Qemu-devel] [PULL 17/21] target-i386/kvm: cache the return value of kvm_enable_x2apic(), Eduardo Habkost, 2016/10/17
- [Qemu-devel] [PULL 21/21] target-i386: Don't use cpu->migratable when filtering features, Eduardo Habkost, 2016/10/17
- [Qemu-devel] [PULL 20/21] target-i386: Return runnability information on query-cpu-definitions, Eduardo Habkost, 2016/10/17