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 96B302E2EFF; Tue, 22 Jul 2025 11:36:15 +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=1753184175; cv=none; b=bNZDAVezy98RwH96rDIsUHrZl6S6bx1Q4BVpl18pUIAWhqLEI/MhMI174FxiLRJWdm14BBkC+z+VuV14bua8SpQsjRIbtdI+hI1ECUjxdhUYq4mrAsuV9aOf+eTrJTT72iy3nyTnZTqdHwG+kuZmaLfMU3IgNAxHqYr334NO+E0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753184175; c=relaxed/simple; bh=6jt5GTK+6dNViwg0jv8XmC2xhjI3baxH4ZvaFc5mP4s=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=b3eoOocaYrcY8QeJciIk86ngYn7YHX+oFF2lX8dnjlIixhuycg96lmjDAsCNqFFmCNode8krBPPJXOaiAo2z68X9B3qA3Jkx0zGNpY95xX0HpiZPY0/i352BmcofvyBJiYmZF0GvMuDxCpGLybTfEebdf4ics4eeEofafN2SRaI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=StWvaIKB; 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="StWvaIKB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79D10C4CEEB; Tue, 22 Jul 2025 11:36:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1753184175; bh=6jt5GTK+6dNViwg0jv8XmC2xhjI3baxH4ZvaFc5mP4s=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=StWvaIKBx7VqaynVbI/AZYu1cCXsyFJRkejL4J2AtdBwwEPMzat9W0QAvS+9Mh0ei /3BwOJ+McrGyto0rwKt8CG72NBFVbZLVQYFqTSvXoWfHETVXJ+D00MGkN7FHxefHkn 7DheYPT3W5Jy4AKGs9gekdZlz4LTxboWrqKS8a2KVx6I9HR/XFvSDv/gZ5NcZ12Vp0 jEHB/cfAN/0moVw5FGPsOlsTQh9YsEpY9uk8pJl2BXPgNX2XWwnzmyzcpfrEIvXeiW eR1UdYPwjd8VmOiDJ8ALnaDXoqpKNt+dvjlp/heCDnyKK/lqcFY44fLaTruWHQFcKv Mhf5hzPoS/Ltw== Message-ID: Date: Tue, 22 Jul 2025 13:36:09 +0200 Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/2] rust: Update PCI binding safety comments and add inline compiler hint To: Benno Lossin Cc: Alistair Popple , rust-for-linux@vger.kernel.org, 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 , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org References: <20250710022415.923972-1-apopple@nvidia.com> From: Danilo Krummrich Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/22/25 1:21 PM, Benno Lossin wrote: > On Tue Jul 22, 2025 at 1:02 PM CEST, Danilo Krummrich wrote: >> On 7/22/25 12:57 PM, Benno Lossin wrote: >>> 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 worst >>>> 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: >> >> It is used for for FFI calls and to access fields of the underlying >> struct pci_dev. > > By "access fields" you mean read-only? We might also write them, but currently we only write them through FFI calls on the C side.