• Mark Rutland's avatar
    arm64: insn: simplify insn group identification · 4488f90c
    Mark Rutland authored
    The only code which needs to check for an entire instruction group is
    the aarch64_insn_is_steppable() helper function used by kprobes, which
    must not be instrumented, and only needs to check for the "Branch,
    exception generation and system instructions" class.
    
    Currently we have an out-of-line helper in insn.c which must be marked
    as __kprobes, which indexes a table with some bits extracted from the
    instruction. In aarch64_insn_is_steppable() we then need to compare the
    result with an expected enum value.
    
    It would be simpler to have a predicate for this, as with the other
    aarch64_insn_is_*() helpers, which would be always inlined to prevent
    inadvertent instrumentation, and would permit better code generation.
    
    This patch adds a predicate function for this instruction group using
    the existing __AARCH64_INSN_FUNCS() helpers, and removes the existing
    out-of-line helper. As the only class we currently care about is the
    branch+exception+sys class, I have only added helpers for this, and left
    the other classes unimplemented for now.
    
    There should be no functional change as a result of this patch.
    Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Joey Gouly <joey.gouly@arm.com>
    Cc: Will Deacon <will@kernel.org>
    Reviewed-by: default avatarJoey Gouly <joey.gouly@arm.com>
    Link: https://lore.kernel.org/r/20221114135928.3000571-4-mark.rutland@arm.comSigned-off-by: default avatarWill Deacon <will@kernel.org>
    4488f90c
decode-insn.c 4.98 KB