From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 18BE0C5AD46 for ; Fri, 20 Feb 2026 17:51:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5A50010E827; Fri, 20 Feb 2026 17:51:28 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="ogMLxT4f"; dkim-atps=neutral Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id 185D510E827 for ; Fri, 20 Feb 2026 17:51:26 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 59C806183A for ; Fri, 20 Feb 2026 17:51:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24AA5C19421 for ; Fri, 20 Feb 2026 17:51:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771609885; bh=LCZsbY0WlkLDQaB+g3+Nolk280ujbFsPA+yQ4pCMsbQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ogMLxT4fZDIGFz9T/q1fVk1xsqCLg7tuOxY0rcVuLkCjEG7zOjZaWVrBOSWJ1QcY+ ctyFHL1ed8ZGNkOShwM6jUeq/i5Mr2NSGw/d3iHKbRvDjYN8olL3xDUnjQA/2nIDDa WLlq2vxK1I50F4iJaPRoXU2UzPQmLQJgKY63W/nHdsJ7gKsjs4ZDhTgsiuydRl+mae pXtK0Ng25A6oXSizGr2uz90pVVIQey7vfDZ9AnI9kXcIblN/xyljgOxgBvdOfpYJwL Uv9Q37Hh9G4yDpza8wDS9GWvbl1Ulz9veM8yBxM6CE8V43IQaV6WIwyVyl+uJgpVSA tcIk/S0il7niA== Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-3870d178a9aso19722641fa.0 for ; Fri, 20 Feb 2026 09:51:25 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWE7aaQ8tuYLXR8x1yA4N/QVN+y4+WEmGovfRjDrMxRwBpalNG/WgeLAy9yZ3oLLhTlpX0NTPPESCo=@lists.freedesktop.org X-Gm-Message-State: AOJu0Yx8Xb29KNRxZpAayeQ2AvFKNrMQbBxfZBviYoo15cjwvlHzG6on IU4nFFsdXuhmMlK5ClQ4qg1eL18LZdoXa+XSWlXSFdDO6o6adWM4lr9Avc93cCyGQIHbxhdTLPx N+0W30ezi3UhIDQMpjHS3LJw2/vpUVf0= X-Received: by 2002:a2e:be1a:0:b0:383:24fe:4eaf with SMTP id 38308e7fff4ca-389a5de4d48mr1328121fa.30.1771609883065; Fri, 20 Feb 2026 09:51:23 -0800 (PST) MIME-Version: 1.0 References: <20260220-unique-ref-v15-0-893ed86b06cc@kernel.org> <20260220-unique-ref-v15-9-893ed86b06cc@kernel.org> In-Reply-To: From: Tamir Duberstein Date: Fri, 20 Feb 2026 12:50:46 -0500 X-Gmail-Original-Message-ID: X-Gm-Features: AaiRm50BHJk8sWqZZGVukWMOtaBDUYkSm_Z-CQij1pvKGbmHOip5UB_YSDsNkM0 Message-ID: Subject: Re: [PATCH v15 9/9] rust: page: add `from_raw()` To: Miguel Ojeda Cc: Andreas Hindborg , Benno Lossin , Miguel Ojeda , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Alice Ryhl , Trevor Gross , Danilo Krummrich , Greg Kroah-Hartman , Dave Ertman , Ira Weiny , Leon Romanovsky , Paul Moore , Serge Hallyn , "Rafael J. Wysocki" , David Airlie , Simona Vetter , Alexander Viro , Christian Brauner , Jan Kara , Igor Korotin , Daniel Almeida , Lorenzo Stoakes , "Liam R. Howlett" , Viresh Kumar , Nishanth Menon , Stephen Boyd , Bjorn Helgaas , =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= , Boqun Feng , linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-block@vger.kernel.org, linux-security-module@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-pm@vger.kernel.org, linux-pci@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Fri, Feb 20, 2026 at 12:34=E2=80=AFPM Miguel Ojeda wrote: > > On Fri, Feb 20, 2026 at 10:52=E2=80=AFAM Andreas Hindborg wrote: > > > > + /// Create a `&Page` from a raw `struct page` pointer > > Please end sentences with a period. > > > + // SAFETY: By function safety requirements, ptr is not null an= d is > > Please use Markdown in comments: `ptr`. > > > + /// `ptr` must be valid for use as a reference for the duration of= `'a`. > > Since we will likely try to starting introducing at least a subset of > the Safety Standard soon, we should try to use standard terms. > > So I think this "valid for use as a reference" is not an established > one, no? Isn't "convertible to a shared reference" the official term? > > https://doc.rust-lang.org/std/ptr/index.html#pointer-to-reference-conve= rsion > > In fact, I see `as_ref_unchecked()` and `as_mut_unchecked()` just got > stabilized for 1.95.0, so we should probably starting using those were > applicable as we bump the minimum, but we should probably use already > a similar wording as the standard library for the safety section and > the comment: > > "`ptr` must be [convertible to a reference](...)." > > where the term is a link to that section. Cc'ing Benno. > > I have created a (future) issue for that: > > https://github.com/Rust-for-Linux/linux/issues/1225 > > Cc'ing Tamir since this is close to the cast work, so it may interest > him as well. Thanks Miguel -- FWIW there's no current cast work on my plate, I believe everything was merged except for provenance which was a bit too hard to work with given MSRV.