From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54229) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPX0K-0001d3-B3 for qemu-devel@nongnu.org; Mon, 17 Mar 2014 08:51:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WPX0F-0004nF-6Z for qemu-devel@nongnu.org; Mon, 17 Mar 2014 08:50:56 -0400 Received: from mail-la0-f52.google.com ([209.85.215.52]:47730) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPX0E-0004n7-Vv for qemu-devel@nongnu.org; Mon, 17 Mar 2014 08:50:51 -0400 Received: by mail-la0-f52.google.com with SMTP id ec20so3664943lab.11 for ; Mon, 17 Mar 2014 05:50:49 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <1394134385-1727-1-git-send-email-peter.maydell@linaro.org> <1394134385-1727-7-git-send-email-peter.maydell@linaro.org> From: Peter Maydell Date: Mon, 17 Mar 2014 12:50:29 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v4 06/21] target-arm: Provide syndrome information for MMU faults 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 12:41, Peter Maydell wrote: > On 17 March 2014 03:28, Peter Crosthwaite wrote: >> On Fri, Mar 7, 2014 at 5:32 AM, Peter Maydell wrote: >>> From: Rob Herring > >>> + /* Set bit 26 for exceptions with no change in EL */ >>> + if (arm_current_pl(env)) { >>> + syn |= 1 << ARM_EL_EC_SHIFT; >>> + } >>> + >> >> Perhaps in internals.h: >> >> #define ARM_EL_EC_SAME_LEVEL (1 << ARM_EL_EC_SHIFT) >> >> Then this becomes: >> >> syn |= ARM_EL_EC_SAME_LEVEL >> >> Then in internals.h you can be more self documenting with: >> >> EC_BREAKPOINT_SAME_EL = EC_BREAKPOINT | ARM_EL_EC_SAME_LEVEL > > Yeah, seems reasonable. On the other hand you can't define EC_BREAKPOINT_SAME_EL like that, because the EC_ enum values aren't shifted. Perhaps it would be better to have the syn_* functions for the EC values which have SAME_EL versions (currently just insn abort and data abort, since we don't implement any of the hardware debug exceptions) have an extra parameter bool same_el, and have the syn_ function OR in the extra bit. thanks -- PMM