From: Glauber Costa Subject: [PATCH 1/4] [PATCH] kvmclock: release time_page if msr is rewritten Date: Wed, 5 Mar 2008 15:41:29 -0300 Message-ID: <1204742492-20738-2-git-send-email-gcosta@redhat.com> References: <1204742492-20738-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: In-Reply-To: <1204742492-20738-1-git-send-email-gcosta@redhat.com> 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 If the calling cpu rewrites the system clock msr for any reason, release the page we allocated in the last time Signed-off-by: Glauber Costa --- arch/x86/kvm/x86.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index e65a9d6..6abd784 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -588,6 +588,9 @@ int kvm_set_msr_common(struct kvm_vcpu * kvm_write_wall_clock(vcpu->kvm, data); break; case MSR_KVM_SYSTEM_TIME: { + if (vcpu->arch.time_page) + kvm_release_page_dirty(vcpu->arch.time_page); + vcpu->arch.time = data & PAGE_MASK; vcpu->arch.time_offset = data & ~PAGE_MASK; -- 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/