From patchwork Wed Jul 28 14:23:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Lo=C3=AFc_Minier?= X-Patchwork-Id: 60147 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1564FB6EED for ; Thu, 29 Jul 2010 00:25:25 +1000 (EST) Received: from localhost ([127.0.0.1]:59262 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oe7ZS-0002dF-Aq for incoming@patchwork.ozlabs.org; Wed, 28 Jul 2010 10:25:22 -0400 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) Received: by bee.dooz.org (Postfix, from userid 1000) id 622E4778; Wed, 28 Jul 2010 16:23:05 +0200 (CEST) Date: Wed, 28 Jul 2010 16:23:05 +0200 From: =?iso-8859-1?Q?Lo=EFc?= Minier To: qemu-devel@nongnu.org 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-Disposition: inline In-Reply-To: <1280086076-20649-1-git-send-email-loic.minier@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org I found out Matt Waddel has written a better looking patch, but I didn't test it; reviews welcome -- attached 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);