Following a suggestion from Nicolas I have implemented table driven decoding of CPU instructions in kprobes. This is an alternative to the mass of if/else code in the original kprobes implementation. Also, by making the register usage in emulation code completely uniform, emulation functions can be more widely reused and all the separate prep_emulate_xxx functions unnecessary.
All of infrastructure for this is in patch 1, and I am looking for feedback on this.
I've also added a second patch which shows how this infrastructure is used to implement decoding and emulation of all the 32-bit Thumb instructions.