From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sheng Yang Subject: Re: [PATCH] use bitmap ops on a bitmap instead of bit ops Date: Tue, 3 Mar 2009 09:28:00 +0800 Message-ID: <200903030928.00971.sheng@linux.intel.com> References: <20090226130339.GG8810@redhat.com> <20090227132658.GA10118@redhat.com> <200903021512.01051.sheng@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: Gleb Natapov , avi@redhat.com, kvm@vger.kernel.org To: Marcelo Tosatti Return-path: Received: from mga06.intel.com ([134.134.136.21]:19232 "EHLO orsmga101.jf.intel.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750745AbZCCB2S (ORCPT ); Mon, 2 Mar 2009 20:28:18 -0500 In-Reply-To: <200903021512.01051.sheng@linux.intel.com> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: On Monday 02 March 2009 15:12:00 Sheng Yang wrote: > On Friday 27 February 2009 21:26:58 Gleb Natapov wrote: > > On Fri, Feb 27, 2009 at 11:19:09AM +0800, Sheng Yang wrote: > > > > - *mask = 0; > > > > > > I think the caller should not assume anything about the output, so let > > > function itself do the clean is better. (however, not in this way for > > > "mask" should be KVM_MAX_VCPUS long.) > > > > Ok. I'll leave it although all callers of the function zeroes bitmask > > anyway. > > > > > And, I found some other things are not proper after looking back code, > > > I would send a patch to fix it (deliver_bitmask in > > > kvm_get_intr_delivery_bitmask). > > > > > > > if (dest_mode == 0) { /* Physical mode. */ > > > > if (dest == 0xFF) { /* Broadcast. */ > > > > for (i = 0; i < KVM_MAX_VCPUS; ++i) > > > > if (kvm->vcpus[i] && kvm->vcpus[i]->arch.apic) > > > > - *mask |= 1 << i; > > > > + __set_bit(i, *mask); > > > > > > Should be __set_bit(i, mask)? > > > > Oh. Here is updated patch: > > Thanks. :) > > Acked-by: Sheng Yang Just a reminder that I have merge this patch into the patch title"[PATCH] KVM: Merge kvm_ioapic_get_delivery_bitmask into kvm_get_intr_delivery_bitmask" with Gleb's agreement. Thanks. :) -- regards Yang, Sheng