Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5470549img; Wed, 27 Mar 2019 09:05:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqyiWb9Ml60zTzjgIWMI0pCYse2sG1iyO2AmLJLbK21WToYYXXuuJy9tyR8i35Za9ouSpjnv X-Received: by 2002:a63:1003:: with SMTP id f3mr26070995pgl.227.1553702757934; Wed, 27 Mar 2019 09:05:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553702757; cv=none; d=google.com; s=arc-20160816; b=Dxq9lvGFLELGqIdatVE2vWY0/qv7k5yUZaFwOBNAwclywAI7g2cwnZzkNFSLdLw7e+ mYTYKX2kFO+BGUXtHZP8aUJ3OmS9ZrQYTCNx/QZb2V0Qs15Mvi2Hh16T8NMNTSu2Kv/R WSq1s8vJ+fHAKmlcX85T3VvG1bIcsJH7kvCMAKXDQWXLQAZuKEjQqGgfY46VX0+6YyzJ b1xx22UuAAgCin/85z3tNn0YiFUk8OcD2vcXmgXJ1ISQoKDgMja0zgSi8DbKyIJf1Bof fOEygx2xL04//o7SjyJLxeF8CLHj/xiIPa6558ytYdYZqKh7gd5SiLA0buYrvVjrBQQZ LM9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=2V6SEWEoMGTPJ/A//K0Pth7F+2DFKkZIWdUab1UbdCg=; b=gJoyI5iMBHXgu8rZF3TW//og1JR+3KSM+ia2O61neLfyVOJsAA+avotxgnIrVVB3oc 4cXYm/0y4yFywkUfnxjTNePsJaGDyq/nQsd0LP/ohITLhchINDrWoUaqEzJErH6ejowx AKfR0skmLc3xqfvBeoEOYx/tRNuqH8pl+WqmrzJ8HIhSHV1YQQ3b6M3fZMSA4GWQCfcl vhFp8cOUAnQoX4Dsq5HX3oZz9NzFG0VGV4smkXJF6dIGD9IDVgOjMmK/Qa1QM79yroef FAWdhgoR2OAU2xFad6/M6EER9E4mvTw6tejFbnfcxuM6nSgvf6CAB4obUkLVScAwgZc5 wyPQ== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j35si20252071plb.61.2019.03.27.09.05.42; Wed, 27 Mar 2019 09:05:57 -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; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727699AbfC0QEw (ORCPT + 99 others); Wed, 27 Mar 2019 12:04:52 -0400 Received: from monster.unsafe.ru ([5.9.28.80]:58638 "EHLO mail.unsafe.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726990AbfC0QEv (ORCPT ); Wed, 27 Mar 2019 12:04:51 -0400 Received: from Legion-PC.fortress (nat-pool-brq-t.redhat.com [213.175.37.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.unsafe.ru (Postfix) with ESMTPSA id 3250AC61AAA; Wed, 27 Mar 2019 16:04:42 +0000 (UTC) Date: Wed, 27 Mar 2019 17:04:40 +0100 From: Alexey Gladkov To: Jessica Yu Cc: Masahiro Yamada , 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 Subject: Re: [RESEND PATCH v1] moduleparam: Save information about built-in modules in separate file Message-ID: <20190327160440.GE15936@Legion-PC.fortress> References: <20190315101013.GN8455@Legion-PC.fortress> <20190326172411.GA15936@Legion-PC.fortress> <20190327154025.GB23293@linux-8ccs> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190327154025.GB23293@linux-8ccs> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 important > >> > information about the kernel module is available via .modinfo section 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_generic, > >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 mentioned, > 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 cases: > >> > > >> > 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 alias > information for built-in modules - modprobe will currently error (I think, > 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.builtin or > modules.alias. Yes. Patch for modprobe in my todo list. The reason I didn’t do it was because I wasn’t sure that the file format was final. > Since kbuild already outputs modules.builtin, I would suggest outputting > something like a modules.builtin.alias file (and I guess maybe a modules.builtin.param > file too if that's deemed useful), in a format that is consumable by kmod/modprobe, > so that modprobing an alias of a built-in module doesn't produce an error. I > think this should be easy to do if we keep and parse the resulting .modinfo for > builtin modules. This is just an idea, opinions welcome. I've added Lucas to CC > in case he has any thoughts. You don't like kernel.builtin.modinfo ? 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. -- Rgrds, legion