On 24/12/2017 17:13, Liran Alon wrote: > If L1 doesn't intercept L2 HLT (doesn't set CPU_BASED_HLT_EXITING), > then when L2 executes HLT instruction, KVM will block vCPU from > further execution (just like what happens when L1 executes HLT). > > Thus, when some CPU sends nested-posted-interrupt to a halted > L2 vCPU, vmx_deliver_nested_posted_interrupt() notes that > vcpu->mode != IN_GUEST_MODE and therefore doesn't send a physical IPI. > Because the dest vCPU is blocked by HLT, we should kick it. In patch 9, you write "in addition, assume that dest CPU passes the checks for pending kvm requests before sender sets KVM_REQ_EVENT". But, this is pretty much the same scenario that you are fixing here (except without KVM_REQ_EVENT involvement). So patch 10 should be placed *before patch 9* and it should do something like this: - kvm_vcpu_trigger_posted_interrupt(vcpu, true); ... kvm_make_request(KVM_REQ_EVENT, vcpu); + if (!kvm_vcpu_trigger_posted_interrupt(vcpu, true)) + kvm_vcpu_kick(vcpu); with patch 9's commit message adjusted. Paolo