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: <aF8hp5-e5LrHTWfT@tardis.local>
Date: Fri, 27 Jun 2025 15:56:39 -0700
From: Boqun Feng <boqun.feng@...il.com>
To: Daniel Almeida <daniel.almeida@...labora.com>
Cc: Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
	Maxime Ripard <mripard@...nel.org>,
	Thomas Zimmermann <tzimmermann@...e.de>,
	David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
	Miguel Ojeda <ojeda@...nel.org>,
	Alex Gaynor <alex.gaynor@...il.com>, Gary Guo <gary@...yguo.net>,
	Björn Roy Baron <bjorn3_gh@...tonmail.com>,
	Benno Lossin <lossin@...nel.org>,
	Andreas Hindborg <a.hindborg@...nel.org>,
	Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>,
	Danilo Krummrich <dakr@...nel.org>,
	Daniel Stone <daniels@...labora.com>, Rob Herring <robh@...nel.org>,
	Alice Ryhl <alice.ryhl@...gle.com>,
	Beata Michalska <beata.michalska@....com>,
	Carsten Haitzler <carsten.haitzler@...s.arm.com>,
	Boris Brezillon <boris.brezillon@...labora.com>,
	Ashley Smith <ashley.smith@...labora.com>,
	linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
	rust-for-linux@...r.kernel.org, kernel@...labora.com
Subject: Re: [PATCH] Introduce Tyr

On Fri, Jun 27, 2025 at 07:34:04PM -0300, Daniel Almeida wrote:
[...]
> +#[pin_data]
> +pub(crate) struct TyrData {
> +    pub(crate) pdev: ARef<platform::Device>,
> +
> +    #[pin]
> +    clks: Mutex<Clocks>,
> +
> +    #[pin]
> +    regulators: Mutex<Regulators>,
> +
> +    // Some inforation on the GPU. This is mainly queried by userspace (mesa).
> +    pub(crate) gpu_info: GpuInfo,
> +}
> +
> +unsafe impl Send for TyrData {}
> +unsafe impl Sync for TyrData {}

I think you better just mark Clk (which is just a refcount to `struct
clk`) and Regulator `Send` and `Sync`?

Then `TyrData` will be `Send` and `Sync` automatically. And the total
number of `unsafe` in this patch goes down to 1.

Regards,
Boqun

> +
[...]
> +// This can be queried by userspace to get information about the GPU.
> +#[repr(C)]
> +pub(crate) struct GpuInfo {
> +    pub(crate) gpu_id: u32,
> +    pub(crate) csf_id: u32,
> +    pub(crate) gpu_rev: u32,
> +    pub(crate) core_features: u32,
> +    pub(crate) l2_features: u32,
> +    pub(crate) tiler_features: u32,
> +    pub(crate) mem_features: u32,
> +    pub(crate) mmu_features: u32,
> +    pub(crate) thread_features: u32,
> +    pub(crate) max_threads: u32,
> +    pub(crate) thread_max_workgroup_size: u32,
> +    pub(crate) thread_max_barrier_size: u32,
> +    pub(crate) coherency_features: u32,
> +    pub(crate) texture_features: [u32; 4],
> +    pub(crate) as_present: u32,
> +    pub(crate) shader_present: u64,
> +    pub(crate) tiler_present: u64,
> +    pub(crate) l2_present: u64,
> +}
> +
[...]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ