From: Avi Kivity <avi@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm@vger.kernel.org, sheng@linux.intel.com
Subject: Re: [patch 2/2] KVM: PIT: provide an option to disable interrupt reinjection
Date: Tue, 30 Dec 2008 12:08:01 +0200 [thread overview]
Message-ID: <4959F301.2030104@redhat.com> (raw)
In-Reply-To: <20081229174009.523082019@localhost.localdomain>
Marcelo Tosatti wrote:
> Certain clocks (such as TSC) in older 2.6 guests overaccount for lost
> ticks, causing severe time drift. Interrupt reinjection magnifies the
> problem.
>
> Provide an option to disable it.
>
> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
>
> Index: kvm/arch/x86/kvm/i8254.c
> ===================================================================
> --- kvm.orig/arch/x86/kvm/i8254.c
> +++ kvm/arch/x86/kvm/i8254.c
> @@ -201,6 +201,9 @@ static int __pit_timer_fn(struct kvm_kpi
> if (!atomic_inc_and_test(&pt->pending))
> set_bit(KVM_REQ_PENDING_TIMER, &vcpu0->requests);
>
> + if (pt->no_reinject)
> + atomic_set(&pt->pending, 1);
> +
>
What about moving this to the place where we atomic_inc()? Any reason
not to?
> --- kvm.orig/arch/x86/kvm/i8254.h
> +++ kvm/arch/x86/kvm/i8254.h
> @@ -9,6 +9,7 @@ struct kvm_kpit_timer {
> s64 period; /* unit: ns */
> s64 scheduled;
> atomic_t pending;
> + bool no_reinject;
> };
>
Negative logic = !good. Call it reinject and init to true.
> @@ -991,6 +991,7 @@ int kvm_dev_ioctl_check_extension(long e
> case KVM_CAP_NOP_IO_DELAY:
> case KVM_CAP_MP_STATE:
> case KVM_CAP_SYNC_MMU:
> + case KVM_CAP_PIT_NO_REINJECT:
>
Negative logic. PIT_REINJECT_CONTROL?
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2008-12-30 10:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-29 17:38 [patch 0/2] PIT: optionally disable interrupt reinjection Marcelo Tosatti
2008-12-29 17:38 ` [patch 1/2] KVM: PIT: fix i8254 pending count read Marcelo Tosatti
2008-12-29 17:38 ` [patch 2/2] KVM: PIT: provide an option to disable interrupt reinjection Marcelo Tosatti
2008-12-30 10:08 ` Avi Kivity [this message]
2008-12-30 16:13 ` Marcelo Tosatti
2008-12-30 16:35 ` Avi Kivity
-- strict thread matches above, loose matches on Subject: below --
2008-12-30 17:55 [patch 0/2] PIT: optionally disable interrupt reinjection (v2) Marcelo Tosatti
2008-12-30 17:55 ` [patch 2/2] KVM: PIT: provide an option to disable interrupt reinjection Marcelo Tosatti
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=4959F301.2030104@redhat.com \
--to=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=sheng@linux.intel.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.