[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/3] i386: Make sure kvm_arch_set_tsc_khz() succeeds on migra
From: |
Vitaly Kuznetsov |
Subject: |
Re: [PATCH 3/3] i386: Make sure kvm_arch_set_tsc_khz() succeeds on migration when 'hv-reenlightenment' was exposed |
Date: |
Fri, 19 Mar 2021 10:41:58 +0100 |
Paolo Bonzini <pbonzini@redhat.com> writes:
> On 18/03/21 17:38, Vitaly Kuznetsov wrote:
>>> Could we instead fail to load the reenlightenment section if
>>> user_tsc_khz was not set? This seems to be user (well, management)
>>> error really, since reenlightenment has to be enabled manually (or with
>>> hv-passthrough which blocks migration too).
>>
>> Yes, we certainly could do that but what's the added value of
>> user_tsc_khz which upper layer will have to set explicitly (probably to
>> the tsc frequency of the source host anyway)? In case we just want to
>> avoid calling KVM_SET_TSC_KHZ twice, we can probably achieve that by
>> adding a CPU flag or something.
>
> What I want to achieve is to forbid migration of VMs with
> reenlightenment, if they don't also specify tsc-khz to the frequency of
> the TSC on the source host. We can't check it at the beginning of
> migration, but at least we can check it at the end.
>
> Maybe we're talking about two different things?
No, your suggestion basically extends mine and I'm just trying to
understand the benefit. With my suggestion, it is not required to
specify tsc-khz on the source, we just take 'native' tsc frequency as a
reference. Post-migration, we require that KVM_SET_TSC_KHZ succeeds (and
not just 'try' like kvm_arch_put_registers() does so we effectively
break migration when we are unable to set the desired TSC frequency
(also at the end).
With your suggestion to require user_tsc_khz (as I see it) it'll work
the exact same way but there's an additional burden on the
user/management to explicitly specify tsc-khz on the command line and I
believe that almost always this is going to match 'native' tsc frequency
of the source host.
--
Vitaly
Re: [PATCH 3/3] i386: Make sure kvm_arch_set_tsc_khz() succeeds on migration when 'hv-reenlightenment' was exposed, Dr. David Alan Gilbert, 2021/03/18
[PATCH 1/3] i386: Make Hyper-V related sections KVM only, Vitaly Kuznetsov, 2021/03/18
[PATCH 2/3] i386: Fix 'hypercall_hypercall' typo, Vitaly Kuznetsov, 2021/03/18