[RFC PATCH v1 14/17] accel/kvm: skip MSI route updates for a CoVE guest

Baolong Duan <[email protected]> Fri, 31 Jul 2026 11:50:08 +0800
Newsgroups org.nongnu.qemu-riscv,org.nongnu.qemu-devel
Message-ID <[email protected]>
A CoVE guest has no in-kernel APLIC, so there is no MSI route for KVM to
update and KVM_SET_GSI_ROUTING fails.

This is a workaround: the accelerator should rather be told that GSI
routing is unavailable than have CoVE special cased here.

Signed-off-by: Baolong Duan <[email protected]>
---
 accel/kvm/kvm-all.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 2753bf8b8b..aaaa88bd2b 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -2448,6 +2448,14 @@ int kvm_irqchip_update_msi_route(KVMState *s, int virq, MSIMessage msg,
 {
     struct kvm_irq_routing_entry kroute = {};
 
+    /*
+     * A CoVE guest has no in-kernel APLIC, so there is no MSI route for KVM
+     * to update.
+     */
+    if (riscv_cove_vm_active()) {
+        return 0;
+    }
+
     if (kvm_gsi_direct_mapping()) {
         return 0;
     }
-- 
2.34.1