* [Qemu-devel] [PATCH 0/6] i386: Add "max" CPU model to TCG and KVM
@ 2017-01-19 21:04 Eduardo Habkost
2017-01-19 21:04 ` [Qemu-devel] [PATCH 1/6] i386: Unset cannot_destroy_with_object_finalize_yet on "host" model Eduardo Habkost
` (8 more replies)
0 siblings, 9 replies; 13+ messages in thread
From: Eduardo Habkost @ 2017-01-19 21:04 UTC (permalink / raw)
To: qemu-devel
Cc: Richard W.M. Jones, David Hildenbrand, Cornelia Huck,
Daniel P. Berrange, Peter Maydell, Igor Mammedov, Jiri Denemark,
Richard Henderson, Christian Borntraeger, Jason J. Herne,
Paolo Bonzini
This is v2 of the previous series that enabled the "host" CPU
model on TCG. Now a new "max" CPU is being added, while keeping
"host" KVM-specific.
In addition to simply adding "max" as a copy of the existing
"host" CPU model, additional patches change it to not use any
host CPUID information when in TCG mode.
---
Cc: "Richard W.M. Jones" <rjones@redhat.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: "Daniel P. Berrange" <berrange@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Jiri Denemark <jdenemar@redhat.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: "Jason J. Herne" <jjherne@linux.vnet.ibm.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Eduardo Habkost (6):
i386: Unset cannot_destroy_with_object_finalize_yet on "host" model
i386: Add ordering field to CPUClass
i386: Rename X86CPU::host_features to X86CPU::max_features
i386: Create "max" CPU model
i386: Make "max" model not use any host CPUID info on TCG
i386: Don't set CPUClass::cpu_def on "max" model
target/i386/cpu-qom.h | 6 ++-
target/i386/cpu.h | 2 +-
target/i386/cpu.c | 110 +++++++++++++++++++++++++++++---------------------
3 files changed, 71 insertions(+), 47 deletions(-)
--
2.11.0.259.g40922b1
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH 1/6] i386: Unset cannot_destroy_with_object_finalize_yet on "host" model
2017-01-19 21:04 [Qemu-devel] [PATCH 0/6] i386: Add "max" CPU model to TCG and KVM Eduardo Habkost
@ 2017-01-19 21:04 ` Eduardo Habkost
2017-02-22 18:21 ` Eduardo Habkost
2017-01-19 21:04 ` [Qemu-devel] [PATCH 2/6] i386: Add ordering field to CPUClass Eduardo Habkost
` (7 subsequent siblings)
8 siblings, 1 reply; 13+ messages in thread
From: Eduardo Habkost @ 2017-01-19 21:04 UTC (permalink / raw)
To: qemu-devel
The class is now safe because the assert(kvm_enabled()) line was
removed by commit e435601058e656e6d24e3e87b187e5518f7bf16a.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
target/i386/cpu.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index cff23e129d..7947c8737c 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -1571,8 +1571,6 @@ static void host_x86_cpu_class_init(ObjectClass *oc, void *data)
*/
dc->props = host_x86_cpu_properties;
- /* Reason: host_x86_cpu_initfn() dies when !kvm_enabled() */
- dc->cannot_destroy_with_object_finalize_yet = true;
}
static void host_x86_cpu_initfn(Object *obj)
--
2.11.0.259.g40922b1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH 2/6] i386: Add ordering field to CPUClass
2017-01-19 21:04 [Qemu-devel] [PATCH 0/6] i386: Add "max" CPU model to TCG and KVM Eduardo Habkost
2017-01-19 21:04 ` [Qemu-devel] [PATCH 1/6] i386: Unset cannot_destroy_with_object_finalize_yet on "host" model Eduardo Habkost
@ 2017-01-19 21:04 ` Eduardo Habkost
2017-02-22 18:22 ` Eduardo Habkost
2017-01-19 21:04 ` [Qemu-devel] [PATCH 3/6] i386: Rename X86CPU::host_features to X86CPU::max_features Eduardo Habkost
` (6 subsequent siblings)
8 siblings, 1 reply; 13+ messages in thread
From: Eduardo Habkost @ 2017-01-19 21:04 UTC (permalink / raw)
To: qemu-devel
Instead of using kvm_enabled to order the "-cpu help" list, use a
new "ordering" field for that.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
target/i386/cpu-qom.h | 2 ++
target/i386/cpu.c | 8 ++++----
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/target/i386/cpu-qom.h b/target/i386/cpu-qom.h
index 8cd607e9a2..14abd0a8c1 100644
--- a/target/i386/cpu-qom.h
+++ b/target/i386/cpu-qom.h
@@ -48,6 +48,7 @@ typedef struct X86CPUDefinition X86CPUDefinition;
* X86CPUClass:
* @cpu_def: CPU model definition
* @kvm_required: Whether CPU model requires KVM to be enabled.
+ * @ordering: Ordering on the "-cpu help" CPU model list.
* @migration_safe: See CpuDefinitionInfo::migration_safe
* @parent_realize: The parent class' realize handler.
* @parent_reset: The parent class' reset handler.
@@ -63,6 +64,7 @@ typedef struct X86CPUClass {
X86CPUDefinition *cpu_def;
bool kvm_required;
+ int ordering;
bool migration_safe;
/* Optional description of CPU model.
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 7947c8737c..0c6d8d605e 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -1550,6 +1550,7 @@ static void host_x86_cpu_class_init(ObjectClass *oc, void *data)
uint32_t eax = 0, ebx = 0, ecx = 0, edx = 0;
xcc->kvm_required = true;
+ xcc->ordering = 9;
host_cpuid(0x0, 0, &eax, &ebx, &ecx, &edx);
x86_cpu_vendor_words2str(host_cpudef.vendor, ebx, edx, ecx);
@@ -2127,7 +2128,7 @@ static void listflags(FILE *f, fprintf_function print, const char **featureset)
}
}
-/* Sort alphabetically by type name, listing kvm_required models last. */
+/* Sort alphabetically by type name, respecting X86CPUClass::ordering. */
static gint x86_cpu_list_compare(gconstpointer a, gconstpointer b)
{
ObjectClass *class_a = (ObjectClass *)a;
@@ -2136,9 +2137,8 @@ static gint x86_cpu_list_compare(gconstpointer a, gconstpointer b)
X86CPUClass *cc_b = X86_CPU_CLASS(class_b);
const char *name_a, *name_b;
- if (cc_a->kvm_required != cc_b->kvm_required) {
- /* kvm_required items go last */
- return cc_a->kvm_required ? 1 : -1;
+ if (cc_a->ordering != cc_b->ordering) {
+ return cc_a->ordering - cc_b->ordering;
} else {
name_a = object_class_get_name(class_a);
name_b = object_class_get_name(class_b);
--
2.11.0.259.g40922b1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH 3/6] i386: Rename X86CPU::host_features to X86CPU::max_features
2017-01-19 21:04 [Qemu-devel] [PATCH 0/6] i386: Add "max" CPU model to TCG and KVM Eduardo Habkost
2017-01-19 21:04 ` [Qemu-devel] [PATCH 1/6] i386: Unset cannot_destroy_with_object_finalize_yet on "host" model Eduardo Habkost
2017-01-19 21:04 ` [Qemu-devel] [PATCH 2/6] i386: Add ordering field to CPUClass Eduardo Habkost
@ 2017-01-19 21:04 ` Eduardo Habkost
2017-02-22 18:23 ` Eduardo Habkost
2017-01-19 21:04 ` [Qemu-devel] [PATCH 4/6] i386: Create "max" CPU model Eduardo Habkost
` (5 subsequent siblings)
8 siblings, 1 reply; 13+ messages in thread
From: Eduardo Habkost @ 2017-01-19 21:04 UTC (permalink / raw)
To: qemu-devel
Rename the field and add a small comment to make its purpose
clearer.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
target/i386/cpu.h | 2 +-
target/i386/cpu.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 10c5a3538d..889363e120 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -1211,7 +1211,7 @@ struct X86CPU {
bool enforce_cpuid;
bool expose_kvm;
bool migratable;
- bool host_features;
+ bool max_features; /* Enable all supported features automatically */
uint32_t apic_id;
/* if true the CPUID code directly forward host cache leaves to the guest */
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 0c6d8d605e..006d0a8b70 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -1583,7 +1583,7 @@ static void host_x86_cpu_initfn(Object *obj)
/* We can't fill the features array here because we don't know yet if
* "migratable" is true or false.
*/
- cpu->host_features = true;
+ cpu->max_features = true;
/* If KVM is disabled, x86_cpu_realizefn() will report an error later */
if (kvm_enabled()) {
@@ -3102,12 +3102,12 @@ static void x86_cpu_load_features(X86CPU *cpu, Error **errp)
GList *l;
Error *local_err = NULL;
- /*TODO: cpu->host_features incorrectly overwrites features
+ /*TODO: cpu->max_features incorrectly overwrites features
* set using "feat=on|off". Once we fix this, we can convert
* plus_features & minus_features to global properties
* inside x86_cpu_parse_featurestr() too.
*/
- if (cpu->host_features) {
+ if (cpu->max_features) {
for (w = 0; w < FEATURE_WORDS; w++) {
env->features[w] =
x86_cpu_get_supported_feature_word(w, cpu->migratable);
--
2.11.0.259.g40922b1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH 4/6] i386: Create "max" CPU model
2017-01-19 21:04 [Qemu-devel] [PATCH 0/6] i386: Add "max" CPU model to TCG and KVM Eduardo Habkost
` (2 preceding siblings ...)
2017-01-19 21:04 ` [Qemu-devel] [PATCH 3/6] i386: Rename X86CPU::host_features to X86CPU::max_features Eduardo Habkost
@ 2017-01-19 21:04 ` Eduardo Habkost
2017-01-19 21:04 ` [Qemu-devel] [PATCH 5/6] i386: Make "max" model not use any host CPUID info on TCG Eduardo Habkost
` (4 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: Eduardo Habkost @ 2017-01-19 21:04 UTC (permalink / raw)
To: qemu-devel
Rename the existing "host" CPU model to "max, and set it to
kvm_enabled=false. The new "max" CPU model will be able to enable
all features supported by TCG out of the box, because its logic
is based on x86_cpu_get_supported_feature_word(), which already
works with TCG.
A new KVM-specific "host" class was added, that simply inherits
everything from "max" except the 'ordering' and 'description'
fields.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
target/i386/cpu.c | 42 +++++++++++++++++++++++++++++-------------
1 file changed, 29 insertions(+), 13 deletions(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 006d0a8b70..6f3a62840f 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -1503,8 +1503,6 @@ void x86_cpu_change_kvm_default(const char *prop, const char *value)
static uint32_t x86_cpu_get_supported_feature_word(FeatureWord w,
bool migratable_only);
-#ifdef CONFIG_KVM
-
static bool lmce_supported(void)
{
uint64_t mce_cap;
@@ -1533,23 +1531,22 @@ static int cpu_x86_fill_model_id(char *str)
static X86CPUDefinition host_cpudef;
-static Property host_x86_cpu_properties[] = {
+static Property max_x86_cpu_properties[] = {
DEFINE_PROP_BOOL("migratable", X86CPU, migratable, true),
DEFINE_PROP_BOOL("host-cache-info", X86CPU, cache_info_passthrough, false),
DEFINE_PROP_END_OF_LIST()
};
-/* class_init for the "host" CPU model
+/* class_init for the "max" CPU model
*
* This function may be called before KVM is initialized.
*/
-static void host_x86_cpu_class_init(ObjectClass *oc, void *data)
+static void max_x86_cpu_class_init(ObjectClass *oc, void *data)
{
DeviceClass *dc = DEVICE_CLASS(oc);
X86CPUClass *xcc = X86_CPU_CLASS(oc);
uint32_t eax = 0, ebx = 0, ecx = 0, edx = 0;
- xcc->kvm_required = true;
xcc->ordering = 9;
host_cpuid(0x0, 0, &eax, &ebx, &ecx, &edx);
@@ -1564,17 +1561,16 @@ static void host_x86_cpu_class_init(ObjectClass *oc, void *data)
xcc->cpu_def = &host_cpudef;
xcc->model_description =
- "KVM processor with all supported host features "
- "(only available in KVM mode)";
+ "Enables all features supported by the accelerator in the current host";
/* level, xlevel, xlevel2, and the feature words are initialized on
* instance_init, because they require KVM to be initialized.
*/
- dc->props = host_x86_cpu_properties;
+ dc->props = max_x86_cpu_properties;
}
-static void host_x86_cpu_initfn(Object *obj)
+static void max_x86_cpu_initfn(Object *obj)
{
X86CPU *cpu = X86_CPU(obj);
CPUX86State *env = &cpu->env;
@@ -1585,7 +1581,6 @@ static void host_x86_cpu_initfn(Object *obj)
*/
cpu->max_features = true;
- /* If KVM is disabled, x86_cpu_realizefn() will report an error later */
if (kvm_enabled()) {
env->cpuid_min_level =
kvm_arch_get_supported_cpuid(s, 0x0, 0, R_EAX);
@@ -1602,10 +1597,30 @@ static void host_x86_cpu_initfn(Object *obj)
object_property_set_bool(OBJECT(cpu), true, "pmu", &error_abort);
}
+static const TypeInfo max_x86_cpu_type_info = {
+ .name = X86_CPU_TYPE_NAME("max"),
+ .parent = TYPE_X86_CPU,
+ .instance_init = max_x86_cpu_initfn,
+ .class_init = max_x86_cpu_class_init,
+};
+
+#ifdef CONFIG_KVM
+
+static void host_x86_cpu_class_init(ObjectClass *oc, void *data)
+{
+ X86CPUClass *xcc = X86_CPU_CLASS(oc);
+
+ xcc->kvm_required = true;
+ xcc->ordering = 8;
+
+ xcc->model_description =
+ "KVM processor with all supported host features "
+ "(only available in KVM mode)";
+}
+
static const TypeInfo host_x86_cpu_type_info = {
.name = X86_CPU_TYPE_NAME("host"),
- .parent = TYPE_X86_CPU,
- .instance_init = host_x86_cpu_initfn,
+ .parent = X86_CPU_TYPE_NAME("max"),
.class_init = host_x86_cpu_class_init,
};
@@ -3729,6 +3744,7 @@ static void x86_cpu_register_types(void)
for (i = 0; i < ARRAY_SIZE(builtin_x86_defs); i++) {
x86_register_cpudef_type(&builtin_x86_defs[i]);
}
+ type_register_static(&max_x86_cpu_type_info);
#ifdef CONFIG_KVM
type_register_static(&host_x86_cpu_type_info);
#endif
--
2.11.0.259.g40922b1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH 5/6] i386: Make "max" model not use any host CPUID info on TCG
2017-01-19 21:04 [Qemu-devel] [PATCH 0/6] i386: Add "max" CPU model to TCG and KVM Eduardo Habkost
` (3 preceding siblings ...)
2017-01-19 21:04 ` [Qemu-devel] [PATCH 4/6] i386: Create "max" CPU model Eduardo Habkost
@ 2017-01-19 21:04 ` Eduardo Habkost
2017-01-19 21:04 ` [Qemu-devel] [PATCH 6/6] i386: Don't set CPUClass::cpu_def on "max" model Eduardo Habkost
` (3 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: Eduardo Habkost @ 2017-01-19 21:04 UTC (permalink / raw)
To: qemu-devel
Instead of reporting host CPUID data on "max", use the qemu64 CPU
model as reference to initialize CPUID
vendor/family/model/stepping/model-id.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
target/i386/cpu.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 6f3a62840f..ea4e1ae519 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -1592,6 +1592,15 @@ static void max_x86_cpu_initfn(Object *obj)
if (lmce_supported()) {
object_property_set_bool(OBJECT(cpu), true, "lmce", &error_abort);
}
+ } else {
+ object_property_set_str(OBJECT(cpu), CPUID_VENDOR_AMD,
+ "vendor", &error_abort);
+ object_property_set_int(OBJECT(cpu), 6, "family", &error_abort);
+ object_property_set_int(OBJECT(cpu), 6, "model", &error_abort);
+ object_property_set_int(OBJECT(cpu), 3, "stepping", &error_abort);
+ object_property_set_str(OBJECT(cpu),
+ "QEMU TCG CPU version " QEMU_HW_VERSION,
+ "model-id", &error_abort);
}
object_property_set_bool(OBJECT(cpu), true, "pmu", &error_abort);
--
2.11.0.259.g40922b1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH 6/6] i386: Don't set CPUClass::cpu_def on "max" model
2017-01-19 21:04 [Qemu-devel] [PATCH 0/6] i386: Add "max" CPU model to TCG and KVM Eduardo Habkost
` (4 preceding siblings ...)
2017-01-19 21:04 ` [Qemu-devel] [PATCH 5/6] i386: Make "max" model not use any host CPUID info on TCG Eduardo Habkost
@ 2017-01-19 21:04 ` Eduardo Habkost
2017-01-20 10:16 ` [Qemu-devel] [PATCH 0/6] i386: Add "max" CPU model to TCG and KVM Peter Maydell
` (2 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: Eduardo Habkost @ 2017-01-19 21:04 UTC (permalink / raw)
To: qemu-devel
Host CPUID info is used by the "max" CPU model only in KVM mode.
Move the initialization of CPUID data for "max" from class_init
to instance_init, and don't set CPUClass::cpu_def for "max".
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
target/i386/cpu-qom.h | 4 +++-
target/i386/cpu.c | 45 +++++++++++++++++++++------------------------
2 files changed, 24 insertions(+), 25 deletions(-)
diff --git a/target/i386/cpu-qom.h b/target/i386/cpu-qom.h
index 14abd0a8c1..f6c704c3a9 100644
--- a/target/i386/cpu-qom.h
+++ b/target/i386/cpu-qom.h
@@ -60,7 +60,9 @@ typedef struct X86CPUClass {
CPUClass parent_class;
/*< public >*/
- /* Should be eventually replaced by subclass-specific property defaults. */
+ /* CPU definition, automatically loaded by instance_init if not NULL.
+ * Should be eventually replaced by subclass-specific property defaults.
+ */
X86CPUDefinition *cpu_def;
bool kvm_required;
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index ea4e1ae519..f959eaa2a5 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -1529,47 +1529,27 @@ static int cpu_x86_fill_model_id(char *str)
return 0;
}
-static X86CPUDefinition host_cpudef;
-
static Property max_x86_cpu_properties[] = {
DEFINE_PROP_BOOL("migratable", X86CPU, migratable, true),
DEFINE_PROP_BOOL("host-cache-info", X86CPU, cache_info_passthrough, false),
DEFINE_PROP_END_OF_LIST()
};
-/* class_init for the "max" CPU model
- *
- * This function may be called before KVM is initialized.
- */
static void max_x86_cpu_class_init(ObjectClass *oc, void *data)
{
DeviceClass *dc = DEVICE_CLASS(oc);
X86CPUClass *xcc = X86_CPU_CLASS(oc);
- uint32_t eax = 0, ebx = 0, ecx = 0, edx = 0;
xcc->ordering = 9;
- host_cpuid(0x0, 0, &eax, &ebx, &ecx, &edx);
- x86_cpu_vendor_words2str(host_cpudef.vendor, ebx, edx, ecx);
-
- host_cpuid(0x1, 0, &eax, &ebx, &ecx, &edx);
- host_cpudef.family = ((eax >> 8) & 0x0F) + ((eax >> 20) & 0xFF);
- host_cpudef.model = ((eax >> 4) & 0x0F) | ((eax & 0xF0000) >> 12);
- host_cpudef.stepping = eax & 0x0F;
-
- cpu_x86_fill_model_id(host_cpudef.model_id);
-
- xcc->cpu_def = &host_cpudef;
xcc->model_description =
"Enables all features supported by the accelerator in the current host";
- /* level, xlevel, xlevel2, and the feature words are initialized on
- * instance_init, because they require KVM to be initialized.
- */
-
dc->props = max_x86_cpu_properties;
}
+static void x86_cpu_load_def(X86CPU *cpu, X86CPUDefinition *def, Error **errp);
+
static void max_x86_cpu_initfn(Object *obj)
{
X86CPU *cpu = X86_CPU(obj);
@@ -1582,6 +1562,21 @@ static void max_x86_cpu_initfn(Object *obj)
cpu->max_features = true;
if (kvm_enabled()) {
+ X86CPUDefinition host_cpudef = { };
+ uint32_t eax = 0, ebx = 0, ecx = 0, edx = 0;
+
+ host_cpuid(0x0, 0, &eax, &ebx, &ecx, &edx);
+ x86_cpu_vendor_words2str(host_cpudef.vendor, ebx, edx, ecx);
+
+ host_cpuid(0x1, 0, &eax, &ebx, &ecx, &edx);
+ host_cpudef.family = ((eax >> 8) & 0x0F) + ((eax >> 20) & 0xFF);
+ host_cpudef.model = ((eax >> 4) & 0x0F) | ((eax & 0xF0000) >> 12);
+ host_cpudef.stepping = eax & 0x0F;
+
+ cpu_x86_fill_model_id(host_cpudef.model_id);
+
+ x86_cpu_load_def(cpu, &host_cpudef, &error_abort);
+
env->cpuid_min_level =
kvm_arch_get_supported_cpuid(s, 0x0, 0, R_EAX);
env->cpuid_min_xlevel =
@@ -2184,7 +2179,7 @@ static void x86_cpu_list_entry(gpointer data, gpointer user_data)
CPUListState *s = user_data;
char *name = x86_cpu_class_get_model_name(cc);
const char *desc = cc->model_description;
- if (!desc) {
+ if (!desc && cc->cpu_def) {
desc = cc->cpu_def->model_id;
}
@@ -3592,7 +3587,9 @@ static void x86_cpu_initfn(Object *obj)
object_property_add_alias(obj, "sse4_1", obj, "sse4.1", &error_abort);
object_property_add_alias(obj, "sse4_2", obj, "sse4.2", &error_abort);
- x86_cpu_load_def(cpu, xcc->cpu_def, &error_abort);
+ if (xcc->cpu_def) {
+ x86_cpu_load_def(cpu, xcc->cpu_def, &error_abort);
+ }
}
static int64_t x86_cpu_get_arch_id(CPUState *cs)
--
2.11.0.259.g40922b1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [Qemu-devel] [PATCH 0/6] i386: Add "max" CPU model to TCG and KVM
2017-01-19 21:04 [Qemu-devel] [PATCH 0/6] i386: Add "max" CPU model to TCG and KVM Eduardo Habkost
` (5 preceding siblings ...)
2017-01-19 21:04 ` [Qemu-devel] [PATCH 6/6] i386: Don't set CPUClass::cpu_def on "max" model Eduardo Habkost
@ 2017-01-20 10:16 ` Peter Maydell
2017-01-20 14:27 ` David Hildenbrand
2017-01-20 14:36 ` Cornelia Huck
8 siblings, 0 replies; 13+ messages in thread
From: Peter Maydell @ 2017-01-20 10:16 UTC (permalink / raw)
To: Eduardo Habkost
Cc: QEMU Developers, Richard W.M. Jones, David Hildenbrand,
Cornelia Huck, Daniel P. Berrange, Igor Mammedov, Jiri Denemark,
Richard Henderson, Christian Borntraeger, Jason J. Herne,
Paolo Bonzini
On 19 January 2017 at 21:04, Eduardo Habkost <ehabkost@redhat.com> wrote:
> This is v2 of the previous series that enabled the "host" CPU
> model on TCG. Now a new "max" CPU is being added, while keeping
> "host" KVM-specific.
>
> In addition to simply adding "max" as a copy of the existing
> "host" CPU model, additional patches change it to not use any
> host CPUID information when in TCG mode.
>
> ---
> Cc: "Richard W.M. Jones" <rjones@redhat.com>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
> Cc: "Daniel P. Berrange" <berrange@redhat.com>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Cc: Jiri Denemark <jdenemar@redhat.com>
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: Christian Borntraeger <borntraeger@de.ibm.com>
> Cc: "Jason J. Herne" <jjherne@linux.vnet.ibm.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
>
> Eduardo Habkost (6):
> i386: Unset cannot_destroy_with_object_finalize_yet on "host" model
> i386: Add ordering field to CPUClass
> i386: Rename X86CPU::host_features to X86CPU::max_features
> i386: Create "max" CPU model
> i386: Make "max" model not use any host CPUID info on TCG
> i386: Don't set CPUClass::cpu_def on "max" model
>
> target/i386/cpu-qom.h | 6 ++-
> target/i386/cpu.h | 2 +-
> target/i386/cpu.c | 110 +++++++++++++++++++++++++++++---------------------
> 3 files changed, 71 insertions(+), 47 deletions(-)
Should we be documenting this new -cpu max somewhere?
(If this series is OK I can send patches to add support to
ARM, and also to add "-machine gic-version=max" to allow
picking the best available interrupt controller type, by
analogy.)
thanks
-- PMM
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Qemu-devel] [PATCH 0/6] i386: Add "max" CPU model to TCG and KVM
2017-01-19 21:04 [Qemu-devel] [PATCH 0/6] i386: Add "max" CPU model to TCG and KVM Eduardo Habkost
` (6 preceding siblings ...)
2017-01-20 10:16 ` [Qemu-devel] [PATCH 0/6] i386: Add "max" CPU model to TCG and KVM Peter Maydell
@ 2017-01-20 14:27 ` David Hildenbrand
2017-01-20 14:36 ` Cornelia Huck
8 siblings, 0 replies; 13+ messages in thread
From: David Hildenbrand @ 2017-01-20 14:27 UTC (permalink / raw)
To: Eduardo Habkost, qemu-devel
Cc: Richard W.M. Jones, Cornelia Huck, Daniel P. Berrange,
Peter Maydell, Igor Mammedov, Jiri Denemark, Richard Henderson,
Christian Borntraeger, Jason J. Herne, Paolo Bonzini
Am 19.01.2017 um 22:04 schrieb Eduardo Habkost:
> This is v2 of the previous series that enabled the "host" CPU
> model on TCG. Now a new "max" CPU is being added, while keeping
> "host" KVM-specific.
>
> In addition to simply adding "max" as a copy of the existing
> "host" CPU model, additional patches change it to not use any
> host CPUID information when in TCG mode.
>
Concept looks good to me. Should also be fairly simple to implement for
s390x. Of course, the same restriction as for the "host" model applies
to "max" then. When running under KVM, and the CPU model KVM interface
is missing, the "max" model won't be able to be expanded.
--
David
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Qemu-devel] [PATCH 0/6] i386: Add "max" CPU model to TCG and KVM
2017-01-19 21:04 [Qemu-devel] [PATCH 0/6] i386: Add "max" CPU model to TCG and KVM Eduardo Habkost
` (7 preceding siblings ...)
2017-01-20 14:27 ` David Hildenbrand
@ 2017-01-20 14:36 ` Cornelia Huck
8 siblings, 0 replies; 13+ messages in thread
From: Cornelia Huck @ 2017-01-20 14:36 UTC (permalink / raw)
To: Eduardo Habkost
Cc: qemu-devel, Peter Maydell, David Hildenbrand, Richard W.M. Jones,
Christian Borntraeger, Jason J. Herne, Paolo Bonzini,
Igor Mammedov, Jiri Denemark, Richard Henderson
On Thu, 19 Jan 2017 19:04:43 -0200
Eduardo Habkost <ehabkost@redhat.com> wrote:
> This is v2 of the previous series that enabled the "host" CPU
> model on TCG. Now a new "max" CPU is being added, while keeping
> "host" KVM-specific.
This looks like a good idea, and I think we'll do the same on s390.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Qemu-devel] [PATCH 1/6] i386: Unset cannot_destroy_with_object_finalize_yet on "host" model
2017-01-19 21:04 ` [Qemu-devel] [PATCH 1/6] i386: Unset cannot_destroy_with_object_finalize_yet on "host" model Eduardo Habkost
@ 2017-02-22 18:21 ` Eduardo Habkost
0 siblings, 0 replies; 13+ messages in thread
From: Eduardo Habkost @ 2017-02-22 18:21 UTC (permalink / raw)
To: qemu-devel
On Thu, Jan 19, 2017 at 07:04:44PM -0200, Eduardo Habkost wrote:
> The class is now safe because the assert(kvm_enabled()) line was
> removed by commit e435601058e656e6d24e3e87b187e5518f7bf16a.
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Applied to x86-next.
--
Eduardo
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Qemu-devel] [PATCH 2/6] i386: Add ordering field to CPUClass
2017-01-19 21:04 ` [Qemu-devel] [PATCH 2/6] i386: Add ordering field to CPUClass Eduardo Habkost
@ 2017-02-22 18:22 ` Eduardo Habkost
0 siblings, 0 replies; 13+ messages in thread
From: Eduardo Habkost @ 2017-02-22 18:22 UTC (permalink / raw)
To: qemu-devel
On Thu, Jan 19, 2017 at 07:04:45PM -0200, Eduardo Habkost wrote:
> Instead of using kvm_enabled to order the "-cpu help" list, use a
> new "ordering" field for that.
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Applied to x86-next.
--
Eduardo
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Qemu-devel] [PATCH 3/6] i386: Rename X86CPU::host_features to X86CPU::max_features
2017-01-19 21:04 ` [Qemu-devel] [PATCH 3/6] i386: Rename X86CPU::host_features to X86CPU::max_features Eduardo Habkost
@ 2017-02-22 18:23 ` Eduardo Habkost
0 siblings, 0 replies; 13+ messages in thread
From: Eduardo Habkost @ 2017-02-22 18:23 UTC (permalink / raw)
To: qemu-devel
On Thu, Jan 19, 2017 at 07:04:46PM -0200, Eduardo Habkost wrote:
> Rename the field and add a small comment to make its purpose
> clearer.
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Applied to x86-next.
--
Eduardo
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2017-02-22 18:23 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-19 21:04 [Qemu-devel] [PATCH 0/6] i386: Add "max" CPU model to TCG and KVM Eduardo Habkost
2017-01-19 21:04 ` [Qemu-devel] [PATCH 1/6] i386: Unset cannot_destroy_with_object_finalize_yet on "host" model Eduardo Habkost
2017-02-22 18:21 ` Eduardo Habkost
2017-01-19 21:04 ` [Qemu-devel] [PATCH 2/6] i386: Add ordering field to CPUClass Eduardo Habkost
2017-02-22 18:22 ` Eduardo Habkost
2017-01-19 21:04 ` [Qemu-devel] [PATCH 3/6] i386: Rename X86CPU::host_features to X86CPU::max_features Eduardo Habkost
2017-02-22 18:23 ` Eduardo Habkost
2017-01-19 21:04 ` [Qemu-devel] [PATCH 4/6] i386: Create "max" CPU model Eduardo Habkost
2017-01-19 21:04 ` [Qemu-devel] [PATCH 5/6] i386: Make "max" model not use any host CPUID info on TCG Eduardo Habkost
2017-01-19 21:04 ` [Qemu-devel] [PATCH 6/6] i386: Don't set CPUClass::cpu_def on "max" model Eduardo Habkost
2017-01-20 10:16 ` [Qemu-devel] [PATCH 0/6] i386: Add "max" CPU model to TCG and KVM Peter Maydell
2017-01-20 14:27 ` David Hildenbrand
2017-01-20 14:36 ` Cornelia Huck
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).