]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
objtool,x86: Support %riz encodings
authorPeter Zijlstra <peterz@infradead.org>
Wed, 10 Feb 2021 10:47:35 +0000 (11:47 +0100)
committerIngo Molnar <mingo@kernel.org>
Sat, 6 Mar 2021 11:44:23 +0000 (12:44 +0100)
commit78df6245c3c82484200b9f8e306dc86fb19e9c02
tree1110853d3eb012b4e101a0a892226c4cf2757c8d
parent16ef7f159c503c7befec7018ee0e82fdc311721e
objtool,x86: Support %riz encodings

When there's a SIB byte, the register otherwise denoted by r/m will
then be denoted by SIB.base REX.b will now extend this. SIB.index == SP
is magic and notes an index value zero.

This means that there's a bunch of alternative (longer) encodings for
the same thing. Eg. 'ModRM.mod != 3, ModRM.r/m = AX' can be encoded as
'ModRM.mod != 3, ModRM.r/m = SP, SIB.base = AX, SIB.index = SP' which is actually 4
different encodings because the value of SIB.scale is irrelevant,
giving rise to 5 different but equal encodings.

Support these encodings and clean up the SIB handling in general.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Link: https://lkml.kernel.org/r/20210211173627.472967498@infradead.org
tools/objtool/arch/x86/decode.c