Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5447605img; Wed, 27 Mar 2019 08:41:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqwUXHnSMYagcNc56NXndNJMNDGbhqk/yBUJKjDkjaE/RynzHck8S1LQay+QRnVdKFPUv6QL X-Received: by 2002:a17:902:8690:: with SMTP id g16mr37475954plo.284.1553701303010; Wed, 27 Mar 2019 08:41:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553701303; cv=none; d=google.com; s=arc-20160816; b=SEZ/xhfciwiI/CPpmIlIkMBsPBJ1BXAXFR/np2s0tsljMkZqanP47mX6Ws5IUcSfxA HjnVyilF8YJph2+Z92T63Zee7RHfHFjoVSLPalwZIgS9czIUE//D1wUGLSdJY/+15Ju4 9cgcWv+VcGj/Jy4XUONcHThoSW6BU7VesKO03s29PfN5mfvprCBGjKtkqJDqskr/IT8B tXB2zvo0seU5nsAo4cuGucAKZza5Y9Oao6Xt0cyQQfS9l3YJ+TCtivw5LoYbUSlRi5PU SvyHeXQGLQn/z+MosyFgJ02emOcsqF4xq1DJqIQXDVjVpc+lMs1BdBlAZG8u9qYeX5JR ySJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=RmVyo5Wmr00i812bmjHJlR17huAo6P2QyytHpee/sHg=; b=x+4xY8JKgEvPjPx+qgCUu8bqhRRVVeVZMaKfs3SDMzKqz3leyjhMAgFhBqrOkIgPr6 ALarpZS80ScTuF7bVqGFwFWuFXlWhNEsd44rFcCMph/tB+p0YcBaOTtWgaOW+3tAhjzB xfcISz/4khPZ2o1KUyY6/ez9lPwWF5PVUWVkPecAjUpNDOGz1/BKZGh3mOJb6+wURXJ0 KKkQgV8A8hPEP0JTKxHS4h9BEiMKbeoTxM6sVdxnYxyzUKZTOEqfsReYE0rzQRnAbsNJ R80ZtSlNYgPO+HTKXOGxKGQ3PrSYOj5IKyVmbxiyUsKM/rMejHxuixG9LerdFqyfXaJo KZdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JmbV03Xs; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n6si19165177pgj.96.2019.03.27.08.41.27; Wed, 27 Mar 2019 08:41:42 -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=@kernel.org header.s=default header.b=JmbV03Xs; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728141AbfC0Pkb (ORCPT + 99 others); Wed, 27 Mar 2019 11:40:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:49982 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726533AbfC0Pkb (ORCPT ); Wed, 27 Mar 2019 11:40:31 -0400 Received: from linux-8ccs (nat.nue.novell.com [195.135.221.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2EBEE206B8; Wed, 27 Mar 2019 15:40:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553701230; bh=Vv69CyZDAdI5phXsBuaCREGJToik5CgoOszAvDKqv60=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JmbV03XskTRR6jrWyq2R+1dRwypI5hAv8q7enXSyuvKoNpVAoM/8yNqTulKyXeF+7 LzE7kX8TliUZxd/ewfZ7WjtZOjNVKkMQg787QYjLyq9cwn9NwsApj1kMgXY+vybGk3 xr7+1Ws6qxbCMNpEnR/kSjlky9andvbs2n71t6P4= Date: Wed, 27 Mar 2019 16:40:25 +0100 From: Jessica Yu To: Alexey Gladkov 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: <20190327154025.GB23293@linux-8ccs> References: <20190315101013.GN8455@Legion-PC.fortress> <20190326172411.GA15936@Legion-PC.fortress> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20190326172411.GA15936@Legion-PC.fortress> X-OS: Linux linux-8ccs 5.1.0-rc1-lp150.12.28-default+ x86_64 User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +++ 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. 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. Thanks, Jessica