Received: from eggs.gnu.org ([2001:4830:134:3::10]:58331) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZec3-0007Fu-Ir for qemu-devel@nongnu.org; Tue, 16 Aug 2016 09:41:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bZebz-00042E-Dq for qemu-devel@nongnu.org; Tue, 16 Aug 2016 09:41:02 -0400 From: Michael Walle Date: Tue, 16 Aug 2016 15:40:50 +0200 Message-Id: <1471354850-5549-1-git-send-email-michael@walle.cc> Subject: [Qemu-devel] [PATCH] linux-user: ppc64: fix ARCH_206 bit in AT_HWCAP List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Riku Voipio Cc: Alexander Graf , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Tom Musta , Michael Walle Only the POWER[789] CPUs should have the ARCH_206 bit set. This is what the linux kernel does. I guess this was also the intention of commit 0e019746. We have to make sure all *206 bits are set. Signed-off-by: Michael Walle --- checkpatch.pl flags one warning, but I think this is a false positive. linux-user/elfload.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index f807baf..4945d48 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -742,7 +742,8 @@ static uint32_t get_elf_hwcap(void) #define GET_FEATURE(flag, feature) \ do { if (cpu->env.insns_flags & flag) { features |= feature; } } while (0) #define GET_FEATURE2(flag, feature) \ - do { if (cpu->env.insns_flags2 & flag) { features |= feature; } } while (0) + do { if ((cpu->env.insns_flags2 & flag) == flag) \ + { features |= 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); -- 2.1.4