From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35185) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkNpU-0001sk-Kb for qemu-devel@nongnu.org; Tue, 13 May 2014 21:18:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WkNpL-0001FG-Ks for qemu-devel@nongnu.org; Tue, 13 May 2014 21:17:56 -0400 Received: from mail-pa0-x230.google.com ([2607:f8b0:400e:c03::230]:56795) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkNpL-0001Ev-E5 for qemu-devel@nongnu.org; Tue, 13 May 2014 21:17:47 -0400 Received: by mail-pa0-f48.google.com with SMTP id rd3so952416pab.7 for ; Tue, 13 May 2014 18:17:46 -0700 (PDT) Date: Wed, 14 May 2014 01:18:04 +0000 From: "Edgar E. Iglesias" Message-ID: <20140514011804.GE21821@hostname> References: <1399356506-5609-1-git-send-email-edgar.iglesias@gmail.com> <1399356506-5609-19-git-send-email-edgar.iglesias@gmail.com> <53725719.9020305@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53725719.9020305@twiddle.net> Subject: Re: [Qemu-devel] [PATCH v1 18/22] target-arm: A64: Generalize update_spsel for the various ELs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: peter.maydell@linaro.org, peter.crosthwaite@xilinx.com, rob.herring@linaro.org, qemu-devel@nongnu.org, agraf@suse.de, john.williams@xilinx.com, alex.bennee@linaro.org On Tue, May 13, 2014 at 10:32:09AM -0700, Richard Henderson wrote: > On 05/05/2014 11:08 PM, Edgar E. Iglesias wrote: > > - /* EL0 has no access rights to update SPSel, and this code > > - * assumes we are updating SP for EL1 while running as EL1. > > - */ > > - assert(arm_current_pl(env) == 1); > > + /* EL0 has no access rights to update SPSel. */ > > + assert(cur_el >= 1 && cur_el <= 3); > > The old comment makes it clear that we're not supposed to get here when running > as EL0. The new comment makes this look like a possible DoS attack. I've changed it to the following for next version: /* We rely on illegal updates to SPsel from EL0 to get trapped * at translation time. */ If you have better suggestions I'm happy to update. Thanks, Edgar