public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Glauber Costa <gcosta@redhat.com>
To: kvm-devel@lists.sourceforge.net
Cc: chrisw@sous-sol.org, avi@qumranet.com, Glauber Costa <gcosta@redhat.com>
Subject: [PATCH 1/4] [PATCH] kvmclock: release time_page if msr is rewritten
Date: Wed,  5 Mar 2008 15:41:29 -0300	[thread overview]
Message-ID: <1204742492-20738-2-git-send-email-gcosta@redhat.com> (raw)
In-Reply-To: <1204742492-20738-1-git-send-email-gcosta@redhat.com>

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 <gcosta@redhat.com>
---
 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/

  reply	other threads:[~2008-03-05 18:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-05 18:41 [PATCH 0/4] kvmclock fixes Glauber Costa
2008-03-05 18:41 ` Glauber Costa [this message]
2008-03-05 18:41   ` [PATCH 2/4] [PATCH] cacheline-align kvmclock structures Glauber Costa
2008-03-05 18:41     ` [PATCH 3/4] [PATCH] kvmclock: allow it to be turned off Glauber Costa
2008-03-05 18:41       ` [PATCH 4/4] [PATCH] cleanup leftovers Glauber Costa
2008-03-06  6:49         ` Avi Kivity
2008-03-06  6:47       ` [PATCH 3/4] [PATCH] kvmclock: allow it to be turned off Avi Kivity
2008-03-06 12:01         ` Glauber Costa
2008-03-06 12:11           ` Avi Kivity
2008-03-06 12:15             ` Glauber Costa
2008-03-06  6:45     ` [PATCH 2/4] [PATCH] cacheline-align kvmclock structures Avi Kivity
2008-03-06  6:42   ` [PATCH 1/4] [PATCH] kvmclock: release time_page if msr is rewritten Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1204742492-20738-2-git-send-email-gcosta@redhat.com \
    --to=gcosta@redhat.com \
    --cc=avi@qumranet.com \
    --cc=chrisw@sous-sol.org \
    --cc=kvm-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox