From: Avi Kivity <avi@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>,
kvm@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com,
hpa@zytor.com, x86@kernel.org, johnstul@us.ibm.com,
riel@redhat.com, amit.shah@redhat.com
Subject: Re: x86: kvmclock: abstract save/restore sched_clock_state (v2)
Date: Wed, 15 Feb 2012 12:28:33 +0200 [thread overview]
Message-ID: <4F3B88D1.5070405@redhat.com> (raw)
In-Reply-To: <20120213155207.GA10105@amt.cnet>
On 02/13/2012 05:52 PM, Marcelo Tosatti wrote:
> > > {
> > >+ x86_platform.restore_sched_clock_state();
> > Isn't it too early? It is scarry to say hypervisor to write to some
> > memory location and than completely replace page-tables and half of
> > cpu state in __restore_processor_state. Wouldn't that have a potential
> > of writing into a place that is not restored hv_clock and restored
> > hv_clock might still be stale?
>
> No, memory is copied in swsusp_arch_resume(), which happens
> before restore_processor_state. restore_processor_state() is only
> setting up registers and MTRR.
>
In addition, kvmclock uses physical addresses, so page table changes
don't matter.
Note we could have done this in
__save_processor_state()/__restore_processor_state() (it's just reading
and writing an MSR, like we do for MSR_IA32_MISC_ENABLE), but I think
your patch is the right way. I'd like an ack from the x86 maintainers
though.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2012-02-15 10:28 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-07 21:05 x86: kvmclock: abstract save/restore sched_clock_state Marcelo Tosatti
2012-02-08 10:53 ` Igor Mammedov
2012-02-09 12:27 ` Amit Shah
2012-02-09 15:13 ` Igor Mammedov
2012-02-10 10:02 ` Amit Shah
2012-02-10 10:11 ` Igor Mammedov
2012-02-10 10:23 ` Amit Shah
2012-02-10 12:32 ` Marcelo Tosatti
2012-02-10 12:33 ` Marcelo Tosatti
2012-02-10 12:43 ` Igor Mammedov
2012-02-13 12:46 ` Amit Shah
2012-02-13 12:56 ` Amit Shah
2012-02-10 13:18 ` Amit Shah
2012-02-10 20:58 ` Igor Mammedov
2012-02-13 12:39 ` Amit Shah
2012-02-13 13:07 ` x86: kvmclock: abstract save/restore sched_clock_state (v2) Marcelo Tosatti
2012-02-13 15:20 ` Igor Mammedov
2012-02-13 15:52 ` Marcelo Tosatti
2012-02-15 10:28 ` Avi Kivity [this message]
2012-02-13 15:45 ` [PATCH RFC] pvclock: Make pv_clock more robust and fixup it if overflow happens Igor Mammedov
2012-02-13 17:48 ` Marcelo Tosatti
2012-02-13 18:15 ` Igor Mammedov
2012-02-13 16:26 ` x86: kvmclock: abstract save/restore sched_clock_state (v2) Amit Shah
2012-03-01 9:58 ` x86: kvmclock: abstract save/restore sched_clock_state Thomas Gleixner
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=4F3B88D1.5070405@redhat.com \
--to=avi@redhat.com \
--cc=amit.shah@redhat.com \
--cc=hpa@zytor.com \
--cc=imammedo@redhat.com \
--cc=johnstul@us.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mtosatti@redhat.com \
--cc=riel@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).