Message ID | 20221125133713.314796-1-andrea.righi@canonical.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp4024355wrr; Fri, 25 Nov 2022 05:39:05 -0800 (PST) X-Google-Smtp-Source: AA0mqf41wJ8i2ZCpeDjUPPYkAs/R7DX2nBAp30uZX0vGwBLs4sY3jQLK5kTmTZxwppLb4+zj7eJk X-Received: by 2002:a17:906:a2da:b0:7ad:84d1:5b56 with SMTP id by26-20020a170906a2da00b007ad84d15b56mr33170746ejb.205.1669383545374; Fri, 25 Nov 2022 05:39:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669383545; cv=none; d=google.com; s=arc-20160816; b=RoqlXToDawbXM/Bls7EghISpLY8YXepccn7JBP705B0EQde7kPdyDSOp6L/6semzHj wGyDdLe18+MzFFr1fYr1vZCRLpYvNdOA3YMwQldTXehdIvE4Gg3vAoBc8prvp1S6ERyF NU2GK4tA9OVjknzOD+AuSQSkwJmMW/aS7mFTlsUhM2BcvRKLvi5kYkNvkpZEwYglaqEr bnSRy1Q9xpKaXs3J8LQ0T5ipxZFjXd1DB3DPQsjnx4shZwNfT2SxC0tDghwCuA6ciEtp djiKp4ceOcdiAsOMIXaMqSkjUBILNgiAPOGYhIGR2k7YbU2zqG8LI0whfdtg1cEO1J+z ppYQ== 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:date:subject:cc:to:from:dkim-signature; bh=8DnTlIACDbzEtLRf6uyG90k2lVADApi5Q0dzsALoGgs=; b=ICm/ky7H0X1CAyQqttxsSPuosMBwH0Bgt6wX25vgmeaA6HyBzDI6kviN6hdgf4PLw8 4VDi29mrvkpzgnM0BXKF4Ck8Px16/LT1+AmpEPJn5vaF9qEDq5lNS9PHzah3K741rROG e/p4LPNDNpFTeYwHXDEk+auGpeAUyLx0bQ3r65+BNgdjk5ydMHbPwHoHIeDi9CTWBiIn Z6aE3drSkRa36Qe2XKfHNXgw6T1Mv6WjTWSLA/y3ZUqJKPpt3W7+5Ybv0GxEFH4wuXkN v/C9S2F7J+vbf+4C3mkpZh2jmJzphQhWggAKOHc9LfT+Ffn67FTaPMdBekvvLFCJ19jY pGXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=gybrPLUq; 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=NONE sp=NONE dis=NONE) header.from=canonical.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hq26-20020a1709073f1a00b007addc76341csi3247360ejc.25.2022.11.25.05.38.41; Fri, 25 Nov 2022 05:39:05 -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=@canonical.com header.s=20210705 header.b=gybrPLUq; 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=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229792AbiKYNhW (ORCPT <rfc822;zxc52fgh@gmail.com> + 99 others); Fri, 25 Nov 2022 08:37:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229784AbiKYNhU (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 25 Nov 2022 08:37:20 -0500 Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BE1127171 for <linux-kernel@vger.kernel.org>; Fri, 25 Nov 2022 05:37:17 -0800 (PST) Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 607943F202 for <linux-kernel@vger.kernel.org>; Fri, 25 Nov 2022 13:37:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1669383435; bh=8DnTlIACDbzEtLRf6uyG90k2lVADApi5Q0dzsALoGgs=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=gybrPLUqAFnpSc7NoZM0A616yXIXzfLYLPUSk79gfOb8kTPlXiJoc2QUyn3Hx9oCn ewDrTwgKkWn3Djf+r2kojXpef6fP7xMZhosMbekVPS4aHwH8x3QsWEefLod+0IfbL6 LjuVTqvn3ys64wMuYIaDmrrzm7IK91Xuz4oUW2iUBoXQIRbmLAno+/sQu+jQSUqBWw b9BEqxY0zJrLnPDfGGJC+b52/1KwdhL5OXog14EdFzd/1N27oQavwXNysdUie3jWsa vcEZf6mPIsQd3Wmsg9/cI6fwnaVWXdqIs8df35yGo8BgAKUWgn9k5zP9IZmuhvZqKs rmGp423BPDX5g== Received: by mail-ej1-f71.google.com with SMTP id hr21-20020a1709073f9500b007b29ccd1228so2286881ejc.16 for <linux-kernel@vger.kernel.org>; Fri, 25 Nov 2022 05:37:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8DnTlIACDbzEtLRf6uyG90k2lVADApi5Q0dzsALoGgs=; b=P+h/ej6H1zUFjXxLYg3W8mvw0QAgZt1TT1VdgmcC/dvTVLH8bhKOiP1xymdcF+UXqy t+ds7AE9ibuhj2BCWXA2/anyYLG/5FYQ4RH8UWr8v8SX4/uox46FIZuHDv4lEaaUhW9T 97xHHLTKHd1LlAdYT5GVyPu8se8hRCz+0QQvOIPHGHVUq39SNj2ccqahYvJHnxhwQzxH YNOV41iNgVj7AhJ9/svW2mn+m3R+bBclsMN+uN2l6FmQ+Qe1UclTVqx8anHd8npXWWrd y1yKpuBZyYOT1JOGK47v+mTccU/j0MaolR8rlP1gMT+YXQGPt/bCuPcHUT4x759jvbNp powA== X-Gm-Message-State: ANoB5pnY4pYVtYrKywtZzWfwkeJvbfhu1qLGP0QKVAXWjSEH3rgnp9st 0lv7stTNbxwkGF+1d4TQx9KNeo8TJ6KP+X+lTWwJeea7dzQkQdw+tsRiMddq6N9mSBOx+lqVRWR GvhRP/w0Yptj7HMaCjJzowCgWbbUfP2WBBLHCeEma6Q== X-Received: by 2002:a17:906:68a:b0:78d:3188:9116 with SMTP id u10-20020a170906068a00b0078d31889116mr32469850ejb.176.1669383435065; Fri, 25 Nov 2022 05:37:15 -0800 (PST) X-Received: by 2002:a17:906:68a:b0:78d:3188:9116 with SMTP id u10-20020a170906068a00b0078d31889116mr32469823ejb.176.1669383434765; Fri, 25 Nov 2022 05:37:14 -0800 (PST) Received: from righiandr-XPS-13-7390.homenet.telecomitalia.it ([95.236.177.174]) by smtp.gmail.com with ESMTPSA id va5-20020a170907d00500b0078d0981516esm1585372ejc.38.2022.11.25.05.37.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Nov 2022 05:37:14 -0800 (PST) From: Andrea Righi <andrea.righi@canonical.com> To: Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com> Cc: Emil Renner Berthing <emil.renner.berthing@canonical.com>, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] riscv: increase boot command line size to 1K Date: Fri, 25 Nov 2022 14:37:13 +0100 Message-Id: <20221125133713.314796-1-andrea.righi@canonical.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750475520634606948?= X-GMAIL-MSGID: =?utf-8?q?1750475520634606948?= |
Series |
riscv: increase boot command line size to 1K
|
|
Commit Message
Andrea Righi
Nov. 25, 2022, 1:37 p.m. UTC
Kernel parameters string is limited to 512 characters on riscv (using
the default from include/uapi/asm-generic/setup.h).
In some testing environments (e.g., qemu with long kernel parameters
string) we may exceed this limit, triggering errors like the following:
[ 3.331893] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000
[ 3.332625] CPU: 2 PID: 1 Comm: sh Not tainted 6.1.0-rc6-kc #1
[ 3.333233] Hardware name: riscv-virtio,qemu (DT)
[ 3.333550] Call Trace:
[ 3.333736] [<ffffffff800062b6>] dump_backtrace+0x1c/0x24
[ 3.334053] [<ffffffff806e8f54>] show_stack+0x2c/0x38
[ 3.334260] [<ffffffff806f2d06>] dump_stack_lvl+0x5a/0x7c
[ 3.334483] [<ffffffff806f2d3c>] dump_stack+0x14/0x1c
[ 3.334687] [<ffffffff806e92fa>] panic+0x116/0x2d0
[ 3.334878] [<ffffffff8001b0aa>] do_exit+0x80a/0x810
[ 3.335079] [<ffffffff8001b1d0>] do_group_exit+0x24/0x70
[ 3.335287] [<ffffffff8001b234>] __wake_up_parent+0x0/0x20
[ 3.335502] [<ffffffff80003cee>] ret_from_syscall+0x0/0x2
[ 3.335857] SMP: stopping secondary CPUs
[ 3.337561] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000 ]---
It seems reasonable enough to increase the default command line size to
1024, like arm, to prevent issues like the one reported above.
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
---
arch/riscv/include/asm/setup.h | 7 +++++++
arch/riscv/include/uapi/asm/setup.h | 7 +++++++
2 files changed, 14 insertions(+)
create mode 100644 arch/riscv/include/asm/setup.h
create mode 100644 arch/riscv/include/uapi/asm/setup.h
Comments
Hi Andrea, On 11/25/22 14:37, Andrea Righi wrote: > Kernel parameters string is limited to 512 characters on riscv (using > the default from include/uapi/asm-generic/setup.h). > > In some testing environments (e.g., qemu with long kernel parameters > string) we may exceed this limit, triggering errors like the following: > > [ 3.331893] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000 > [ 3.332625] CPU: 2 PID: 1 Comm: sh Not tainted 6.1.0-rc6-kc #1 > [ 3.333233] Hardware name: riscv-virtio,qemu (DT) > [ 3.333550] Call Trace: > [ 3.333736] [<ffffffff800062b6>] dump_backtrace+0x1c/0x24 > [ 3.334053] [<ffffffff806e8f54>] show_stack+0x2c/0x38 > [ 3.334260] [<ffffffff806f2d06>] dump_stack_lvl+0x5a/0x7c > [ 3.334483] [<ffffffff806f2d3c>] dump_stack+0x14/0x1c > [ 3.334687] [<ffffffff806e92fa>] panic+0x116/0x2d0 > [ 3.334878] [<ffffffff8001b0aa>] do_exit+0x80a/0x810 > [ 3.335079] [<ffffffff8001b1d0>] do_group_exit+0x24/0x70 > [ 3.335287] [<ffffffff8001b234>] __wake_up_parent+0x0/0x20 > [ 3.335502] [<ffffffff80003cee>] ret_from_syscall+0x0/0x2 > [ 3.335857] SMP: stopping secondary CPUs > [ 3.337561] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000 ]--- > > It seems reasonable enough to increase the default command line size to > 1024, like arm, to prevent issues like the one reported above. > > Signed-off-by: Andrea Righi <andrea.righi@canonical.com> > --- > arch/riscv/include/asm/setup.h | 7 +++++++ > arch/riscv/include/uapi/asm/setup.h | 7 +++++++ > 2 files changed, 14 insertions(+) > create mode 100644 arch/riscv/include/asm/setup.h > create mode 100644 arch/riscv/include/uapi/asm/setup.h > > diff --git a/arch/riscv/include/asm/setup.h b/arch/riscv/include/asm/setup.h > new file mode 100644 > index 000000000000..f4fe549aab40 > --- /dev/null > +++ b/arch/riscv/include/asm/setup.h > @@ -0,0 +1,7 @@ > +/* SPDX-License-Identifier: GPL-2.0-only */ > +#ifndef __ASMRISCV_SETUP_H > +#define __ASMRISCV_SETUP_H > + > +#include <uapi/asm/setup.h> > + > +#endif /* __ASMRISCV_SETUP_H */ > diff --git a/arch/riscv/include/uapi/asm/setup.h b/arch/riscv/include/uapi/asm/setup.h > new file mode 100644 > index 000000000000..5738f93ae437 > --- /dev/null > +++ b/arch/riscv/include/uapi/asm/setup.h > @@ -0,0 +1,7 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +#ifndef _UAPI__ASMRISCV_SETUP_H > +#define _UAPI__ASMRISCV_SETUP_H > + > +#define COMMAND_LINE_SIZE 1024 > + > +#endif /* _UAPI__ASMRISCV_SETUP_H */ Just for reference to previous discussions regarding this: https://lore.kernel.org/lkml/CACT4Y+YYAfTafFk7DE0B=qQFgkPXS7492AhBdY_CP1WdB8CGfA@mail.gmail.com/T/ Thanks, Alex
On Fri, Nov 25, 2022 at 02:41:11PM +0100, Alexandre Ghiti wrote: > Hi Andrea, > > On 11/25/22 14:37, Andrea Righi wrote: > > Kernel parameters string is limited to 512 characters on riscv (using > > the default from include/uapi/asm-generic/setup.h). > > > > In some testing environments (e.g., qemu with long kernel parameters > > string) we may exceed this limit, triggering errors like the following: > > > > [ 3.331893] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000 > > [ 3.332625] CPU: 2 PID: 1 Comm: sh Not tainted 6.1.0-rc6-kc #1 > > [ 3.333233] Hardware name: riscv-virtio,qemu (DT) > > [ 3.333550] Call Trace: > > [ 3.333736] [<ffffffff800062b6>] dump_backtrace+0x1c/0x24 > > [ 3.334053] [<ffffffff806e8f54>] show_stack+0x2c/0x38 > > [ 3.334260] [<ffffffff806f2d06>] dump_stack_lvl+0x5a/0x7c > > [ 3.334483] [<ffffffff806f2d3c>] dump_stack+0x14/0x1c > > [ 3.334687] [<ffffffff806e92fa>] panic+0x116/0x2d0 > > [ 3.334878] [<ffffffff8001b0aa>] do_exit+0x80a/0x810 > > [ 3.335079] [<ffffffff8001b1d0>] do_group_exit+0x24/0x70 > > [ 3.335287] [<ffffffff8001b234>] __wake_up_parent+0x0/0x20 > > [ 3.335502] [<ffffffff80003cee>] ret_from_syscall+0x0/0x2 > > [ 3.335857] SMP: stopping secondary CPUs > > [ 3.337561] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000 ]--- > > > > It seems reasonable enough to increase the default command line size to > > 1024, like arm, to prevent issues like the one reported above. > > > > Signed-off-by: Andrea Righi <andrea.righi@canonical.com> > > --- > > arch/riscv/include/asm/setup.h | 7 +++++++ > > arch/riscv/include/uapi/asm/setup.h | 7 +++++++ > > 2 files changed, 14 insertions(+) > > create mode 100644 arch/riscv/include/asm/setup.h > > create mode 100644 arch/riscv/include/uapi/asm/setup.h > > > > diff --git a/arch/riscv/include/asm/setup.h b/arch/riscv/include/asm/setup.h > > new file mode 100644 > > index 000000000000..f4fe549aab40 > > --- /dev/null > > +++ b/arch/riscv/include/asm/setup.h > > @@ -0,0 +1,7 @@ > > +/* SPDX-License-Identifier: GPL-2.0-only */ > > +#ifndef __ASMRISCV_SETUP_H > > +#define __ASMRISCV_SETUP_H > > + > > +#include <uapi/asm/setup.h> > > + > > +#endif /* __ASMRISCV_SETUP_H */ > > diff --git a/arch/riscv/include/uapi/asm/setup.h b/arch/riscv/include/uapi/asm/setup.h > > new file mode 100644 > > index 000000000000..5738f93ae437 > > --- /dev/null > > +++ b/arch/riscv/include/uapi/asm/setup.h > > @@ -0,0 +1,7 @@ > > +/* SPDX-License-Identifier: GPL-2.0 */ > > +#ifndef _UAPI__ASMRISCV_SETUP_H > > +#define _UAPI__ASMRISCV_SETUP_H > > + > > +#define COMMAND_LINE_SIZE 1024 > > + > > +#endif /* _UAPI__ASMRISCV_SETUP_H */ > > > Just for reference to previous discussions regarding this: https://lore.kernel.org/lkml/CACT4Y+YYAfTafFk7DE0B=qQFgkPXS7492AhBdY_CP1WdB8CGfA@mail.gmail.com/T/ > > Thanks, > > Alex Ah! It has been address/discussed already, great! Thanks for pointing that out and sorry for the unnecessary patch. :) -Andrea
On 11/25/22 14:44, Andrea Righi wrote: > On Fri, Nov 25, 2022 at 02:41:11PM +0100, Alexandre Ghiti wrote: >> Hi Andrea, >> >> On 11/25/22 14:37, Andrea Righi wrote: >>> Kernel parameters string is limited to 512 characters on riscv (using >>> the default from include/uapi/asm-generic/setup.h). >>> >>> In some testing environments (e.g., qemu with long kernel parameters >>> string) we may exceed this limit, triggering errors like the following: >>> >>> [ 3.331893] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000 >>> [ 3.332625] CPU: 2 PID: 1 Comm: sh Not tainted 6.1.0-rc6-kc #1 >>> [ 3.333233] Hardware name: riscv-virtio,qemu (DT) >>> [ 3.333550] Call Trace: >>> [ 3.333736] [<ffffffff800062b6>] dump_backtrace+0x1c/0x24 >>> [ 3.334053] [<ffffffff806e8f54>] show_stack+0x2c/0x38 >>> [ 3.334260] [<ffffffff806f2d06>] dump_stack_lvl+0x5a/0x7c >>> [ 3.334483] [<ffffffff806f2d3c>] dump_stack+0x14/0x1c >>> [ 3.334687] [<ffffffff806e92fa>] panic+0x116/0x2d0 >>> [ 3.334878] [<ffffffff8001b0aa>] do_exit+0x80a/0x810 >>> [ 3.335079] [<ffffffff8001b1d0>] do_group_exit+0x24/0x70 >>> [ 3.335287] [<ffffffff8001b234>] __wake_up_parent+0x0/0x20 >>> [ 3.335502] [<ffffffff80003cee>] ret_from_syscall+0x0/0x2 >>> [ 3.335857] SMP: stopping secondary CPUs >>> [ 3.337561] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000 ]--- >>> >>> It seems reasonable enough to increase the default command line size to >>> 1024, like arm, to prevent issues like the one reported above. >>> >>> Signed-off-by: Andrea Righi <andrea.righi@canonical.com> >>> --- >>> arch/riscv/include/asm/setup.h | 7 +++++++ >>> arch/riscv/include/uapi/asm/setup.h | 7 +++++++ >>> 2 files changed, 14 insertions(+) >>> create mode 100644 arch/riscv/include/asm/setup.h >>> create mode 100644 arch/riscv/include/uapi/asm/setup.h >>> >>> diff --git a/arch/riscv/include/asm/setup.h b/arch/riscv/include/asm/setup.h >>> new file mode 100644 >>> index 000000000000..f4fe549aab40 >>> --- /dev/null >>> +++ b/arch/riscv/include/asm/setup.h >>> @@ -0,0 +1,7 @@ >>> +/* SPDX-License-Identifier: GPL-2.0-only */ >>> +#ifndef __ASMRISCV_SETUP_H >>> +#define __ASMRISCV_SETUP_H >>> + >>> +#include <uapi/asm/setup.h> >>> + >>> +#endif /* __ASMRISCV_SETUP_H */ >>> diff --git a/arch/riscv/include/uapi/asm/setup.h b/arch/riscv/include/uapi/asm/setup.h >>> new file mode 100644 >>> index 000000000000..5738f93ae437 >>> --- /dev/null >>> +++ b/arch/riscv/include/uapi/asm/setup.h >>> @@ -0,0 +1,7 @@ >>> +/* SPDX-License-Identifier: GPL-2.0 */ >>> +#ifndef _UAPI__ASMRISCV_SETUP_H >>> +#define _UAPI__ASMRISCV_SETUP_H >>> + >>> +#define COMMAND_LINE_SIZE 1024 >>> + >>> +#endif /* _UAPI__ASMRISCV_SETUP_H */ >> >> Just for reference to previous discussions regarding this: https://lore.kernel.org/lkml/CACT4Y+YYAfTafFk7DE0B=qQFgkPXS7492AhBdY_CP1WdB8CGfA@mail.gmail.com/T/ >> >> Thanks, >> >> Alex > Ah! It has been address/discussed already, great! Thanks for pointing > that out and sorry for the unnecessary patch. :) Not unnecessary at all, that will hopefully trigger a new discussion because no progress was made so far :) > -Andrea > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv
Hey Andrea, On Fri, Nov 25, 2022 at 02:37:13PM +0100, Andrea Righi wrote: > Kernel parameters string is limited to 512 characters on riscv (using > the default from include/uapi/asm-generic/setup.h). > > In some testing environments (e.g., qemu with long kernel parameters > string) we may exceed this limit, triggering errors like the following: > > [ 3.331893] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000 > [ 3.332625] CPU: 2 PID: 1 Comm: sh Not tainted 6.1.0-rc6-kc #1 > [ 3.333233] Hardware name: riscv-virtio,qemu (DT) > [ 3.333550] Call Trace: > [ 3.333736] [<ffffffff800062b6>] dump_backtrace+0x1c/0x24 > [ 3.334053] [<ffffffff806e8f54>] show_stack+0x2c/0x38 > [ 3.334260] [<ffffffff806f2d06>] dump_stack_lvl+0x5a/0x7c > [ 3.334483] [<ffffffff806f2d3c>] dump_stack+0x14/0x1c > [ 3.334687] [<ffffffff806e92fa>] panic+0x116/0x2d0 > [ 3.334878] [<ffffffff8001b0aa>] do_exit+0x80a/0x810 > [ 3.335079] [<ffffffff8001b1d0>] do_group_exit+0x24/0x70 > [ 3.335287] [<ffffffff8001b234>] __wake_up_parent+0x0/0x20 > [ 3.335502] [<ffffffff80003cee>] ret_from_syscall+0x0/0x2 > [ 3.335857] SMP: stopping secondary CPUs > [ 3.337561] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000 ]--- > > It seems reasonable enough to increase the default command line size to > 1024, like arm, to prevent issues like the one reported above. error: arch/riscv/include/uapi/asm/setup.h: missing "WITH Linux-syscall-note" for SPDX-License-Identifier Unfortunately this does not build :/ Thanks, Conor. > Signed-off-by: Andrea Righi <andrea.righi@canonical.com> > --- > arch/riscv/include/asm/setup.h | 7 +++++++ > arch/riscv/include/uapi/asm/setup.h | 7 +++++++ > 2 files changed, 14 insertions(+) > create mode 100644 arch/riscv/include/asm/setup.h > create mode 100644 arch/riscv/include/uapi/asm/setup.h > > diff --git a/arch/riscv/include/asm/setup.h b/arch/riscv/include/asm/setup.h > new file mode 100644 > index 000000000000..f4fe549aab40 > --- /dev/null > +++ b/arch/riscv/include/asm/setup.h > @@ -0,0 +1,7 @@ > +/* SPDX-License-Identifier: GPL-2.0-only */ > +#ifndef __ASMRISCV_SETUP_H > +#define __ASMRISCV_SETUP_H > + > +#include <uapi/asm/setup.h> > + > +#endif /* __ASMRISCV_SETUP_H */ > diff --git a/arch/riscv/include/uapi/asm/setup.h b/arch/riscv/include/uapi/asm/setup.h > new file mode 100644 > index 000000000000..5738f93ae437 > --- /dev/null > +++ b/arch/riscv/include/uapi/asm/setup.h > @@ -0,0 +1,7 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +#ifndef _UAPI__ASMRISCV_SETUP_H > +#define _UAPI__ASMRISCV_SETUP_H > + > +#define COMMAND_LINE_SIZE 1024 > + > +#endif /* _UAPI__ASMRISCV_SETUP_H */ > -- > 2.37.2 >
On Sat, Nov 26, 2022 at 06:46:05PM +0000, Conor Dooley wrote: > Hey Andrea, > > On Fri, Nov 25, 2022 at 02:37:13PM +0100, Andrea Righi wrote: > > Kernel parameters string is limited to 512 characters on riscv (using > > the default from include/uapi/asm-generic/setup.h). > > > > In some testing environments (e.g., qemu with long kernel parameters > > string) we may exceed this limit, triggering errors like the following: > > > > [ 3.331893] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000 > > [ 3.332625] CPU: 2 PID: 1 Comm: sh Not tainted 6.1.0-rc6-kc #1 > > [ 3.333233] Hardware name: riscv-virtio,qemu (DT) > > [ 3.333550] Call Trace: > > [ 3.333736] [<ffffffff800062b6>] dump_backtrace+0x1c/0x24 > > [ 3.334053] [<ffffffff806e8f54>] show_stack+0x2c/0x38 > > [ 3.334260] [<ffffffff806f2d06>] dump_stack_lvl+0x5a/0x7c > > [ 3.334483] [<ffffffff806f2d3c>] dump_stack+0x14/0x1c > > [ 3.334687] [<ffffffff806e92fa>] panic+0x116/0x2d0 > > [ 3.334878] [<ffffffff8001b0aa>] do_exit+0x80a/0x810 > > [ 3.335079] [<ffffffff8001b1d0>] do_group_exit+0x24/0x70 > > [ 3.335287] [<ffffffff8001b234>] __wake_up_parent+0x0/0x20 > > [ 3.335502] [<ffffffff80003cee>] ret_from_syscall+0x0/0x2 > > [ 3.335857] SMP: stopping secondary CPUs > > [ 3.337561] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000 ]--- > > > > It seems reasonable enough to increase the default command line size to > > 1024, like arm, to prevent issues like the one reported above. > > error: arch/riscv/include/uapi/asm/setup.h: missing "WITH Linux-syscall-note" for SPDX-License-Identifier > > Unfortunately this does not build :/ > > Thanks, > Conor. Oh I see, because it's uapi it needs "WITH Linux-syscall-note", wondering why I can't reproduce this failure... Anyway, as pointed out by Alexandre, there was already a previous discussion about this topic: https://lore.kernel.org/lkml/CACT4Y+YYAfTafFk7DE0B=qQFgkPXS7492AhBdY_CP1WdB8CGfA@mail.gmail.com/T/ Hopefully this change will be addressed there (and the patch land in -next at least), otherwise I'll post a v2. Thanks, -Andrea
On Sat, Nov 26, 2022 at 08:18:43PM +0100, Andrea Righi wrote: > On Sat, Nov 26, 2022 at 06:46:05PM +0000, Conor Dooley wrote: > > Hey Andrea, > > > > On Fri, Nov 25, 2022 at 02:37:13PM +0100, Andrea Righi wrote: > > > Kernel parameters string is limited to 512 characters on riscv (using > > > the default from include/uapi/asm-generic/setup.h). > > > > > > In some testing environments (e.g., qemu with long kernel parameters > > > string) we may exceed this limit, triggering errors like the following: > > > > > > [ 3.331893] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000 > > > [ 3.332625] CPU: 2 PID: 1 Comm: sh Not tainted 6.1.0-rc6-kc #1 > > > [ 3.333233] Hardware name: riscv-virtio,qemu (DT) > > > [ 3.333550] Call Trace: > > > [ 3.333736] [<ffffffff800062b6>] dump_backtrace+0x1c/0x24 > > > [ 3.334053] [<ffffffff806e8f54>] show_stack+0x2c/0x38 > > > [ 3.334260] [<ffffffff806f2d06>] dump_stack_lvl+0x5a/0x7c > > > [ 3.334483] [<ffffffff806f2d3c>] dump_stack+0x14/0x1c > > > [ 3.334687] [<ffffffff806e92fa>] panic+0x116/0x2d0 > > > [ 3.334878] [<ffffffff8001b0aa>] do_exit+0x80a/0x810 > > > [ 3.335079] [<ffffffff8001b1d0>] do_group_exit+0x24/0x70 > > > [ 3.335287] [<ffffffff8001b234>] __wake_up_parent+0x0/0x20 > > > [ 3.335502] [<ffffffff80003cee>] ret_from_syscall+0x0/0x2 > > > [ 3.335857] SMP: stopping secondary CPUs > > > [ 3.337561] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000 ]--- > > > > > > It seems reasonable enough to increase the default command line size to > > > 1024, like arm, to prevent issues like the one reported above. > > > > error: arch/riscv/include/uapi/asm/setup.h: missing "WITH Linux-syscall-note" for SPDX-License-Identifier > > > > Unfortunately this does not build :/ > > > > Thanks, > > Conor. > > Oh I see, because it's uapi it needs "WITH Linux-syscall-note", > wondering why I can't reproduce this failure... tuxmake --wrapper ccache --target-arch riscv --directory . \ --environment=KBUILD_BUILD_TIMESTAMP=@1621270510 \ --environment=KBUILD_BUILD_USER=tuxmake --environment=KBUILD_BUILD_HOST=tuxmake \ -o $tmpdir --toolchain llvm -z none -k rv32_defconfig (copy paste from a script) That's what caught it initially & I think should be reproduce able. My own standard build script also runs all of the HDRINST stuff if they've changed since the last time a given toolchain was used so it reproduces locally for me too. > Anyway, as pointed out by Alexandre, there was already a previous > discussion about this topic: > https://lore.kernel.org/lkml/CACT4Y+YYAfTafFk7DE0B=qQFgkPXS7492AhBdY_CP1WdB8CGfA@mail.gmail.com/T/ > > Hopefully this change will be addressed there (and the patch land in > -next at least), otherwise I'll post a v2. Yup, I noticed that thread - in fact I was going to link it yesterday before I saw Alex already had ;) Thanks, Conor.
On Sat, Nov 26, 2022 at 07:25:01PM +0000, Conor Dooley wrote: > On Sat, Nov 26, 2022 at 08:18:43PM +0100, Andrea Righi wrote: > > On Sat, Nov 26, 2022 at 06:46:05PM +0000, Conor Dooley wrote: > > > Hey Andrea, > > > > > > On Fri, Nov 25, 2022 at 02:37:13PM +0100, Andrea Righi wrote: > > > > Kernel parameters string is limited to 512 characters on riscv (using > > > > the default from include/uapi/asm-generic/setup.h). > > > > > > > > In some testing environments (e.g., qemu with long kernel parameters > > > > string) we may exceed this limit, triggering errors like the following: > > > > > > > > [ 3.331893] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000 > > > > [ 3.332625] CPU: 2 PID: 1 Comm: sh Not tainted 6.1.0-rc6-kc #1 > > > > [ 3.333233] Hardware name: riscv-virtio,qemu (DT) > > > > [ 3.333550] Call Trace: > > > > [ 3.333736] [<ffffffff800062b6>] dump_backtrace+0x1c/0x24 > > > > [ 3.334053] [<ffffffff806e8f54>] show_stack+0x2c/0x38 > > > > [ 3.334260] [<ffffffff806f2d06>] dump_stack_lvl+0x5a/0x7c > > > > [ 3.334483] [<ffffffff806f2d3c>] dump_stack+0x14/0x1c > > > > [ 3.334687] [<ffffffff806e92fa>] panic+0x116/0x2d0 > > > > [ 3.334878] [<ffffffff8001b0aa>] do_exit+0x80a/0x810 > > > > [ 3.335079] [<ffffffff8001b1d0>] do_group_exit+0x24/0x70 > > > > [ 3.335287] [<ffffffff8001b234>] __wake_up_parent+0x0/0x20 > > > > [ 3.335502] [<ffffffff80003cee>] ret_from_syscall+0x0/0x2 > > > > [ 3.335857] SMP: stopping secondary CPUs > > > > [ 3.337561] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000 ]--- > > > > > > > > It seems reasonable enough to increase the default command line size to > > > > 1024, like arm, to prevent issues like the one reported above. > > > > > > error: arch/riscv/include/uapi/asm/setup.h: missing "WITH Linux-syscall-note" for SPDX-License-Identifier > > > > > > Unfortunately this does not build :/ > > > > > > Thanks, > > > Conor. > > > > Oh I see, because it's uapi it needs "WITH Linux-syscall-note", > > wondering why I can't reproduce this failure... > > tuxmake --wrapper ccache --target-arch riscv --directory . \ > --environment=KBUILD_BUILD_TIMESTAMP=@1621270510 \ > --environment=KBUILD_BUILD_USER=tuxmake --environment=KBUILD_BUILD_HOST=tuxmake \ > -o $tmpdir --toolchain llvm -z none -k rv32_defconfig > > (copy paste from a script) > That's what caught it initially & I think should be reproduce able. My > own standard build script also runs all of the HDRINST stuff if they've > changed since the last time a given toolchain was used so it reproduces > locally for me too. Ah! I'm pretty sure it's HDRINST, I'm just doing make, cross-compiling the kernel, and running it directly from the build directory with a custom script (that is basically a wrapper to qemu), so I don't need to actually install anything. That's why I didn't catch the error. Thanks for sharing that, I'll make sure to test also a proper install next time. :) -Andrea > > > Anyway, as pointed out by Alexandre, there was already a previous > > discussion about this topic: > > https://lore.kernel.org/lkml/CACT4Y+YYAfTafFk7DE0B=qQFgkPXS7492AhBdY_CP1WdB8CGfA@mail.gmail.com/T/ > > > > Hopefully this change will be addressed there (and the patch land in > > -next at least), otherwise I'll post a v2. > > Yup, I noticed that thread - in fact I was going to link it yesterday > before I saw Alex already had ;) > > Thanks, > Conor.
Hi Andrea,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v6.1-rc7 next-20221201]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Andrea-Righi/riscv-increase-boot-command-line-size-to-1K/20221125-213750
patch link: https://lore.kernel.org/r/20221125133713.314796-1-andrea.righi%40canonical.com
patch subject: [PATCH] riscv: increase boot command line size to 1K
config: riscv-allmodconfig
compiler: riscv64-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/68f7f12cac48557c337a453631d4e39b14f3a326
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Andrea-Righi/riscv-increase-boot-command-line-size-to-1K/20221125-213750
git checkout 68f7f12cac48557c337a453631d4e39b14f3a326
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=riscv prepare
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
scripts/genksyms/parse.y: warning: 9 shift/reduce conflicts [-Wconflicts-sr]
scripts/genksyms/parse.y: warning: 5 reduce/reduce conflicts [-Wconflicts-rr]
scripts/genksyms/parse.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
>> error: arch/riscv/include/uapi/asm/setup.h: missing "WITH Linux-syscall-note" for SPDX-License-Identifier
make[2]: *** [scripts/Makefile.headersinst:63: usr/include/asm/setup.h] Error 1
make[2]: Target '__headers' not remade because of errors.
make[1]: *** [Makefile:1367: headers] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:231: __sub-make] Error 2
make: Target 'prepare' not remade because of errors.
On Sat, 26 Nov 2022 11:31:36 PST (-0800), andrea.righi@canonical.com wrote: > On Sat, Nov 26, 2022 at 07:25:01PM +0000, Conor Dooley wrote: >> On Sat, Nov 26, 2022 at 08:18:43PM +0100, Andrea Righi wrote: >> > On Sat, Nov 26, 2022 at 06:46:05PM +0000, Conor Dooley wrote: >> > > Hey Andrea, >> > > >> > > On Fri, Nov 25, 2022 at 02:37:13PM +0100, Andrea Righi wrote: >> > > > Kernel parameters string is limited to 512 characters on riscv (using >> > > > the default from include/uapi/asm-generic/setup.h). >> > > > >> > > > In some testing environments (e.g., qemu with long kernel parameters >> > > > string) we may exceed this limit, triggering errors like the following: >> > > > >> > > > [ 3.331893] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000 >> > > > [ 3.332625] CPU: 2 PID: 1 Comm: sh Not tainted 6.1.0-rc6-kc #1 >> > > > [ 3.333233] Hardware name: riscv-virtio,qemu (DT) >> > > > [ 3.333550] Call Trace: >> > > > [ 3.333736] [<ffffffff800062b6>] dump_backtrace+0x1c/0x24 >> > > > [ 3.334053] [<ffffffff806e8f54>] show_stack+0x2c/0x38 >> > > > [ 3.334260] [<ffffffff806f2d06>] dump_stack_lvl+0x5a/0x7c >> > > > [ 3.334483] [<ffffffff806f2d3c>] dump_stack+0x14/0x1c >> > > > [ 3.334687] [<ffffffff806e92fa>] panic+0x116/0x2d0 >> > > > [ 3.334878] [<ffffffff8001b0aa>] do_exit+0x80a/0x810 >> > > > [ 3.335079] [<ffffffff8001b1d0>] do_group_exit+0x24/0x70 >> > > > [ 3.335287] [<ffffffff8001b234>] __wake_up_parent+0x0/0x20 >> > > > [ 3.335502] [<ffffffff80003cee>] ret_from_syscall+0x0/0x2 >> > > > [ 3.335857] SMP: stopping secondary CPUs >> > > > [ 3.337561] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000 ]--- >> > > > >> > > > It seems reasonable enough to increase the default command line size to >> > > > 1024, like arm, to prevent issues like the one reported above. >> > > >> > > error: arch/riscv/include/uapi/asm/setup.h: missing "WITH Linux-syscall-note" for SPDX-License-Identifier >> > > >> > > Unfortunately this does not build :/ >> > > >> > > Thanks, >> > > Conor. >> > >> > Oh I see, because it's uapi it needs "WITH Linux-syscall-note", >> > wondering why I can't reproduce this failure... >> >> tuxmake --wrapper ccache --target-arch riscv --directory . \ >> --environment=KBUILD_BUILD_TIMESTAMP=@1621270510 \ >> --environment=KBUILD_BUILD_USER=tuxmake --environment=KBUILD_BUILD_HOST=tuxmake \ >> -o $tmpdir --toolchain llvm -z none -k rv32_defconfig >> >> (copy paste from a script) >> That's what caught it initially & I think should be reproduce able. My >> own standard build script also runs all of the HDRINST stuff if they've >> changed since the last time a given toolchain was used so it reproduces >> locally for me too. > > Ah! I'm pretty sure it's HDRINST, I'm just doing make, cross-compiling > the kernel, and running it directly from the build directory with a > custom script (that is basically a wrapper to qemu), so I don't need to > actually install anything. That's why I didn't catch the error. > > Thanks for sharing that, I'll make sure to test also a proper install > next time. :) > > -Andrea > >> >> > Anyway, as pointed out by Alexandre, there was already a previous >> > discussion about this topic: >> > https://lore.kernel.org/lkml/CACT4Y+YYAfTafFk7DE0B=qQFgkPXS7492AhBdY_CP1WdB8CGfA@mail.gmail.com/T/ >> > >> > Hopefully this change will be addressed there (and the patch land in >> > -next at least), otherwise I'll post a v2. I posted a new version of the asm-generic changes here: https://lore.kernel.org/r/20221211061358.28035-1-palmer@rivosinc.com/ >> >> Yup, I noticed that thread - in fact I was going to link it yesterday >> before I saw Alex already had ;) >> >> Thanks, >> Conor.
diff --git a/arch/riscv/include/asm/setup.h b/arch/riscv/include/asm/setup.h new file mode 100644 index 000000000000..f4fe549aab40 --- /dev/null +++ b/arch/riscv/include/asm/setup.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASMRISCV_SETUP_H +#define __ASMRISCV_SETUP_H + +#include <uapi/asm/setup.h> + +#endif /* __ASMRISCV_SETUP_H */ diff --git a/arch/riscv/include/uapi/asm/setup.h b/arch/riscv/include/uapi/asm/setup.h new file mode 100644 index 000000000000..5738f93ae437 --- /dev/null +++ b/arch/riscv/include/uapi/asm/setup.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _UAPI__ASMRISCV_SETUP_H +#define _UAPI__ASMRISCV_SETUP_H + +#define COMMAND_LINE_SIZE 1024 + +#endif /* _UAPI__ASMRISCV_SETUP_H */