[PATCH 0/2] LoongArch: KVM: Code cleanup with MSI intterupt injection

Bibo Mao posted 2 patches 2 weeks, 2 days ago
There is a newer version of this series
arch/loongarch/include/asm/kvm_dmsintc.h |  3 +--
arch/loongarch/include/asm/kvm_pch_pic.h |  2 +-
arch/loongarch/kvm/intc/dmsintc.c        | 19 +++----------------
arch/loongarch/kvm/intc/pch_pic.c        |  6 +++---
arch/loongarch/kvm/irqfd.c               |  6 +++---
5 files changed, 11 insertions(+), 25 deletions(-)
[PATCH 0/2] LoongArch: KVM: Code cleanup with MSI intterupt injection
Posted by Bibo Mao 2 weeks, 2 days ago
Here is to remove some unnecessary parameter checking when injecting
MSI interrupt, include MSI level parameter and vcpu::arch::dmsintc_state
NULL pointer etc.

Bibo Mao (2):
  LoongArch: KVM: Remove parameter line when inject MSI
  LoongArch: KVM: Remove duplicated checking with DMSI irq injection

 arch/loongarch/include/asm/kvm_dmsintc.h |  3 +--
 arch/loongarch/include/asm/kvm_pch_pic.h |  2 +-
 arch/loongarch/kvm/intc/dmsintc.c        | 19 +++----------------
 arch/loongarch/kvm/intc/pch_pic.c        |  6 +++---
 arch/loongarch/kvm/irqfd.c               |  6 +++---
 5 files changed, 11 insertions(+), 25 deletions(-)


base-commit: df2908090cda368b01ff43709f51890076c56157
-- 
2.39.3
Re: [PATCH 0/2] LoongArch: KVM: Code cleanup with MSI intterupt injection
Posted by Tao Cui 2 weeks, 1 day ago
Hi, Bibo

在 2026/9/9 16:32, Bibo Mao 写道:
> Here is to remove some unnecessary parameter checking when injecting
> MSI interrupt, include MSI level parameter and vcpu::arch::dmsintc_state
> NULL pointer etc.
> 
> Bibo Mao (2):
>   LoongArch: KVM: Remove parameter line when inject MSI
>   LoongArch: KVM: Remove duplicated checking with DMSI irq injection
> 
>  arch/loongarch/include/asm/kvm_dmsintc.h |  3 +--
>  arch/loongarch/include/asm/kvm_pch_pic.h |  2 +-
>  arch/loongarch/kvm/intc/dmsintc.c        | 19 +++----------------
>  arch/loongarch/kvm/intc/pch_pic.c        |  6 +++---
>  arch/loongarch/kvm/irqfd.c               |  6 +++---
>  5 files changed, 11 insertions(+), 25 deletions(-)
> 
> 
> base-commit: df2908090cda368b01ff43709f51890076c56157

The series looks good to me.

Reviewed-by: Tao Cui <cuitao@kylinos.cn>

Minor question: kvm_set_msi() now returns -EINVAL for !level instead
of -1. Since MSI is edge-triggered, returning 0 to ignore a deassert
would also work, though nothing looks at the return value today.


Re: [PATCH 0/2] LoongArch: KVM: Code cleanup with MSI intterupt injection
Posted by Bibo Mao 3 days, 5 hours ago

On 2026/9/10 上午11:06, Tao Cui wrote:
> Hi, Bibo
> 
> 在 2026/9/9 16:32, Bibo Mao 写道:
>> Here is to remove some unnecessary parameter checking when injecting
>> MSI interrupt, include MSI level parameter and vcpu::arch::dmsintc_state
>> NULL pointer etc.
>>
>> Bibo Mao (2):
>>    LoongArch: KVM: Remove parameter line when inject MSI
>>    LoongArch: KVM: Remove duplicated checking with DMSI irq injection
>>
>>   arch/loongarch/include/asm/kvm_dmsintc.h |  3 +--
>>   arch/loongarch/include/asm/kvm_pch_pic.h |  2 +-
>>   arch/loongarch/kvm/intc/dmsintc.c        | 19 +++----------------
>>   arch/loongarch/kvm/intc/pch_pic.c        |  6 +++---
>>   arch/loongarch/kvm/irqfd.c               |  6 +++---
>>   5 files changed, 11 insertions(+), 25 deletions(-)
>>
>>
>> base-commit: df2908090cda368b01ff43709f51890076c56157
> 
> The series looks good to me.
> 
> Reviewed-by: Tao Cui <cuitao@kylinos.cn>
> 
> Minor question: kvm_set_msi() now returns -EINVAL for !level instead
> of -1. Since MSI is edge-triggered, returning 0 to ignore a deassert
yes, it seems that returning 0 is better, since there is such usage with
level == 0 when injecting MSI interrupt.

Regards
Bibo Mao
> would also work, though nothing looks at the return value today.
>