tech-kern archive

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

Re: RFC: New bus_space routine: bus_space_sync

On Thu, Jan 19, 2012 at 10:59:01AM -0800, Matt Thomas wrote:
> For prefetchable regions (like framebuffers) mapped by bus_space_map,
> there is a need to able force the contents out of the cache back into
> memory (especially when the cache is a writeback cache).

Don't some ethernet drivers already have to do this - for systems
where the cpu's cache isn't snooped by the dma accesses.

There is subtle difference as to whether would need an 'invalidate'
the cache line (with or without a writeback).

The (old) BUS_SPACE(9) page I've got does mention the difference
between 'ordering' and 'completion' barriers - noting that a
completion barrier may take 'hundreds of cycles'.

'Interestingly' is suggests that cacheable maps will 'only be useful in
very rare occasions'.

There is another lurking problem I see. Some memory accesses on
cached memory will cause some cpu to prefretch the next cache line.
Code trying to have full control over cache line reads (eg descriptors)
will need to invalidate cache lines it hasn't actually read!



David Laight:

Home | Main Index | Thread Index | Old Index