From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] Introduce bitmask for apic attention reasons. Date: Thu, 19 Apr 2012 12:53:12 +0300 Message-ID: <4F8FE088.20606@redhat.com> References: <1334828002-12709-1-git-send-email-gleb@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, mtosatti@redhat.com, mst@redhat.com To: Gleb Natapov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:44984 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753449Ab2DSJxO (ORCPT ); Thu, 19 Apr 2012 05:53:14 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q3J9rEhi025836 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 19 Apr 2012 05:53:14 -0400 In-Reply-To: <1334828002-12709-1-git-send-email-gleb@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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. > 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. -- error compiling committee.c: too many arguments to function