From: Glauber de Oliveira Costa Subject: [PATCH] call write_guest_time as soon as we register the paravirt clock. Date: Thu, 21 Feb 2008 18:04:14 -0300 Message-ID: <1203627854-4216-1-git-send-email-gcosta@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: chrisw@sous-sol.org, avi@qumranet.com, Glauber Costa To: kvm-devel@lists.sourceforge.net Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org From: Glauber Costa In situations, like, cpu hotplugging, a cpu can arrive later on the game and register its paravirt clock while everything else is already running, which will lead to breakage, since the time readings will return bogus values. To prevent this, we write system time as soon as the guest registers its clock Signed-off-by: Glauber Costa --- arch/x86/kvm/x86.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 5dfc21f..03c0c6d 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -595,6 +595,8 @@ int kvm_set_msr_common(struct kvm_vcpu * if (is_error_page(vcpu->arch.time_page)) vcpu->arch.time_page = NULL; + + kvm_write_guest_time(vcpu); break; } default: -- 1.4.2 ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/