From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B094B257820; Wed, 24 Sep 2025 06:40:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758696014; cv=none; b=PnCmYnQbI+BmwihFwfSE5RNMiu0Qn7lHBkwXP7TSBKcYV+jI8Xva05urmdbbpj85Rjp/XuSdi/vTPyM9e172yoltsbkiwM0J+HhND3GhlfDVgt+CE+pGKEBaaAhRZ6YHv/gBZ9mBa/Hk/pn0w7/XHC29dl76W0GPhTvZ49sihx8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758696014; c=relaxed/simple; bh=SujJ08ONnBdw92E/vP0ZQBaMGCJIL8c+zzAzd0/vqkA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sy7gvbxHQr+io7wJR7PMW4k5mIb9pNYa9oXAtwrQLvs/SgeSR97X9yldbuc2PBknOHDf7/VzfyHT6gRCYUsd3SG0oSUKoyeid7pvZf9stdv9IOavKpES/rm1hhlXF3IQBaxF9iiuCso0oeOGFi8/ulFjILk82F8N18uXcpn7FIY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oZbPcjCw; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oZbPcjCw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E318BC113CF; Wed, 24 Sep 2025 06:40:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1758696014; bh=SujJ08ONnBdw92E/vP0ZQBaMGCJIL8c+zzAzd0/vqkA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oZbPcjCwBNizAhUxtuNrFqQ7R0R1COP3ChuINZ0mp9+DR59K6bT+HXVFg5XcQbpGh DlxKbFQ3dTltzlq5xliR44hZtGvRk7trwneAjF9e12ro1Dvn7duiFz7eUfRxfBajl/ PhQFCKSvwdSGtT5Z1K5TPuKlnwguuF8ynDOtjaMhB60x+Mfm6BzQ0aJnQgpR0O+HP8 MQtFPR0sdWSikDGJi9VaYLWaJdFDbV+Jpy27A1hOISdixglYF8x0EzvntlDHupcqGi l96XtzTLFv8e8LFsAVTeuG5eP1JWpI/8v7URCJQoGGSk/4W55cZU/LuA59pMxNK9JU dS6DVLduC7dAw== Date: Wed, 24 Sep 2025 08:38:43 +0200 From: Nicolas Schier To: Alexey Gladkov Cc: Nathan Chancellor , Petr Pavlu , Luis Chamberlain , Sami Tolvanen , Daniel Gomez , linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, linux-kbuild@vger.kernel.org, Masahiro Yamada , Stephen Rothwell Subject: Re: [PATCH v8 7/8] modpost: Create modalias for builtin modules Message-ID: References: <28d4da3b0e3fc8474142746bcf469e03752c3208.1758182101.git.legion@kernel.org> Precedence: bulk X-Mailing-List: linux-modules@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <28d4da3b0e3fc8474142746bcf469e03752c3208.1758182101.git.legion@kernel.org> On Thu, Sep 18, 2025 at 10:05:51AM +0200, Alexey Gladkov wrote: > For some modules, modalias is generated using the modpost utility and > the section is added to the module file. > > When a module is added inside vmlinux, modpost does not generate > modalias for such modules and the information is lost. > > As a result kmod (which uses modules.builtin.modinfo in userspace) > cannot determine that modalias is handled by a builtin kernel module. > > $ cat /sys/devices/pci0000:00/0000:00:14.0/modalias > pci:v00008086d0000A36Dsv00001043sd00008694bc0Csc03i30 > > $ modinfo xhci_pci > name: xhci_pci > filename: (builtin) > license: GPL > file: drivers/usb/host/xhci-pci > description: xHCI PCI Host Controller Driver > > Missing modalias "pci:v*d*sv*sd*bc0Csc03i30*" which will be generated by > modpost if the module is built separately. > > To fix this it is necessary to generate the same modalias for vmlinux as > for the individual modules. Fortunately '.vmlinux.export.o' is already > generated from which '.modinfo' can be extracted in the same way as for > vmlinux.o. > > Signed-off-by: Masahiro Yamada > Signed-off-by: Alexey Gladkov > Tested-by: Stephen Rothwell > --- > include/linux/module.h | 4 ---- > scripts/Makefile.vmlinux | 4 +++- > scripts/mksysmap | 3 +++ > scripts/mod/file2alias.c | 19 ++++++++++++++++++- > scripts/mod/modpost.c | 15 +++++++++++++++ > scripts/mod/modpost.h | 2 ++ > 6 files changed, 41 insertions(+), 6 deletions(-) > Reviewed-by: Nicolas Schier -- Nicolas