On Thu, Sep 30, 2021 at 10:17:09AM -0700, Andi Kleen wrote:
Are any of them in the kernel today?While overall it's a small percentage of the total, there are still quite aThe "it" that I referred to is the claim that no driver should beAndi is wrong.
touching hardware in their module init call. Andi seems to think
such drivers are worth working around with a special remap API.
few drivers that do touch hardware in init functions. Sometimes for good
reasons -- they need to do some extra probing to discover something that is
not enumerated -- sometimes just because it's very old legacy code that
predates the modern driver model.
PCI drivers should not be messing with this, we have had well over a
decade to fix that up.
The legacy drivers could be fixed, but nobody really wants to touch themPointers to them?
anymore and they're impossible to test.
The drivers that probe something that is not enumerated in a standard wayPCI devices are not enumerated in a standard way???
have no choice, it cannot be implemented in a different way.
So instead we're using a "firewall" the prevents these drivers from doingThat's horrible, don't try to protect the kernel from itself. Just fix
bad things by not allowing ioremap access unless opted in, and also do some
filtering on the IO ports The device filter is still the primary mechanism,
the ioremap filtering is just belts and suspenders for those odd cases.
the drivers.