Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp996876pxy; Thu, 22 Apr 2021 20:01:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeFNGi0ZQfFYBrdmew760mSS4hyr/J2R6QibIWCsIfZAlkPqhoy5m9r37Am1fB5V2xKsi5 X-Received: by 2002:a50:ed10:: with SMTP id j16mr1779240eds.29.1619146877179; Thu, 22 Apr 2021 20:01:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619146877; cv=none; d=google.com; s=arc-20160816; b=W66PK/darS4UZmygK6ZzZFkVhVRc1et8OQtcLXEv+mLkPvjbmDfg3zsdLohGznihUa m5RMK52vQtZeKavzgdPevT+vkZyK9KzsZQeNVaPuAAU314foUWytFQAiI0ItT0CivHdm rbJyQnQ7u+L3HwZN1ccfzpolj0SPukylymn5vsAoh+R/A0pPgywNYwaaQicrgJbG8Bcr 8Rd4BM1r1BoucX1rkdrNqqi+5JXZFXjbPYu8i2G9DRkzMuvDTuwQ6w4IX+/oETlkrZtW OkpFtAbZDtXcNo6WEf+MhiPCslynbncn4bGcw7koy/O9vcaIMdDb8GNAT/SS3ZUkyASz Ekyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=arsdj8vKnkIONLNBcA7aqij2gyfUw/1l6TswIRx/eE4=; b=onhhYJCJJVPCjY5Xhd7+21DiVO6IwoLO/m2bVz2IUhkoWRg/IBeGHvlNkihzXv7keN BiURHp0MgOsrjjFw2dW5L8jn20Ns8zZd/vp+jZvLx8WWtxHQcA6g2KiTzhusxmtWLO9F H6Vr0WX+tXo6mslv1Xd7UJbB4T9SxDrMPAuyAzxmnmSn5Aa/sHF9iLFKw23exr14NBor nSq0JYy9d14R4y1Wkvt3Uj0aStISKkSWeDUkM5wOWJWnLFDpwr9VOtQPI07pqPoQxHBl DneEffQflV21JS40kaBJBStk7DwaOfEgO9nsvTZGru87VknIuPnkwRhcqneAv+4f8IoL sLeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dabbelt-com.20150623.gappssmtp.com header.s=20150623 header.b=eXQfRFQn; 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 g17si4591436ejr.16.2021.04.22.20.00.53; Thu, 22 Apr 2021 20:01:17 -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; dkim=pass header.i=@dabbelt-com.20150623.gappssmtp.com header.s=20150623 header.b=eXQfRFQn; 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 S231600AbhDWC6E (ORCPT + 99 others); Thu, 22 Apr 2021 22:58:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229868AbhDWC6D (ORCPT ); Thu, 22 Apr 2021 22:58:03 -0400 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0503C061574 for ; Thu, 22 Apr 2021 19:57:23 -0700 (PDT) Received: by mail-pg1-x52c.google.com with SMTP id z16so34235872pga.1 for ; Thu, 22 Apr 2021 19:57:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20150623.gappssmtp.com; s=20150623; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=arsdj8vKnkIONLNBcA7aqij2gyfUw/1l6TswIRx/eE4=; b=eXQfRFQnN2l37Rz03yVVNKTfVVWaEtnmnCBueTkCJYLwVSfwlr004PJ6fCbfI0cwtE dBsCscUZJdU2+UwOP0gRfKGO14+WjaToJlGk41YLfdasQvfmY3VbL1LvpKE4rBYNhxZh mpPP/78fHZw3MKVGAjLEZbeA/ol8zp/LO+oRGWxMbOeVPraD8VzMgI117jJW2jsQHiwz 0nOzRqej7s5U2DAjBPFp1qw9t++5bOgiHRvkOqsiRJu7eFRYAMkuIPt4VLQHluU7RKPU Ip1ZclGanO2CLGZyAqSrPbFm9FrtftttqFwgpu9u75yuFGL5GuGkh4TNiUyFgI8ReH5K aZhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=arsdj8vKnkIONLNBcA7aqij2gyfUw/1l6TswIRx/eE4=; b=L6vCGQUjHLiBfOM+l8Ut4JWApUN1hB9US1Su3ssse3CkBqUhI5AFVdEgu32hAu1ypL BxHec4CjZ7g/Nzjl0mbbjJZTgya28693f0XJCHa4N8H2AW03OHj+UHoJVOxkWAaxSEs5 IvNhx/y9cfZEkDymMjuDJjeR7i2uujBoQXHJEUGKu4oxIDRW2zI7szBZRbnfCNn4/xEE sFRqgylXpw9neMxT0hIO0ng4R8u54Q3GrNc41zKs8X5CGP8ogr2HhqYkHN82t7vYK8Nt QLJ5f3a7HzBpG4ZT9WqL9NqR8LNioESi2b93FA2FlteQl7SHlHJvcOmQ+ChGv1DYhPUt BMvw== X-Gm-Message-State: AOAM530dJCg1C8iFRRyuMNvDUsEBEQ/AGbrieiB0BC7V7HgoWpIXTa7n hugql3pSjoRc8vdm5v+reUGcPA== X-Received: by 2002:a65:5888:: with SMTP id d8mr1634494pgu.23.1619146643509; Thu, 22 Apr 2021 19:57:23 -0700 (PDT) Received: from localhost (76-210-143-223.lightspeed.sntcca.sbcglobal.net. [76.210.143.223]) by smtp.gmail.com with ESMTPSA id d4sm5796664pjz.49.2021.04.22.19.57.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Apr 2021 19:57:22 -0700 (PDT) Date: Thu, 22 Apr 2021 19:57:22 -0700 (PDT) X-Google-Original-Date: Thu, 22 Apr 2021 19:57:21 PDT (-0700) Subject: Re: [PATCH] riscv: Bump COMMAND_LINE_SIZE value to 1024 In-Reply-To: CC: david.abdurachmanov@gmail.com, dvyukov@google.com, alex@ghiti.fr, Paul Walmsley , linux-api@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org From: Palmer Dabbelt To: macro@orcam.me.uk Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 02 Apr 2021 11:33:30 PDT (-0700), macro@orcam.me.uk wrote: > 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. It kind of feels to me like COMMAND_LINE_SIZE shouldn't have been part of the UABI to begin with. I sent a patch to remove it from the asm-generic UABI, let's see if anyone knows of a reason it should be UABI: https://lore.kernel.org/linux-arch/20210423025545.313965-1-palmer@dabbelt.com/T/#u