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: <975c8346-dddc-44ef-ab24-71cadfbce23a@kernel.org>
Date: Wed, 23 Apr 2025 14:05:29 +0200
From: Danilo Krummrich <dakr@...nel.org>
To: Viresh Kumar <viresh.kumar@...aro.org>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>,
 Miguel Ojeda <miguel.ojeda.sandonis@...il.com>,
 Danilo Krummrich <dakr@...hat.com>, Miguel Ojeda <ojeda@...nel.org>,
 Alex Gaynor <alex.gaynor@...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>,
 Andreas Hindborg <a.hindborg@...nel.org>, Alice Ryhl <aliceryhl@...gle.com>,
 Trevor Gross <tmgross@...ch.edu>, linux-pm@...r.kernel.org,
 Vincent Guittot <vincent.guittot@...aro.org>, Stephen Boyd
 <sboyd@...nel.org>, Nishanth Menon <nm@...com>,
 rust-for-linux@...r.kernel.org,
 Manos Pitsidianakis <manos.pitsidianakis@...aro.org>,
 Alex Bennée <alex.bennee@...aro.org>,
 Joakim Bech <joakim.bech@...aro.org>, Rob Herring <robh@...nel.org>,
 Yury Norov <yury.norov@...il.com>, Burak Emir <bqe@...gle.com>,
 Rasmus Villemoes <linux@...musvillemoes.dk>,
 Russell King <linux@...linux.org.uk>, linux-clk@...r.kernel.org,
 Michael Turquette <mturquette@...libre.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH V11 13/15] rust: cpufreq: Extend abstractions for driver
 registration

On 4/21/25 9:22 AM, Viresh Kumar wrote:
> Extend the cpufreq abstractions to support driver registration from
> Rust.
> 
> Signed-off-by: Viresh Kumar <viresh.kumar@...aro.org>
> ---
>   rust/kernel/cpufreq.rs | 490 ++++++++++++++++++++++++++++++++++++++++-
>   1 file changed, 488 insertions(+), 2 deletions(-)
> 
> diff --git a/rust/kernel/cpufreq.rs b/rust/kernel/cpufreq.rs
> index 5e0bfd03fd30..8628f0bada02 100644
> --- a/rust/kernel/cpufreq.rs
> +++ b/rust/kernel/cpufreq.rs

<snip>

> +    /// Registers a CPU frequency driver with the cpufreq core.
> +    pub fn new() -> Result<Self> {
> +        // We can't use `&Self::VTABLE` directly because the cpufreq core modifies some fields in
> +        // the C `struct cpufreq_driver`, which requires a mutable reference.
> +        let mut drv = KBox::new(UnsafeCell::new(Self::VTABLE), GFP_KERNEL)?;

Maybe add a comment that it would be desired to make a struct cpufreq_driver 
capable of being declared as static const in the future.

Either way,

	Reviewed-by: Danilo Krummrich <dakr@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ