From: Wanpeng Li <kernellwp@gmail.com>
To: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
kvm <kvm@vger.kernel.org>, Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH 2/3] KVM: x86: really disarm lapic timer when clearing TMICT
Date: Sat, 7 Oct 2017 08:30:38 +0800 [thread overview]
Message-ID: <CANRm+CwaUw1Zit8C-Di+C4WugfQrxgxigX7xG5WY7nb8V_S-wQ@mail.gmail.com> (raw)
In-Reply-To: <20171006172555.30087-3-rkrcmar@redhat.com>
2017-10-07 1:25 GMT+08:00 Radim Krčmář <rkrcmar@redhat.com>:
> preemption timer only looks at tscdeadline and could inject already
> disarmed timer.
>
> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Reviewed-by: Wanpeng Li <wanpeng.li@hotmail.com>
> ---
> arch/x86/kvm/lapic.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
> index 39c1ae11ce1d..96ade848ae0b 100644
> --- a/arch/x86/kvm/lapic.c
> +++ b/arch/x86/kvm/lapic.c
> @@ -1489,8 +1489,10 @@ static bool set_target_expiration(struct kvm_lapic *apic)
> apic->lapic_timer.period = (u64)kvm_lapic_get_reg(apic, APIC_TMICT)
> * APIC_BUS_CYCLE_NS * apic->divide_count;
>
> - if (!apic->lapic_timer.period)
> + if (!apic->lapic_timer.period) {
> + apic->lapic_timer.tscdeadline = 0;
> return false;
> + }
>
> limit_periodic_timer_frequency(apic);
>
> --
> 2.14.2
>
next prev parent reply other threads:[~2017-10-07 0:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-06 17:25 [PATCH 0/3] KVM: x86: fix restart_apic_timer Radim Krčmář
2017-10-06 17:25 ` [PATCH 1/3] KVM: x86: handle 0 write to TSC_DEADLINE MSR Radim Krčmář
2017-10-07 0:26 ` Wanpeng Li
2017-10-06 17:25 ` [PATCH 2/3] KVM: x86: really disarm lapic timer when clearing TMICT Radim Krčmář
2017-10-07 0:30 ` Wanpeng Li [this message]
2017-10-06 17:25 ` [PATCH 3/3] KVM: x86: thoroughly disarm LAPIC timer around TSC deadline switch Radim Krčmář
2017-10-07 0:30 ` Wanpeng Li
2017-10-07 0:58 ` [PATCH 0/3] KVM: x86: fix restart_apic_timer Wanpeng Li
2017-10-10 8:35 ` 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=CANRm+CwaUw1Zit8C-Di+C4WugfQrxgxigX7xG5WY7nb8V_S-wQ@mail.gmail.com \
--to=kernellwp@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.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;
as well as URLs for NNTP newsgroup(s).