From: Greg KH <greg@kroah.com>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: Thomas Bertschinger <tahbertschinger@gmail.com>,
ojeda@kernel.org, alex.gaynor@gmail.com, wedsonaf@gmail.com,
rust-for-linux@vger.kernel.org,
Martin Rodriguez Reboredo <yakoyoku@gmail.com>,
Alice Ryhl <aliceryhl@google.com>
Subject: Re: [PATCH v2] rust: place generated init_module() function in .init.text
Date: Tue, 6 Feb 2024 10:58:23 +0000 [thread overview]
Message-ID: <2024020617-robin-countdown-d572@gregkh> (raw)
In-Reply-To: <CANiq72m8V2nycL=P8yT3M=e6Nek0w45zBK48Aqbt39Kpt+bwTA@mail.gmail.com>
On Tue, Feb 06, 2024 at 11:51:35AM +0100, Miguel Ojeda wrote:
> On Tue, Feb 6, 2024 at 11:01 AM Greg KH <greg@kroah.com> wrote:
> >
> > "once" is not right, it can be called zillions of times, it's just that
> > it can't be called _AFTER_ module_init() is over for the file, as it
> > will no longer be present in memory.
> >
> > So technically, the wording you added here isn't correct, sorry.
>
> The safety preconditions may be stronger than needed. For instance, if
> we do not expect anybody to manually call this, then we can say so. In
> fact, we could even say Rust code cannot call this function.
But why not? Rust code can call these functions, and you should be
writing functions in rust code in the init section. There's nothing
"special" about this other than it is a memory size savings, and if you
get it wrong, the linker will tell you at build time.
thanks,
greg k-h
next prev parent reply other threads:[~2024-02-06 10:58 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-06 1:25 [PATCH v2] rust: place generated init_module() function in .init.text Thomas Bertschinger
2024-02-06 1:39 ` Martin Rodriguez Reboredo
2024-02-06 2:13 ` Thomas Bertschinger
2024-02-06 3:10 ` Trevor Gross
2024-02-06 3:17 ` Trevor Gross
2024-02-06 10:01 ` Greg KH
2024-02-06 10:51 ` Miguel Ojeda
2024-02-06 10:58 ` Greg KH [this message]
2024-02-06 11:31 ` Miguel Ojeda
2024-02-06 14:49 ` Thomas Bertschinger
2024-02-06 16:07 ` Martin Rodriguez Reboredo
2024-02-06 17:19 ` Miguel Ojeda
2024-02-06 21:28 ` Martin Rodriguez Reboredo
2024-02-06 17:19 ` Miguel Ojeda
2024-02-06 10:01 ` Greg KH
2024-02-06 10:29 ` Alice Ryhl
2024-02-06 10:50 ` Greg KH
2024-02-06 11:18 ` Miguel Ojeda
2024-02-06 10:57 ` Miguel Ojeda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2024020617-robin-countdown-d572@gregkh \
--to=greg@kroah.com \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tahbertschinger@gmail.com \
--cc=wedsonaf@gmail.com \
--cc=yakoyoku@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).