* [Qemu-devel] [qom-cpu PATCH v2 0/2] target-i386: Fixes for migratable/invtsc
@ 2014-05-16 17:58 Eduardo Habkost
2014-05-16 17:58 ` [Qemu-devel] [qom-cpu PATCH v2 1/2] target-i386: Use x86_cpu_get_supported_feature_word() for "-cpu host" Eduardo Habkost
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Eduardo Habkost @ 2014-05-16 17:58 UTC (permalink / raw)
To: qemu-devel, Andreas Färber
Cc: Paolo Bonzini, Richard Henderson, Marcelo Tosatti, Aurelien Jarno,
Igor Mammedov
This series contains two fixes for the qom-cpu branch:
* Make the new "migratable" property actually work;
* Avoid breaking setups where "-cpu host" needs to be migratable.
(See discussion at http://marc.info/?l=qemu-devel&m=139838802220184&w=2 )
Cc: Andreas Färber <afaerber@suse.de>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Richard Henderson <rth@twiddle.net>
Eduardo Habkost (2):
target-i386: Use x86_cpu_get_supported_feature_word() for "-cpu host"
target-i386: Set migratable=yes by default on "host" CPU mooel
target-i386/cpu.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
--
1.9.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] [qom-cpu PATCH v2 1/2] target-i386: Use x86_cpu_get_supported_feature_word() for "-cpu host"
2014-05-16 17:58 [Qemu-devel] [qom-cpu PATCH v2 0/2] target-i386: Fixes for migratable/invtsc Eduardo Habkost
@ 2014-05-16 17:58 ` Eduardo Habkost
2014-05-16 17:58 ` [Qemu-devel] [qom-cpu PATCH v2 2/2] target-i386: Set migratable=yes by default on "host" CPU mooel Eduardo Habkost
2014-06-02 20:45 ` [Qemu-devel] [qom-cpu PATCH v2 0/2] target-i386: Fixes for migratable/invtsc Eduardo Habkost
2 siblings, 0 replies; 4+ messages in thread
From: Eduardo Habkost @ 2014-05-16 17:58 UTC (permalink / raw)
To: qemu-devel, Andreas Färber
This will make "-cpu host" reuse the feature filtering logic used by
x86_cpu_filter_features() (i.e. TCG support, and the new "migratable" flag).
This doesn't add "-cpu host" support to TCG mode yet, but that may be
possible eventually.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
target-i386/cpu.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 715078a..61e8800 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1279,6 +1279,9 @@ static void host_x86_cpu_class_init(ObjectClass *oc, void *data)
dc->props = host_x86_cpu_properties;
}
+static uint32_t x86_cpu_get_supported_feature_word(FeatureWord w,
+ bool migratable_only);
+
static void host_x86_cpu_initfn(Object *obj)
{
X86CPU *cpu = X86_CPU(obj);
@@ -1293,10 +1296,8 @@ static void host_x86_cpu_initfn(Object *obj)
env->cpuid_xlevel2 = kvm_arch_get_supported_cpuid(s, 0xC0000000, 0, R_EAX);
for (w = 0; w < FEATURE_WORDS; w++) {
- FeatureWordInfo *wi = &feature_word_info[w];
env->features[w] =
- kvm_arch_get_supported_cpuid(s, wi->cpuid_eax, wi->cpuid_ecx,
- wi->cpuid_reg);
+ x86_cpu_get_supported_feature_word(w, cpu->migratable);
}
object_property_set_bool(OBJECT(cpu), true, "pmu", &error_abort);
}
--
1.9.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Qemu-devel] [qom-cpu PATCH v2 2/2] target-i386: Set migratable=yes by default on "host" CPU mooel
2014-05-16 17:58 [Qemu-devel] [qom-cpu PATCH v2 0/2] target-i386: Fixes for migratable/invtsc Eduardo Habkost
2014-05-16 17:58 ` [Qemu-devel] [qom-cpu PATCH v2 1/2] target-i386: Use x86_cpu_get_supported_feature_word() for "-cpu host" Eduardo Habkost
@ 2014-05-16 17:58 ` Eduardo Habkost
2014-06-02 20:45 ` [Qemu-devel] [qom-cpu PATCH v2 0/2] target-i386: Fixes for migratable/invtsc Eduardo Habkost
2 siblings, 0 replies; 4+ messages in thread
From: Eduardo Habkost @ 2014-05-16 17:58 UTC (permalink / raw)
To: qemu-devel, Andreas Färber
Having only migratable flags reported by default on the "host" CPU model
is safer for the following reasons:
* Existing users may expect "-cpu host" to be migration-safe, if they
take care of always using compatible host CPUs, host kernels, and
QEMU versions.
* Users who don't care aboug migration and want to enable all features
supported by the host kernel can simply change their setup to use
migratable=no.
Without this change, people using "-cpu host" will stop being able to
migrate, because now "invtsc" is getting enabled by default.
We are not setting migratable=yes by default on all X86CPU subclasses,
because users should be able to get non-migratable features enabled if
they ask for them explicitly.
Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
For a discussion about why it makes sense to set it by default, see:
http://marc.info/?l=qemu-devel&m=139838802220184&w=2
---
target-i386/cpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 61e8800..1395473 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1243,7 +1243,7 @@ static int cpu_x86_fill_model_id(char *str)
static X86CPUDefinition host_cpudef;
static Property host_x86_cpu_properties[] = {
- DEFINE_PROP_BOOL("migratable", X86CPU, migratable, false),
+ DEFINE_PROP_BOOL("migratable", X86CPU, migratable, true),
DEFINE_PROP_END_OF_LIST()
};
--
1.9.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [qom-cpu PATCH v2 0/2] target-i386: Fixes for migratable/invtsc
2014-05-16 17:58 [Qemu-devel] [qom-cpu PATCH v2 0/2] target-i386: Fixes for migratable/invtsc Eduardo Habkost
2014-05-16 17:58 ` [Qemu-devel] [qom-cpu PATCH v2 1/2] target-i386: Use x86_cpu_get_supported_feature_word() for "-cpu host" Eduardo Habkost
2014-05-16 17:58 ` [Qemu-devel] [qom-cpu PATCH v2 2/2] target-i386: Set migratable=yes by default on "host" CPU mooel Eduardo Habkost
@ 2014-06-02 20:45 ` Eduardo Habkost
2 siblings, 0 replies; 4+ messages in thread
From: Eduardo Habkost @ 2014-06-02 20:45 UTC (permalink / raw)
To: qemu-devel, Andreas Färber
Cc: Paolo Bonzini, Igor Mammedov, Marcelo Tosatti, Aurelien Jarno,
Richard Henderson
Ping? qom-cpu is still broken and needs the fixes below.
Are there plans to include them and submit a pull request soon?
This one is also pending:
Message-ID: <20140529165514.GB13386@amt.cnet>
From: Marcelo Tosatti <mtosatti@redhat.com>
Subject: [Qemu-devel] [qom/qom-cpu PATCH] i386: improve invtsc migration
blocker error message
http://marc.info/?l=qemu-devel&m=140138256316042
On Fri, May 16, 2014 at 02:58:46PM -0300, Eduardo Habkost wrote:
> This series contains two fixes for the qom-cpu branch:
> * Make the new "migratable" property actually work;
> * Avoid breaking setups where "-cpu host" needs to be migratable.
> (See discussion at http://marc.info/?l=qemu-devel&m=139838802220184&w=2 )
>
>
> Cc: Andreas Färber <afaerber@suse.de>
> Cc: Marcelo Tosatti <mtosatti@redhat.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Cc: Aurelien Jarno <aurelien@aurel32.net>
> Cc: Richard Henderson <rth@twiddle.net>
>
> Eduardo Habkost (2):
> target-i386: Use x86_cpu_get_supported_feature_word() for "-cpu host"
> target-i386: Set migratable=yes by default on "host" CPU mooel
>
> target-i386/cpu.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> --
> 1.9.0
>
>
--
Eduardo
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-06-02 20:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-16 17:58 [Qemu-devel] [qom-cpu PATCH v2 0/2] target-i386: Fixes for migratable/invtsc Eduardo Habkost
2014-05-16 17:58 ` [Qemu-devel] [qom-cpu PATCH v2 1/2] target-i386: Use x86_cpu_get_supported_feature_word() for "-cpu host" Eduardo Habkost
2014-05-16 17:58 ` [Qemu-devel] [qom-cpu PATCH v2 2/2] target-i386: Set migratable=yes by default on "host" CPU mooel Eduardo Habkost
2014-06-02 20:45 ` [Qemu-devel] [qom-cpu PATCH v2 0/2] target-i386: Fixes for migratable/invtsc Eduardo Habkost
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).