Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp58924yba; Wed, 3 Apr 2019 04:33:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqy+Bb+CXu1WHVxB1rxccj5HDC0k2G5i+dNGPBOnKnZcNgFOPJqIdemhOGiMlpCOJbqwS3kj X-Received: by 2002:a62:1b03:: with SMTP id b3mr70710182pfb.150.1554291182730; Wed, 03 Apr 2019 04:33:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554291182; cv=none; d=google.com; s=arc-20160816; b=I4MDofTpeL1HgfdxG6bTxhkSSlhd/7VJGQmTENszPcoEohxyDP28GAXF8urBuAsvu6 zWfXvO3uptP1Dbw0bcrrNZcrTV5j7dgQisTJjsDbxLVN1Hri2GVAELsmONNRvsLDB1/f LUySa7Wti4PkmmepXGjTPo/L52IR2Yi9H+QtQsa7aRlGOW/A9+EG48/tkfYEnr/jYXFD 6I2uKgIHSsaMCoPYjR+E4GDY3B9vUH/y1012iz98HGwy9D+yN+ywlONHcNIKOTnE57OT uKxgbBSoQ6kR7N3+nlSQ3BO3jYNAQ800pRqo5AbWkZEbMHA7XUURXJFJbFaWpQhq/e4Q ohnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature:dkim-filter; bh=vpMvTkZ3zjKetPMWRIiMdWOr7NlF5E+vS3OXn39zX/k=; b=PC0JroPYCw3H5xD4NhOkwXyojKW6zuMhpDukxcr/dMdVC16pnDLc1Lr6emCLK54CqD W5Fvmvp7MLzTHT0325VvSuf6vwrm0BM8Co6tzdCWjd/GJ63hTEI7W/H5W5Ew1f+soI1G kttcIWfzn4v4goxE7nFZTAQ3CZhRDMsvzF+bzaoZKybQImQfvHC+b0REDoHJ12m9CVFq dzb8VJxH9QFUsDg4SmtvVC/qOnGYKEkuUnr3II95JpPekwwcsNPY8MbqqmTF2/mmENxG OKaayACFUu6OS7GfWN2Myv7Eofe6KVy8RzYWiT9o9T7WEWc73XUeQa++0yK1WxTv497F rBww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=15cjfyuJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m23si13889176pgc.550.2019.04.03.04.32.46; Wed, 03 Apr 2019 04:33:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=15cjfyuJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726615AbfDCLbg (ORCPT + 99 others); Wed, 3 Apr 2019 07:31:36 -0400 Received: from conssluserg-06.nifty.com ([210.131.2.91]:53481 "EHLO conssluserg-06.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725935AbfDCLbf (ORCPT ); Wed, 3 Apr 2019 07:31:35 -0400 Received: from mail-vs1-f47.google.com (mail-vs1-f47.google.com [209.85.217.47]) (authenticated) by conssluserg-06.nifty.com with ESMTP id x33BVWNr014492; Wed, 3 Apr 2019 20:31:33 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-06.nifty.com x33BVWNr014492 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1554291093; bh=vpMvTkZ3zjKetPMWRIiMdWOr7NlF5E+vS3OXn39zX/k=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=15cjfyuJX00T0a7K9NCQH6VmjhnADhDUDM7nyCrG0fosqVwSFST1wLipCMhb+GTLt 9v008DKwMu7seOgYdfnYfvJTZJfwiWItXym01fh1bfHxoZ2GiSb4NTK+pjO4Chh6wr p+QTjMLGkK6Qy7SPnerdFt9eS+goYLP7253g4YWlqziAHe4qhUiad0gnvXQuwnruNu j9Gh1VWnTETqtN9JoS7leSW+CaL3YlyWOaq4JeJE7cRCSyRYxzTnL2LxfgwBs3kXFV /dvjY6Nd3UWfeRcp+jf73RTp6EK9IGQ9RkbG1fJJ8Myw3ekYRMkiSqe9YU4fA4DuGo zDD57DG/t1Jww== X-Nifty-SrcIP: [209.85.217.47] Received: by mail-vs1-f47.google.com with SMTP id f22so9727125vso.7; Wed, 03 Apr 2019 04:31:32 -0700 (PDT) X-Gm-Message-State: APjAAAWYHDRa2353VyWVHzyfR9lrze8cwN51ATBFIQ9Hzx77B1asC5QJ Yo95f97tBSaV9F2n8joa6x3cRmhliCerVgv29bI= X-Received: by 2002:a67:c29e:: with SMTP id k30mr46049859vsj.203.1554291091691; Wed, 03 Apr 2019 04:31:31 -0700 (PDT) MIME-Version: 1.0 References: <20190315101013.GN8455@Legion-PC.fortress> <20190326172411.GA15936@Legion-PC.fortress> <20190327154025.GB23293@linux-8ccs> <20190327160440.GE15936@Legion-PC.fortress> In-Reply-To: <20190327160440.GE15936@Legion-PC.fortress> From: Masahiro Yamada Date: Wed, 3 Apr 2019 20:30:55 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RESEND PATCH v1] moduleparam: Save information about built-in modules in separate file To: Alexey Gladkov Cc: Jessica Yu , Michal Marek , Linux Kernel Mailing List , Linux Kbuild mailing list , linux-api@vger.kernel.org, "Kirill A . Shutemov" , Gleb Fotengauer-Malinovskiy , "Dmitry V. Levin" , Dmitry Torokhov , Rusty Russell , Lucas De Marchi Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 28, 2019 at 1:04 AM Alexey Gladkov w= rote: > > On Wed, Mar 27, 2019 at 04:40:25PM +0100, Jessica Yu wrote: > > +++ Alexey Gladkov [26/03/19 18:24 +0100]: > > >On Fri, Mar 22, 2019 at 02:34:12PM +0900, Masahiro Yamada wrote: > > >> Hi. > > >> > > >> (added some people to CC) > > > > (Thanks Masahiro for the CC!) > > > > >> > > >> On Fri, Mar 15, 2019 at 7:10 PM Alexey Gladkov wrote: > > >> > > > >> > Problem: > > >> > > > >> > When a kernel module is compiled as a separate module, some import= ant > > >> > information about the kernel module is available via .modinfo sect= ion of > > >> > the module. In contrast, when the kernel module is compiled into = the > > >> > kernel, that information is not available. > > >> > > >> > > >> I might be missing something, but > > >> vmlinux provides info of builtin modules > > >> in /sys/module/. > > > > > >No. There are definitely not all modules. I have a builtin sha256_gene= ric, > > >but I can't find him in the /sys/module. > > > > Yeah, you'll only find builtin modules under /sys/module/ if it has any= module > > parameters, otherwise you won't find it there. As Masahiro already ment= ioned, > > if a builtin module has any parameters, they would be accessible under = /sys/module/. > > > > >> (Looks like currently only module_param and MODULE_VERSION) > > >> > > >> This patch is not exactly the same, but I see a kind of overwrap. > > >> I'd like to be sure if we want this new scheme. > > > > > >The /sys/module is only for running kernel. One of my use cases is > > >to create an initrd for a new kernel. > > > > > >> > > >> > Information about built-in modules is necessary in the following c= ases: > > >> > > > >> > 1. When it is necessary to find out what additional parameters can= be > > >> > passed to the kernel at boot time. > > >> > > >> > > >> Actually, /sys/module//parameters/ > > >> exposes this information. > > >> > > >> Doesn't it work for your purpose? > > > > > >No, since creating an initrd needs to know all the modalias before > > >I get the sysfs for new kernel. Also there are no modalias at all. > > > > > >> > 2. When you need to know which module names and their aliases are = in > > >> > the kernel. This is very useful for creating an initrd image. > > >> > > > > > Hm, I do see one possible additional use-case for preserving module ali= as > > information for built-in modules - modprobe will currently error (I thi= nk, > > correct me if I'm wrong) if we try invoking modprobe with an alias of a > > built-in module, simply because this information is not in modules.buil= tin or > > modules.alias. > > Yes. Patch for modprobe in my todo list. The reason I didn=E2=80=99t do i= t was > because I wasn=E2=80=99t sure that the file format was final. > > > Since kbuild already outputs modules.builtin, I would suggest outputtin= g > > something like a modules.builtin.alias file (and I guess maybe a module= s.builtin.param > > file too if that's deemed useful), in a format that is consumable by km= od/modprobe, > > so that modprobing an alias of a built-in module doesn't produce an err= or. I > > think this should be easy to do if we keep and parse the resulting .mod= info for > > builtin modules. This is just an idea, opinions welcome. I've added Luc= as to CC > > in case he has any thoughts. > > You don't like kernel.builtin.modinfo ? Naming is often the most difficult thing. :) IMHO, 'kernel' and 'builtin' have a similar meaning here. Is 'kernel.builtin' unnecessarily too long? Perhaps, another idea is: 'builtin.alias' instead of 'modules.builtin.alias' if we want a separate file in the same format. In hindsight, 'modules.builtin' should have been 'builtin.order', I think. > It is much easier to create and it has almost the same format as the > modules. So I think it will be easier to parse in kmod. --=20 Best Regards Masahiro Yamada