From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54179) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJINJ-0000X8-Hd for qemu-devel@nongnu.org; Mon, 18 Aug 2014 04:33:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XJINE-0002lE-FC for qemu-devel@nongnu.org; Mon, 18 Aug 2014 04:33:09 -0400 Received: from mail-la0-f46.google.com ([209.85.215.46]:38843) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJINE-0002kP-5n for qemu-devel@nongnu.org; Mon, 18 Aug 2014 04:33:04 -0400 Received: by mail-la0-f46.google.com with SMTP id b8so4314670lan.33 for ; Mon, 18 Aug 2014 01:33:03 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <8e576951af6f010c8471eec161115f703e042369.1408348649.git.peter.crosthwaite@xilinx.com> References: <8e576951af6f010c8471eec161115f703e042369.1408348649.git.peter.crosthwaite@xilinx.com> From: Peter Maydell Date: Mon, 18 Aug 2014 09:32:42 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH target-arm v3 8/8] target-arm: Call pmccntr_sync() when swapping ELs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite Cc: Alistair Francis , =?UTF-8?B?QWxleCBCZW5uw6ll?= , QEMU Developers , Christopher Covington On 18 August 2014 09:16, Peter Crosthwaite wrote: > Call the pmccntr_sync() when the EL changes. All Runtime changes > of EL are done as a pstate_write so we can catch these EL-change side > effects here. Hmm. This probably clashes badly with Alex's cleanup of how we handle pstate writes... I'm not sure I really want more side effects in pstate_write(), either; the ones we have in cpsr_write() are pretty annoying (makes migration load awkward). > Signed-off-by: Peter Crosthwaite > --- > > target-arm/cpu.h | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/target-arm/cpu.h b/target-arm/cpu.h > index 5bc2afe..2533fc0 100644 > --- a/target-arm/cpu.h > +++ b/target-arm/cpu.h > @@ -503,12 +503,24 @@ static inline uint32_t pstate_read(CPUARMState *env) > > static inline void pstate_write(CPUARMState *env, uint32_t val) > { > +#ifndef CONFIG_USER_ONLY > + bool pmccntr_need_sync = (env->pstate ^ val) & PSTATE_M; > + > + if (pmccntr_need_sync) { > + pmccntr_sync(env); > + } > +#endif > env->ZF = (~val) & PSTATE_Z; > env->NF = val; > env->CF = (val >> 29) & 1; > env->VF = (val << 3) & 0x80000000; > env->daif = val & PSTATE_DAIF; > env->pstate = val & ~CACHED_PSTATE_BITS; > +#ifndef CONFIG_USER_ONLY > + if (pmccntr_need_sync) { > + pmccntr_sync(env); > + } > +#endif > } > > /* Return the current CPSR value. */ > -- > 2.0.1.1.gfbfc394 thanks -- PMM