Re: [PATCH v3 0/2] LoongArch: KVM: Fix timer restore issues

Huacai Chen <[email protected]> Sun, 2 Aug 2026 20:01:53 +0800
Newsgroups dev.linux.lists.loongarch,org.kernel.vger.kvm,org.kernel.vger.linux-kernel
Message-ID <CAAhV-H7NArGzQJX-h9U5Wr5JjkKoTAc=4Ug6z9FeR5yDy6PSTA@mail.gmail.com>
Series applied, thanks.

Huacai

On Wed, Jul 15, 2026 at 6:07=E2=80=AFPM Tao Cui <[email protected]> wrote:
>
> From: Tao Cui <[email protected]>
>
> Fix two issues in kvm_restore_timer():
>
> Patch 1 fixes a one-shot timer firing immediately after migration because
> vcpu->arch.expire is not migrated.
>
> Patch 2 fixes a division-by-zero crash when a guest programs a periodic
> timer with a period value of zero.
>
> Both are in the same function (kvm_restore_timer) and are sent as a
> series for convenience.
>
> Tao Cui (2):
>   LoongArch: KVM: Reload one-shot TVAL on migration destination
>   LoongArch: KVM: Prevent division by zero in periodic timer restore
>
>  arch/loongarch/kvm/timer.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> ---
> Changes in v3:
> - Add patch 2 (division by zero fix, found by Sashiko AI review).
> - Reuse the existing now timestamp instead of a redundant ktime_get().
>
> Changes in v2:
> - Move the expire check before ktime_before() (suggested by Bibo Mao)
> - Remove the old else-if branch that was one-shot only.
> --
> 2.43.0
>