Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1DA58C433EF for ; Thu, 2 Sep 2021 23:07:57 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 655FB60231 for ; Thu, 2 Sep 2021 23:07:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 655FB60231 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 896FE8348D; Fri, 3 Sep 2021 01:07:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 0DBCB834C0; Fri, 3 Sep 2021 01:07:53 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 6EA5683304 for ; Fri, 3 Sep 2021 01:07:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=andre.przywara@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A5B1A31B; Thu, 2 Sep 2021 16:07:48 -0700 (PDT) Received: from slackpad.fritz.box (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 947223F5A1; Thu, 2 Sep 2021 16:07:47 -0700 (PDT) Date: Fri, 3 Sep 2021 00:07:20 +0100 From: Andre Przywara To: Tom Rini Cc: Peter Hoyes , u-boot@lists.denx.de, patrick.delaunay@foss.st.com, sjg@chromium.org, diego.sueiro@arm.com Subject: Re: [PATCH v2 5/6] arm: Use armv8_switch_to_el1 env to switch to EL1 Message-ID: <20210903000628.4419ad1f@slackpad.fritz.box> In-Reply-To: <20210902224205.GX858@bill-the-cat> References: <20210819155314.1787973-1-peter.hoyes@arm.com> <20210819155314.1787973-6-peter.hoyes@arm.com> <20210902224205.GX858@bill-the-cat> Organization: Arm Ltd. X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.31; x86_64-slackware-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On Thu, 2 Sep 2021 18:42:05 -0400 Tom Rini wrote: Hi Tom, > On Thu, Aug 19, 2021 at 04:53:13PM +0100, Peter Hoyes wrote: > > > From: Peter Hoyes > > > > Use the environment variable armv8_switch_to_el1 to determine whether > > to switch to EL1 at runtime. This is an alternative to the > > CONFIG_ARMV8_SWITCH_TO_EL1 compile-time option. > > > > The environment variable will be ineffective if the ARMV8_MULTIENTRY > > config is used. > > > > This is required by the Armv8r64 architecture, which must be able to > > boot at S-EL1 for Linux but may need to boot at other ELs for other > > systems. > > > > Signed-off-by: Peter Hoyes > > Applied to u-boot/next, thanks! Sorry for keeping silent on this, we had some internal discussions here, and we don't think this is the right approach. This whole CONFIG_ARMV8_SWITCH_TO_EL1 solution is actually already questionable, as it goes somewhat against the PSCI spec, which requires secondaries to enter in the highest non-secure exception level (Section 6.1.3: "... As described in Figure 6, the return Exception level for a CPU_ON call is the highest Non secure Exception level implemented.") In any case the primary core must enter an the same exception level as the secondaries, or all hell breaks loose. The current code violates this bluntly when the dynamic method is used (as the spin table code doesn't know about this variable). So can you please revert this patch? We are looking into a different solution for getting into EL2, which wouldn't involve U-Boot at all. The other patches and the next one are fine, however we would need one small change in the next patch to live with this patch removed. If you like, I can send an amended version of 6/6 to accommodate this. Thanks! Andre