Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp5764831pxu; Thu, 22 Oct 2020 10:25:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsYyr7yyapicmKYe8CVxkebdK4AioK7lXjyXvHxhrzzvF/VqOSqYlEdksx6AlxmvsjhRuc X-Received: by 2002:a17:906:5d9:: with SMTP id t25mr3237185ejt.443.1603387519124; Thu, 22 Oct 2020 10:25:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603387519; cv=none; d=google.com; s=arc-20160816; b=kX7YvnlhP7ky43kcC6pg99ljQzI1Cp/zTEpfelJPI2iYkG3Y0pXWQw35D76n9ZGYHQ 3qOdnvrfZOIpXDKEETpvdgUMuvfaLoi6CxL9uUYuNhhvTtIKGHpz3LaX9uXd4gL7rAjG VMtb37fMKDQRIpk4Fav9mem4ykPP18W6FF7oPmy5Whv4wNFW6t5tGYpqwpiojc9gXISi dHB79E0AkXploXK4CxCmmok8HJvPJ930lZc4YUK/JQgaQDv6T0hae7tBLEVOs5BrOQq9 SbRrlQAjB0CZ4F91gycT+MDqbhrkXnSvouGRiikEqT19ylaraQ0WF0e58AOAL+aYyxWh khGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=gnF1P3sA4Hd6GneuxlfbrmwcHsIi+cF2IGQfZ4BK0Cg=; b=epZgAz91S9abf4heZm3nsp9BZQtMjuhnQYydN6Z+/Xr1+BtrbF7KYogR5TdXImVMUP UNh5hlKvAUhP4kYUdx5Oc/ZuQpoSs5Z2HFh/sNalSbj9oLCJpTCAbSrW5JAXyu5VDYf2 cFUUZu47q2P7cgrA++fTEFsV5sNjkVON/LYUtiWV9l74r1oiYjYvqU9DGQPEv/wUkOtP R2IFEx+uXwPexVSJw6nOtnYBiwwwm7FBM+lU3+N2pwD6a7jbbxDFCDBF2UwgRSSqXT+N ur+9AzL2VlJQgQSdo8GGqngntKPusvE8fvMRDPuDoYj+XVTFlnW7jSLoe6IYqbtRlwb5 uW+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GSwwHYXT; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o13si1454080ejb.631.2020.10.22.10.24.57; Thu, 22 Oct 2020 10:25:19 -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=@gmail.com header.s=20161025 header.b=GSwwHYXT; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2900141AbgJVNcc (ORCPT + 99 others); Thu, 22 Oct 2020 09:32:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2443424AbgJVNcc (ORCPT ); Thu, 22 Oct 2020 09:32:32 -0400 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78DA7C0613CE for ; Thu, 22 Oct 2020 06:32:32 -0700 (PDT) Received: by mail-pl1-x641.google.com with SMTP id v22so945778ply.12 for ; Thu, 22 Oct 2020 06:32:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=gnF1P3sA4Hd6GneuxlfbrmwcHsIi+cF2IGQfZ4BK0Cg=; b=GSwwHYXTNViLl47wUHv3Jt/BWD+3bdbyi3N2T+spIY6omvMAP98KM+Pj833+RyX3Sg NeABqGnEMht0y9cLy38uzI+zm8aD1wy2o+O8pTB2kbgRkpKJfQO4EixnlqrFC/W+x6X2 xo5UccvZok/YPlYqfhDKVg9IwSbh4dXCLHjQ/ugVArdoEL0rj96VPiaerF7zCTO/ZVAf +dFJQfzpukqltGitPVaDZQQtL9+8DMVbq4XiRYTkKeNCbMdUbn20u7C+Iva6rVX7U0zD R6+fcKuvc2ACbECIP1qZVSbTQmkcUzzDdqoUtFKsBdzEIzmdKXyl5Axzcyyv6W2VTPc2 vrtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=gnF1P3sA4Hd6GneuxlfbrmwcHsIi+cF2IGQfZ4BK0Cg=; b=nxDnm0T7QMM4SW45I8KNfaOwqYuoTY5dMVag5SD+ZXyf+m1KTxs8ToAEIhLW035bzS PpKjZWy9OYacsv/3W771zVHcCyFzLi5QLwOLw8pB9/axCK2oIflmpA8vLE9DvrX2GqAH hocz2AOJSPN6BiyuiEoqzw0H9mEmzbEqV7M1a/dYV+APOiqyOBCPBt59sW5nbcMK9xVp QNjAZKyeXNz2n6CET/KzZq625DdvvRUZR1HZCQ4x9G4NrU3pCf3sgZKQ5w6rflebUeCJ YDn+7lSyvtoOcsIvBGYFutIhP9WyjoF+6Jzl90v86Q4KW/R4bNF/BOTxKMjDFxw97BXU 8nWQ== X-Gm-Message-State: AOAM531OvEvXsGnA38pZ5uAeoZW1KuIT8VaHSPuviIVM7Qjl54/85Xxb ZlRCTeGL2luMHhkA+8ieGBc= X-Received: by 2002:a17:90b:1c0d:: with SMTP id oc13mr2511335pjb.192.1603373551847; Thu, 22 Oct 2020 06:32:31 -0700 (PDT) Received: from localhost ([2409:10:2e40:5100:6e29:95ff:fe2d:8f34]) by smtp.gmail.com with ESMTPSA id k9sm2491028pgt.72.2020.10.22.06.32.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2020 06:32:30 -0700 (PDT) Date: Thu, 22 Oct 2020 22:32:28 +0900 From: Sergey Senozhatsky To: Petr Mladek Cc: Sergey Senozhatsky , Guenter Roeck , Shreyas Joshi , rostedt@goodmis.org, shreyasjoshi15@gmail.com, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Linus Torvalds Subject: Re: [PATCH] printk: handle blank console arguments passed in. Message-ID: <20201022133228.GA160085@jagdpanzerIV.localdomain> References: <24f7a6bc-c917-2bb7-0e86-9d729c18e812@roeck-us.net> <20201006134328.GD32369@alley> <20201006163514.GE32369@alley> <20201006171504.GA64770@jagdpanzerIV.localdomain> <20201007072853.GF32369@alley> <20201007123044.GA509@jagdpanzerIV.localdomain> <20201007162942.GA440@jagdpanzerIV.localdomain> <20201008055238.GA554@jagdpanzerIV.localdomain> <20201022113805.GA32486@alley> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201022113805.GA32486@alley> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (20/10/22 13:38), Petr Mladek wrote: > > Hmm. How about this. console= is undocumented and unspecified - it > > may work sometimes or it may kill the system (and theoretically even > > corrupt some files, depending on what fd 1 and fd 2 point to). So > > maybe we can document console= and handle it in printk, rather than > > somewhere deep in init/main.c > > I have dig more into it. If I get it correctly, /dev/console is really > used as stdin, stdout, and stderr for the init process. It has been > like this from the very beginning. > > In theory, it might be possible to fallback into /dev/null. But it > would not solve the problem when anyone tries to use /dev/console > later. > > IMHO, creating /dev/console really _should not_ fail. It means > that we should register some console. Yes, I didn't find out exactly why the kernel panics yet. Got interrupted. What I did notice (when we don't have stdin/out/err) was init process installing "/" as fd 0, and then doing things like fprintf(stderr, "running early hook"), perhaps some of those fprintf()-s end up in the wrong place. > > IOW add one more flag (yeah, I know) and set it when console_setup() > > sees console= boot param. The idea is allow console registration, > > but all consoles should be disabled (cleared CON_ENABLED bit). This > > would be easier to document, at least. > > It seems that introducing a new option/flag is the best solution > after all. All other flags are manipulated on different situations > and it would not be easy to define a sane behavior. > > I like the proposed "mute_consoles". Well, I have it associated rather > with CONSOLE_LOGLEVEL_SILENT than with disabled console. > > I have played with it and am going to send two patches as RFC. Cool, thanks. I'll reply to that RFC patch set; there are some more ideas, that we can discuss. -ss