Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1299462rwb; Thu, 10 Nov 2022 14:12:19 -0800 (PST) X-Google-Smtp-Source: AMsMyM6gi3T6fDdgJ3EYigvidn9xhH2R056o+SOipPExNhT11xui9ZZLlEN7adx7UaUTD7IS2/Un X-Received: by 2002:aa7:d8c1:0:b0:458:dbc5:67c5 with SMTP id k1-20020aa7d8c1000000b00458dbc567c5mr3717869eds.214.1668118339756; Thu, 10 Nov 2022 14:12:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668118339; cv=none; d=google.com; s=arc-20160816; b=1Ku5qR/pbZQzXq3Nba9v/vKHQaAZvprON1vZFFftYPH7T1BRS/hPklFBlTgv5KdunC eArl1DyBEgYNBVIRaQg9IGJhlD2ea4frMF1AXWb5Ojc2UIDbHrTuF1DvwKP7HXe+8Dhi gX69TAr8ezNF0pguMPSupcJPJNHUIyNHz8z0yIWtUwwO+BRv5WP+S5p2JgLBolLEflBl hyi0DZyZcwyRcNQmX+Eg/6YIGIa9Y7EkHgvh1DbDvqmcGeOsUulDdh2aivCPaJrAUnOl 2NjOTTPB8bQN0ls9YSzO0daL3LLlzIgscw5cWrG5ABNzQmpjiuxaxZhv2YwCH+qr3qoc h3Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=uSbodY8FqZ0Ciim/vAb77VV4F9ElrHL2UVuKiq5ungA=; b=ubR0joD/tEEs1XGwE2GH6GfPnmth3KKPhVouPW6Ncq5/GeR5XNupCkDchJ8UeTDSKB ixnoLqXnj72diM5H+65xuqv4Yb08BPz7QkxCN3BvMoArEObxsfmfBeNa8HuKyQJsn93+ VVpKyN6TDvvEM27KuZsKeW2u42yJjvLHwqZfTYcv5KOELH8DWUeSMmOsTKjdJ0xP6L+b QQQ2FBPo14Spr612KO00mHcGZk4oNhCuOKt4TUjWCWVwJ7cNJdEY+1gTWsMxIKW4wPdB 3dEl3LjGwzRofsUKvzP3AxBf3v8TU8+vH3wLy8lmUHDlUWnEeLWowZb9pcjQG1wW4irA y9xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=YMGD8nMS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ka2-20020a170907990200b007ae4717bf18si347930ejc.156.2022.11.10.14.11.52; Thu, 10 Nov 2022 14:12:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=YMGD8nMS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231502AbiKJVBn (ORCPT + 92 others); Thu, 10 Nov 2022 16:01:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229961AbiKJVBi (ORCPT ); Thu, 10 Nov 2022 16:01:38 -0500 Received: from mail-oa1-x35.google.com (mail-oa1-x35.google.com [IPv6:2001:4860:4864:20::35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E337CBF43 for ; Thu, 10 Nov 2022 13:01:37 -0800 (PST) Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-13b103a3e5dso3529282fac.2 for ; Thu, 10 Nov 2022 13:01:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=uSbodY8FqZ0Ciim/vAb77VV4F9ElrHL2UVuKiq5ungA=; b=YMGD8nMS55gvLSoZ8tKrtFoOZ/Ve6TrHy42MgIRNg7/fmubAxDJH5DG0RW10SxvOeP DjTT4GnaBPcWIi5FHosoNTKOgkLUY73yZvvLd9GalbDMFolHEKGR8P2hdFUvIFmPB/SO BrV90aXQ1eoZkI6c1yhjIGCApzY+hu3tS/DTZEU/Fg2s7BMNOWpnAvF4Cuip1vbjLDDi Wi0Cf6JFPCLTbtm34QorcHgGhquebmcOqtlB6bTQLk4Mr7H+4Eba3Bf+AHWKYeyJTbOW TJMserRFDaCMIXo5v2+5i1CgxrdLo/ul7beHcB3VpcJHaJjJRJj3Y82oz8ECPN2Z55/w fCMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uSbodY8FqZ0Ciim/vAb77VV4F9ElrHL2UVuKiq5ungA=; b=RfFdCKHgh1+wX9nQM5Aoilns6QgVqcVn1HDWu7EV6nX3ngfrYIC8tBLqrBWtmgLHg9 lO92EHSCdENEXny8G0cGQ3UDl7hiTaXmJvgBiCe03pvcWNIXo5++EKKcBKpnWXpcFXxf ASIuOF0Ux07RS+JjTzwBCM/wVMm0pTRD2lGzGpvmjbJsRaR6T5lt0bOa2m3CVrTAJV9y 1G413aDRTb3iypBX1BH0Sc95TfRbuZF+pmT5/qVLdmbSsFksVSwyqPVPe1L97NOBXGBr MeWj+V2a04VQ4tBXEmce97cyaHSxqiTxt8ZNTrw0O4zPA6z4E3tFQwuNGNs4S5ujqXbN FAWg== X-Gm-Message-State: ACrzQf12pB3fBPdAtxgoJzv2skBGLbAzvNeqVHLqOwkTMx+SAymWCiM0 p2NPbUkk4FiwavydGS2S0VKW832Garhit2ezGnOdqg== X-Received: by 2002:a05:6870:ab84:b0:13c:7d1c:5108 with SMTP id gs4-20020a056870ab8400b0013c7d1c5108mr2177638oab.282.1668114096980; Thu, 10 Nov 2022 13:01:36 -0800 (PST) MIME-Version: 1.0 References: <182c1d4e-a117-79d6-4dd1-8e3c8a447b4a@ghiti.fr> In-Reply-To: <182c1d4e-a117-79d6-4dd1-8e3c8a447b4a@ghiti.fr> From: Dmitry Vyukov Date: Thu, 10 Nov 2022 13:01:26 -0800 Message-ID: Subject: Re: [PATCH] riscv: Bump COMMAND_LINE_SIZE value to 1024 To: Alex Ghiti Cc: Palmer Dabbelt , macro@orcam.me.uk, david.abdurachmanov@gmail.com, Paul Walmsley , linux-api@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 21 Jun 2021 at 00:11, Alex Ghiti wrote: > > Hi Palmer, > > Le 23/04/2021 =C3=A0 04:57, Palmer Dabbelt a =C3=A9crit : > > 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 woul= d > >>> > 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 unfortuna= te > >>> > user-space code... is it what we afraid of? > >>> > > >>> > Alternatively, could expose the same COMMAND_LINE_SIZE, but interna= lly > >>> > 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 userl= and > >> and a part of the user API. I don't know what the consequences are fo= r > >> the RISC-V port specifically, but it has raised my attention, and I th= ink > >> 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 h= ave > >> access to the configuration, and then presumably wants to handle any a= nd > >> 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 UA= BI: > > > > https://lore.kernel.org/linux-arch/20210423025545.313965-1-palmer@dabbe= lt.com/T/#u > > Arnd seemed to agree with you about removing COMMAND_LINE_SIZE from the > UABI, any progress on your side? Was this ever merged? Don't see this even in linux-next.