mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
hw/intc/loongarch_pch_msi: Inject MSI interrupt to kernel
If kvm_irqchip_in_kernel() return true, MSI interrupt can be injected with API kvm_irqchip_send_msi() to KVM. Reviewed-by: Song Gao <gaosong@loongson.cn> Signed-off-by: Bibo Mao <maobibo@loongson.cn> Message-ID: <20250606063033.2557365-7-maobibo@loongson.cn> Signed-off-by: Song Gao <gaosong@loongson.cn>
This commit is contained in:
parent
f936caa315
commit
5b0e05b902
1 changed files with 10 additions and 0 deletions
|
@ -13,6 +13,7 @@
|
|||
#include "hw/pci/msi.h"
|
||||
#include "hw/misc/unimp.h"
|
||||
#include "migration/vmstate.h"
|
||||
#include "system/kvm.h"
|
||||
#include "trace.h"
|
||||
|
||||
static uint64_t loongarch_msi_mem_read(void *opaque, hwaddr addr, unsigned size)
|
||||
|
@ -26,6 +27,15 @@ static void loongarch_msi_mem_write(void *opaque, hwaddr addr,
|
|||
LoongArchPCHMSI *s = (LoongArchPCHMSI *)opaque;
|
||||
int irq_num;
|
||||
|
||||
if (kvm_irqchip_in_kernel()) {
|
||||
MSIMessage msg;
|
||||
|
||||
msg.address = addr;
|
||||
msg.data = val;
|
||||
kvm_irqchip_send_msi(kvm_state, msg);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* vector number is irq number from upper extioi intc
|
||||
* need subtract irq base to get msi vector offset
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue