From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: KVM: x86: do not execute guest code if vcpu not runnable Date: Sat, 19 Jul 2008 20:41:04 -0300 Message-ID: <20080719234104.GA10435@dmt.cnet> References: <20080719181143.GA27283@dmt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm-devel To: Avi Kivity Return-path: Received: from mx1.redhat.com ([66.187.233.31]:46404 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753972AbYGSXle (ORCPT ); Sat, 19 Jul 2008 19:41:34 -0400 Content-Disposition: inline In-Reply-To: <20080719181143.GA27283@dmt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On Sat, Jul 19, 2008 at 03:11:44PM -0300, Marcelo Tosatti wrote: > > If a vcpu has been offlined, or not initialized at all, signals > requesting userspace work to be performed will result in KVM attempting > to re-entry guest mode. > > Problem is that the in-kernel irqchip emulation happily executes HALTED > state vcpu's. This breaks "savevm" on Windows SMP installation, for > example. > > Also, setting the mpstate to runnable when setting an IRQ via > pic_irq_request / kvm_apic_set_irq is necessary due to this check on > emulate_halt: > > kvm_vcpu_block(vcpu); > down_read(&vcpu->kvm->slots_lock); > if (vcpu->arch.mp_state != KVM_MP_STATE_RUNNABLE) > return -EINTR; > > Otherwise the vcpu will return to userspace needlessly. Scratch this, burns 100% CPU.