From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1FA3D23814A; Tue, 22 Jul 2025 10:57:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753181870; cv=none; b=GQe//jTxpGWSFtB7YnjvotfXlFansQzmDLRcOezIThRJppXYNrUPjEfFqwitZobNVZwMv28VZ6deGc4iKGBYk18+ytFP2280YxR/ChWdEASW2jWquJP8rWUD1bwLPVoE1HSadMYs8M6vkdulnJVhiUuNvRH4gtq9r1daHMZ6OMQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753181870; c=relaxed/simple; bh=JCaLeIkKYK9vcbF9x+dxX58Uyp9vdXBja1Yl/fWoVKQ=; h=Mime-Version:Content-Type:Date:Message-Id:To:Cc:Subject:From: References:In-Reply-To; b=BihDN9qqiJUeQe9ZbAp3yyrf8sGIX+qOkQycS1ytBUwXYT+1+AlHkDkadW61wygLgmfW4mykBQzNN6Cjr3wbWCuIhkbD8HFF9pH1t+vuNS1qWMhELjktG3rTJurlCb7mkpgzL2eszLWyzI9I6eZZ1oo1lRHSWJgbfxnTGZTXt68= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=E5wo7gFe; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="E5wo7gFe" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2DBE2C4CEEB; Tue, 22 Jul 2025 10:57:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1753181869; bh=JCaLeIkKYK9vcbF9x+dxX58Uyp9vdXBja1Yl/fWoVKQ=; h=Date:To:Cc:Subject:From:References:In-Reply-To:From; b=E5wo7gFeqU5eoDBAU65ptshD7sV+bSsePDzQdltC/n2smvy1hlcz+vAmBf+7MV95G IMmi9coX+O3sBMRUtC8OMphvG/jQoQppTM6cXKJKn+V2oAduANUu8ajr74yv29O7P4 0RyafTOhC9kjR8gyKXEdPT+JcNLuoHtyAGSJEGmtXiyCm/u6Mez6VYJL2d3mPmASEH V7RoSb1EN4RyGOXX5taSRMKmsCpPq+4hbRkb02qzaQqwi6meihFzvkwQa3y2bWXIiA A8Zk3rZ8HlJAifGTlSG0hKWOyW6MQ/W0lHBGX7ytRl4bwkSJdqSLQ5AprAdnIvsIO5 0Zcz8TEqKyx8g== Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 22 Jul 2025 12:57:44 +0200 Message-Id: To: "Danilo Krummrich" , "Alistair Popple" Cc: , "Bjorn Helgaas" , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , "Miguel Ojeda" , "Alex Gaynor" , "Boqun Feng" , "Gary Guo" , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , "Andreas Hindborg" , "Alice Ryhl" , "Trevor Gross" , "Greg Kroah-Hartman" , "Rafael J. Wysocki" , "John Hubbard" , "Alexandre Courbot" , , Subject: Re: [PATCH v2 1/2] rust: Update PCI binding safety comments and add inline compiler hint From: "Benno Lossin" X-Mailer: aerc 0.20.1 References: <20250710022415.923972-1-apopple@nvidia.com> In-Reply-To: On Tue Jul 22, 2025 at 11:51 AM CEST, Danilo Krummrich wrote: > I think they're good, but we're pretty late in the cycle now. That should= be > fine though, we can probably take them through the nova tree, or in the w= orst > case share a tag, if needed. > > Given that, it would probably be good to add the Guarantee section on as_= raw(), > as proposed by Benno, right away. > > @Benno: Any proposal on what this section should say? At a minimum I'd say "The returned pointer is valid.", but that doesn't really say for what it's valid... AFAIK you're mostly using this pointer to pass it to the C side, in that case, how about: /// # Guarantees /// /// The returned pointer is valid for reads and writes from the C side = for as long as `self` exists. Maybe we need to change it a bit more, but let's just start with this. (If you're also using the pointer from Rust, then we need to make changes) --- Cheers, Benno