From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50749) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoRGu-0001T2-14 for qemu-devel@nongnu.org; Tue, 20 Oct 2015 03:23:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZoRGl-0007mg-03 for qemu-devel@nongnu.org; Tue, 20 Oct 2015 03:23:44 -0400 Received: from mga09.intel.com ([134.134.136.24]:20480) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoRGk-0007ls-Q8 for qemu-devel@nongnu.org; Tue, 20 Oct 2015 03:23:38 -0400 From: Haozhong Zhang Date: Tue, 20 Oct 2015 15:22:51 +0800 Message-Id: <1445325774-7195-1-git-send-email-haozhong.zhang@intel.com> Subject: [Qemu-devel] [PATCH v2 0/3] target-i386: save/restore vcpu's TSC rate during migration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Haozhong Zhang , Eduardo Habkost , kvm@vger.kernel.org, "Michael S. Tsirkin" , Marcelo Tosatti , Paolo Bonzini , afaerber@suse.de, Richard Henderson This patchset enables QEMU to save/restore vcpu's TSC rate during the migration. When cooperating with KVM which supports TSC scaling, guest programs can observe a consistent guest TSC rate even though they are migrated among machines with different host TSC rates. A pair of cpu options 'save-tsc-freq' and 'load-tsc-freq' are added to control the migration of vcpu's TSC rate. * By default, the migration of vcpu's TSC rate is enabled only on pc-*-2.5 and newer machine types. If the cpu option 'save-tsc-freq' is present, the vcpu's TSC rate will be migrated from older machine types as well. * Another cpu option 'load-tsc-freq' controls whether the migrated vcpu's TSC rate is used. By default, QEMU will not use the migrated TSC rate if this option is not present. Otherwise, QEMU will use the migrated TSC rate and override the TSC rate given by the cpu option 'tsc-freq'. Changes in v2: * Add a pair of cpu options 'save-tsc-freq' and 'load-tsc-freq' to control the migration of vcpu's TSC rate. * Move all logic of setting TSC rate to target-i386. * Remove the duplicated TSC setup in kvm_arch_init_vcpu(). Haozhong Zhang (3): target-i386: add a subsection for migrating vcpu's TSC rate target-i386: calculate vcpu's TSC rate to be migrated target-i386: load the migrated vcpu's TSC rate include/hw/i386/pc.h | 5 +++++ target-i386/cpu.c | 2 ++ target-i386/cpu.h | 3 +++ target-i386/kvm.c | 61 +++++++++++++++++++++++++++++++++++++++++++-------- target-i386/machine.c | 19 ++++++++++++++++ 5 files changed, 81 insertions(+), 9 deletions(-) -- 2.4.8