From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH] Introduce bitmask for apic attention reasons. Date: Thu, 19 Apr 2012 13:26:27 +0300 Message-ID: <20120419102627.GA12768@redhat.com> References: <1334828002-12709-1-git-send-email-gleb@redhat.com> <4F8FE088.20606@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, mtosatti@redhat.com, mst@redhat.com To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:36602 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753758Ab2DSLW6 (ORCPT ); Thu, 19 Apr 2012 07:22:58 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q3JBMvq0021506 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 19 Apr 2012 07:22:57 -0400 Content-Disposition: inline In-Reply-To: <4F8FE088.20606@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Apr 19, 2012 at 12:53:12PM +0300, Avi Kivity wrote: > On 04/19/2012 12:33 PM, Gleb Natapov wrote: > > The patch introduces a bitmap that will hold reasons apic should be > > checked during vmexit. This is in a preparation for vp eoi patch > > that will add one more check on vmexit. With the bitmap we can do > > if(apic_attention) to check everything simultaneously which will > > add zero overhead on the fast path. > > > > Good idea. > > > > > +#define KVM_APIC_CHECK_VAPIC 0 > > Comment above relating this to apic_attention. > OK. > > vcpu->arch.apic->vapic_addr = vapic_addr; > > + if (vapic_addr) > > + __set_bit(KVM_APIC_CHECK_VAPIC, &vcpu->arch.apic_attention); > > + else > > + __clear_bit(KVM_APIC_CHECK_VAPIC, &vcpu->arch.apic_attention); > > } > > > > Unrelated: this pattern is probably common. Would be nice to have a > __deposit_bit() function. > What semantics should it have? Set bit A in bitmap B if value C is non-zero? -- Gleb.