rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gary Guo <gary@garyguo.net>
To: Ramon de C Valle <rcvalle@google.com>
Cc: "Benno Lossin" <benno.lossin@proton.me>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Wedson Almeida Filho" <wedsonaf@gmail.com>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Andreas Hindborg" <a.hindborg@samsung.com>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	rust-for-linux@vger.kernel.org
Subject: Re: [PATCH 0/5] use custom FFI integer types
Date: Sun, 15 Sep 2024 00:52:13 +0100	[thread overview]
Message-ID: <20240915005213.7ee8b814.gary@garyguo.net> (raw)
In-Reply-To: <CAOcBZOTcoPEk2Bo05gj66cHiqKxTR7j1z9U_j+Jeh1oCjtOKXg@mail.gmail.com>

On Fri, 13 Sep 2024 19:51:01 -0700
Ramon de C Valle <rcvalle@google.com> wrote:

> Since we're doing this, may I suggest that we use
> https://crates.io/crates/cfi-types by reexporting them as kernel::ffi
> instead? By using those, we would also avoid the granularity loss of
> normalizing integers and using the integer normalization option
> wouldn't be necessary. I could accept any
> contributions/kernel-specific changes that would make it easier for
> the kernel to use them.

I don't think integer normalization is a big issue. Sami said the
granularity loss only results in ~1% reduction of unique type hashes in
https://lore.kernel.org/all/CABCJKuc8ue1y7WBPo3YRRoDeGUFpRon4at=Wa1rQjrXzOGpt9w@mail.gmail.com/.

As Alice said, if the CFI annotation works with type aliases then we
should switch to use them. Without it though, I think it's quite
inconvenient if we have to use new types for all FFI integer
primitives and add a ton of conversions. I'd prefer we still use type
aliases.

Best,
Gary

  parent reply	other threads:[~2024-09-14 23:52 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-13 21:29 [PATCH 0/5] use custom FFI integer types Gary Guo
2024-09-13 21:29 ` [PATCH 1/5] rust: fix size_t in bindgen prototypes of C builtins Gary Guo
2024-09-29 21:00   ` Trevor Gross
2024-10-05 22:10     ` Gary Guo
2024-09-13 21:29 ` [PATCH 2/5] rust: map `__kernel_size_t` and friends also to usize/isize Gary Guo
2024-09-23  9:20   ` Alice Ryhl
2024-09-29 21:02   ` Trevor Gross
2024-09-13 21:29 ` [PATCH 3/5] rust: use custom FFI integer types Gary Guo
2024-09-13 21:29 ` [PATCH 4/5] rust: map `long` to `isize` and `char` to `u8` Gary Guo
2024-09-23  9:20   ` Alice Ryhl
2024-09-13 21:29 ` [PATCH 5/5] rust: cleanup unnecessary casts Gary Guo
2024-09-23  9:19   ` Alice Ryhl
2024-09-13 21:42 ` [PATCH 0/5] use custom FFI integer types Benno Lossin
     [not found]   ` <CAOcBZOS6BAJ1FTFkB3x6jdag_hL7zrLbFy7TxkvZWKxRZ_+ggA@mail.gmail.com>
2024-09-14  2:51     ` Ramon de C Valle
2024-09-14  8:52       ` Alice Ryhl
2024-09-14 23:52       ` Gary Guo [this message]
2024-09-16 17:17         ` Ramon de C Valle
2024-09-16 17:26           ` Miguel Ojeda
2024-11-11  0:14 ` Miguel Ojeda
2024-12-15 22:25   ` 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=20240915005213.7ee8b814.gary@garyguo.net \
    --to=gary@garyguo.net \
    --cc=a.hindborg@samsung.com \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=benno.lossin@proton.me \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=ojeda@kernel.org \
    --cc=rcvalle@google.com \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    --cc=wedsonaf@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).