Next steps for pci-rework branches
mailinglists at erwinrol.com
Sun Aug 13 06:42:12 PDT 2006
On Sat, 2006-08-12 at 23:43 +0200, Mark Kettenis wrote:
> > 4. Replace any calls to the old PCI accessor routines (e.g.,
> > pciReadLong, xf86MapPciMem, etc.) with calls to the new accessor
> > routines. The APIs are similar, but there are some differences. The
> > biggest difference, which bit me during the Savage driver conversion, is
> > that the new routines only allow an entire BAR to be mapped, whereas the
> > old routines allowed subranges of a BAR to be mapped. I suggest
> > converting subrange mappings to full BAR mappings *before* converting to
> > the new interfaces. This is the approach that I took with the Savage
> > driver.
> Sorry to bring this up again, but this means that the libpciaccess API
> is *broken*. There needs to be an interface for subrange
> mappings. Since:
> 1. Mappings can take up valueable resource in the kernel.
Doesn't mapping several small regions instead of one big region take up
more resources ?
> 2. Mapping the whole BAR might expose "dangerous" registers that could
> be accidentally (or on purpose by a malicious attacker) accessed.
> It's much better to not map these registers in the first place.
If the library can map them, anything else can map them too. So if your
x-server/driver gets hacked it doesn't help you at all when only "safe"
registers are mapped.
More information about the xorg