summary refs log tree commit diff stats
path: root/hw/intc/loongarch_ipi_kvm.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/intc/loongarch_ipi_kvm.c')
-rw-r--r--hw/intc/loongarch_ipi_kvm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/intc/loongarch_ipi_kvm.c b/hw/intc/loongarch_ipi_kvm.c
index b615060d83..4cb3acc921 100644
--- a/hw/intc/loongarch_ipi_kvm.c
+++ b/hw/intc/loongarch_ipi_kvm.c
@@ -25,6 +25,10 @@ static void kvm_ipi_access_regs(void *opaque, bool write)
     uint64_t attr;
     int cpu, fd = lis->dev_fd;
 
+    if (fd == 0) {
+        return;
+    }
+
     for (cpu = 0; cpu < ipi->num_cpu; cpu++) {
         core = &ipi->cpu[cpu];
         attr = (cpu << 16) | CORE_STATUS_OFF;