On Wed, Sep 16, 2020 at 02:50:56PM +0200, Vitaly Kuznetsov wrote: [...] > >> > > > > > > Oh, I think I see what's going on. When you add 'kvm=off' > > cpu->env.features[FEAT_KVM] is reset (see x86_cpu_expand_features()) so > > kvmclock QEMU device is not created and nobody calls KVM_SET_CLOCK on > > migration. > > > > In case we really want to support 'kvm=off' I think we can add Hyper-V > > features check here along with KVM, this should do the job. > > Does the untested > > diff --git a/hw/i386/kvm/clock.c b/hw/i386/kvm/clock.c > index 64283358f91d..e03b2ca6d8f6 100644 > --- a/hw/i386/kvm/clock.c > +++ b/hw/i386/kvm/clock.c > @@ -333,8 +333,9 @@ void kvmclock_create(void) > X86CPU *cpu = X86_CPU(first_cpu); > > if (kvm_enabled() && > - cpu->env.features[FEAT_KVM] & ((1ULL << KVM_FEATURE_CLOCKSOURCE) | > - (1ULL << KVM_FEATURE_CLOCKSOURCE2))) { > + ((cpu->env.features[FEAT_KVM] & ((1ULL << KVM_FEATURE_CLOCKSOURCE) | > + (1ULL << > KVM_FEATURE_CLOCKSOURCE2))) || > + (cpu->env.features[FEAT_HYPERV_EAX] & > HV_TIME_REF_COUNT_AVAILABLE))) { > sysbus_create_simple(TYPE_KVM_CLOCK, -1, NULL); > } > } > > help?
It appears to work :) > > (I don't think we need to remove all 'if (kvm_enabled())' checks from > machine types as 'kvm=off' should not be related). Indeed (I didn't look at the macro, it was just quick & dirty). > > -- > Vitaly > > -- Antoine 'xdbob' Damhet
signature.asc
Description: PGP signature