From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH v3 1/3] KVM: nVMX: Rework interception of IRQs and NMIs Date: Fri, 07 Mar 2014 17:29:22 +0100 Message-ID: <5319F3E2.3020205@siemens.com> References: <5319E975.1030400@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: kvm To: Paolo Bonzini , Gleb Natapov , Marcelo Tosatti Return-path: Received: from thoth.sbs.de ([192.35.17.2]:57476 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753591AbaCGQ3e (ORCPT ); Fri, 7 Mar 2014 11:29:34 -0500 In-Reply-To: <5319E975.1030400@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 2014-03-07 16:44, Paolo Bonzini wrote: > Il 06/03/2014 18:33, Jan Kiszka ha scritto: >> Move the check for leaving L2 on pending and intercepted IRQs or NMIs >> from the *_allowed handler into a dedicated callback. Invoke this >> callback at the relevant points before KVM checks if IRQs/NMIs can be >> injected. The callback has the task to switch from L2 to L1 if needed >> and inject the proper vmexit events. >> >> The rework fixes L2 wakeups from HLT and provides the foundation for >> preemption timer emulation. >> >> Signed-off-by: Jan Kiszka >> --- >> arch/x86/include/asm/kvm_host.h | 2 ++ >> arch/x86/kvm/vmx.c | 67 +++++++++++++++++++++++------------------ >> arch/x86/kvm/x86.c | 15 +++++++-- >> 3 files changed, 53 insertions(+), 31 deletions(-) > > With this patch do we still need > > if (is_guest_mode(vcpu) && nested_exit_on_intr(vcpu)) > /* > * We get here if vmx_interrupt_allowed() said we can't > * inject to L1 now because L2 must run. The caller will have > * to make L2 exit right after entry, so we can inject to L1 > * more promptly. > */ > return -EBUSY; > > in enable_irq_window? If not, enable_nmi_window and enable_irq_window > can both return void. I don't see right now why this should have changed. We still cannot interrupt vmlaunch/vmresume. > > And perhaps, vmx_check_nested_events could use the preemption timer trick > from Jailhouse instead of smp_send_reschedule. That would exclude CPUs without preemption timer support... Jan -- Siemens AG, Corporate Technology, CT RTC ITP SES-DE Corporate Competence Center Embedded Linux