lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87h6hu9udb.fsf@metaspace.dk>
Date: Tue, 27 Feb 2024 09:32:27 +0100
From: Andreas Hindborg <nmi@...aspace.dk>
To: Alice Ryhl <aliceryhl@...gle.com>
Cc: Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>,
 Wedson Almeida Filho <wedsonaf@...il.com>, Boqun Feng
 <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>, Björn
 Roy Baron
 <bjorn3_gh@...tonmail.com>, Benno Lossin <benno.lossin@...ton.me>, Kees
 Cook <keescook@...omium.org>, Al Viro <viro@...iv.linux.org.uk>, Andrew
 Morton <akpm@...ux-foundation.org>, Greg Kroah-Hartman
 <gregkh@...uxfoundation.org>, Arve Hjønnevåg
 <arve@...roid.com>, Todd Kjos
 <tkjos@...roid.com>, Martijn Coenen <maco@...roid.com>, Joel Fernandes
 <joel@...lfernandes.org>, Carlos Llamas <cmllamas@...gle.com>, Suren
 Baghdasaryan <surenb@...gle.com>, Arnd Bergmann <arnd@...db.de>,
 linux-mm@...ck.org, linux-kernel@...r.kernel.org,
 rust-for-linux@...r.kernel.org, Christian Brauner <brauner@...nel.org>
Subject: Re: [PATCH v2 4/4] rust: add abstraction for `struct page`


Hi Alice,

Alice Ryhl <aliceryhl@...gle.com> writes:

> Adds a new struct called `Page` that wraps a pointer to `struct page`.
> This struct is assumed to hold ownership over the page, so that Rust
> code can allocate and manage pages directly.

<cut>

> +/// A bitwise shift for the page size.
> +pub const PAGE_SHIFT: usize = bindings::PAGE_SHIFT as usize;
> +/// The number of bytes in a page.
> +pub const PAGE_SIZE: usize = 1 << PAGE_SHIFT;

For consistency, could we get page size from bindings as well? The folio
patches already do this [1].

BR Andreas


[1] https://lore.kernel.org/rust-for-linux/20231018122518.128049-10-wedsonaf@gmail.com/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ