arm64: BTI: Decode BYTPE bits when printing PSTATE
authorDave Martin <Dave.Martin@arm.com>
Mon, 16 Mar 2020 16:50:48 +0000 (16:50 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Mon, 16 Mar 2020 17:19:49 +0000 (17:19 +0000)
commitec94a46ee7ac999b0f10f7772c40aed3f604831b
treeb3bc62ff2f4ac7d790d2aa49351795765d86e441
parentab7876a98a2160092133de4c648e94b18bc3f139
arm64: BTI: Decode BYTPE bits when printing PSTATE

The current code to print PSTATE symbolically when generating
backtraces etc., does not include the BYTPE field used by Branch
Target Identification.

So, decode BYTPE and print it too.

In the interests of human-readability, print the classes of BTI
matched.  The symbolic notation, BYTPE (PSTATE[11:10]) and
permitted classes of subsequent instruction are:

    -- (BTYPE=0b00): any insn
    jc (BTYPE=0b01): BTI jc, BTI j, BTI c, PACIxSP
    -c (BYTPE=0b10): BTI jc, BTI c, PACIxSP
    j- (BTYPE=0b11): BTI jc, BTI j

Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/process.c