On 11/28/25 1:49 PM, Joel Fernandes wrote:
On 11/27/2025 8:46 AM, Alexandre Courbot wrote:
On Thu Nov 27, 2025 at 2:10 PM JST, Joel Fernandes wrote:
...
There is also at least one precedent: the Rust `page_align()` does not
call a C helper that wraps `PAGE_ALIGN()`, it just reimplements it. I
think `list_head` is a quite similar situation, but ultimately that's
for the core team to say.

I don't think a one size/rule fits all will apply for this. We need carefully do

Case-by-case is certainly a good way to evaluate these things, yes.

it on a case-by-case basis, for example - if we implement list_add directly in
rust, we'd miss out on CONFIG_LIST_HARDENED. So for that, I will still use the
bindings. For INIT_LIST_HEAD and iteration, it should be Ok, though. So I'll add
that directly in Rust without bindings.

Here, I'm not so sure that even this case is a solid one. Because
CONFIG_LIST_HARDENED is a way for C code to help protect against
list corruption--which is generally going to come from the C side,
not the Rust side, for the most part.

Let the C code have its extra checks, but on the Rust side we can
either add them, or skip them--but I don't think we need to *invoke*
them via the C code.



thanks,
--
John Hubbard

Reply via email to