From patchwork Tue Aug 16 13:40:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 9283925 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 19003600CB for ; Tue, 16 Aug 2016 13:41:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07F9028B83 for ; Tue, 16 Aug 2016 13:41:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F070228C10; Tue, 16 Aug 2016 13:41:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 89C6628B83 for ; Tue, 16 Aug 2016 13:41:25 +0000 (UTC) Received: from localhost ([::1]:42208 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZecN-0007GF-Su for patchwork-qemu-devel@patchwork.kernel.org; Tue, 16 Aug 2016 09:41:23 -0400 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 Received: from ssl.serverraum.org ([2a01:4f8:130:84d6::1:2]:60842) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZebz-00042A-7K; Tue, 16 Aug 2016 09:40:59 -0400 Received: from mwalle01.kse.adk.loc (unknown [194.25.174.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 52A0522398; Tue, 16 Aug 2016 15:40:56 +0200 (CEST) Authentication-Results: ssl.serverraum.org; dmarc=none header.from=walle.cc DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1471354856; bh=XWv/1GYiWNWEXYAIB1N5J3EIoM/dRhujM773d/xt29s=; h=From:To:Cc:Subject:Date:From; b=Ce6awi/Ihs+OZVt11xB3Z2TX/ziFPyyDZ8RjWmZ6WjuHGUvjSOgwZeI8LCMwmEHz0 me5D2LS3Ad5p5is78vihS8v4pOlD2xR9t0h8igYAl7l5qgm+iw7dTss6QWFcZEbi8H i0Ud2JorC+1j5PvLPv6jrcs6aUQpvaNrqtJaQtFo= From: Michael Walle To: Riku Voipio Date: Tue, 16 Aug 2016 15:40:50 +0200 Message-Id: <1471354850-5549-1-git-send-email-michael@walle.cc> X-Mailer: git-send-email 2.1.4 X-Virus-Scanned: clamav-milter 0.99.2 at web X-Virus-Status: Clean X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:4f8:130:84d6::1:2 Subject: [Qemu-devel] [PATCH] linux-user: ppc64: fix ARCH_206 bit in AT_HWCAP X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tom Musta , Michael Walle , qemu-ppc@nongnu.org, Alexander Graf , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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);