From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=54427 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OnFDm-0006uF-0k for qemu-devel@nongnu.org; Sun, 22 Aug 2010 14:24:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OnFDk-0005C0-Qb for qemu-devel@nongnu.org; Sun, 22 Aug 2010 14:24:41 -0400 Received: from duck.dooz.org ([194.146.227.125]:33962) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OnFDk-0005AY-IU for qemu-devel@nongnu.org; Sun, 22 Aug 2010 14:24:40 -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 18E20C80AA for ; Sun, 22 Aug 2010 20:24:38 +0200 (CEST) Date: Sun, 22 Aug 2010 20:24:33 +0200 From: =?iso-8859-1?Q?Lo=EFc?= Minier Subject: Re: [Qemu-devel] [PATCH 1/1] Added PMCR support Message-ID: <20100822182433.GA9649@bee.dooz.org> References: <1280859290-25983-1-git-send-email-matt.waddel@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1280859290-25983-1-git-send-email-matt.waddel@linaro.org> Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org We've been using a cp15 fix for a while to fix modern ARM kernels (with perf support) from booting. e.g. both the Ubuntu versatile and OMAP kernels fail to boot without this fix (the latter only boots with the OMAP patches too of course). Thanks! On Tue, Aug 03, 2010, Matt Waddel wrote: > From: Matt Waddel >=20 > Added support for the CP15c9-CR12 register(Performance Monitor Control > Register). Calls to this register are being implemented in the ARM Lin= ux > kernel. The register has several bit fields, as described in the ARM > technical reference manual, but right now I only implemented it as a > single register. >=20 > Signed-off-by: Matt Waddel > --- > target-arm/cpu.h | 3 ++- > target-arm/helper.c | 20 ++++++++++++++++++++ > target-arm/machine.c | 2 ++ > 3 files changed, 24 insertions(+), 1 deletions(-) >=20 > diff --git a/target-arm/cpu.h b/target-arm/cpu.h > index 39c4a0e..a96c512 100644 > --- a/target-arm/cpu.h > +++ b/target-arm/cpu.h > @@ -126,6 +126,7 @@ typedef struct CPUARMState { > uint32_t c6_data; > uint32_t c9_insn; /* Cache lockdown registers. */ > uint32_t c9_data; > + uint32_t c9_pmcr; /* Performance Monitor Control Register */ > uint32_t c13_fcse; /* FCSE PID. */ > uint32_t c13_context; /* Context ID. */ > uint32_t c13_tls1; /* User RW Thread register. */ > @@ -414,7 +415,7 @@ void cpu_arm_set_cp_io(CPUARMState *env, int cpnum, > #define cpu_signal_handler cpu_arm_signal_handler > #define cpu_list arm_cpu_list > =20 > -#define CPU_SAVE_VERSION 2 > +#define CPU_SAVE_VERSION 3 > =20 > /* MMU modes definitions */ > #define MMU_MODE0_SUFFIX _kernel > diff --git a/target-arm/helper.c b/target-arm/helper.c > index 2dd64d9..2272e8c 100644 > --- a/target-arm/helper.c > +++ b/target-arm/helper.c > @@ -1484,6 +1484,16 @@ void HELPER(set_cp15)(CPUState *env, uint32_t in= sn, uint32_t val) > case 1: /* TCM memory region registers. */ > /* Not implemented. */ > goto bad_reg; > + case 12: /* PM control register */ > + switch (op2) { > + case 0: > + /* c9_pmcr register has several bit-fields */ > + env->cp15.c9_pmcr =3D val; > + break; > + default: > + goto bad_reg; > + } > + break; > default: > goto bad_reg; > } > @@ -1774,6 +1784,16 @@ uint32_t HELPER(get_cp15)(CPUState *env, uint32_= t insn) > goto bad_reg; > /* L2 Lockdown and Auxiliary control. */ > return 0; > + case 12: /* PM control register */ > + switch (op2) { > + case 0: > + /* c9_pmcr register has several bit-fields */ > + return env->cp15.c9_pmcr; > + break; > + default: > + goto bad_reg; > + } > + break; > default: > goto bad_reg; > } > diff --git a/target-arm/machine.c b/target-arm/machine.c > index 3925d3a..efe9a02 100644 > --- a/target-arm/machine.c > +++ b/target-arm/machine.c > @@ -43,6 +43,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); > qemu_put_be32(f, env->cp15.c13_fcse); > qemu_put_be32(f, env->cp15.c13_context); > qemu_put_be32(f, env->cp15.c13_tls1); > @@ -150,6 +151,7 @@ int cpu_load(QEMUFile *f, void *opaque, int version= _id) > env->cp15.c6_data =3D qemu_get_be32(f); > env->cp15.c9_insn =3D qemu_get_be32(f); > env->cp15.c9_data =3D qemu_get_be32(f); > + env->cp15.c9_pmcr =3D qemu_get_be32(f); > env->cp15.c13_fcse =3D qemu_get_be32(f); > env->cp15.c13_context =3D qemu_get_be32(f); > env->cp15.c13_tls1 =3D qemu_get_be32(f); > --=20 > 1.7.0.4 >=20 >=20 --=20 Lo=EFc Minier