Benjamin Herrenschmidt <b...@kernel.crashing.org> wrote on 25/09/2009 11:47:34: > > On Fri, 2009-09-25 at 10:31 +0200, Joakim Tjernlund wrote: > > > > The main problem with 8xx it does not update the DAR register in > > the TLB Miss/Fault handlers for cache instructions :( It on old bug > > that was found only some years ago. > > > > I think the old comment is correct though, as I recall it was Marcelo > > that found the problem and added the workaround. > > But the TLB needs flushing on more than just the cache instructions, > no ? > > IE. We take a TLB miss, there's no valid PTE, we put one of those > "unpopulated" entries in and get into the page fault, at which point we > do a set_pte, we -still- need to do an invalidation to get rid of the > unpopulated entry so it gets a new TLB miss no ? Without that, it's just > going to fault over and over again...
I don't know enough about 8xx in 2.6 as we still use 2.4 for 8xx to say for sure. > > In any case, I think flushing unconditionally the target address isn't > going to hurt since we are just changing its PTE anyways. > > As for the DAR problem, I'm not sure whether we really need a workaround > since I haven't seem much people complaining about it so far :-) I did some years ago on 2.4 but no one cared enough :( The drawbacks of not handling this problem is that you will have to very carful to use cache instructions and user space must be especially compiled to omit using them in optimizations. > > Can you educate me more on the problem ? Can it be fixed without > bloating those handlers to oblivion ? Yes, I fixed it for myself but the fix was never accepted. Currently only TLB Error depends on DAR so what I did was to tag DAR with an impossible value and test for that value in the TLB Error handler. If it matched I branched to a subroutine the did instruction decoding in assembler to get at registers used and calculate DAR, then return to the TLB error handler. In hindsight it would have been better to do this work in handle_page_fault. I am attaching my old head_8xx.S for 2.4 Jocke (See attached file: head_8xx.S)
head_8xx.S
Description: Binary data
_______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev