From nobody Sat May 4 05:28:12 2024 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.zoho.com; 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 1497624268385133.5487189914328; Fri, 16 Jun 2017 07:44:28 -0700 (PDT) Received: from localhost ([::1]:59254 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLsU7-0003M2-4Q for importer@patchew.org; Fri, 16 Jun 2017 10:44:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47245) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLsSX-0002Jm-RA for qemu-devel@nongnu.org; Fri, 16 Jun 2017 10:42:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dLsSU-0007Vq-Ns for qemu-devel@nongnu.org; Fri, 16 Jun 2017 10:42:49 -0400 Received: from smtp1.lauterbach.com ([62.154.241.196]:38629) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dLsSU-0007Ph-Bu for qemu-devel@nongnu.org; Fri, 16 Jun 2017 10:42:46 -0400 Received: (qmail 26356 invoked by uid 484); 16 Jun 2017 14:42:26 -0000 Received: from unknown (HELO [192.168.187.23]) (Authenticated_SSL:abouassida@[41.224.44.126]) (envelope-sender ) by smtp1.lauterbach.com (qmail-ldap-1.03) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 16 Jun 2017 14:42:25 -0000 X-Qmail-Scanner-Diagnostics: from 41.224.44.126 by smtp1.lauterbach.com (envelope-from , uid 484) with qmail-scanner-2.11 (mhr: 1.0. clamdscan: 0.99/21437. spamassassin: 3.4.0. Clear:RC:1(41.224.44.126):. Processed in 0.328541 secs); 16 Jun 2017 14:42:26 -0000 To: qemu-arm@nongnu.org From: Abdallah Bouassida Message-ID: <1701daf4-b2de-a9fb-7337-7aa791676516@lauterbach.com> Date: Fri, 16 Jun 2017 15:42:34 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 62.154.241.196 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.21 Subject: [Qemu-devel] [PATCH] target-arm: Bug fix in filling the cp_regs hashtable 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: peter.maydell@linaro.org, qemu-devel@nongnu.org, Khaled Jmal Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8"; format="flowed" Check if the CPU supports AARCH64 before adding the 64bit view of the coprocessor's register to the cp_regs hashtable. Signed-off-by: Abdallah Bouassida --- Bug description: if a register has the .state =3D ARM_CP_STATE_BOTH, its=20 64bit view will be added to the hashtable even if the CPU is not 64bit. target/arm/helper.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index 2594faa..7fa2889 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -5607,11 +5607,13 @@ void define_one_arm_cp_reg_with_opaque(ARMCPU *cpu, break; } } else { - /* AArch64 registers get mapped to non-secure=20 instance - * of AArch32 */ - add_cpreg_to_hashtable(cpu, r, opaque, state, - ARM_CP_SECSTATE_NS, - crm, opc1, opc2); + if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) { + /* AArch64 registers get mapped to=20 non-secure instance + * of AArch32 */ + add_cpreg_to_hashtable(cpu, r, opaque, state, + ARM_CP_SECSTATE_NS, + crm, opc1, opc2); + } } } } --=20 1.9.1