Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id B14C5C369D9 for ; Wed, 30 Apr 2025 19:26:13 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 254018007D; Wed, 30 Apr 2025 21:26:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="xzA+2ssy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6BFE4800D7; Wed, 30 Apr 2025 21:26:10 +0200 (CEST) Received: from fllvem-ot04.ext.ti.com (fllvem-ot04.ext.ti.com [198.47.19.246]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3FFF18004F for ; Wed, 30 Apr 2025 21:26:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bb@ti.com Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllvem-ot04.ext.ti.com (8.15.2/8.15.2) with ESMTPS id 53UJQ5et4051868 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 Apr 2025 14:26:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1746041165; bh=IaEk1gMoNo13Kw1ih5ENsV3bqP0hKlXgyibI8j2g42s=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=xzA+2ssyHjcyG6Razs7N+8FMFnoJTcv8TX8FTFTRRqcki9Jne65j3elq4cOLfohkZ DD65x6mwXjt1Dg6We+C67XW1RkapAwamQx0DdOjq4AmOXrKm9rL+LrAla/kH+bnMiF j1MAxjiuHd8txeGu5idbHnGwAvCXgypvlJn97V2g= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 53UJQ5L2036056 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 30 Apr 2025 14:26:05 -0500 Received: from DFLE113.ent.ti.com (10.64.6.34) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Wed, 30 Apr 2025 14:26:05 -0500 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Wed, 30 Apr 2025 14:26:04 -0500 Received: from localhost (bb.dhcp.ti.com [128.247.81.12]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 53UJQ4dg098612; Wed, 30 Apr 2025 14:26:04 -0500 Date: Wed, 30 Apr 2025 14:26:04 -0500 From: Bryan Brattlof To: Tom Rini CC: "Raghavendra, Vignesh" , Anshul Dalal , Subject: Re: [PATCH v1] arm: add call to cleanup_before_linux for go command Message-ID: <20250430192604.5dmv465thftsm2uj@bryanbrattlof.com> X-PGP-Fingerprint: D3D1 77E4 0A38 DF4D 1853 FEEF 41B9 0D5D 71D5 6CE0 References: <20250430135751.2626849-1-anshuld@ti.com> <20250430162904.nmjqomr2kmxhllfc@bryanbrattlof.com> <20250430163156.GV1261075@bill-the-cat> <20250430174004.GX1261075@bill-the-cat> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: <20250430174004.GX1261075@bill-the-cat> X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean On April 30, 2025 thus sayeth Tom Rini: > On Wed, Apr 30, 2025 at 10:56:27PM +0530, Raghavendra, Vignesh wrote: > > > > > > On 4/30/2025 10:01 PM, Tom Rini wrote: > > > On Wed, Apr 30, 2025 at 11:29:04AM -0500, Bryan Brattlof wrote: > > >> On April 30, 2025 thus sayeth Anshul Dalal: > > >>> As discussed here[1], the go command causes undefined behavior when used > > >>> for running custom OSes since the icache might hold outdated data. OSes > > >>> usually also expect the MMU to be disabled upon execution. > > >>> > > >>> Therefore this patch adds a call to cleanup_before_linux before we jump > > >>> to the loaded program/os which disables both the caches and the MMU. > > >>> This makes the go command's behavior consistent with riscv platforms. > > >>> > > >> > > >> I know quite a few other OSes are beginning to use U-Boot (QNX, > > >> GreenHills or all the other RTOSes) each with their own requirements > > >> from the bootloader. I'm curious if we should make boot* a little more > > >> generic rather than abuse the 'go' command. > > > > VXworks has its own: > > https://docs.u-boot.org/en/stable/usage/os/vxworks.html > > > > I suppose QNX and others should ideally have their own cmds as needed. > > Well, what's the QNX output file format (options?) again? I've only ever seen outputs in compressed binary formats but I've been told there are tools to produce an ELF for the simulators > > > > Well, that's what bootelf is for :) > > > > > > > And if its not an elf but some .bin file "go" cmd should be used in > > conjunction with "cache" cmd here to flush/disable cache, I guess? > > Well, what exactly are we talking about? Is this an "in theory" or some > project(s) which exist today? > I noticed this thread mainly because of the number of RTOS people asking me about low level stuff U-Boot and TF-A is doing. I haven't seen any 'In-Production' type bugs but I wouldn't be surprised if U-Boot is being used in their CI environments today. ~Bryan > There's a whole lot of reasons for either a legacy header and bootm or a > not-legacy FIT image. The "go" command is for the "U-Boot is a debugger" > side of the world, not how you should kick off some OS/application in > production. It is all of the "this is dangerous" idioms. > > > If so, we should probably update the docs for this cmd appropriately so > > as to avoid end users overloading like what RISC-V did? > > Yes, we should clarify things as needed and unwind, most likely, what > RISC-V is doing. But not blindly so as perhaps there's now, sigh, a > production / in-the-wild case here and we're now in a sticky spot. > I like the idea of boot${OS} flags if only to standardize the interface of how each OS should boot. I worry about situation where custom scripting is being used to boot in production rather than stdboot ~Bryan