qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] target-i386: block migration and savevm if invariant ts


From: Marcelo Tosatti
Subject: Re: [Qemu-devel] target-i386: block migration and savevm if invariant tsc is exposed (v3)
Date: Thu, 24 Apr 2014 18:32:42 -0300
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Apr 24, 2014 at 04:21:59PM -0300, Eduardo Habkost wrote:
> On Wed, Apr 23, 2014 at 06:04:45PM -0300, Marcelo Tosatti wrote:
> > 
> > Invariant TSC documentation mentions that "invariant TSC will run at a
> > constant rate in all ACPI P-, C-. and T-states".
> > 
> > This is not the case if migration to a host with different TSC frequency 
> > is allowed, or if savevm is performed. So block migration/savevm.
> > 
> > Signed-off-by: Marcelo Tosatti <address@hidden>
> > 
> [...]
> > @@ -702,6 +706,16 @@ int kvm_arch_init_vcpu(CPUState *cs)
> >                                    !!(c->ecx & CPUID_EXT_SMX);
> >      }
> >  
> > +    c = cpuid_find_entry(&cpuid_data.cpuid, 0x80000007, 0);
> > +    if (c && (c->edx & 1<<8) && invtsc_mig_blocker == NULL) {
> > +        /* for migration */
> > +        error_set(&invtsc_mig_blocker,
> > +                  QERR_DEVICE_FEATURE_BLOCKS_MIGRATION, "invtsc", "cpu");
> > +        migrate_add_blocker(invtsc_mig_blocker);
> > +        /* for savevm */
> > +        vmstate_x86_cpu.unmigratable = 1;
> 
> Did you ensure this will always happen before vmstate_register() is
> called for vmstate_x86_cpu? I believe kvm_arch_init_vcpu() is called a
> long long time after device_set_realized() (which is where
> vmstate_register() is called for DeviceState objects).

x86_cpu_realizefn -> qemu_init_vcpu -> qemu_kvm_start_vcpu ->
qemu_kvm_cpu_thread_fn -> kvm_init_vcpu -> kvm_arch_init_vcpu


@@ -2573,6 +2598,8 @@ static void x86_cpu_realizefn(DeviceState *dev,
Error **errp)
     CPUX86State *env = &cpu->env;
     Error *local_err = NULL;

+    printf("%s: dev->realized=%d\n", __func__, dev->realized);
+
     if (env->features[FEAT_7_0_EBX] && env->cpuid_level < 7) {
         env->cpuid_level = 7;
     }



QEMU 1.7.93 monitor - type 'help' for more information
(qemu) x86_cpu_realizefn: dev->realized=0
x86_cpu_realizefn: dev->realized=0
audio: Could not init `oss' audio driver




reply via email to

[Prev in Thread] Current Thread [Next in Thread]