From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39293) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPXQW-0004nR-6w for qemu-devel@nongnu.org; Mon, 17 Mar 2014 09:18:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WPXQR-0008C1-89 for qemu-devel@nongnu.org; Mon, 17 Mar 2014 09:18:00 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:33236) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPXQR-0008BX-3C for qemu-devel@nongnu.org; Mon, 17 Mar 2014 09:17:55 -0400 Received: by mail-wi0-f175.google.com with SMTP id cc10so2119792wib.14 for ; Mon, 17 Mar 2014 06:17:54 -0700 (PDT) MIME-Version: 1.0 Sender: peter.crosthwaite@petalogix.com In-Reply-To: References: <1394134385-1727-1-git-send-email-peter.maydell@linaro.org> <1394134385-1727-15-git-send-email-peter.maydell@linaro.org> Date: Mon, 17 Mar 2014 23:17:53 +1000 Message-ID: From: Peter Crosthwaite Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Qemu-devel] [PATCH v4 14/21] target-arm: Implement AArch64 views of fault status and data registers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Rob Herring , Patch Tracking , Michael Matz , Claudio Fontana , "qemu-devel@nongnu.org Developers" , Alexander Graf , Will Newton , Dirk Mueller , Laurent Desnogues , =?ISO-8859-1?Q?Alex_Benn=E9e?= , "kvmarm@lists.cs.columbia.edu" , Christoffer Dall , Richard Henderson On Mon, Mar 17, 2014 at 11:06 PM, Peter Maydell wrote: > On 17 March 2014 05:30, Peter Crosthwaite wrote: >> On Fri, Mar 7, 2014 at 5:32 AM, Peter Maydell wrote: >>> @@ -2979,20 +2988,23 @@ void arm_cpu_do_interrupt(CPUState *cs) >>> env->exception.fsr = 2; >>> /* Fall through to prefetch abort. */ >>> case EXCP_PREFETCH_ABORT: >>> - env->cp15.c5_insn = env->exception.fsr; >>> - env->cp15.c6_insn = env->exception.vaddress; >>> + env->cp15.ifsr_el2 = env->exception.fsr; >>> + env->cp15.far_el1 = deposit64(env->cp15.far_el1, 32, 32, >>> + env->exception.vaddress); >> >> Is it better to just grab the CPRegInfo and pass it to raw_write() to >> do the deposit dirty work? > > You'd have to do a hash-table lookup and it would be an odd > case compared to the other registers we update here, so I think > just directly depositing to the state field is simpler. > OK fair enough. I was thinking just pass the & of static const CPRegInfo (if its even visible here) rather than doing a lookup. But then I spose you have a preformatted CPRegInfo that may or may not be correct. FWIW I know you dislike unions, but it would solve this one. In general its verbose and cumbersome, but I think its applicable to the ones where you have wierd register sharing policys (like the somewhat numerically unrealted IFAR and DFAR being high and low words of FAR). Regards, Peter > thanks > -- PMM >