diff --git a/hw/ub/ub_ummu.c b/hw/ub/ub_ummu.c index 5eff0c1f6ed4b6f64814454046c8877af960844a..23f2c6c7985804a75a12b9ed37b51cfd685a039e 100644 --- a/hw/ub/ub_ummu.c +++ b/hw/ub/ub_ummu.c @@ -918,7 +918,9 @@ static void ummu_glb_int_enable(UMMUState *u, UMMUUSIVectorType type) KVMRouteChange route_change; USIMessage msg; uint32_t interrupt_id = UMMU_INTERRUPT_ID; - + if (!kvm_state) { + return; + } if (type == UMMU_USI_VECTOR_EVETQ) { msg = ummu_get_eventq_usi_message(u); } else { diff --git a/hw/vfio/ub.c b/hw/vfio/ub.c index 1f0d511bc0d9241612402b857da6986e6479d62f..ab2beea49298b67532034b9b4803a80516542396 100644 --- a/hw/vfio/ub.c +++ b/hw/vfio/ub.c @@ -536,7 +536,7 @@ static int vfio_usi_vector_do_use(UBDevice *udev, uint16_t nr, USIMessage *msg, vfio_update_kvm_usi_virq(vector, *msg, udev); } } else { - if (msg) { + if (msg && kvm_state) { vfio_route_change = kvm_irqchip_begin_route_changes(kvm_state); vfio_add_kvm_usi_virq(vdev, vector, nr); kvm_irqchip_commit_route_changes(&vfio_route_change); @@ -1283,4 +1283,4 @@ static void register_vfio_ub_dev_types(void) type_register_static(&vfio_ub_dev_info); } -type_init(register_vfio_ub_dev_types) \ No newline at end of file +type_init(register_vfio_ub_dev_types)