x86/kgdb: Allow removal of early BPs]
Hi Peter,
Quoted 9 lines · Stefan Saecherl
Quoted 7 lines
One thing to consider when doing this is that code can go away during boot (e.g. .init.text). Previously
kgdb_arch_remove_breakpointhandled this case gracefully by just havingcopy_to_kernel_nofaultfail but if one then callstext_poke_kgdbthe system dies due to theBUG_ONwe moved out of__text_poke. To avoid this__text_pokenow returns an error in case of a nonpresent code page and the error is handled at call site.
Quoted 5 lines
So what if the page is reused and now exists again?
We keep track of the init state, how about you look at that and not poke at .init.text after it's freed instead?
Makes sense. I'll see if I can patch the debug core to get an architecture neutral fix for this.
-Sumit