[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251030165115.GA1636169@bhelgaas>
Date: Thu, 30 Oct 2025 11:51:15 -0500
From: Bjorn Helgaas <helgaas@...nel.org>
To: Zhi Wang <zhiw@...dia.com>
Cc: rust-for-linux@...r.kernel.org, dakr@...nel.org, bhelgaas@...gle.com,
	kwilczynski@...nel.org, ojeda@...nel.org, alex.gaynor@...il.com,
	boqun.feng@...il.com, gary@...yguo.net, bjorn3_gh@...tonmail.com,
	lossin@...nel.org, a.hindborg@...nel.org, aliceryhl@...gle.com,
	tmgross@...ch.edu, linux-pci@...r.kernel.org,
	linux-kernel@...r.kernel.org, cjia@...dia.com, smitra@...dia.com,
	ankita@...dia.com, aniketa@...dia.com, kwankhede@...dia.com,
	targupta@...dia.com, zhiwang@...nel.org, acourbot@...dia.com,
	joelagnelf@...dia.com, jhubbard@...dia.com, markus.probst@...teo.de
Subject: Re: [PATCH v3 3/5] rust: pci: add a helper to query configuration
 space size
On Thu, Oct 30, 2025 at 03:48:40PM +0000, Zhi Wang wrote:
> Expose a safe Rust wrapper for the `cfg_size` field of `struct pci_dev`,
> allowing drivers to query the size of a device's configuration space.
> 
> This is useful for code that needs to know whether the device supports
> extended configuration space (e.g. 256 vs 4096 bytes) when accessing PCI
> configuration registers and apply runtime checks.
What is the value of knowing the config space size, as opposed to just
having config space accessors return PCIBIOS_BAD_REGISTER_NUMBER or
similar when trying to read past the implemented size?
Apart from pci-sysfs and vfio, I don't really see any drivers that use
pdev->cfg_size today.
Powered by blists - more mailing lists
 
