From: Paolo Bonzini <pbonzini@redhat.com>
To: nick <xerofoify@gmail.com>, gleb@kernel.org
Cc: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
x86@kernel.org, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: Question about hrtimer_restart apic_timer_fn in lapic.c
Date: Fri, 19 Dec 2014 12:28:48 +0100 [thread overview]
Message-ID: <54940BF0.1020104@redhat.com> (raw)
In-Reply-To: <549319DD.1020908@gmail.com>
On 18/12/2014 19:15, nick wrote:
> /*
> * There is a race window between reading and incrementing, but we do
> * not care about potentially losing timer events in the !reinject
> * case anyway. Note: KVM_REQ_PENDING_TIMER is implicitly checked
> * in vcpu_enter_guest.
> */
> if (!atomic_read(&ktimer->pending)) {
> atomic_inc(&ktimer->pending);
> /* FIXME: this code should not know anything about vcpus */
> kvm_make_request(KVM_REQ_PENDING_TIMER, vcpu);
> }
>
> if (waitqueue_active(q))
> wake_up_interruptible(q);
>
> if (lapic_is_periodic(apic)) {
> hrtimer_add_expires_ns(&ktimer->timer, ktimer->period);
> return HRTIMER_RESTART;
> } else
> return HRTIMER_NORESTART;
> }
> What is point of the comment, clearly we need access to vcpu in the call as it's a pointer to the apic structure's vcpu
> and we need to call on that particular CPU a request of KVM_REQ_PENDING_TIMER? Please let me known if I am missing any
> important information.
The idea is that there should be a function in x86.c (something like
kvm_vcpu_set_pending_timer) that calls kvm_make_request, instead of
doing it in lapic.c.
Paolo
next parent reply other threads:[~2014-12-19 11:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <549319DD.1020908@gmail.com>
2014-12-19 11:28 ` Paolo Bonzini [this message]
[not found] ` <5494304F.30802@gmail.com>
2014-12-19 14:12 ` Question about hrtimer_restart apic_timer_fn in lapic.c Paolo Bonzini
[not found] ` <5494393D.3070904@gmail.com>
2014-12-19 14:42 ` Paolo Bonzini
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=54940BF0.1020104@redhat.com \
--to=pbonzini@redhat.com \
--cc=gleb@kernel.org \
--cc=hpa@zytor.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=xerofoify@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox