From: Avi Kivity <avi@qumranet.com>
To: dor.laor@qumranet.com
Cc: kvm-devel <kvm-devel@lists.sourceforge.net>
Subject: Re: windows acpi time drift
Date: Wed, 19 Mar 2008 19:45:42 +0200 [thread overview]
Message-ID: <47E15146.7020900@qumranet.com> (raw)
In-Reply-To: <1205944079.31347.42.camel@localhost.localdomain>
Dor Laor wrote:
> On Wed, 2008-03-19 at 17:39 +0200, Avi Kivity wrote:
>
>> 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.
>>
>
> but you can also do it before the vcpu goes to userspace after vmexit.
>
>
You only want to do it when needed. We might add an ioctl for it, but
it's tricky.
>> 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).
>>
>>
>
> Actually I'm coming to think we don't need a irq queue in the kernel.
> We just need to count the pending timer interrupts in userspace and
> change the qemu_set_irq interface to return a status when the irq was
> really injected by pic/apic (like kvm_pit_timer_intr_post).
>
> This way qemu timer devices will not inject another irq until the
> previous irq got ack by the kernel (or even userspace pic/acpi).
>
Yes, I think you're right. We can return the information in the vcpu
shared area, so it doesn't generate new exits.
--
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/
next prev parent reply other threads:[~2008-03-19 17:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-18 23:09 windows acpi time drift Dor Laor
2008-03-18 23:33 ` Dor Laor
2008-03-18 23:57 ` Anthony Liguori
2008-03-18 23:35 ` Anthony Liguori
2008-03-19 8:19 ` Avi Kivity
2008-03-19 14:09 ` Anthony Liguori
2008-03-19 15:39 ` Avi Kivity
2008-03-19 16:27 ` Dor Laor
2008-03-19 17:45 ` Avi Kivity [this message]
2008-03-19 0:07 ` Anthony Liguori
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=47E15146.7020900@qumranet.com \
--to=avi@qumranet.com \
--cc=dor.laor@qumranet.com \
--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