On Thu, Nov 26, 2020 at 05:25:52PM +0800, Jason Wang wrote:
This patch tries to convert the modern device to use devres to manageI think the point of mapping capability was e.g. for devices with
its resources (iomaps). Before this patch the IO address is mapped
individually according to the capability. After this patch, we simply
map the whole BAR.
huge BARs. We don't want to waste virtual memory for e.g. 32 bit guests.
And in particular the spec says:
The drivers SHOULD only map part of configuration structure large enough for device operation. The drivers
MUST handle an unexpectedly large length, but MAY check that length is large enough for device operation.
I also wonder how would this interact with cases where device memory is
mapped for different reasons, such as for MSI table access, into userspace
as it has resources such as virtio mem, etc.
E.g. don't e.g. intel CPUs disallow mapping the same address twice
with different attributes?