Re: [RFC PATCH 2/4] powerpc: kprobe: add arch specific blacklist
From: Naveen N. Rao <hidden>
Date: 2016-11-18 11:22:28
On 2016/11/18 04:48PM, Michael Ellerman wrote:
"Naveen N. Rao" [off-list ref] writes:quoted
Add symbol to mark end of entry_*.S and use the same to blacklist all addresses from kernel start (_stext) to entry code from kprobes. Much of this code is early exception handling where we can't really take a trap.I'm not sure about this. entry_*.S is actually a bit of jumble, especially the 64bit version. I've been wanting to split it up for a long time.
Ok. Let me take a stab at that.
It doesn't actually contain any early exception handling. It does contain the common syscall handler, and the exception return paths, some of which should be black listed. And lots of other junk. Also I'm not sure if it's guaranteed that there won't be other code between _stext and the end of entry, it's not handled explicitly in the linker script, it just tends to get linked early because it's in head-y.
I actually considered that. One of the issues in trying to get entry_* linked in early has to do with the exception common handlers - they start at 0x7000 or 0x8000 and are placed in .text *and* I think they need to be within 64k from the exception vectors. As such, placing entry_* in a separate section and linking it after HEAD_TEXT resulted in moving down the common exception handlers. Regardless of the kprobe blacklist, does it make sense to put the common exception handlers into a separate section so as to separate them out from the rest of the code?
So I think it would be better if we had a clearer picture of exactly what in this file we want to blacklist.
Agreed. As a first step, I wanted to get a coarser blacklist in place and fine tune it later. But, I can see why entry_* needs a smaller blacklist. I'll get back on this. - Naveen