[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210811180322.GA178399@fuller.cnet>
Date: Wed, 11 Aug 2021 15:03:22 -0300
From: Marcelo Tosatti <mtosatti@...hat.com>
To: Paolo Bonzini <pbonzini@...hat.com>
Cc: linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
vkuznets@...hat.com
Subject: Re: [PATCH 1/2] KVM: KVM-on-hyperv: shorten no-entry section on
reenlightenment
On Wed, Aug 11, 2021 at 06:23:55AM -0400, Paolo Bonzini wrote:
> During re-enlightenment, update kvmclock a VM at a time instead of
> raising KVM_REQ_MASTERCLOCK_UPDATE for all VMs. Because the guests
> can now run after TSC emulation has been disabled, invalidate
> their TSC page so that they refer to the reference time counter
> MSR while the update is in progress.
>
> Signed-off-by: Paolo Bonzini <pbonzini@...hat.com>
> ---
> arch/x86/kvm/x86.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index bab8eb3e0a47..284afaa1db86 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -8111,7 +8111,7 @@ static void kvm_hyperv_tsc_notifier(void)
>
> mutex_lock(&kvm_lock);
> list_for_each_entry(kvm, &vm_list, vm_list)
> - kvm_make_mclock_inprogress_request(kvm);
> + kvm_hv_invalidate_tsc_page(kvm);
>
> hyperv_stop_tsc_emulation();
hyperv_stop_tsc_emulation();
/* TSC frequency always matches when on Hyper-V */
for_each_present_cpu(cpu)
per_cpu(cpu_tsc_khz, cpu) = tsc_khz;
kvm_max_guest_tsc_khz = tsc_khz;
Is this safe with a running guest? Why?
Powered by blists - more mailing lists