From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BD437CD13CF for ; Tue, 3 Sep 2024 12:30:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Type:MIME-Version:References:Message-ID:Subject:To:Date:From:Reply-To :Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=pQaEXKZRWyREIUo8wC8RcTnNWfD1rXPNnUAij9Sr27k=; b=CD9TVWr4BrdVxiHD0FtwB+Buvl byp9bij0DKOneXqtxMpPnwkWAkkXH3S7y5vUiyvdxBdqLoMO66obfurJ/jk25Z+01oxk08HBf5q4g KcIapUQSlzUL5n5wITiY/qiVFCMrilQZgtNhHgpnVdzqxc2o9ZC48Mv2DB+pg/IIPfzmsFILouYqf 1nZlC4Xgvt9npYT2FvC08KZJRW8TNXWOGi6bEvyscJJBdMYe8oFhr1m30fjuuRyz8Cye7e5Dcy5Fk CQK1GFz3J/YKgZlYC1VOgcQmmZ1fLm4GKn0cSpaA73Vef71HILyUB2ApYf3BIHnXVcaa2a06ULacr P51xq3Mw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1slSfj-00000000APs-3SyD; Tue, 03 Sep 2024 12:30:11 +0000 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1slSen-00000000ABw-1xyg for linux-arm-kernel@lists.infradead.org; Tue, 03 Sep 2024 12:29:14 +0000 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-53345dcd377so7298902e87.2 for ; Tue, 03 Sep 2024 05:29:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1725366551; x=1725971351; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc:subject:date:message-id:reply-to; bh=pQaEXKZRWyREIUo8wC8RcTnNWfD1rXPNnUAij9Sr27k=; b=HlUlztxigCds/vtUa3vr6jAxrPHmjDTPJac81AmGOfnNWivpbHfEsinzCng+pulmlZ 6dLG8pHonr6yUpR+LN67qqXKpEZzF4dkOPIZ7OCNBAlAtnhGR8hoJR4/RMG4TgLSO/ZV zB1qhg71/dFGy1rp45rIAzY1XxWkkFtFyVjLalygcuDszZm8rb5fjqGyREa3ba+NOGO7 lRBp3BBYXzzFWAEc+Fz6jjkVk3xj9GrWNvihXq8uXDEkrUsynsFHBcJ8Dqe/BlcRP8UM R+UoyvKTMIesz/HZm9tX5lQ65K+/ElcELcKdQtHxKSNYH/DtSLGy5DRKsQmiy7eKUEc3 /KVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725366551; x=1725971351; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=pQaEXKZRWyREIUo8wC8RcTnNWfD1rXPNnUAij9Sr27k=; b=WErudREsqiMgxuRJo3t4W1dXcVuM2XaxNffG6VWQly01Bf9QuR1mp+0Nzfz96nOn70 vk5ZUkw3i71XHR6zsGSFwiepQf9cLfdghH3ZoZuXsuiMAxl869WVYNYZTcwvcJK/wlQu +BcIrtmH/lUNKCTuH62ZeM2Uo090MZdhwfqKymwcVl+SWM619RT3f1ALZmDMgw6a7McS DNz/e4w4gT9Ctavpzfr4vF1DFt43bfVtFAE4qiS4kgGTfJIN1RRA/4KxiDce2LTijhz7 PIq22TKoYO+jjyHhE3jas3YFvppwkK1F0zMsKHPhHle2i6idVe7FwjzOruhA/1PCJKHU C3+Q== X-Forwarded-Encrypted: i=1; AJvYcCXz6nY23fyEQKRxWYIU8//0Wna7+6deHR1ymXd8lKjTMB/r/1kltynpcBnpGDqlpDSo3yyqM6n5FopIbenYwiML@lists.infradead.org X-Gm-Message-State: AOJu0Yy1BGp4vSMgivyQeeksLoOR3GQIZ/C37/qO7aPNb1TD/jRnnANs G0mQows2Xq8BQ4Y/h+qrNv4skNKK75mXJRClQtiNoGneqKFvRUMHFHO2+2cg7tE= X-Google-Smtp-Source: AGHT+IFq5h7rZ8oQIIXm6nz6CibNpWmLcPJNLG4TGtm/2ICu6a9ZqKTz9NHYYqSXDVwrc61upSj1pQ== X-Received: by 2002:a05:6512:2254:b0:530:ea60:7e07 with SMTP id 2adb3069b0e04-53546bb9455mr9237621e87.58.1725366550821; Tue, 03 Sep 2024 05:29:10 -0700 (PDT) Received: from localhost (host-80-182-198-72.retail.telecomitalia.it. [80.182.198.72]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a89891d7834sm688285166b.177.2024.09.03.05.29.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 05:29:10 -0700 (PDT) From: Andrea della Porta X-Google-Original-From: Andrea della Porta Date: Tue, 3 Sep 2024 14:29:18 +0200 To: Stephen Boyd Subject: Re: [PATCH 05/11] vmlinux.lds.h: Preserve DTB sections from being discarded after init Message-ID: References: <12d0909b1612fb6d2caa42b4fda5e5ae63d623a3.1724159867.git.andrea.porta@suse.com> <2113b8df52164733a0ee3860bb793d6e.sboyd@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2113b8df52164733a0ee3860bb793d6e.sboyd@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240903_052913_518332_F35631A1 X-CRM114-Status: GOOD ( 28.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Lunn , Catalin Marinas , Linus Walleij , Eric Dumazet , Dragan Cvetic , Will Deacon , linux-clk@vger.kernel.org, linux-arch@vger.kernel.org, Rob Herring , Florian Fainelli , Lee Jones , Saravana Kannan , Broadcom internal kernel review list , linux-pci@vger.kernel.org, Jakub Kicinski , Paolo Abeni , Michael Turquette , devicetree@vger.kernel.org, Conor Dooley , Arnd Bergmann , linux-gpio@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, Bjorn Helgaas , Andrea della Porta , linux-arm-kernel@lists.infradead.org, Derek Kiernan , Greg Kroah-Hartman , Claudiu Beznea , linux-kernel@vger.kernel.org, Stefan Wahren , netdev@vger.kernel.org, Krzysztof Kozlowski , "David S. Miller" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Stephen, On 12:46 Fri 30 Aug , Stephen Boyd wrote: > Quoting Andrea della Porta (2024-08-20 07:36:07) > > The special section .dtb.init.rodata contains dtb and dtbo compiled > > as objects inside the kernel and ends up in .init.data sectiion that > > will be discarded early after the init phase. This is a problem for > > builtin drivers that apply dtb overlay at runtime since this happens > > later (e.g. during bus enumeration) and also for modules that should > > be able to do it dynamically during runtime. > > Move the dtb section to .data. > > > > Signed-off-by: Andrea della Porta > > --- > > include/asm-generic/vmlinux.lds.h | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h > > index ad6afc5c4918..3ae9097774b0 100644 > > --- a/include/asm-generic/vmlinux.lds.h > > +++ b/include/asm-generic/vmlinux.lds.h > > @@ -365,6 +365,7 @@ > > TRACE_PRINTKS() \ > > BPF_RAW_TP() \ > > TRACEPOINT_STR() \ > > + KERNEL_DTB() \ > > The KERNEL_DTB() macro shows the section name is dtb.init.rodata. Can > you remove the ".init." part if this isn't initdata anymore? And > shouldn't it be in the RO_DATA() macro? Ack. > > It would be nice to keep the initdata properties when this isn't used > after init as well. Perhaps we need another macro and/or filename to > indicate that the DTB{O} can be thrown away after init/module init. We can certainly add some more filename extension that would place the relevant data in a droppable section. Throwing away the dtb/o after init is like the actual KERNEL_DTB macro that is adding teh data to section .init.data, but this would mean t would be useful only at very early init stage, just like for CONFIG_OF_UNITTEST. Throwing after module init could be more difficult though, I think, for example we're not sure when to discard the section in case of deferred modules probe. Many thanks, Andrea