From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MM6sd-0003nU-Mu for qemu-devel@nongnu.org; Wed, 01 Jul 2009 16:58:11 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MM6sZ-0003l2-32 for qemu-devel@nongnu.org; Wed, 01 Jul 2009 16:58:11 -0400 Received: from [199.232.76.173] (port=41801 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MM6sY-0003kw-Tl for qemu-devel@nongnu.org; Wed, 01 Jul 2009 16:58:06 -0400 Received: from mx20.gnu.org ([199.232.41.8]:25245) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MM6sY-0000IQ-UD for qemu-devel@nongnu.org; Wed, 01 Jul 2009 16:58:07 -0400 Received: from mail.codesourcery.com ([65.74.133.4]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MM6sX-0003J9-E3 for qemu-devel@nongnu.org; Wed, 01 Jul 2009 16:58:05 -0400 Date: Wed, 1 Jul 2009 13:58:02 -0700 From: Nathan Froyd Subject: Re: [Qemu-devel] [PATCH v2] Use ffs in favor of ffsll Message-ID: <20090701205802.GA11286@codesourcery.com> References: <4A4BC57E.504@web.de> <4A4BC87A.6050005@web.de> <4A4BCD26.2060102@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A4BCD26.2060102@web.de> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: Blue Swirl , Anthony Liguori , qemu-devel On Wed, Jul 01, 2009 at 10:55:02PM +0200, Jan Kiszka wrote: > Jan Kiszka wrote: > > Blue Swirl wrote: > >> I think this will not work on a big endian host. > > > > Right, may theoretically bite us once we are able to migrate between kvm > > and tcg. Will send a better version nevertheless. > > > > - for (i = 0; i < ARRAY_SIZE(env->interrupt_bitmap); i++) { > - bit = ffsll(env->interrupt_bitmap[i]); > + for (i = 0; i < sizeof(env->interrupt_bitmap) / sizeof(int); i++) { > + /* Note: This assumes little endian host, which is true in KVM mode. > + In TCG mode it must be zero anyway. */ > + bit = ffs(((int *)env->interrupt_bitmap)[i]); ISTR that some PPC hosts support KVM... -Nathan