[parisc-linux] The problem on the PA8800 is all in the data-cache.
James Bottomley
James.Bottomley at SteelEye.com
Wed Jul 26 15:54:39 MDT 2006
On Tue, 2006-07-25 at 16:02 -0600, Grant Grundler wrote:
> You misheard. I'll be poking at this again in the near future.
> I've gotten the code to modify diag registers done.
> I just need to test the L2 disable and write a wrapper that
> does the necessary I/D cache flushing.
Actually, I found a different way to prove the theory.
In linux, we're careful about sequential accesses to memory (i.e. only
the user or the kernel may touch a page) to avoid the dirty line
aliasing which bites on all architectures. However, the kernel takes
this care in almost every place, principally because we don't
necessarily know if the user line is dirty or not. Thus it's possible
to use this guarantee to make the kernel fully equivalently mapped.
The primary engine of this guarantee is the kmap/kunmap (also _atomic).
When we come into a kmap region, we're guaranteed that the user mappings
have been flushed, so really all we have to do is flush the kernel
mappings when we leave.
This flush kernel mapping is a simple two line addition to highmem.h and
with it (as demonstration code), the pa8800 works reliably.
This fix is a gross O(1) one. There will still be O(2) regions where
this guarantee needs to be fixed up independent of kmap/kunmap.
However, the O(1) fix gets pa8800 to the point where sshd works and we
get only the occasional segfault (I've only found one so far in an hour
of stress testing).
The other thing that will be contributing to O(2) effects is cache
movein. Even though we flush the page, the CPU is entitled to move it
back into cache if it finds a TLB entry, so we have to begin purging the
TLB entries as we do this as well.
The final problem (once we have the O(2) effects all sorted) will be to
get this upstream. The kmap API is supposed not to care about coherence
effects, now I'm making it, so I can sell this to the arch maintainers
as eliminating a lot of the kmap/flush_kernel_dcache_page/kunmap that we
do today ... I hope.
James
More information about the parisc-linux
mailing list