linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Alice Ryhl <aliceryhl@google.com>
To: Gary Guo <gary@garyguo.net>
Cc: "Joerg Roedel" <joro@8bytes.org>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Will Deacon" <will@kernel.org>,
	"Daniel Almeida" <daniel.almeida@collabora.com>,
	"Boris Brezillon" <boris.brezillon@collabora.com>,
	"Robin Murphy" <robin.murphy@arm.com>,
	"Jason Gunthorpe" <jgg@ziepe.ca>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Lorenzo Stoakes" <lorenzo.stoakes@oracle.com>,
	"Liam R. Howlett" <Liam.Howlett@oracle.com>,
	"Asahi Lina" <lina+kernel@asahilina.net>,
	linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org,
	iommu@lists.linux.dev, linux-mm@kvack.org,
	"Deborah Brouwer" <deborah.brouwer@collabora.com>
Subject: Re: [PATCH v6] rust: iommu: add io_pgtable abstraction
Date: Sun, 18 Jan 2026 22:26:42 +0100	[thread overview]
Message-ID: <CAH5fLgixtTyrRcHE6i5RWE3_DgeY59b4B81gF4iDEu1shT_ikw@mail.gmail.com> (raw)
In-Reply-To: <DFRU7CF0SSWN.3KMT2U5FWC2NU@garyguo.net>

On Sun, Jan 18, 2026 at 4:57 PM Gary Guo <gary@garyguo.net> wrote:
>
> On Sun Jan 18, 2026 at 10:08 AM GMT, Alice Ryhl wrote:
> > +// For the initial users of these rust bindings, the GPU FW is managing the IOTLB and performs all
> > +// required invalidations using a range. There is no need for it get ARM style invalidation
> > +// instructions from the page table code.
> > +//
> > +// Support for flushing the TLB with ARM style invalidation instructions may be added in the
> > +// future.
> > +static NOOP_FLUSH_OPS: bindings::iommu_flush_ops = bindings::iommu_flush_ops {
> > +    tlb_flush_all: Some(rust_tlb_flush_all_noop),
> > +    tlb_flush_walk: Some(rust_tlb_flush_walk_noop),
> > +    tlb_add_page: None,
> > +};
> > +
> > +#[no_mangle]
> > +extern "C" fn rust_tlb_flush_all_noop(_cookie: *mut core::ffi::c_void) {}
>
> Any reason that these needs to be `#[no_mangle]`? Would just `extern "C"` not be
> enough? If there is a good reason, I think this should be noted as such (note
> that `#[no_mangle]` would be unsafe in edition 2024 so we probably would want to
> avoid using it if possible.

No, it's not required because these are referenced only via function
pointers stored in NOOP_FLUSH_OPS. In principle #[no_mangle] may be
removed here.

However, keeping it doesn't hurt either. There's no particular risk of
overlap with other symbols of the same name. I won't send another
version just for this. Joerg may remove it if he cares, but I don't
think it's a big deal.

> The rest LGTM, so
>
> Reviewed-by: Gary Guo <gary@garyguo.net>

Thanks for the review!

Alice


  reply	other threads:[~2026-01-18 21:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-18 10:08 Alice Ryhl
2026-01-18 14:43 ` Danilo Krummrich
2026-01-18 15:57 ` Gary Guo
2026-01-18 21:26   ` Alice Ryhl [this message]
2026-01-19  9:29 ` Joerg Roedel

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=CAH5fLgixtTyrRcHE6i5RWE3_DgeY59b4B81gF4iDEu1shT_ikw@mail.gmail.com \
    --to=aliceryhl@google.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=a.hindborg@kernel.org \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=boris.brezillon@collabora.com \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=deborah.brouwer@collabora.com \
    --cc=gary@garyguo.net \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@ziepe.ca \
    --cc=joro@8bytes.org \
    --cc=lina+kernel@asahilina.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    --cc=will@kernel.org \
    /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