Re: [PATCH] rust: pci: add resource_flags accessor

From: Alexandre Courbot

Date: Fri Sep 11 2026 - 08:46:31 EST


On Tue Sep 8, 2026 at 4:51 PM JST, Eliot Courtney wrote:
> From: Joel Fernandes <joelagnelf@xxxxxxxxxx>
>
> Add a `Device::resource_flags()` method to the PCI Rust abstraction,
> wrapping the C-side static inline `pci_resource_flags()`.
>
> The flags returned correspond to the `IORESOURCE` bitmask carried by a
> PCI BAR's `struct resource`.
>
> The immediate motivation is BAR layout discovery on NVIDIA GPUs: a
> 64-bit BAR consumes two consecutive Linux PCI resource slots (the lower
> 32 bits at index N and the upper 32 bits at index N+1, with the latter
> having no flags or size of its own).
>
> Signed-off-by: Joel Fernandes <joelagnelf@xxxxxxxxxx>
> Signed-off-by: Eliot Courtney <ecourtney@xxxxxxxxxx>

Reviewed-by: Alexandre Courbot <acourbot@xxxxxxxxxx>