Re: [PATCH v3 10/11] KVM: nVMX: Wake halted L2 on nested posted-interrupt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux