From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:33894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QDAig-0003QZ-91 for qemu-devel@nongnu.org; Fri, 22 Apr 2011 03:24:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QDAif-0006uI-Fq for qemu-devel@nongnu.org; Fri, 22 Apr 2011 03:24:02 -0400 Received: from ipmail05.adl6.internode.on.net ([150.101.137.143]:17195) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QDAie-0006uA-TH for qemu-devel@nongnu.org; Fri, 22 Apr 2011 03:24:01 -0400 From: Brad Hards Date: Fri, 22 Apr 2011 17:23:55 +1000 References: <1303401708-5419-1-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1303401708-5419-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_L0SsNhBFZuywWNH" Message-Id: <201104221723.55529.bradh@frogmouth.net> Subject: Re: [Qemu-devel] [PATCH] target-arm: Minimal implementation of performance counters List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell --Boundary-00=_L0SsNhBFZuywWNH Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit On Friday 22 April 2011 02:01:48 Peter Maydell wrote: > Newer Linux kernels assume the existence of the performance counter > cp15 registers. Provide a minimal implementation of these registers. > We support no events. This should be compliant with the ARM ARM, > except that we don't implement the cycle counter. I tried to apply this to git master, and got a reject (attached). It looks like that area of target-arm/helper.c hasn't been touched in a while. Is it possible you have other changes for this? Did I miss a pre-requisite? Brad --Boundary-00=_L0SsNhBFZuywWNH Content-Type: application/x-reject; name="helper.c.rej" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="helper.c.rej" --- target-arm/helper.c +++ target-arm/helper.c @@ -1957,27 +2036,81 @@ return 0; case 8: /* MMU TLB control. */ goto bad_reg; - case 9: /* Cache lockdown. */ - switch (op1) { - case 0: /* L1 cache. */ - if (arm_feature(env, ARM_FEATURE_OMAPCP)) - return 0; + case 9: + switch (crm) { + case 0: /* Cache lockdown */ + switch (op1) { + case 0: /* L1 cache. */ + if (arm_feature(env, ARM_FEATURE_OMAPCP)) { + return 0; + } + switch (op2) { + case 0: + return env->cp15.c9_data; + case 1: + return env->cp15.c9_insn; + default: + goto bad_reg; + } + case 1: /* L2 cache */ + if (crm != 0) { + goto bad_reg; + } + /* L2 Lockdown and Auxiliary control. */ + return 0; + default: + goto bad_reg; + } + break; + case 12: /* Performance monitor control */ + if (!arm_feature(env, ARM_FEATURE_V7)) { + goto bad_reg; + } switch (op2) { - case 0: - return env->cp15.c9_data; - case 1: - return env->cp15.c9_insn; + case 0: /* performance monitor control register */ + return env->cp15.c9_pmcr; + case 1: /* count enable set */ + case 2: /* count enable clear */ + return env->cp15.c9_pmcnten; + case 3: /* overflow flag status */ + return env->cp15.c9_pmovsr; + case 4: /* software increment */ + case 5: /* event counter selection register */ + return 0; /* Unimplemented, RAZ/WI */ default: goto bad_reg; } - case 1: /* L2 cache */ - if (crm != 0) + case 13: /* Performance counters */ + if (!arm_feature(env, ARM_FEATURE_V7)) { + goto bad_reg; + } + switch (op2) { + case 1: /* Event type select */ + return env->cp15.c9_pmxevtyper; + case 0: /* Cycle count register */ + case 2: /* Event count register */ + /* Unimplemented, so RAZ/WI */ + return 0; + default: goto bad_reg; - /* L2 Lockdown and Auxiliary control. */ - return 0; + } + case 14: /* Performance monitor control */ + if (!arm_feature(env, ARM_FEATURE_V7)) { + goto bad_reg; + } + switch (op2) { + case 0: /* user enable */ + return env->cp15.c9_pmuserenr; + case 1: /* interrupt enable set */ + case 2: /* interrupt enable clear */ + return env->cp15.c9_pminten; + default: + goto bad_reg; + } default: goto bad_reg; } + break; case 10: /* MMU TLB lockdown. */ /* ??? TLB lockdown not implemented. */ return 0; --Boundary-00=_L0SsNhBFZuywWNH--