public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: John Stultz <johnstul@us.ibm.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Avi Kivity <avi@qumranet.com>, Chris Wright <chrisw@redhat.com>,
	Glauber Costa <gcosta@redhat.com>,
	Anthony Liguori <aliguori@us.ibm.com>,
	kvm@vger.kernel.org
Subject: Re: [patch 01/12] expose ACPI pmtimer to userspace (/dev/pmtimer)
Date: Mon, 02 Jun 2008 09:43:20 -0700	[thread overview]
Message-ID: <1212425000.6881.24.camel@jstultz-laptop> (raw)
In-Reply-To: <20080601175604.GA3070@dmt>

On Sun, 2008-06-01 at 14:56 -0300, Marcelo Tosatti wrote:
> On Sun, Jun 01, 2008 at 06:34:27PM +0200, Thomas Gleixner wrote:
> > On Thu, 29 May 2008, Marcelo Tosatti wrote:
> > > KVM wishes to allow direct guest access to the ACPI pmtimer. In that
> > > case QEMU/KVM has to read the current value for migration, so the proper
> > > syncing can be done on the destination.
> > 
> > I don't understand from the above which problem you are trying to
> > solve. Which pmtimer is read out, the one of the host (physical
> > hardware) or the one of the guest (emulated hardware) ? What is synced
> > at the destination ?
> 
> Problem is this:
> 
> We want to allow guests to directly access the hosts pmtimer (by using
> the I/O bitmap feature in VMX/SVM hardware). The advantage of doing it
> is that no VMExits are necessary for guest pmtimer reads (which happen
> often if we inform the guest that ACPI C1 state is supported, or if the
> workload is gettimeofday() intensive).
> 
> If you migrate such a guest that has direct (ie. non-virtualized, using
> the physical hardware) pmtimer access to a different host (destination),
> you need to save the current host pmtimer value at the time of migration
> so that you can either emulate it with a proper offset or synchronize
> (wait for the destination hosts real hardware pmtimer value to be in
> sync before actually resuming guest execution)

I'm a little wary on this, another thing to catch here as well is host
suspend-resume cycles that might reset the pmtimer.

> > > This patch will not register the device if the chipset has an unreliable
> > > timer.
> > 
> > Can we please keep that code inside of drivers/clocksource/acpi_pm.c
> > without creating a new disconnected file in drivers/char ?
> > 
> > Btw, depending on the use case we might as well have a sysfs entry for that.
> 
> A sysfs entry sounds fine and much simpler. Should probably be a generic
> clocksource interface (so userspace can read any available clocksource)
> rather than acpi_pm specific.

Again, I'd be hesitant to expose this stuff to userland since if the
counters reset (such as in the suspend/resume case) the applications may
not be aware. 

And if its a generic interface, we would then have to also export
frequency and mask values. It just gets messy, so I'd avoid doing
anything generic in exporting clocksources (since either userland wants
specific hardware and is aware of all the known troubles it may have, or
userland should use the existing kernel time interfaces).

thanks
-john


  parent reply	other threads:[~2008-06-02 16:43 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-29 22:22 [patch 00/12] fake ACPI C2 emulation v2 Marcelo Tosatti
2008-05-29 22:22 ` [patch 01/12] expose ACPI pmtimer to userspace (/dev/pmtimer) Marcelo Tosatti
2008-06-01 16:34   ` Thomas Gleixner
2008-06-01 16:56     ` Anthony Liguori
2008-06-04  9:53       ` Avi Kivity
2008-06-04 10:01         ` Thomas Gleixner
2008-06-04 10:35           ` Avi Kivity
2008-06-01 17:56     ` Marcelo Tosatti
2008-06-01 18:17       ` Thomas Gleixner
2008-06-02 16:43       ` John Stultz [this message]
2008-06-03  4:09         ` Marcelo Tosatti
2008-05-29 22:22 ` [patch 02/12] KVM: allow multiple IO bitmap pages, provide userspace interface Marcelo Tosatti
2008-05-29 22:22 ` [patch 03/12] KVM: allow userspace to open access to ACPI pmtimer Marcelo Tosatti
2008-05-29 22:22 ` [patch 04/12] KVM: move muldiv64 to x86.c, export Marcelo Tosatti
2008-05-29 22:22 ` [patch 05/12] KVM: in-kernel ACPI timer emulation Marcelo Tosatti
2008-05-29 22:22 ` [patch 06/12] QEMU/KVM: self-disabling C2 emulation Marcelo Tosatti
2008-05-29 22:22 ` [patch 07/12] libkvm: interface to KVM_SET_OPEN_IOPORT Marcelo Tosatti
2008-05-29 22:22 ` [patch 08/12] QEMU/KVM: non-virtualized ACPI PMTimer support Marcelo Tosatti
2008-05-29 22:22 ` [patch 09/12] libkvm: in-kernel ACPI pmtimer interface Marcelo Tosatti
2008-05-29 22:22 ` [patch 10/12] QEMU/KVM: add option to disable in-kernel pmtimer emulation Marcelo Tosatti
2008-05-29 22:23 ` [patch 11/12] libkvm: interface for pmtimer save/restore Marcelo Tosatti
2008-05-29 22:23 ` [patch 12/12] QEMU/KVM: in-kernel pmtimer save/restore support Marcelo Tosatti
2008-06-01  9:21 ` [patch 00/12] fake ACPI C2 emulation v2 Avi Kivity
2008-06-02 16:08   ` Marcelo Tosatti
2008-06-04 10:49     ` Avi Kivity
2008-06-05  3:12       ` Marcelo Tosatti
2008-06-05  7:56         ` 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=1212425000.6881.24.camel@jstultz-laptop \
    --to=johnstul@us.ibm.com \
    --cc=aliguori@us.ibm.com \
    --cc=avi@qumranet.com \
    --cc=chrisw@redhat.com \
    --cc=gcosta@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=tglx@linutronix.de \
    /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