From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9EF49481FAF for ; Thu, 13 Aug 2026 14:15:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786630512; cv=none; b=m9LpV/z0uOLOXPMGbwjYi56a+SRILLtUXusd2VXj8x6/x1Pc3KMwrr1Jg88YnCKGyrLNtE6KZbLZZHD/VFJyWtKQVpO2wt7y7yBi8QamK2P+axKRyHFDcHCZLfiytBN1aT8dWuS0gAV7ubQ3YutV2/MD3knQiTp/Exr6r5+4xQU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786630512; c=relaxed/simple; bh=BJmgQ0xsWwLek3a34c+eZxt3ELWgWeEXeHtsjDuughU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=r4coiGPPD9HavQUCuQ2/ViBWWYi0aFDCo4U7R/TfmHwZkUhj4omgvhSuIIY+NtZXua9aA+sYxUws20b8XA+549NjDGoLTsIxkc0869LUCVXaxS1b7wce7U2myhB4/OemDvA9OQh9zr3ugVHm4rn2BvuhiF8cATfkRt9HQz5q8FQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=TNKwobiN; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="TNKwobiN" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-495590dde14so26817715e9.0 for ; Thu, 13 Aug 2026 07:15:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1786630509; x=1787235309; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=in6woJYFkc39bFtfodNqD0fkpoWFu5/eR61xqqy33mA=; b=TNKwobiNDry3Jg29pIVwqvbGOSLRwhjctHlglRVHgFA+h1A4RzTLVpgDAXfIKopaHP tubDpQuDDPFpTBWHmhwje9fX+uDhhch+AUD1KSzQ25xIwxTrXD8sr30mpaTGvnNVRIYm dBvHdInLOtGbZY2t3UUaDftXbV5VjABV9/79tSmw1kWbcT3ngOR10XMtQmi0MowPGITA TuEb+IeLRTv2nhdAuEUV9Uap9h7GJqQUu1/YxYWzo6IcuojhYKzYExWow6lPi/ccNK4v 4d+oI3VqBdKxJF9/6AyRp6jyUeMgOKpQKrQwsvJbt/YJgEevsxWKyRrJcYCds6sUBT8c TZuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786630509; x=1787235309; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=in6woJYFkc39bFtfodNqD0fkpoWFu5/eR61xqqy33mA=; b=id/BzcVKbB8YClxFnW1YXv2lRvDTEg3xSJUcOpap7m6uFbP0OVG/as+OQjqwtI6icG JLKHPK59WAoiQCBgWrb0tug0VMo7O/g7qFHXEEXsQu6Q5dv0jZZTXCZECpWJas9vljDE LU8qprhhCRl4sxRN/pslHtEr36V1bNPUsX6BoJSwKzkTIJZK0jMKikyqwcWkTbgsK01q U22Jb3/m2OYG+PuvRhsab3xfmkdEudkBz/f7gSDjHhAn+xsXjCVk3JM7uUjPi38MaK64 wEFp15fHtv6eRzNyAEPflxUqRwTayUny1fdl9fJbH8E6MxaLsFAZaGNgbl2k+LySp9Ic nXVg== X-Forwarded-Encrypted: i=1; AHgh+RqN+Avrbo6uV8iEBylBsn8njjj4FJztSurv2hbqqMLUDTqdXP/qOx/u3ZOVuXj9U4x9ExGea23AdWJMQW4=@vger.kernel.org X-Gm-Message-State: AOJu0YyQt5ZDBnFEbMWMzr1MCk7jFD+qJEfHILe3v5eAoW8zZu5iTCoC 8KhNizg3EyeXO6+OuHv7v4iWKp3kY16b8uirt9KDx5n7HuU8VHEIPsOhrP9qeeQ2Gkc= X-Gm-Gg: AR+sD11bqZr9Lf5/OeIIE9IAKVz7WyngWTWnK1/5Vncd+yhNp7YYmgR7wMbi4C/eiO1 kQUUaf2Z6L5s+2NsBv+alW0QfFCtHBLOAsPTeB+w5UMPiIZiL9k9MtvoE7MdVwseWXrZ6Tg+/t+ yQLw+LIF3AOgy/QrP0yEhRhscfExu/AgaC6HjGOjhq5FtKcVJhUXsggUpeas+oOo3EM0rh8VNX9 4DIaS8QO87VoHZlb50fBfCc2up3XFzUrnLoWJZLZl6kFvei8Rk3no1ZMtHeq8+9bfCDweI5nXu5 GAgQdeDYPR38FCsU2N+Mk6PHxsiKM5QLLRuQcopsL6TaCNphgINcbwkd2er0Kl6j5imf6oYaamJ tu1tU59EQTmpF38bNDxDswitGgygzSVGeHvGW8OuMoZx8hC6EC5NVI37p8xDX2fBLDjtLkPBqhe CvDO65Vq9Fh4u5IE9KBwIW6/AU7XNuHorfpRboeTC5ImqW+QCwqYlxNzyOMSampcMTdHx8huQOL 6Kn/MZfw4cacbAQpAqx1ocgXQ== X-Received: by 2002:a05:600c:6995:b0:494:596e:e8c4 with SMTP id 5b1f17b1804b1-499821bdcadmr82447915e9.17.1786630508708; Thu, 13 Aug 2026 07:15:08 -0700 (PDT) Received: from ?IPV6:2a07:de40:8100:0:fc6c:f9a2:4a0a:6354? ([2001:af0:8000:1409:193:86:92:181]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4998212a011sm62452805e9.5.2026.08.13.07.15.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 13 Aug 2026 07:15:08 -0700 (PDT) Message-ID: Date: Thu, 13 Aug 2026 16:15:05 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v9 1/2] module: Extend module_blacklist parameter to built-in modules To: Aaron Tomlin Cc: arnd@arndb.de, mcgrof@kernel.org, da.gomez@kernel.org, samitolvanen@google.com, peterz@infradead.org, ojeda@kernel.org, akpm@linux-foundation.org, mhiramat@kernel.org, boqun@kernel.org, neelx@suse.com, da.anzani@gmail.com, sean@ashe.io, chjohnst@mail.com, steve@abita.co, mproche@mail.com, nick.lane@mail.com, linux-arch@vger.kernel.org, linux-modules@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260807012601.360452-1-atomlin@atomlin.com> <20260807012601.360452-2-atomlin@atomlin.com> Content-Language: en-US From: Petr Pavlu In-Reply-To: <20260807012601.360452-2-atomlin@atomlin.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 8/7/26 3:26 AM, Aaron Tomlin wrote: > diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h > index 5659f4b5a125..799d912dcbc0 100644 > --- a/include/asm-generic/vmlinux.lds.h > +++ b/include/asm-generic/vmlinux.lds.h > @@ -734,7 +734,9 @@ > EARLYCON_TABLE() \ > LSM_TABLE() \ > EARLY_LSM_TABLE() \ > - KUNIT_INIT_TABLE() > + KUNIT_INIT_TABLE() \ > + STRUCT_ALIGN(); \ > + BOUNDED_SECTION_BY(.initcall.modnames, _initcall_modnames) > > #define INIT_TEXT \ > *(.init.text .init.text.*) \ I realized that instead of using STRUCT_ALIGN(), a cleaner and less wasteful approach is to prevent any potential over-alignment of individual .initcall.modnames sections by having ____define_initcall_modname() define each `struct initcall_modname` with `__aligned(__alignof__(struct initcall_modname))`. > diff --git a/rust/macros/module.rs b/rust/macros/module.rs > index 06c18e207508..13353b43b38d 100644 > --- a/rust/macros/module.rs > +++ b/rust/macros/module.rs > @@ -479,6 +479,7 @@ pub(crate) fn module(info: ModuleInfo) -> Result { > let ident_init = format_ident!("__{ident}_init"); > let ident_exit = format_ident!("__{ident}_exit"); > let ident_initcall = format_ident!("__{ident}_initcall"); > + let ident_modname = format_ident!("__{ident}_modname"); > let initcall_section = ".initcall6.init"; > > let global_asm = format!( > @@ -590,6 +591,21 @@ pub extern "C" fn cleanup_module() { > #[cfg(CONFIG_HAVE_ARCH_PREL32_RELOCATIONS)] > ::core::arch::global_asm!(#global_asm); > > + #[cfg(not(MODULE))] > + #[repr(C)] > + struct InitcallModname { > + initcall_fn: extern "C" fn() -> ::kernel::ffi::c_int, > + modname: *const ::kernel::ffi::c_char, > + } > + > + #[cfg(not(MODULE))] > + #[used(compiler)] > + #[link_section = ".initcall.modnames"] > + static #ident_modname: InitcallModname = InitcallModname { Can Rust directly use the C definition of initcall_modname via ::kernel::bindings::initcall_modname? > + initcall_fn: #ident_init, > + modname: #name_cstr.as_ptr().cast(), Can the modname string be placed in .init.rodata to match the behavior on the C side? > + }; > + > #[cfg(not(MODULE))] > #[no_mangle] > pub extern "C" fn #ident_init() -> ::kernel::ffi::c_int { -- Thanks, Petr