On 10/11/2017 19:06, Radim Krčmář wrote: >> /* the PIR and ON have been set by L1. */ >> if (!kvm_vcpu_trigger_posted_interrupt(vcpu, true)) { > This would still fail on the exiting case. > > If one VCPU was just after a VM exit, then the sender would see it > IN_GUEST_MODE, send the posted notification and return true, but the > notification would do nothing It would cause *something*---a vmexit because the vector doesn't match the L1 posted interrupt. Then smp_kvm_posted_intr_nested_ipi would be invoked from vmx_handle_external_intr. Could we detect the vector in vmx_handle_external_intr and set pi_pending+KVM_REQ_EVENT? Or invoke a function in KVM from smp_kvm_posted_intr_nested_ipi? Or would both be insane?... Thanks, Paolo > and we didn't set vmx->nested.pi_pending = > true, so the interrupt would not get handled until the next posted > notification or nested VM entry. >