Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp80831pxb; Tue, 2 Mar 2021 19:59:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJwkI7NFDYxUNj9RscPk9Ij6ZswvBJTDGaWYc13pxsHdAsF/ajduBF6SwSGPGTLp/IVcfd0Y X-Received: by 2002:a17:906:f296:: with SMTP id gu22mr22629979ejb.20.1614743985041; Tue, 02 Mar 2021 19:59:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614743985; cv=none; d=google.com; s=arc-20160816; b=jbPb1s/B0/5ZBgpMBTOXZ2qv/pLSh8yiIeTwRGbl0T7djECpPpZdHWapJRfKZ3DW5v cCaJ3hfAeZIzKkQKUpvClgrA+ikQ5NWdDuFJQk0aUzds9/W01nu1TMsvxjeUMrkKFNZS bW+LbuOMOeIUuq8sD4PJ9hLW7gWFufNEtp8H4+NbWts6jkiSnpwl/o9LR4dU29jxVeeM HeMfWTtjcy+xTS+PmjCrfzNFK2o/r2BzSq2SU4ZFhA6E2JuRA7itPWR2M3/6k1SeryCo L6TRWQ5njn9NjH1ylBG4ZaRNePW17UC7LzfkGqRfpoOCMWnjRf98lowMPJ6+rgotRfpU hyyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=OmK5xMymlRiK07FjEeoz7L8dTdvXoH4fQ2h2UPL3QEw=; b=U5nojHUSMs4JF/zSgIV7VdsnTqGXCjrSiwNn7QQtaDu0hFGiRd657NB6b2rT1dDLYO Doj+WcwUyWp5yBEQOVLxM5cms7SwDYFff77rwzF/CbKmc1yT3LQubZcFyJBE+YVyc5G1 PtV7PdIqIqcRvHeYRuDWL0EOOjHN/wJVmA6rIB+qj+9MgXlppjdNd1UlcgZV5zSp24r/ EXBDys/oIrsPuiOm82tlLuEtrI58If4//HxKHwRuTIZ8zJyGmThQyN5LNGkxdBJQHeoM SJ+XsAaoC2kFPAqiYIQQ27RWHhY31c+U8/mQ610F9dyw14fe1FAhGMM6TIqK/mJaEILq sRmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=U32ZnyzN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l17si7297724eda.91.2021.03.02.19.59.22; Tue, 02 Mar 2021 19:59:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=U32ZnyzN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236490AbhCAOmv (ORCPT + 99 others); Mon, 1 Mar 2021 09:42:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:60976 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236488AbhCAOmn (ORCPT ); Mon, 1 Mar 2021 09:42:43 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 79ACF6146D; Mon, 1 Mar 2021 14:41:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614609720; bh=A8uvgt2qITNiFx+O5TMfvqSj4kp8O0GQYgdE+yNAFZ4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=U32ZnyzNuFxVGAvPJ2ZT4hvEfjXEbHwS4KdUK50MYVWI7Ltxpdi9gqdnA02eLyzqG WXoHEWPYP0RwJz6kW6fwXpkGSFRhts1XKAIYsor0N3x4kD1w1zDYRh3OFCJfZg3phY H8Ym+mYpq34a7DHpCztHTUqw01RTrNZGItBjy8cGiBsredQgW6ZhRLnreRSX1Y5oN5 KtMobEll+DtAYzNVHvi/6UX0i+Zo/uvB+C4NB8uXIfrX0KVei4P4OPGMOtz8piINFo JThDquLAWOnhV0oYQ95MLdd1OZ/kxVWzKXVyAQX5PhUw81WESpVSgn+PdJDyhohvl5 X0GZa4HOFjOoQ== Date: Mon, 1 Mar 2021 14:41:54 +0000 From: Will Deacon To: Rob Herring Cc: "linux-kernel@vger.kernel.org" , Max Uvarov , Ard Biesheuvel , Marc Zyngier , Doug Anderson , Tyler Hicks , Frank Rowand , Arnd Bergmann , Palmer Dabbelt , Greg Kroah-Hartman , Catalin Marinas , Android Kernel Team , linux-arm-kernel , devicetree@vger.kernel.org Subject: Re: [PATCH 0/2] Fix CMDLINE_EXTEND handling for FDT "bootargs" Message-ID: <20210301144153.GA16716@willie-the-truck> References: <20210225125921.13147-1-will@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 01, 2021 at 08:19:32AM -0600, Rob Herring wrote: > On Thu, Feb 25, 2021 at 6:59 AM Will Deacon wrote: > > We recently [1] enabled support for CMDLINE_EXTEND on arm64, however > > when I started looking at replacing Android's out-of-tree implementation [2] > > Did anyone go read the common, reworked version of all this I > referenced that supports prepend and append. Here it is again[1]. > Maybe I should have been more assertive there and said 'extend' is > ambiguous. I tried reading that, but (a) most of the series is not in the mailing list archives and (b) the patch that _is_ doesn't touch CMDLINE_EXTEND at all. Right now the code in mainline does the opposite of what it's documented to do. > > with the upstream version, I noticed that the two behave significantly > > differently: Android follows the Kconfig help text of appending the > > bootloader arguments to the kernel command line, whereas upstream appends > > the kernel command line to the bootloader arguments. That is, except for > > the EFI stub, which follows the documented behaviour. > > > > I think the documented behaviour is more useful, so this patch series > > reworks the FDT code to follow that and updates the very recently merged > > arm64 idreg early command-line parsing as well. > > I can just as easily argue that the kernel having the last say makes > sense. Dunno, I'd say that's what CMDLINE_FORCE is for. Plus you'd be arguing against both the documentation and the EFI stub implementation. > Regardless, I'm pretty sure there's someone out there relying on current > behavior. What is the impact of this change to other arches? On arm64, I doubt it, as Android is the main user of this (where it's been supported for 9 years with the documented behaviour). The other option, then, is reverting CMDLINE_EXTEND from arm64 until this is figured out. I think that's preferable to having divergent behaviour. As for other architectures, I think the ATAGs-based solution on arch/arm/ gets it right: static int __init parse_tag_cmdline(const struct tag *tag) { #if defined(CONFIG_CMDLINE_EXTEND) strlcat(default_command_line, " ", COMMAND_LINE_SIZE); strlcat(default_command_line, tag->u.cmdline.cmdline, COMMAND_LINE_SIZE); For now I think we have two options for arm64: either fix the fdt code, or revert CMDLINE_EXTEND until the PREPEND/APPEND series is merged. Which do you prefer? Will