From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33049) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXIho-00087q-K5 for qemu-devel@nongnu.org; Thu, 25 Sep 2014 19:44:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XXIhi-0007xB-E6 for qemu-devel@nongnu.org; Thu, 25 Sep 2014 19:44:12 -0400 Received: from mail-lb0-f172.google.com ([209.85.217.172]:38969) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXIhi-0007vy-6p for qemu-devel@nongnu.org; Thu, 25 Sep 2014 19:44:06 -0400 Received: by mail-lb0-f172.google.com with SMTP id p9so13057863lbv.3 for ; Thu, 25 Sep 2014 16:44:00 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20140925233119.GW16081@toto> References: <1410582564-27687-1-git-send-email-edgar.iglesias@gmail.com> <1410582564-27687-9-git-send-email-edgar.iglesias@gmail.com> <20140925225521.GT16081@toto> <20140925233119.GW16081@toto> From: Peter Maydell Date: Fri, 26 Sep 2014 00:43:40 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v6 08/10] target-arm: A64: Emulate the SMC insn List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Edgar E. Iglesias" Cc: Rob Herring , Peter Crosthwaite , Fabian Aggeler , QEMU Developers , Alexander Graf , Greg Bellows , Paolo Bonzini , =?UTF-8?B?QWxleCBCZW5uw6ll?= , Christoffer Dall , Richard Henderson On 26 September 2014 00:31, Edgar E. Iglesias wrote: > On Fri, Sep 26, 2014 at 12:17:59AM +0100, Peter Maydell wrote: >> Oh, yes, that's the trap enable bit. In that case we shouldn't >> be using EXCP_SMC: this isn't routing the SMC exception, it's >> taking a Hyp trap exception, and in AArch32 the vector >> entry point is different. (Granted, you can't get to AArch32 >> by taking an exception from AArch64, but we should use the >> right EXCP_ value to avoid the code looking gratuitously >> different for the two cases.) > > I see. I hadn't thought much about the AArch32 case here. For > AArch64, the pseudo code referes to this as route_to_el2. Mmm, but the pseudocode keeps AArch64 and AArch32 exception paths a lot more separate than we do, and so it doesn't need any information about the AArch32 exception when it's dealing with a from-AArch64 exception. Our implementation routes both paths in common, and so it's slightly clearer to always retain the correct info for both cases (if nothing else, it's slightly more accurate when we print out debug log about what exceptions we're taking). > Anyway, your comment makes sense to avoid diff between a32/a64 > and I think it actually makes the AArch64 code a bit cleaner > aswell. > > I'll add EXCP_HYP_TRAP. Thanks. -- PMM