Received: from [140.186.70.92] (port=33829 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oe7XO-0001wh-LT for qemu-devel@nongnu.org; Wed, 28 Jul 2010 10:23:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oe7XJ-0005Gd-94 for qemu-devel@nongnu.org; Wed, 28 Jul 2010 10:23:14 -0400 Received: from duck.dooz.org ([194.146.227.125]:58394) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oe7XJ-0005GA-1n for qemu-devel@nongnu.org; Wed, 28 Jul 2010 10:23:09 -0400 Received: from bee.dooz.org (serris.dooz.org [88.166.229.232]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by duck.dooz.org (Postfix) with ESMTP id BAC8DC809C for ; Wed, 28 Jul 2010 16:23:06 +0200 (CEST) Date: Wed, 28 Jul 2010 16:23:05 +0200 From: =?iso-8859-1?Q?Lo=EFc?= Minier Subject: Re: [Qemu-devel] [PATCH] Ignore writes of perf reg (cp15 with crm == 12) Message-ID: <20100728142305.GF13511@bee.dooz.org> References: <1280086076-20649-1-git-send-email-loic.minier@linaro.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="tKW2IUtsqtDRztdT" Content-Disposition: inline In-Reply-To: <1280086076-20649-1-git-send-email-loic.minier@linaro.org> Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --tKW2IUtsqtDRztdT Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I found out Matt Waddel has written a better looking patch, but I didn't test it; reviews welcome -- attached --=20 Lo=EFc Minier --tKW2IUtsqtDRztdT Content-Type: message/rfc822 Content-Disposition: inline Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-26) on pig.zood.org X-Spam-Level: X-Spam-Status: No, score=-98.5 required=3.0 tests=BAYES_40, RATWARE_GECKO_BUILD,USER_IN_WHITELIST autolearn=disabled version=3.1.4 X-Original-To: lool@dooz.org Delivered-To: lool@pig.zood.org Received: from mail-qy0-f172.google.com (mail-qy0-f172.google.com [209.85.216.172]) by pig.zood.org (Postfix) with ESMTP id B070E4C0C6 for ; Tue, 27 Jul 2010 19:22:31 +0200 (CEST) Received: by qyk1 with SMTP id 1so2929439qyk.3 for ; Tue, 27 Jul 2010 10:22:30 -0700 (PDT) Received: by 10.224.60.211 with SMTP id q19mr7862913qah.85.1280251350380; Tue, 27 Jul 2010 10:22:30 -0700 (PDT) X-Forwarded-To: lool@dooz.org X-Forwarded-For: loic.minier@linaro.org lool@dooz.org Delivered-To: loic.minier@linaro.org Received: by 10.231.142.228 with SMTP id r36cs265184ibu; Tue, 27 Jul 2010 10:22:29 -0700 (PDT) Received: by 10.216.87.209 with SMTP id y59mr9230573wee.91.1280251348423; Tue, 27 Jul 2010 10:22:28 -0700 (PDT) Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by mx.google.com with ESMTP id v17si6997588weq.181.2010.07.27.10.22.27; Tue, 27 Jul 2010 10:22:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of matt.waddel@canonical.com designates 91.189.90.139 as permitted sender) client-ip=91.189.90.139; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of matt.waddel@canonical.com designates 91.189.90.139 as permitted sender) smtp.mail=matt.waddel@canonical.com Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1OdnrH-0004PW-Kf for ; Tue, 27 Jul 2010 18:22:27 +0100 Received: from 75-162-181-248.slkc.qwest.net ([75.162.181.248] helo=[192.168.1.102]) by hutte.canonical.com with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1OdnrH-00067z-BO for loic.minier@linaro.org; Tue, 27 Jul 2010 18:22:27 +0100 Message-ID: <4C4F15C4.2070502@canonical.com> Date: Tue, 27 Jul 2010 11:22:12 -0600 From: Matt Waddel User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.1.11) Gecko/20100711 Lightning/1.0b1 Thunderbird/3.0.6 ThunderBrowse/3.3.1 MIME-Version: 1.0 To: =?ISO-8859-1?Q?Lo=EFc_Minier?= Subject: qemu cp15 register patch X-Enigmail-Version: 1.0.1 Content-Type: multipart/mixed; boundary="------------020300010903030602010303" This is a multi-part message in MIME format. --------------020300010903030602010303 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit --------------020300010903030602010303 Content-Type: text/x-diff; name="cp15-9-pmcr.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="cp15-9-pmcr.patch" diff --git a/target-arm/cpu.h b/target-arm/cpu.h index 7440163..b5d8a6c 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -130,6 +130,7 @@ typedef struct CPUARMState { uint32_t c6_data; uint32_t c9_insn; /* Cache lockdown registers. */ uint32_t c9_data; + uint32_t c9_pmcr_data; /* Performance Monitor Control Register */ uint32_t c12_vbar; /* secure/nonsecure vector base address register. */ uint32_t c12_mvbar; /* monitor vector base address register. */ uint32_t c13_fcse; /* FCSE PID. */ diff --git a/target-arm/helper.c b/target-arm/helper.c index 1f5f307..2136c07 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -1558,6 +1558,15 @@ void HELPER(set_cp15)(CPUState *env, uint32_t insn, uint32_t val) case 1: /* TCM memory region registers. */ /* Not implemented. */ goto bad_reg; + case 12: + switch (op2) { + case 0: + env->cp15.c9_pmcr_data = val; + break; + default: + goto bad_reg; + } + break; default: goto bad_reg; } @@ -1897,6 +1906,13 @@ uint32_t HELPER(get_cp15)(CPUState *env, uint32_t insn) goto bad_reg; /* L2 Lockdown and Auxiliary control. */ return 0; + case 12: + switch (op2) { + case 0: + return env->cp15.c9_pmcr_data; + default: + goto bad_reg; + } default: goto bad_reg; } diff --git a/target-arm/machine.c b/target-arm/machine.c index 8595549..026776d 100644 --- a/target-arm/machine.c +++ b/target-arm/machine.c @@ -46,6 +46,7 @@ void cpu_save(QEMUFile *f, void *opaque) qemu_put_be32(f, env->cp15.c6_data); qemu_put_be32(f, env->cp15.c9_insn); qemu_put_be32(f, env->cp15.c9_data); + qemu_put_be32(f, env->cp15.c9_pmcr_data); qemu_put_be32(f, env->cp15.c13_fcse); qemu_put_be32(f, env->cp15.c13_context); qemu_put_be32(f, env->cp15.c13_tls1); @@ -156,6 +157,7 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id) env->cp15.c6_data = qemu_get_be32(f); env->cp15.c9_insn = qemu_get_be32(f); env->cp15.c9_data = qemu_get_be32(f); + env->cp15.c9_pmcr_data = qemu_get_be32(f); env->cp15.c13_fcse = qemu_get_be32(f); env->cp15.c13_context = qemu_get_be32(f); env->cp15.c13_tls1 = qemu_get_be32(f); --------------020300010903030602010303-- --tKW2IUtsqtDRztdT--