From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH v3 1/3] KVM: nVMX: Rework interception of IRQs and NMIs Date: Fri, 07 Mar 2014 20:45:20 +0100 Message-ID: <531A21D0.8030502@redhat.com> References: <5319E975.1030400@redhat.com> <5319F3E2.3020205@siemens.com> <5319F7FE.50106@redhat.com> <531A01C6.1060400@siemens.com> <531A0DC9.4010106@siemens.com> <531A0F71.40507@siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm To: Jan Kiszka , Gleb Natapov , Marcelo Tosatti Return-path: Received: from mail-ee0-f45.google.com ([74.125.83.45]:42779 "EHLO mail-ee0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751649AbaCGTp0 (ORCPT ); Fri, 7 Mar 2014 14:45:26 -0500 Received: by mail-ee0-f45.google.com with SMTP id d17so1914776eek.18 for ; Fri, 07 Mar 2014 11:45:25 -0800 (PST) In-Reply-To: <531A0F71.40507@siemens.com> Sender: kvm-owner@vger.kernel.org List-ID: Il 07/03/2014 19:26, Jan Kiszka ha scritto: >> > Reading through my code again, I'm now wondering why I added >> > check_nested_events to both inject_pending_event and vcpu_enter_guest. >> > The former seems redundant, only vcpu_enter_guest calls >> > inject_pending_event. I guess I forgot a cleanup here. > Nah, it's not redundant, we need to check for potential L2->L2 switches > *before* trying deliver events to L2. Yeah, and after the call in inject_pending_event you can similarly have an "else if" since vmx_nmi/interrupt_allowed will check nested_run_pending and never return true. > But think I can (and probably > should) get rid of the second test in vcpu_enter_guest. If so inject_pending_event would return true to request an immediate exit, right? Paolo