Skip to content

LoongArch: KVM: Fix timer restore issues

Tao Cui kvm lkml loongarch 3 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 3 repliesIn review
  2. v21 patch 0 repliesSuperseded
  3. v11 patch 4 repliesSuperseded

Changes in v3 from the cover letter

- Add patch 2 (division by zero fix, found by Sashiko AI review).
- Reuse the existing now timestamp instead of a redundant ktime_get().

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2LoongArch: KVM: Reload one-shot TVAL on migration destinationarch/loongarch/kvm/timer.c+12 -01 reply
2/2LoongArch: KVM: Prevent division by zero in periodic timer restorearch/loongarch/kvm/timer.c+2 -01 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchBibo Mao
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

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

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.

Signature · 1 line
2.43.0