On 26/08/19 20:26, Liran Alon wrote: > An alternative could be to just add a flag to events->flags that modifies > behaviour to treat events->smi.latched_init as just events->latched_init. > But I prefer the previous option. Why would you even need the flag? I think you only need to move the "if (lapic_in_kernel(vcpu)) outside, under "if (events->flags & KVM_VCPUEVENT_VALID_SMM)". In fact, I think it would make sense anyway to clear KVM_APIC_SIPI in kvm_vcpu_ioctl_x86_set_vcpu_events (i.e. clear apic->pending_events and then possibly set KVM_APIC_INIT if events->smi.latched_init is true). Paolo