From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MM8EF-00025e-UH for qemu-devel@nongnu.org; Wed, 01 Jul 2009 18:24:35 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MM8EB-00023c-8d for qemu-devel@nongnu.org; Wed, 01 Jul 2009 18:24:35 -0400 Received: from [199.232.76.173] (port=44747 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MM8EB-00023U-40 for qemu-devel@nongnu.org; Wed, 01 Jul 2009 18:24:31 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:36147) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MM8EA-0006Zf-FV for qemu-devel@nongnu.org; Wed, 01 Jul 2009 18:24:30 -0400 Message-ID: <4A4BE219.6090000@web.de> Date: Thu, 02 Jul 2009 00:24:25 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <4A4BC57E.504@web.de> <4A4BC87A.6050005@web.de> <4A4BCD26.2060102@web.de> <20090701205802.GA11286@codesourcery.com> In-Reply-To: <20090701205802.GA11286@codesourcery.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig65817649D6ABFEAA66137FD9" Sender: jan.kiszka@web.de Subject: [Qemu-devel] Re: [PATCH v2] Use ffs in favor of ffsll List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nathan Froyd Cc: Blue Swirl , Anthony Liguori , qemu-devel This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig65817649D6ABFEAA66137FD9 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Nathan Froyd wrote: > 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 =3D 0; i < ARRAY_SIZE(env->interrupt_bitmap); i++) { >> - bit =3D ffsll(env->interrupt_bitmap[i]); >> + for (i =3D 0; i < sizeof(env->interrupt_bitmap) / sizeof(int); i+= +) { >> + /* Note: This assumes little endian host, which is true in KV= M mode. >> + In TCG mode it must be zero anyway. */ >> + bit =3D ffs(((int *)env->interrupt_bitmap)[i]); >=20 > ISTR that some PPC hosts support KVM... >=20 =2E..but not for x86 guests. :) Jan --------------enig65817649D6ABFEAA66137FD9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkpL4h0ACgkQniDOoMHTA+lJ/wCePMqsWZP1dM8DpXfYp5ERhMOB 4LQAn0ERJPw6/MHb6N4EW9/PpzfIKajV =bv5v -----END PGP SIGNATURE----- --------------enig65817649D6ABFEAA66137FD9--