From patchwork Wed Jun 27 16:59:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris J Arges X-Patchwork-Id: 167718 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 026D7100A7B for ; Thu, 28 Jun 2012 02:59:32 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SjvaM-0008Uv-Th; Wed, 27 Jun 2012 16:59:22 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SjvaL-0008Uq-3Z for kernel-team@lists.ubuntu.com; Wed, 27 Jun 2012 16:59:21 +0000 Received: from cpe-72-177-11-186.austin.res.rr.com ([72.177.11.186] helo=[192.168.11.2]) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1SjvaK-0003aC-US for kernel-team@lists.ubuntu.com; Wed, 27 Jun 2012 16:59:21 +0000 Message-ID: <4FEB3BF0.3050707@canonical.com> Date: Wed, 27 Jun 2012 11:59:28 -0500 From: Chris J Arges User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: Ubuntu Kernel Team Subject: [natty][SRU][PATCH] bug #1018440 - KVM domain restore reboots the domain instead X-Enigmail-Version: 1.4.2 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com BugLink: https://bugs.launchpad.net/bugs/1018440 == Natty SRU Justification == KVM domain restore reboots the domain instead, the reported uptime is incorrect. == Fix == Upstream patch : 5233dd51ece1615d54ab96c4cbe9ac3cc595e955 fixes the issue. This patch is present in Oneiric onwards. This patch only allows vmx_decache_cr3 to be run iff vcpu->arch.cr3 is stale. == Testcase == 1 Start a VM 2 let it accumulate some uptime; maybe start a background job 3 save or managedsave the VM and verify that it becomes "shut off" 4 restore or start the saved VM. 5 check uptime of VM and state of background job, if started. The uptime of the restored VM should represent the time it was up before being saved. It shows as being 0 since the VM gets rebooted Thanks, --chris j arges From b856e079671eb638ee3e78e0d83cc6462da1a575 Mon Sep 17 00:00:00 2001 From: Marcelo Tosatti Date: Mon, 6 Jun 2011 14:27:47 -0300 Subject: [PATCH 2/2] KVM: VMX: do not overwrite uptodate vcpu->arch.cr3 on KVM_SET_SREGS Only decache guest CR3 value if vcpu->arch.cr3 is stale. Fixes loadvm with live guest. Signed-off-by: Marcelo Tosatti Tested-by: Markus Schade Signed-off-by: Avi Kivity (cherry picked from commit 5233dd51ece1615d54ab96c4cbe9ac3cc595e955) BugLink: http://launchpad.net/bugs/1018440 Signed-off-by: Chris J Arges --- arch/x86/kvm/vmx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 3aad96c..51abe43 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -1924,7 +1924,8 @@ static void ept_update_paging_mode_cr0(unsigned long *hw_cr0, unsigned long cr0, struct kvm_vcpu *vcpu) { - vmx_decache_cr3(vcpu); + if (!test_bit(VCPU_EXREG_CR3, (ulong *)&vcpu->arch.regs_avail)) + vmx_decache_cr3(vcpu); if (!(cr0 & X86_CR0_PG)) { /* From paging/starting to nonpaging */ vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, -- 1.7.9.5