Skip to contentSkip to conversation

x86/kgdb: Allow removal of early BPs]

PATCH Sumit Garg 1 participant 1 message Feb 17, 2021 1 message not in the archive

lore
Share & tools
lore

Sumit Garg

author
#1 lore raw
In reply to a message not in the archive

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_breakpoint handled this case gracefully by just having copy_to_kernel_nofault fail but if one then calls text_poke_kgdb the system dies due to the BUG_ON we moved out of __text_poke. To avoid this __text_poke now 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