HomePhabricator

[cfi-verify] Support AArch64.
Audit RequiredrL337007

Description

[cfi-verify] Support AArch64.

This patch adds support for AArch64 to cfi-verify.

This required three changes to cfi-verify. First, it generalizes checking if an instruction is a trap by adding a new isTrap flag to TableGen (and defining it for x86 and AArch64). Second, the code that ensures that the operand register is not clobbered between the CFI check and the indirect call needs to allow a single dereference (in x86 this happens as part of the jump instruction). Third, we needed to ensure that return instructions are not counted as indirect branches. Technically, returns are indirect branches and can be covered by CFI, but LLVM's forward-edge CFI does not protect them, and x86 does not consider them, so we keep that behavior.

In addition, we had to improve AArch64's code to evaluate the branch target of a MCInst to handle calls where the destination is not the first operand (which it often is not).

Differential Revision: https://reviews.llvm.org/D48836

Details

Auditors
grosbach
Committed
jgalensonJul 13 2018, 8:19 AM
Differential Revision
D48836: [cfi-verify] Support AArch64.
Parents
rL337006: [json, test] Fix the json.td test - the path to python could contain spaces
Branches
Unknown
Tags
Unknown