From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH] KVM: Improvements for task switching Date: Thu, 12 Mar 2009 20:12:58 +0100 Message-ID: <49B95EBA.6060301@siemens.com> References: <49B957BD.7000107@siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Bernhard Kohl , kvm@vger.kernel.org To: unlisted-recipients:; (no To-header on input) Return-path: Received: from lizzard.sbs.de ([194.138.37.39]:15206 "EHLO lizzard.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751348AbZCLTND (ORCPT ); Thu, 12 Mar 2009 15:13:03 -0400 In-Reply-To: <49B957BD.7000107@siemens.com> Sender: kvm-owner@vger.kernel.org List-ID: Jan Kiszka wrote: > Bernhard Kohl wrote: >> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c >> index 5cf28df..eca57a3 100644 >> --- a/arch/x86/kvm/vmx.c >> +++ b/arch/x86/kvm/vmx.c >> @@ -3357,7 +3357,8 @@ static void vmx_intr_assist(struct kvm_vcpu *vcpu) >> enable_irq_window(vcpu); >> } >> if (vcpu->arch.interrupt.pending) { >> - vmx_inject_irq(vcpu, vcpu->arch.interrupt.nr); >> + if (vcpu->arch.interrupt_window_open) >> + vmx_inject_irq(vcpu, vcpu->arch.interrupt.nr); >> if (kvm_cpu_has_interrupt(vcpu)) >> enable_irq_window(vcpu); >> } > > That causes concerns on my side as we had a hard time stabilizing this > code. Need to think about it. Do you happen to have a test case for this > (if it's not publicly shareable, contact me directly)? Did you check > that this change causes no obvious regressions to other guests? What > about the user-inject IRQ case, does it already work for you as-is? Hmm, do_interrupt_requests will most likely not cause troubles as it both pends and injects interrupts only when the window if open. I don't get the scenario behind this here yet, but I think it would be a very good chance to align the code layout of vmx_intr_assist to do_interrupt_requests in this respect, either finally de-optimizing or even breaking both :) - or bringing them in the same correct form. Jan -- Siemens AG, Corporate Technology, CT SE 2 Corporate Competence Center Embedded Linux