From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: Exporting kvm_max_guest_tsc_khz to userspace (was Re: [PATCH 4/4] kvm: Allow migration with invtsc) Date: Wed, 11 Jan 2017 15:06:07 +0100 Message-ID: References: <20170104115656.GB14961@amt.cnet> <20170104133916.GG3315@thinpad.lan.raisama.net> <20170104195917.GM3315@thinpad.lan.raisama.net> <20170104222623.GA21789@amt.cnet> <20170105013631.GO3315@thinpad.lan.raisama.net> <20170105104830.GB6299@amt.cnet> <20170105121950.GP3315@thinpad.lan.raisama.net> <20170106103126.GA1575@amt.cnet> <20170108202851.GZ3315@thinpad.lan.raisama.net> <20170111132653.GB3315@thinpad.lan.raisama.net> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org, Haozhong Zhang , libvir-list@redhat.com To: Eduardo Habkost Return-path: Received: from mail-wj0-f193.google.com ([209.85.210.193]:34463 "EHLO mail-wj0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757114AbdAKOGJ (ORCPT ); Wed, 11 Jan 2017 09:06:09 -0500 Received: by mail-wj0-f193.google.com with SMTP id qs7so53385026wjc.1 for ; Wed, 11 Jan 2017 06:06:09 -0800 (PST) In-Reply-To: <20170111132653.GB3315@thinpad.lan.raisama.net> Sender: kvm-owner@vger.kernel.org List-ID: On 11/01/2017 14:26, Eduardo Habkost wrote: > On Mon, Jan 09, 2017 at 03:58:11PM +0100, Paolo Bonzini wrote: >> >> >> On 08/01/2017 21:28, Eduardo Habkost wrote: >>>> Well just export KVM_GET_TSC_KHZ in a QMP command right? Its pretty >>>> easy. >>>> >>>> Let me know if you need any help coding or testing. >>> I just found out that KVM doesn't provide something that QEMU and >>> libvirt need: the value of kvm_max_guest_tsc_khz. Without it, we >>> have no way to know if a given VM is really migratable to a host. >>> >>> Could we add a KVM_CAP_MAX_TSC_KHZ capability for that? >> >> The ratio is really quite high, 256x the host frequency for AMD and >> 65536x for Intel. Anything below 2^32 Hz (above that, there would >> probably be other failures) is safe. > > 2^32 Hz (~4.3 GHz) sounds like a limit likely to be hit by future > CPUs. Which kind of failures do you think we could see? Just integer overflows. Current CPUs have been at 3.9 GHz for a while now. Paolo From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35222) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRJXZ-0004dw-Rp for qemu-devel@nongnu.org; Wed, 11 Jan 2017 09:06:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cRJXV-0002C0-Tf for qemu-devel@nongnu.org; Wed, 11 Jan 2017 09:06:13 -0500 Received: from mail-wj0-x242.google.com ([2a00:1450:400c:c01::242]:35864) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cRJXV-0002B9-N8 for qemu-devel@nongnu.org; Wed, 11 Jan 2017 09:06:09 -0500 Received: by mail-wj0-x242.google.com with SMTP id dh1so10653503wjb.3 for ; Wed, 11 Jan 2017 06:06:09 -0800 (PST) Sender: Paolo Bonzini References: <20170104115656.GB14961@amt.cnet> <20170104133916.GG3315@thinpad.lan.raisama.net> <20170104195917.GM3315@thinpad.lan.raisama.net> <20170104222623.GA21789@amt.cnet> <20170105013631.GO3315@thinpad.lan.raisama.net> <20170105104830.GB6299@amt.cnet> <20170105121950.GP3315@thinpad.lan.raisama.net> <20170106103126.GA1575@amt.cnet> <20170108202851.GZ3315@thinpad.lan.raisama.net> <20170111132653.GB3315@thinpad.lan.raisama.net> From: Paolo Bonzini Message-ID: Date: Wed, 11 Jan 2017 15:06:07 +0100 MIME-Version: 1.0 In-Reply-To: <20170111132653.GB3315@thinpad.lan.raisama.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Exporting kvm_max_guest_tsc_khz to userspace (was Re: [PATCH 4/4] kvm: Allow migration with invtsc) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org, Haozhong Zhang , libvir-list@redhat.com On 11/01/2017 14:26, Eduardo Habkost wrote: > On Mon, Jan 09, 2017 at 03:58:11PM +0100, Paolo Bonzini wrote: >> >> >> On 08/01/2017 21:28, Eduardo Habkost wrote: >>>> Well just export KVM_GET_TSC_KHZ in a QMP command right? Its pretty >>>> easy. >>>> >>>> Let me know if you need any help coding or testing. >>> I just found out that KVM doesn't provide something that QEMU and >>> libvirt need: the value of kvm_max_guest_tsc_khz. Without it, we >>> have no way to know if a given VM is really migratable to a host. >>> >>> Could we add a KVM_CAP_MAX_TSC_KHZ capability for that? >> >> The ratio is really quite high, 256x the host frequency for AMD and >> 65536x for Intel. Anything below 2^32 Hz (above that, there would >> probably be other failures) is safe. > > 2^32 Hz (~4.3 GHz) sounds like a limit likely to be hit by future > CPUs. Which kind of failures do you think we could see? Just integer overflows. Current CPUs have been at 3.9 GHz for a while now. Paolo