From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 72C2B606A322 for ; Sat, 5 Dec 2026 17:41:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.u-boot-project.org header.i=@lists.u-boot-project.org header.a=rsa-sha256 header.s=default header.b=Iuzdymvx; dkim=pass (2048-bit key, unprotected) header.d=freeshell.de header.i=@freeshell.de header.a=rsa-sha256 header.s=s2025 header.b=DVnG2w5o Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 46F2C40667; Sat, 5 Dec 2026 17:41:08 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id HNanKkhU9HkV; Sat, 5 Dec 2026 17:41:07 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp4.osuosl.org DE79A4064A Authentication-Results: smtp4.osuosl.org; arc=none smtp.remote-ip=140.211.166.142 ARC-Seal: i=1; d=osuosl.org; s=arc; a=rsa-sha256; cv=none; t=1796492467; b=HeKF6/tdrBb/nyp9CD0dlePE8q6B/LX+OqeMY81C9Y/KymgrmpUshv3l3wFR2DH2plYk h2YHyEgPkUBlwyaUaNnR4yr2nhdUCNWRLyXnObNgSkURY+Lof1ELid5qvUJ76Y4UF1fUU AoR9D6An0wGd6EpOn1G7/iowASDMlB+jhZ043FOD2YjtZTkbYOR4Y6TzRzPoXMSoYgk0q wQb57+Io0YVN3bVkICUVgxtkQyZWNrkHdzmu973MlWSSZEJUC3oMvquJ5H1MeF8XjyRpR 698+dCKax3hSJcskWd/hsr6irmVEhjvk/HkQ5y+5CWuTfZya/yL1GeFd7utv6+obx9w== ARC-Message-Signature: i=1; d=osuosl.org; s=arc; a=rsa-sha256; c=relaxed/relaxed; t=1796492467; h=X-Comment:DKIM-Signature:X-Original-To:Delivered-To:Received: Received:X-Virus-Scanned:X-Spam-Flag:X-Spam-Score:X-Spam-Level: X-Spam-Status:Received:ARC-Filter:Received-SPF:Received: DKIM-Signature:Received:Message-ID:Date:MIME-Version:User-Agent: Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding:X-BeenThere:X-Mailman-Version: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help: List-Subscribe:Errors-To; bh=cU5NbxFIM/I3/17qX3GLSqhyjKSfCEUPtrGkbXP0pnY=; b=R6lfGYSnI9dL1LD+XDVHO4t0mcNiMOhFA5tqF9HE8nHotioJJLGRdKOXM2DJdFIHaEci cq/Wdr3mH+LY4FOKCok4NkZjSHtX/9jTHZO7xr7AxyjjhY5PMX3KZTnNwQyd8Len4UCWo 5smArVkS6b7lwrqwdo6msrIPckcs0RUYM/OC0njzMuNNIMd0TNPDaV5JtIArlBjRbJoCp 4lKEuPJLYx+HRvAKyVMKYRE17PyMTJlo/s/aAzyJuTKU6NuprxDPNrmRiiIGWOOzsiaLD FOF47X/KJyJK4E/mcTurzgnn+zzWG+8GhhOK2oWK0Sc96q6OjA25nFv1FnkAzQm/rSA== ARC-Authentication-Results: i=1; smtp4.osuosl.org; arc=none smtp.remote-ip=140.211.166.142 X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=u-boot-bounces@lists.u-boot-project.org; receiver= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.u-boot-project.org; s=default; t=1796492467; bh=cU5NbxFIM/I3/17qX3GLSqhyjKSfCEUPtrGkbXP0pnY=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=IuzdymvxfWBU2FFNWLXCLSoSBUIgSs0w1KIrJzAH1MTZ/anPJnvxr63cb8o3zp7tL TBIh7uIDHlC2qNEnLjY1piWFEAJJ+L1fsiFtlpYSa0R+KSDY5kpk++iq/AJmO7G6M1 QBiX7klaaBl5OpwoZmgw+MxgmqKqnBCxBuRrJ1JnssTomn30jBZUht3eC92/Q8qbOK ve8KzxFd3UNkbPGE9NvP3ZXBLnUgIeci7rdNqnwraI/8Y/fXyKOxJa5YtNVgGLHFAu HGSaf3EAuSNXelTK/omr3qnaQgFTIFQE5WcPZMWCwAy7qjOBEeSfDoUQKw0VjcNuJ+ cXTNo/uQ74yuw== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp4.osuosl.org (Postfix) with ESMTP id DE79A4064A; Sat, 5 Dec 2026 17:41:06 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists1.osuosl.org (Postfix) with ESMTP id 392A7325 for ; Sat, 5 Dec 2026 17:41:05 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 2B1CC6064E for ; Sat, 5 Dec 2026 17:41:05 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id TzLupKQEH78s for ; Sat, 5 Dec 2026 17:41:03 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp3.osuosl.org 9AA8D6064A Authentication-Results: smtp3.osuosl.org; arc=none smtp.remote-ip=116.202.128.144 Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=116.202.128.144; helo=freeshell.de; envelope-from=e@freeshell.de; receiver= Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=reject dis=none) header.from=freeshell.de Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=freeshell.de header.i=@freeshell.de header.a=rsa-sha256 header.s=s2025 header.b=DVnG2w5o Received: from freeshell.de (freeshell.de [116.202.128.144]) by smtp3.osuosl.org (Postfix) with ESMTPS id 9AA8D6064A for ; Sat, 5 Dec 2026 17:41:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freeshell.de; s=s2025; t=1796492431; bh=cU5NbxFIM/I3/17qX3GLSqhyjKSfCEUPtrGkbXP0pnY=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=DVnG2w5o1A/GuKwMe+t5dpZn0WuNr18+T36uZm2MYb8twp/+LS6gahK+OwlaXgLiw wQ3N9ET/MnHFl6o7rud6MZLAxiiJu99NiNISpH10vRlfeJrQEWUL+H9cIzW2vKqqCB rNl5yVj2jRk4HMw5e+D/eyw0OqJy6ZF4o4nwPJCE1lCMf761/cNgh3tidRVvrBAGX6 OBJCAknkucBWGWQtRmSIR94sqZT46mzHG9HnO6kUthSmt7ekW+vP83NwLbUzsxFCAb un8S1vTbXhUjluXGUMOxhtKH3fnBx3IYF690ApYlHLEhy//G9KNuebssnJz+RXtNao n47LSLsAOBVCg== Received: from [IPV6:2605:59ca:364f:d400:1b91:6b30:22c2:fffc] (unknown [IPv6:2605:59ca:364f:d400:1b91:6b30:22c2:fffc]) (Authenticated sender: e) by freeshell.de (Postfix) with ESMTPSA id 033AAB2201AB; Sat, 5 Dec 2026 18:40:29 +0100 (CET) Message-ID: Date: Sat, 5 Dec 2026 09:40:16 -0800 X-Archived-By: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4] riscv: Mark M-IMSIC and M-APLIC nodes as reserved in DT passed to next stage in S mode To: Anirudh Srinivasan Cc: Yao Zi , u-boot@lists.u-boot-project.org, Tim Ouyang , Leo Liang , Tom Rini , Troy Mitchell References: <20261203-mimsic_maplic_fixup-v4-1-41acf30f9b68@oss.tenstorrent.com> Content-Language: en-US From: E Shattow In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.u-boot-project.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: U-Boot discussion List-Archive: List-Post: List-Help: List-Subscribe: , X-Spam-Status: No, score=-7.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Hi Anirudh, Thanks for your patience :) replying my questions. On 12/4/26 06:25, Anirudh Srinivasan wrote: > Hi E, > > On Fri, Dec 4, 2026 at 5:10 AM E Shattow wrote: >> >> Hi Anirudh, >> >> On 12/3/26 08:56, Anirudh Srinivasan wrote: >>> When U-Boot is running in S mode, the DT passed to the next S mode stage >>> can either be the bundled in DT U-Boot and the previous M mode stage >>> use, or be loaded by U-Boot from some boot media. In the former case, >>> the M mode stage can fix up the DT to disable the M-IMSIC and M-APLIC >>> nodes on an AIA system (for example, OpenSBI does this fixup). These >>> controllers are to be managed by M-mode software, so this is done to >>> prevent S mode software from trying to probe them. >>> >> >> The way it reads now (in my point of view) is as: >> >> "M-IMSIC and M-APLIC controllers are to be managed by M-mode software, >> and so enforce any M-mode M-IMSIC and M-APLIC nodes are effectively >> status 'reserved' in S-mode U-Boot with a fixup to the received control > > This is what OpenSBI does. > >> Fdt from preceding M-Mode software (e.g. OpenSBI). Enforce again this >> same fixup when entering the next S-mode kernel to prevent S-mode >> software from trying to probe them. > > We're doing this again here cause we may possibly not use the DT > passed by OpenSBI and use a fresh DT from boot media. > > Regards > Anirudh srinivasan If we did not call out to an M-Mode SBI for the transition to S-Mode then we would be managing these with a fix-up at M-Mode U-Boot SPL when handing off to S-Mode U-Boot main app; I see the problem now, M-Mode U-Boot SPL loads U-Boot main multi-fit image which begins code execution with M-Mode SBI (e.g. OpenSBI or RustSBI, etc.) and we have no domain over the Fdt control state as S-Mode U-Boot main app is loaded and begins code execution because that is done by the 3rd party M-Mode SBI. We again incur this problem exiting from S-Mode U-Boot Main app because there are provisions for a user to again load data to the Fdt for hand-off to the next boot phase. I think it would be appropriate to log a warning (or even log "info" level) that this particular M-mode <=> S-Mode fix-up consistency enforcement is being done, as for example: "Enforce reserved M-mode Fdt property status for handoff to S-Mode kernel: * M-IMSIC okay => reserved * M-APLIC okay => reserved" or when the fix-up is activated but no nodes are changed then as: "Enforce reserved M-mode Fdt property status for handoff to S-Mode kernel: (n/a)" Also for consistency we should enforce this twice, at both S-Mode U-Boot main app initialization and at hand-off exiting S-Mode U-Boot main app. I would like an explicit opt-in / opt-out strategy for the M-mode <=> S-mode Fdt fix-up. A compile-time option is fine, here, and to make this implicit for all RISC-V makes sense to me unless disabled explicitly with "=n".... something so it appears in the .config but that it is a sensible default so we don't require an opt-in. Presumably this is only applicable to RISC-V platform? I think this also would apply to U-Boot SPL, in terms of consistency this fix-up should be instrumented so that you can require it to run when exiting the SPL (but this would of course be disabled when there is an SBI). This should not incur any code size overhead as a config option it would simply not be compiled-in. This gives it an explicit application at build time and be visible in the .config With the above suggestions implemented, I think the commit message does not require to mention "OpenSBI" at all. It simply becomes a matter of informing the user and being a consistency enforcement SPL and Main app boot phases. -E