From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nadav Har'El Subject: Re: [PATCH 1/2] nVMX: Add KVM_REQ_IMMEDIATE_EXIT Date: Sun, 25 Sep 2011 11:13:06 +0300 Message-ID: <20110925081306.GA20035@fermat.math.technion.ac.il> References: <1316688715-nyh@il.ibm.com> <201109221052.p8MAquAQ003115@rice.haifa.ibm.com> <20110923123633.GA30599@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , kvm@vger.kernel.org, Dave Allan , Federico Simoncelli , Abel Gordon To: Marcelo Tosatti Return-path: Received: from mailgw12.technion.ac.il ([132.68.225.12]:37659 "EHLO mailgw12.technion.ac.il" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751112Ab1IYIXI (ORCPT ); Sun, 25 Sep 2011 04:23:08 -0400 Content-Disposition: inline In-Reply-To: <20110923123633.GA30599@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: 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, nyh@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!