From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50295) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPWit-0006W2-5B for qemu-devel@nongnu.org; Mon, 17 Mar 2014 08:32:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WPWio-0006V5-P9 for qemu-devel@nongnu.org; Mon, 17 Mar 2014 08:32:55 -0400 Received: from mail-la0-f54.google.com ([209.85.215.54]:39696) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPWio-0006Uu-J8 for qemu-devel@nongnu.org; Mon, 17 Mar 2014 08:32:50 -0400 Received: by mail-la0-f54.google.com with SMTP id mc6so3565400lab.41 for ; Mon, 17 Mar 2014 05:32:49 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <1394134385-1727-1-git-send-email-peter.maydell@linaro.org> <1394134385-1727-5-git-send-email-peter.maydell@linaro.org> From: Peter Maydell Date: Mon, 17 Mar 2014 12:32:29 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v4 04/21] target-arm: Provide correct syndrome information for cpreg access traps List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite Cc: Rob Herring , Patch Tracking , Michael Matz , Claudio Fontana , Alexander Graf , "qemu-devel@nongnu.org Developers" , Laurent Desnogues , Dirk Mueller , Will Newton , =?UTF-8?B?QWxleCBCZW5uw6ll?= , "kvmarm@lists.cs.columbia.edu" , Christoffer Dall , Richard Henderson On 17 March 2014 03:05, Peter Crosthwaite wrote: > On Fri, Mar 7, 2014 at 5:32 AM, Peter Maydell wrote: >> For exceptions taken to AArch64, if a coprocessor/system register >> access fails due to a trap or enable bit then the syndrome information >> must include details of the failing instruction (crn/crm/opc1/opc2 >> fields, etc). Make the decoder construct the syndrome information >> at translate time so it can be passed at runtime to the access-check >> helper function and used as required. > Can we space out the constants to a consistent tab stop for readability? Sure. >> -void HELPER(access_check_cp_reg)(CPUARMState *env, void *rip) >> +void HELPER(access_check_cp_reg)(CPUARMState *env, void *rip, uint32_t syndrome) >> { >> const ARMCPRegInfo *ri = rip; >> switch (ri->accessfn(env, ri)) { >> case CP_ACCESS_OK: >> return; >> case CP_ACCESS_TRAP: >> + env->exception.syndrome = syndrome; > > Can TCG just deposit this directly and unconditionally straight to the > env to avoid the extra syndrome arg? Hmm. I think in theory that would be possible, but it seems to me that it would be pretty confusing if exception.syndrome could be set for anything other than "we're going to take an exception and this is it". Passing the syndrome as a function argument (probably in a register) seems better than always doing a store to memory, as well. Or am I missing something that would make it slower? thanks -- PMM