On Fri, Sep 23, 2011, Marcelo Tosatti wrote about "Re: [PATCH 1/2] nVMX: Add KVM_REQ_IMMEDIATE_EXIT": > On Thu, Sep 22, 2011 at 01:52:56PM +0300, Nadav Har'El wrote: > > This patch adds a new vcpu->requests bit, KVM_REQ_IMMEDIATE_EXIT. > > This bit requests that when next entering the guest, we should run it only > > for as little as possible, and exit again. > > > > We use this new option in nested VMX: When L1 launches L2, but L0 wishes L1 >... > > @@ -5647,6 +5648,8 @@ static int vcpu_enter_guest(struct kvm_v > > } > > if (kvm_check_request(KVM_REQ_STEAL_UPDATE, vcpu)) > > record_steal_time(vcpu); > > + req_immediate_exit = > > + kvm_check_request(KVM_REQ_IMMEDIATE_EXIT, vcpu); >... > The immediate exit information can be lost if entry decides to bail out. > You can do > > req_immediate_exit = kvm_check_request(KVM_REQ_IMMEDIATE_EXIT) > after preempt_disable() > and then transfer back the bit in the bail out case in > if (vcpu->mode == EXITING_GUEST_MODE || vcpu->requests
Thanks. But thinking about this a bit, it seems to me that in my case *losing* this bit on a canceled entry is the correct thing to do, as turning on this bit was decided in the injection phase (in enable_irq_window()), and next time, if the reason to turn on this bit still exists (i.e., L0 has something to inject to L1, but L2 needs to run), we will turn it on again. -- Nadav Har'El | Sunday, Sep 25 2011, n...@math.technion.ac.il |----------------------------------------- Phone +972-523-790466, ICQ 13349191 |Guarantee: this email is 100% free of http://nadav.harel.org.il |magnetic monopoles, or your money back! -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html