• Maneesh Soni's avatar
    MIPS Kprobes: Refactor branch emulation · d8d4e3ae
    Maneesh Soni authored
    This patch refactors MIPS branch emulation code so as to allow skipping
    delay slot instruction in case of branch likely instructions when branch is
    not taken. This is useful for keeping the code common for use cases like
    kprobes where one would like to handle the branch instructions keeping the
    delay slot instuction also in picture for branch likely instructions. Also
    allow emulation when instruction to be decoded is not at pt_regs->cp0_epc
    as in case of kprobes where pt_regs->cp0_epc points to the breakpoint
    instruction.
    
    The patch also exports the function for modules.
    Signed-off-by: default avatarManeesh Soni <manesoni@cisco.com>
    Signed-off-by: default avatarVictor Kamensky <kamensky@cisco.com>
    Cc: David Daney <david.daney@cavium.com>
    Cc: ananth@in.ibm.com
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/2913/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
    d8d4e3ae
cp1emu.c 31.3 KB