From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [patch 2/5] KVM: reintroduce guest mode bit and unify remote request code Date: Thu, 27 Aug 2009 09:45:26 -0300 Message-ID: <20090827124526.GA3476@amt.cnet> References: <20090827012000.762063112@localhost.localdomain> <20090827012955.208915957@localhost.localdomain> <4A96409B.3020001@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:1727 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752499AbZH0M6u (ORCPT ); Thu, 27 Aug 2009 08:58:50 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7RCwqD5000759 for ; Thu, 27 Aug 2009 08:58:52 -0400 Content-Disposition: inline In-Reply-To: <4A96409B.3020001@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Aug 27, 2009 at 11:15:23AM +0300, Avi Kivity wrote: > On 08/27/2009 04:20 AM, Marcelo Tosatti wrote: >> Split KVM_REQ_KICKED in two bits: KVM_VCPU_KICKED, to indicate >> whether a vcpu has been IPI'ed, and KVM_VCPU_GUEST_MODE, in a separate >> vcpu_state variable. >> >> Unify remote requests with kvm_vcpu_kick. >> >> Synchronous requests wait on KVM_VCPU_GUEST_MODE, via wait_on_bit/wake_up_bit. >> >> > > I did miss guest_mode. > >> + unsigned long vcpu_state; >> > > Why not bool guest_mode? Saves two atomics per exit. It must be atomic since GUEST_MODE / VCPU_KICKED bits are manipulated by multiple CPU's.