@samitouri / QOSamiQemu / commits / 9f0c2b3032

accel/kvm: mark guest state as unprotected after vm file descriptor change

When the KVM VM file descriptor has changed and a new one created, the guest state is no longer in protected state. Mark it as such. The guest state becomes protected again when TDX and SEV-ES and SEV-SNP mark it as such. Signed-off-by: Ani Sinha <anisinha@redhat.com> Link: https://lore.kernel.org/r/20260225035000.385950-7-anisinha@redhat.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Ani Sinha committed Feb 25, 2026 at 09:19 UTC 9f0c2b3032639315faf141010a2603b0dbf56230
1 file changed +3
accel/kvm/kvm-all.c
+3
@@ -2650,6 +2650,9 @@ static int kvm_reset_vmfd(MachineState *ms)
2650
2651 s->vmfd = ret;
2652
2653 + /* guest state is now unprotected again */
2654 + kvm_state->guest_state_protected = false;
2655 +
2656 kvm_setup_dirty_ring(s);
2657
2658 /* rebind memory to new vm fd */