From: Chris Torek <chris.torek@xxxxxxxxxxxxx> Date: Mon, 29 Dec 2008 14:55:40 -0700 > >There might be some way we can annotate the regular memcpy() > >implementations with exception handling markers, like we do > >for the user copy cases, such that they only trigger the > >alternative return value handling when a special thread local > >flag has been set. > > I thought about this, but it's ugly and creates (at least potential) > problems with recursion / interrupts. (Not sure if these are possible > in the Linux kernel organization, just "icky on general principles".) Yes, it's not very clean. > >First, if the %o7 or %i7 are inside of the function memcpy_user_stub, > >then we are doing one of these in-kernel copies that are allowed to > >fault. This elides the need for a special thread flag or anything > >like that. > > This, on the other hand, seems quite promising: as with the exception > table itself, we use the program counter (of the return address, > in this case) as the flag. > > >Then the code in do_kernel_fault() can, if it sees a "fixup" value > >with the low bit set, check %o7/%i7 for being inside range of > >memcpy_user_stub. If so, we jump to the fixup. Otherwise we > >behave as if we did not find a matching exception table entry. > > This should work really well. In the end I decided that this other approach is very ad-hoc as well. I ended up settling on something similar to your approach, and I also implemented your .fixup space optimizations. Patch series posting forthcoming... -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html