tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bus_space_physload(9)

On Fri, 26 Mar 2010, Masao Uebayashi wrote:

> This is the list of updated functions:
>       /* register device memory as part of system memory */
>       void *bus_space_physload(bus_space_tag_t space, bus_addr_t addr,
>           bus_size_t size);
>       void bus_space_physunload(void *physseg);
>       /* register device region as user-mappable managed region */
>       void *bus_space_physload_device(bus_space_tag_t space, bus_addr_t addr,
>           bus_size_t size, int prot, int flags);
>       void bus_space_physunload_device(void *physseg);
> I've not considered the "memory" one very much.  It needs more thought...

I'm not convinced that handing device pages off to the VM subsystem is the 
correct approcach.  That makes the assumption that all physical address 
space is equivalent and you don't have to worry about caches or 
sideffects, which the MMU needs to be informed about in some architectures 
or you get all sorts of nasty effects such as data corruption or data 

I think a better design woult be to have the device driver provide a 
routine UVM calls to enter and remove individual pages from the pmap.  
That way you can do device or specific things such as setting the 
non-cacheable or write-only bit on the TTE.  


Home | Main Index | Thread Index | Old Index