From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49629) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmeZS-00068a-6d for qemu-devel@nongnu.org; Wed, 21 Sep 2016 06:16:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmeZO-0006EP-8l for qemu-devel@nongnu.org; Wed, 21 Sep 2016 06:16:06 -0400 Date: Wed, 21 Sep 2016 20:15:23 +1000 From: David Gibson Message-ID: <20160921101523.GF1809@umbus.fritz.box> References: <1474451825-17144-1-git-send-email-michael@walle.cc> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Pql/uPZNXIm1JCle" Content-Disposition: inline In-Reply-To: <1474451825-17144-1-git-send-email-michael@walle.cc> Subject: Re: [Qemu-devel] [PATCH v2] linux-user: ppc64: fix ARCH_206 bit in AT_HWCAP List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Walle Cc: Riku Voipio , Alexander Graf , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Tom Musta --Pql/uPZNXIm1JCle Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 21, 2016 at 11:57:05AM +0200, Michael Walle wrote: > Only the POWER[789] CPUs should have the ARCH_206 bit set. This is what t= he > linux kernel does. I guess this was also the intention of commit 0e019746. > We have to make sure all *206 bits are set. >=20 > Before this patch, the flags check in the GET_FEATURES2 macro returned tr= ue > if _any_ bit was set. This worked well as long as there was only one bit > set in the 'flag' parameter. But as explained before, we have to make sure > all bits in the 'flag' parameter are set. >=20 > Signed-off-by: Michael Walle Applied to ppc-for-2.8, thanks. > --- > v2: > - rename flag to flags > - use normal indent style in macro (also makes checkpatch.pl happy ;) > - add explanation in commit message >=20 > linux-user/elfload.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) >=20 > diff --git a/linux-user/elfload.c b/linux-user/elfload.c > index f807baf..515ba6c 100644 > --- a/linux-user/elfload.c > +++ b/linux-user/elfload.c > @@ -741,8 +741,12 @@ static uint32_t get_elf_hwcap(void) > Altivec/FP/SPE support. Anything else is just a bonus. */ > #define GET_FEATURE(flag, feature) \ > do { if (cpu->env.insns_flags & flag) { features |=3D feature; } } w= hile (0) > -#define GET_FEATURE2(flag, feature) = \ > - do { if (cpu->env.insns_flags2 & flag) { features |=3D feature; } } = while (0) > +#define GET_FEATURE2(flags, feature) \ > + do { \ > + if ((cpu->env.insns_flags2 & flags) =3D=3D flags) { \ > + features |=3D feature; \ > + } \ > + } while (0) > GET_FEATURE(PPC_64B, QEMU_PPC_FEATURE_64); > GET_FEATURE(PPC_FLOAT, QEMU_PPC_FEATURE_HAS_FPU); > GET_FEATURE(PPC_ALTIVEC, QEMU_PPC_FEATURE_HAS_ALTIVEC); --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --Pql/uPZNXIm1JCle Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJX4l27AAoJEGw4ysog2bOSBMsQAN7obKfmsil0AQwgxR/tOSdd lDoqWQ4aRD/KkfnbIEjK5aHTbwuwGQ9OYtLonQFoHIzIcBaKmbLMUscskwZuXAb2 P/G1GkPWZ/mAsez7378K3M/HElNhVc8Aaz1eWD19FwAlZwl5a19yzh6HCvW68Wgv gsK3NCcyPnddpReSQ9JMMR+T+J8ahkwK2PMo4j8nzVB4PGRW1JgyBTXcSdiBXfIO z5k2phGOtzbEW810/3Z0Z3zirLGqSLr3Md/SiT7AxwgGPsLGVQsYPKbeKO5RECFx oOAyKiD1QmOqe3FS9Sm6ego3h8RAULmOJZA5WgQ6pjZ3gAGhF/Xdb0WqwVvl0/T3 +EGlNqalT4Mxca4n2Uu+ybWhaTNipM34CftoSyL8iCV4uc64/SJD2ZxVs4nwy9AB dfVTYqsHhfn1cQtb28dqPpMysvrxxR220V96OwU855nAeNfo7dUIQkHN0DrjLzXC uCnN9Fj0RNbD+Uu8RZqUPbZjBSMf1SzyOQqh7ZeJuSBHhLzFUeuKe+WaLxDU5xN6 5xMZDEt2YJBam1iYuBRGJGDewCnCUbtjVV+2E7QCQWaM28SmY+LDRsmbW7B/wTVG tdYxl81iFtYck8tIwCssNU5gUwDcb6rHrq3xG730aMM+XX8er9wcalppwLafGkuz UKOv479KTK6gEQF6Tf0/ =lIey -----END PGP SIGNATURE----- --Pql/uPZNXIm1JCle--