accel/kvm: Don't clear pending #SMI in kvm_get_vcpu_events
The kvm_get_vcpu_events propogates the state of the pending smi from the kernel to the cpu->interrupt_request, with the intention of having un up to date migration state. Later the opposite is done, the kvm_put_vcpu_events restores the state of the pending #SMI from the 'cs->interrupt_request' The only problem is that kvm_get_vcpu_events also resets the SMI in cpu->interrupt_request when there is no pending #SMI indicated by the kernel, and that is wrong as the SMI might be still raised by qemu. While at it, also fix a similar but more theoretical bug with regard to a latched #INIT while in SMM. A simple reproducer for this bug is to read an EFI variable in a loop from within a guest, while at the same time run 'info registers' on the qemu HMP monitor. The reads will, once in a while, fail with an 'Invalid argument' error. Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Link: https://lore.kernel.org/r/20260223221908.361456-1-mlevitsk@redhat.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>