From nobody Wed Nov 5 18:39:27 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1536305849765981.9944936046369; Fri, 7 Sep 2018 00:37:29 -0700 (PDT) Received: from localhost ([::1]:37135 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fyBKa-0003rt-IU for importer@patchew.org; Fri, 07 Sep 2018 03:37:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45603) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fyBFU-0007UK-J4 for qemu-devel@nongnu.org; Fri, 07 Sep 2018 03:32:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fyBFT-00054n-7z for qemu-devel@nongnu.org; Fri, 07 Sep 2018 03:32:12 -0400 Received: from ozlabs.org ([203.11.71.1]:58613) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fyBFS-00053p-QL; Fri, 07 Sep 2018 03:32:11 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 4268Jz0GMBz9sjB; Fri, 7 Sep 2018 17:32:02 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1536305523; bh=P/OLGRoZhoBumMHDzktWrMKM4+sermO10FwIA2A2U6A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dQLJegDKYys4MnX8G6AH5v14yVKhrw5DDRXEC7ugZg8okSeFJWJEvX4bEVdRXiRgY f6ouRHvI/m5DdKsQ8/mVn8C1hQkr8qv9wj1c2d//T3PE4jidVDHDvT2ibLc8LjECbY clQzH2Ynry8KN53iSSpokc8fo+chq+9VAtR/LSxE= From: David Gibson To: peter.maydell@linaro.org Date: Fri, 7 Sep 2018 17:31:55 +1000 Message-Id: <20180907073155.26200-15-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180907073155.26200-1-david@gibson.dropbear.id.au> References: <20180907073155.26200-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 14/14] target-ppc: Extend HWCAP2 bits for ISA 3.0 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: lvivier@redhat.com, mark.cave-ayland@ilande.co.uk, qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson , Sandipan Das Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Sandipan Das This adds the HWCAP2 bit to detect if a linux user process is running on an ISA 3.0 compliant cpu like POWER9. This can be verified using a simple test program that prints the value in the auxiliary vector for AT_HWCAP2 as shown below. Before: $ qemu-ppc64le -cpu power8 test 0x8c000000 $ qemu-ppc64le -cpu power9 test 0x8c000000 After: $ qemu-ppc64le -cpu power8 test 0x8c000000 $ qemu-ppc64le -cpu power9 test 0x8c800000 Signed-off-by: Sandipan Das Reviewed-by: Laurent Vivier Signed-off-by: David Gibson --- linux-user/elfload.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 8638612aec..e97c4cde49 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -710,6 +710,7 @@ enum { QEMU_PPC_FEATURE2_HAS_EBB =3D 0x10000000, /* Event Base Branching */ QEMU_PPC_FEATURE2_HAS_ISEL =3D 0x08000000, /* Integer Select */ QEMU_PPC_FEATURE2_HAS_TAR =3D 0x04000000, /* Target Address Register */ + QEMU_PPC_FEATURE2_ARCH_3_00 =3D 0x00800000, /* ISA 3.00 */ }; =20 #define ELF_HWCAP get_elf_hwcap() @@ -764,6 +765,7 @@ static uint32_t get_elf_hwcap2(void) GET_FEATURE2(PPC2_BCTAR_ISA207, QEMU_PPC_FEATURE2_HAS_TAR); GET_FEATURE2((PPC2_BCTAR_ISA207 | PPC2_LSQ_ISA207 | PPC2_ALTIVEC_207 | PPC2_ISA207S), QEMU_PPC_FEATURE2_ARCH_2_07); + GET_FEATURE2(PPC2_ISA300, QEMU_PPC_FEATURE2_ARCH_3_00); =20 #undef GET_FEATURE #undef GET_FEATURE2 --=20 2.17.1