All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 0/6] LoongArch: KVM: Small enhancement about interrupt injection
@ 2026-06-11  6:58 Bibo Mao
  2026-06-11  6:58 ` [PATCH v6 1/6] LoongArch: KVM: Check irq validility in kvm_vcpu_ioctl_interrupt() Bibo Mao
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Bibo Mao @ 2026-06-11  6:58 UTC (permalink / raw)
  To: Huacai Chen; +Cc: kernel, kvm, loongarch, linux-kernel

Here add illegal parameter check in kvm_vcpu_ioctl_interrupt() since this
function is called from user mode. Also interrupt inject is handled with
batch method, rather one by one.

---
v5 ... v6:
  1. Remove INT_SWI0 interrupt injection in kvm_vcpu_ioctl_interrupt()
     since there is no corresponding INT_SWI0 interrupt clear. Here keep
     the smallest modification.
  2. Rename macro KVM_VIP_DELTA with VIP_DELTA, KVM_ESTAT_IRQ_MASK with
     KVM_ESTAT_INTI_MASK, and KVM_ESTAT_HWI_MASK with KVM_ESTAT_EXTI_MASK
     in patch 3.

v4 ... v5:
  1. Replace constant 2 with macro GINTC_VIP_DELTA in patch 4.
  2. Keep register CSR_GINTC bits unchanged except CPU_IP0 - CPU_IP7 in
     function _kvm_setcsr().
  3. Add new patch 6 which moves function call with kvm_deliver_intr()
     after smp_store_mb(vcpu->mode, IN_GUEST_MODE).

v3 ... v4:
  1. change type of local variable vector with unsigned int rather than
     int, and use abs() macro.
  2. Remove last patch since kvm_vcpu_sync_intr() does not sync cached
     AVEC interrupt to SW CSR_ISR state.
  3. Replace kvm_set_sw_gcsr() with kvm_write_sw_gcsr() in patch 5,
     since kvm_set_sw_gcsr() is ORed cached ESTAT interrupt bits,
     kvm_write_sw_gcsr() is to overwrite the whole SW ESTAT register.
  4. Modify typo issue about title and log message in patch 5, replace
     GSTAT with ESTAT

v2 ... v3:
  1. Split patch 1 into two smaller patches, one is smaller bugfix patch
     with irq validility check in kvm_vcpu_ioctl_interrupt(), so that it
     is easy to porting to old kernel.

v1 ... v2:
  1. Add irq validility check in function kvm_vcpu_ioctl_interrupt().
  2. Add valid bit check when set ESTAT CSR register.
  3. Merge two patches about interrupt clear and set with batch method into
     one.
---
Bibo Mao (6):
  LoongArch: KVM: Check irq validility in kvm_vcpu_ioctl_interrupt()
  LoongArch: KVM: Check msgint feature in interrupt post
  LoongArch: KVM: Use existing macro about interrupt bit mask
  LoongArch: KVM: Inject interrupt with batch method
  LoongArch: KVM: Add valid bit check when set ESTAT CSR register
  LoongArch: KVM: Deliver interrupt after IN_GUEST_MODE is set

 arch/loongarch/include/asm/kvm_vcpu.h |  43 +++++++----
 arch/loongarch/kvm/interrupt.c        | 100 ++++++++------------------
 arch/loongarch/kvm/vcpu.c             |  35 ++++++---
 3 files changed, 82 insertions(+), 96 deletions(-)


base-commit: 9716c086c8e8b141d35aa61f2e96a2e83de212a7
-- 
2.39.3


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2026-06-12  8:39 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-11  6:58 [PATCH v6 0/6] LoongArch: KVM: Small enhancement about interrupt injection Bibo Mao
2026-06-11  6:58 ` [PATCH v6 1/6] LoongArch: KVM: Check irq validility in kvm_vcpu_ioctl_interrupt() Bibo Mao
2026-06-11  7:08   ` sashiko-bot
2026-06-11  6:58 ` [PATCH v6 2/6] LoongArch: KVM: Check msgint feature in interrupt post Bibo Mao
2026-06-11  7:13   ` sashiko-bot
2026-06-11  6:58 ` [PATCH v6 3/6] LoongArch: KVM: Use existing macro about interrupt bit mask Bibo Mao
2026-06-11  6:58 ` [PATCH v6 4/6] LoongArch: KVM: Inject interrupt with batch method Bibo Mao
2026-06-11  7:17   ` sashiko-bot
2026-06-11  6:58 ` [PATCH v6 5/6] LoongArch: KVM: Add valid bit check when set ESTAT CSR register Bibo Mao
2026-06-11 10:10   ` Huacai Chen
2026-06-11 12:52     ` Bibo Mao
2026-06-11 13:01       ` Huacai Chen
2026-06-12  8:39         ` Huacai Chen
2026-06-11  6:58 ` [PATCH v6 6/6] LoongArch: KVM: Deliver interrupt after IN_GUEST_MODE is set Bibo Mao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.