From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: windows acpi time drift Date: Wed, 19 Mar 2008 17:39:51 +0200 Message-ID: <47E133C7.1080607@qumranet.com> References: <1205881756.21936.21.camel@localhost.localdomain> <47E051DB.9070506@codemonkey.ws> <47E0CC8C.4020901@qumranet.com> <47E11EA7.5000405@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel To: Anthony Liguori Return-path: In-Reply-To: <47E11EA7.5000405@codemonkey.ws> 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 Anthony Liguori wrote: > Avi Kivity wrote: >> The fourth is probably impossible from userspace (and very >> difficult in the kernel). > > What makes it impossible to do in userspace? If you managed a > tsc_offset in userspace, you would of course need to adjust that > tsc_offset within the kernel for the particular PCPU that you were on. > In the kernel you can to tricks like local_irq_disable(); rdtsc(); ktime_get(); local_irq_enable() to get a sense where the tsc is. Take a look at kvm_inject_pit_timer_irqs() and kvm_pit_timer_intr_post(). An attempt to have a accurate userspace pit needs to take into account what those functions do. I believe it's doable, but will require careful design of the interface (which should be usable for rtc and hpet as well). -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- 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/