Re: [PATCH v3 1/5] rust: io: factor common I/O helpers into Io trait
From: Danilo Krummrich
Date: Fri Oct 31 2025 - 08:55:57 EST
On Fri Oct 31, 2025 at 1:48 PM CET, Zhi Wang wrote:
> Yeah, I actually tried that in an earlier version.
> I noticed that each backend is a bit different — for example, the PCI
> config space routines don’t have read64()/write64() either.
We can split it up in multiple traits if necessary, e.g. have a separate trait
for 64 bit operations.
> By
> design, we don’t provide infallible versions for the PCI config space
> backend (unlike the MMIO one). Other backends might have similar cases
> as well.
That seems wrong: For the PCI configuration space we can almost always do
infallibe range checks, i.e. the normal range is always guaranteed and extended
can be asserted as described in [1].
[1] https://lore.kernel.org/lkml/DDWINZJUGVQ8.POKS7A6ZSRFK@xxxxxxxxxx/