[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 11/37] target-i386: introduce vendor-override static
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [PATCH 11/37] target-i386: introduce vendor-override static property |
Date: |
Mon, 22 Oct 2012 17:02:57 +0200 |
currently 'cpuid_vendor_override' can be set only via cmd line cpu_model
string. But setting it in 'vendor' property prevents using 'vendor'
property on its own without setting cpuid_vendor_override.
So fix/remove enabling cpuid_vendor_override from "vendor" property setter.
It's up-to cpu_model string parser to maintain legacy behavior when user
overrides vendor on command line.
- cpuid_vendor_override is converted to uint32_t so it could be used with
DEFINE_PROP_BIT()
Signed-off-by: Igor Mammedov <address@hidden>
---
target-i386/cpu.c | 6 ++++--
target-i386/cpu.h | 2 +-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 4bbfe9b..fa974e7 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -218,6 +218,7 @@ static Property cpu_x86_properties[] = {
DEFINE_PROP_BIT("f-pfthreshold", X86CPU, env.cpuid_svm_features, 12,
false),
DEFINE_PROP_BIT("f-smep", X86CPU, env.cpuid_7_0_ebx_features, 7, false),
DEFINE_PROP_BIT("f-smap", X86CPU, env.cpuid_7_0_ebx_features, 20, false),
+ DEFINE_PROP_BIT("vendor-override", X86CPU, env.cpuid_vendor_override, 0,
false),
DEFINE_PROP_END_OF_LIST(),
};
@@ -1136,7 +1137,6 @@ static void x86_cpuid_set_vendor(Object *obj, const char
*value,
env->cpuid_vendor2 |= ((uint8_t)value[i + 4]) << (8 * i);
env->cpuid_vendor3 |= ((uint8_t)value[i + 8]) << (8 * i);
}
- env->cpuid_vendor_override = 1;
}
static char *x86_cpuid_get_model_id(Object *obj, Error **errp)
@@ -1220,7 +1220,9 @@ static void cpudef_2_x86_cpu(X86CPU *cpu, x86_def_t *def,
Error **errp)
env->cpuid_vendor2 = CPUID_VENDOR_INTEL_2;
env->cpuid_vendor3 = CPUID_VENDOR_INTEL_3;
}
- env->cpuid_vendor_override = def->vendor_override;
+ if (def->vendor_override) {
+ object_property_set_bool(OBJECT(cpu), true, "vendor-override", errp);
+ }
object_property_set_int(OBJECT(cpu), def->level, "level", errp);
object_property_set_int(OBJECT(cpu), def->family, "family", errp);
object_property_set_int(OBJECT(cpu), def->model, "model", errp);
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index 7903413..69f8691 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -788,7 +788,7 @@ typedef struct CPUX86State {
uint32_t cpuid_ext2_features;
uint32_t cpuid_ext3_features;
uint32_t cpuid_apic_id;
- int cpuid_vendor_override;
+ uint32_t cpuid_vendor_override;
/* Store the results of Centaur's CPUID instructions */
uint32_t cpuid_xlevel2;
uint32_t cpuid_ext4_features;
--
1.7.11.7
- [Qemu-devel] [PATCH 02/37] target-i386: cpu_x86_register(): report error from property setter, (continued)
- [Qemu-devel] [PATCH 02/37] target-i386: cpu_x86_register(): report error from property setter, Igor Mammedov, 2012/10/22
- [Qemu-devel] [PATCH 10/37] target-i386: parse cpu_model string into set of stringified properties, Igor Mammedov, 2012/10/22
- [Qemu-devel] [PATCH 01/37] target-i386: return Error from cpu_x86_find_by_name(), Igor Mammedov, 2012/10/22
- [Qemu-devel] [PATCH 03/37] target-i386: if x86_cpu_realize() failed report error and do cleanup, Igor Mammedov, 2012/10/22
- [Qemu-devel] [PATCH 13/37] target-i386: convert "level" to static property, Igor Mammedov, 2012/10/22
- [Qemu-devel] [PATCH 06/37] add visitor for parsing hz[KMG] input string, Igor Mammedov, 2012/10/22
- [Qemu-devel] [PATCH 14/37] target-i386: postpone cpuid_level update to realize time, Igor Mammedov, 2012/10/22
- [Qemu-devel] [PATCH 08/37] target-i386: define static properties for cpuid features, Igor Mammedov, 2012/10/22
- [Qemu-devel] [PATCH 21/37] target-i386: convert 'hv_relaxed' to static property, Igor Mammedov, 2012/10/22
- [Qemu-devel] [PATCH 11/37] target-i386: introduce vendor-override static property,
Igor Mammedov <=
- [Qemu-devel] [PATCH 28/37] target-i386: convert "model-id" to static property, Igor Mammedov, 2012/10/22
- [Qemu-devel] [PATCH 20/37] target-i386: convert 'hv_spinlocks' to static property, Igor Mammedov, 2012/10/22
- [Qemu-devel] [PATCH 19/37] qdev: add DEFINE_ABSTRACT_PROP() helper, Igor Mammedov, 2012/10/22
- [Qemu-devel] [PATCH 34/37] qdev: introduce QDEV_FIND_PROP_FROM_BIT and qdev_prop_find_bit(), Igor Mammedov, 2012/10/22
- [Qemu-devel] [PATCH 25/37] target-i386: replace uint32_t vendor fields by vendor string in x86_def_t, Igor Mammedov, 2012/10/22
- [Qemu-devel] [PATCH 23/37] target-i386: convert 'check' and 'enforce' to static properties, Igor Mammedov, 2012/10/22
- [Qemu-devel] [PATCH 36/37] target-i386: use static properties to list CPUID features, Igor Mammedov, 2012/10/22