[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANeycqpNeHFUu-RwSc6Ewa3r5TMhYYFDC6bO+sj3OZ398JfJ1A@mail.gmail.com>
Date: Tue, 21 May 2024 00:01:45 -0300
From: Wedson Almeida Filho <wedsonaf@...il.com>
To: Dave Airlie <airlied@...il.com>
Cc: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>, Danilo Krummrich <dakr@...hat.com>,
gregkh@...uxfoundation.org, rafael@...nel.org, bhelgaas@...gle.com,
ojeda@...nel.org, alex.gaynor@...il.com, boqun.feng@...il.com,
gary@...yguo.net, bjorn3_gh@...tonmail.com, benno.lossin@...ton.me,
a.hindborg@...sung.com, aliceryhl@...gle.com, fujita.tomonori@...il.com,
lina@...hilina.net, pstanner@...hat.com, ajanulgu@...hat.com,
lyude@...hat.com, rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org
Subject: Re: [RFC PATCH 10/11] rust: add basic abstractions for iomem operations
On Mon, 20 May 2024 at 23:07, Dave Airlie <airlied@...il.com> wrote:
>
> >
> > Wedson wrote a similar abstraction in the past
> > (`rust/kernel/io_mem.rs` in the old `rust` branch), with a
> > compile-time `SIZE` -- it is probably worth taking a look.
> >
>
> Just on this point, we can't know in advance what size the IO BARs are
> at compile time.
>
> The old method just isn't useful for real devices with runtime IO BAR sizes.
The compile-time `SIZE` in my implementation is a minimum size.
Attempts to read/write with constants within that size (offset + size)
were checked at compile time, that is, they would have zero additional
runtime cost when compared to C. Reads/writes beyond the minimum would
have to be checked at runtime.
Powered by blists - more mailing lists