[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 13/15] hw/intc/loongarch_pch: Inject irq line interrupt to kernel
From: |
Bibo Mao |
Subject: |
[PATCH 13/15] hw/intc/loongarch_pch: Inject irq line interrupt to kernel |
Date: |
Fri, 9 May 2025 18:12:43 +0800 |
If property irqchip_in_kernel is enabled, irq line interrupt can be
injected with API kvm_set_irq() to KVM.
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
---
hw/intc/loongarch_pch_pic.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/intc/loongarch_pch_pic.c b/hw/intc/loongarch_pch_pic.c
index e8dfd0ed75..fb063173b7 100644
--- a/hw/intc/loongarch_pch_pic.c
+++ b/hw/intc/loongarch_pch_pic.c
@@ -45,11 +45,17 @@ static void pch_pic_update_irq(LoongArchPICCommonState *s,
uint64_t mask,
static void pch_pic_irq_handler(void *opaque, int irq, int level)
{
LoongArchPICCommonState *s = LOONGARCH_PIC_COMMON(opaque);
+ LoongarchPICState *lps = LOONGARCH_PIC(opaque);
uint64_t mask = 1ULL << irq;
assert(irq < s->irq_num);
trace_loongarch_pch_pic_irq_handler(irq, level);
+ if (kvm_enabled() && lps->irqchip_in_kernel) {
+ kvm_set_irq(kvm_state, irq, !!level);
+ return;
+ }
+
if (s->intedge & mask) {
/* Edge triggered */
if (level) {
--
2.39.3
- [PATCH 09/15] hw/intc/loongarch_pch_msi: Inject MSI interrupt to kernel, (continued)
- [PATCH 09/15] hw/intc/loongarch_pch_msi: Inject MSI interrupt to kernel, Bibo Mao, 2025/05/09
- [PATCH 07/15] hw/intc/loongarch_ipi: Add irqchip-in-kernel save/restore function, Bibo Mao, 2025/05/09
- [PATCH 05/15] hw/intc/loongarch_ipi: Add irqchip-in-kernel realize function, Bibo Mao, 2025/05/09
- [PATCH 04/15] hw/intc/loongarch_ipi: Add irqchip-in-kernel property, Bibo Mao, 2025/05/09
- [PATCH 10/15] hw/intc/loongarch_pch: Add irqchip-in-kernel property, Bibo Mao, 2025/05/09
- [PATCH 11/15] hw/intc/loongarch_pch: Add irqchip-in-kernel realize function, Bibo Mao, 2025/05/09