diff mbox series

[1/1] accel/kvm: set coalesced_mmio_ring to NULL after kvm_run is unmapped

Message ID IA0PR02MB9486FF6FB2D71C90D8602007BEFF2@IA0PR02MB9486.namprd02.prod.outlook.com (mailing list archive)
State New
Headers show
Series [1/1] accel/kvm: set coalesced_mmio_ring to NULL after kvm_run is unmapped | expand

Commit Message

Sid Manning Feb. 13, 2025, 7:56 p.m. UTC
kvm_flush_coalesced_mmio_buffer explicitly checks for this to
be non-null.  Since kvm_init_vcpu sets this as an offset from the mapped
cpu->kvm_run it should be reset to NULL after kvm_run is unmapped.

Signed-off-by: Sid Manning <sidneym@quicinc.com>
---
 accel/kvm/kvm-all.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index c65b790433..b67964e552 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -512,6 +512,8 @@  static int do_kvm_destroy_vcpu(CPUState *cpu)
         goto err;
     }
 
+    s->coalesced_mmio_ring = NULL;
+
     if (cpu->kvm_dirty_gfns) {
         ret = munmap(cpu->kvm_dirty_gfns, s->kvm_dirty_ring_bytes);
         if (ret < 0) {