From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests Date: Tue, 5 Mar 2013 20:16:41 -0300 Message-ID: <20130305231641.GA6846@amt.cnet> References: <51351517.3090600@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Gleb Natapov , kvm , Paolo Bonzini To: Jan Kiszka Return-path: Received: from mx1.redhat.com ([209.132.183.28]:46131 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750931Ab3CEXRw (ORCPT ); Tue, 5 Mar 2013 18:17:52 -0500 Content-Disposition: inline In-Reply-To: <51351517.3090600@web.de> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Mar 04, 2013 at 10:41:43PM +0100, Jan Kiszka wrote: > From: Jan Kiszka > > A VCPU sending INIT or SIPI to some other VCPU races for setting the > remote VCPU's mp_state. When we were unlucky, KVM_MP_STATE_INIT_RECEIVED > was overwritten by kvm_emulate_halt and, thus, got lost. > > Fix this by raising requests on the sender side that will then be > handled synchronously over the target VCPU context. > > Signed-off-by: Jan Kiszka Why is kvm_emulate_halt being executed from KVM_MP_STATE_INIT_RECEIVED/KVM_MP_STATE_SIPI_RECEIVED again? Why is it not true that the only valid transition from KVM_MP_STATE_HALTED is from KVM_MP_STATE_RUNNABLE? It would be good for KVM_MP_STATE_HALTED to indicate "guest executed HLT instruction" (which is impossible without INIT/SIPI being received).