Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1477967pxf; Fri, 2 Apr 2021 11:34:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwc8aciCGSxWREBtmE8983LktefK1COR65Wc5LfblqLuqUVg4anhXNZw497qE/9EClHKcWD X-Received: by 2002:a05:6e02:1989:: with SMTP id g9mr11831348ilf.40.1617388458267; Fri, 02 Apr 2021 11:34:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617388458; cv=none; d=google.com; s=arc-20160816; b=UHUNTX7KpY00c5WTMT1nTdbYq5xS4fFh+zIJwZDwPPEU8x5wIH1eq1cAK/bpgAmZvc CTseTdDgYYsCrlq3gUJeqLeM2RTzAFtNynlHj77JqQ+ir0I73Ra/ajGcOJ4EI7xhHuIe qSSc7o/8nbNl7oxOdeCB9hWz7+fmEM1zRPpdrDvkotEN5SjpAZP/9shR4SG87aELFiz4 EEX66+d6YJX2V7+yvO1l0Kl9qI7RNX37gF4NqhLI3eOSzepr4ESA7R6H/Z6tyqJkDe5k AVQlLnpY4j2aPW7WOU5b4EbPAwsnhQgiIZWfjZRj2Y0gGhwmD61ypMPswHGJc3qIm2YX /JVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=JEImeWQFnJkod2jM98Z/xLXuJvfL1jeKNNYb3HQj8pM=; b=BXpzFudMBnbAaCAUEx+BJ0j1TDcyAMhepa8rvl/Cao/aE0akiAqPgeuL7WxYBRaZTj WBFAEJPjMXZfBtpUHixkyYw5gGD46l0flQ7Pi2ZYnE3SBKJm2wJGozSTNA3VRM12ze6w eYdygR0QgVJHbZho5osg+lzK4s0R7pG7fwW8dA/LU8yG4QoKIyW7wwvo8oMhy9tpNo6K M29LY3AjF9FZam4OQzFxBbLlanJs12qiuhzHgqeGbpXDrpJuihxXknWs09huV2wlJj6p QiPLyxZgfuzeyQIUubpR/S1Hhv3e/VsSdMfcZKf1Unler2vbiBPK0d95OGkB4q1mWhHI yK0Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s4si396827ilv.20.2021.04.02.11.34.04; Fri, 02 Apr 2021 11:34:18 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235256AbhDBSde (ORCPT + 99 others); Fri, 2 Apr 2021 14:33:34 -0400 Received: from angie.orcam.me.uk ([157.25.102.26]:38310 "EHLO angie.orcam.me.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229553AbhDBSdd (ORCPT ); Fri, 2 Apr 2021 14:33:33 -0400 Received: by angie.orcam.me.uk (Postfix, from userid 500) id 0BDAE92009C; Fri, 2 Apr 2021 20:33:31 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 05AAC92009B; Fri, 2 Apr 2021 20:33:30 +0200 (CEST) Date: Fri, 2 Apr 2021 20:33:30 +0200 (CEST) From: "Maciej W. Rozycki" To: David Abdurachmanov cc: Dmitry Vyukov , Palmer Dabbelt , Alex Ghiti , Paul Walmsley , Linux API , linux-riscv , LKML Subject: Re: [PATCH] riscv: Bump COMMAND_LINE_SIZE value to 1024 In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2 Apr 2021, David Abdurachmanov wrote: > > > > This macro is exported as a part of the user API so it must not depend on > > > > Kconfig. Also changing it (rather than say adding COMMAND_LINE_SIZE_V2 or > > > > switching to an entirely new data object that has its dimension set in a > > > > different way) requires careful evaluation as external binaries have and > > > > will have the value it expands to compiled in, so it's a part of the ABI > > > > too. > > > > > > Thanks, I didn't realize this was part of the user BI. In that case we > > > really can't chage it, so we'll have to sort out some other way do fix > > > whatever is going on. > > > > > > I've dropped this from fixes. > > > > Does increasing COMMAND_LINE_SIZE break user-space binaries? I would > > expect it to work the same way as adding new enum values, or adding > > fields at the end of versioned structs, etc. > > I would assume the old bootloaders/etc will only support up to the > > old, smaller max command line size, while the kernel will support > > larger command line size, which is fine. > > However, if something copies /proc/cmdline into a fixed-size buffer > > and expects that to work, that will break... that's quite unfortunate > > user-space code... is it what we afraid of? > > > > Alternatively, could expose the same COMMAND_LINE_SIZE, but internally > > support a larger command line? > > Looking at kernel commit history I see PowerPC switched from 512 to > 2048, and I don't see complaints about the ABI on the mailing list. > > If COMMAND_LINE_SIZE is used by user space applications and we > increase it there shouldn't be problems. I would expect things to > work, but just get truncated boot args? That is the application will > continue only to look at the initial 512 chars. The macro is in an include/uapi header, so it's exported to the userland and a part of the user API. I don't know what the consequences are for the RISC-V port specifically, but it has raised my attention, and I think it has to be investigated. Perhaps it's OK to change it after all, but you'd have to go through known/potential users of this macro. I guess there shouldn't be that many of them. In any case it cannot depend on Kconfig, because the userland won't have access to the configuration, and then presumably wants to handle any and all. Maciej