Skip to content

KVM: x86: Fix IOAPIC remote_irr and irr_delivered handling

Hao Zhang kvm sashiko-reviews 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest6 patches 3 repliesIn review
  2. v44 patches 4 repliesSuperseded
  3. v33 patches 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v11 of 2 patches2 repliesSuperseded

Changes in v5 from the cover letter

- Updated patch 1 changelog to explain the Fixes tag history and added Kai's Reviewed-by.
- Split selftest changes for the irr_delivered fixes into separate patches.
- Dropped the Fixes tag from the duplicate-edge patch, as the exact historical commit is unclear.

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6KVM: x86: ioapic: Update remote_irr only after successful deliveryarch/x86/kvm/ioapic.c+1 -10 replies
2/6KVM: selftests: Verify failed IOAPIC delivery preserves statetools/testing/selftests/kvm/Makefile.kvm tools/testing/selftests/kvm/x86/ioapic_state_test.c+93 -00 replies
3/6KVM: x86: ioapic: Preserve irr_delivered for duplicate edge interruptsarch/x86/kvm/ioapic.c+1 -12 replies
4/6KVM: selftests: Verify duplicate edge preserves IOAPIC statetools/testing/selftests/kvm/x86/ioapic_state_test.c+53 -00 replies
5/6KVM: x86: ioapic: Clear irr_delivered on level-triggered RTEarch/x86/kvm/ioapic.c+10 -11 reply
6/6KVM: selftests: Verify edge-to-level clears IOAPIC statetools/testing/selftests/kvm/x86/ioapic_state_test.c+45 -00 replies

Reviews trailers per patch

2 of 6 patches have a Reviewed-by or Acked-by.

PatchKai Huang
1/6R-b
2/6
3/6
4/6
5/6R-b
6/6

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

Read the v5 thread

Cover letter [PATCH v5 0/6] KVM: x86: Fix IOAPIC remote_irr and irr_delivered handling

From: Hao Zhang <[email protected]>

Fix several cases where KVM updates IOAPIC interrupt state incorrectly.

The first fix avoids setting remote_irr when level-triggered interrupt delivery fails, which can leave the pin blocked waiting for an EOI that will never arrive. The remaining fixes clean up irr_delivered handling for edge-triggered interrupts, which affects the IOAPIC state exposed to userspace through KVM_GET_IRQCHIP.

Changes in v5:
- Updated patch 1 changelog to explain the Fixes tag history and added Kai's Reviewed-by.
- Split selftest changes for the irr_delivered fixes into separate patches.
- Dropped the Fixes tag from the duplicate-edge patch, as the exact historical commit is unclear.

Hao Zhang (6):
KVM: x86: ioapic: Update remote_irr only after successful delivery
KVM: selftests: Verify failed IOAPIC delivery preserves state
KVM: x86: ioapic: Preserve irr_delivered for duplicate edge interrupts
KVM: selftests: Verify duplicate edge preserves IOAPIC state
KVM: x86: ioapic: Clear irr_delivered on level-triggered RTE
KVM: selftests: Verify edge-to-level clears IOAPIC state

 arch/x86/kvm/ioapic.c                              |  15 +-
 tools/testing/selftests/kvm/Makefile.kvm           |   1 +
 .../testing/selftests/kvm/x86/ioapic_state_test.c  | 190 +++++++++++++++++++++
 3 files changed, 203 insertions(+), 3 deletions(-)
 create mode 100644 tools/testing/selftests/kvm/x86/ioapic_state_test.c

base-commit: c21bb4193868a8de71fc4693fa741e195fdf5d86

Signature · 1 line
2.15.0