Add initial support for analyzing AMDGPU binaries (#900) master
authorbbiiggppiigg <bbiiggppiigg@gmail.com>
Tue, 24 Nov 2020 05:28:27 +0000 (05:28 +0000)
committerGitHub <noreply@github.com>
Tue, 24 Nov 2020 05:28:27 +0000 (23:28 -0600)
commit40f9295af0666d7eed13f8c69236ae24e77969c1
treefd176d698cf5f7528583d02804cc4ba2d731d873
parent6266e1a9def4ee4157d3b0228380cfbb8095d669
Add initial support for analyzing AMDGPU binaries (#900)

* remove unnecessary assertion for unknown phdr_type

* add initial stubs for amdgpu support

* add formatters for amdgpu

* add opcode table and register definition

* added support for register vector

* add untracked files

* commit stubs for xiaozhu to see

* initial cfg traversal done

* remove unused register-pair related files

* remove symbol patching since the 256 byte function header is no longer there

* Do not assert in getBaseRegister

* fix instruction length detection and decoding logic

* now decode will only decode operands for branch instructions

* added basic support for amdgpu in rose

* merged upstream

* fix a bug where we decode the vdst as ssrc

* improve the logic for computing len of instructions that might make use of literals, such that we no longer need to pass the buffer all over the place

* fix undefined behavior for std::transform

* Remove empty code blocks/Unreachable code/Unneeded
Comment out dead code
Restore sym_debug_parsing to default value 0

* Added meaningful name and comments to function prototype of getAMDGPURoseRegisters
Remove duplicate public modifiers in class declaration.

* remove unnecessary include of boost/format.hpp

* remove all amdgpu related stuff in dataflowAPI, and patched indirect analyzer so it skips for amdgpu

* renaming Arch_amdgpu to Arch_amdgpu_vega

* make changes to use namespace amdgpu_vega instead of amdgpu

* change the naming of c_NonReturnInsn to c_GPUKernelExitInsn as suggested

Co-authored-by: Xiaozhu Meng <mxz297@gmail.com>
49 files changed:
common/h/amdgpu_op_table.h [new file with mode: 0644]
common/h/amdgpu_vega_sys_regs.h [new file with mode: 0644]
common/h/dyn_regs.h
common/h/entryIDs.h
common/src/dyn_regs.C
dataflowAPI/rose/conversions.h
dataflowAPI/rose/semantics/Registers.C
dataflowAPI/src/AbslocInterface.C
dataflowAPI/src/ExpressionConversionVisitor.C
dataflowAPI/src/RoseInsnFactory.C
dataflowAPI/src/RoseInsnFactory.h
dataflowAPI/src/SymEval.C
dataflowAPI/src/SymbolicExpansion.C
dataflowAPI/src/SymbolicExpansion.h
dataflowAPI/src/convertOpcodes.C
dwarf/src/dwarfHandle.C
elf/src/Elf_X.C
external/rose/amdgpuInstructionEnum.h [new file with mode: 0644]
external/rose/rose-compat.h
instructionAPI/CMakeLists.txt
instructionAPI/h/ArchSpecificFormatters.h
instructionAPI/h/BinaryFunction.h
instructionAPI/h/Instruction.h
instructionAPI/h/InstructionCategories.h
instructionAPI/h/Operation_impl.h
instructionAPI/h/Ternary.h [new file with mode: 0644]
instructionAPI/src/ArchSpecificFormatters.C
instructionAPI/src/Expression.C
instructionAPI/src/Instruction.C
instructionAPI/src/InstructionCategories.C
instructionAPI/src/InstructionDecoder-amdgpu-vega.C [new file with mode: 0644]
instructionAPI/src/InstructionDecoder-amdgpu-vega.h [new file with mode: 0644]
instructionAPI/src/InstructionDecoderImpl.C
instructionAPI/src/InstructionDecoderImpl.h
instructionAPI/src/Register.C
instructionAPI/src/Ternary.C [new file with mode: 0644]
instructionAPI/src/amdgpu_branchinsn_table.h [new file with mode: 0644]
instructionAPI/src/amdgpu_decoder_impl_vega.C [new file with mode: 0644]
instructionAPI/src/amdgpu_decoder_impl_vega.h [new file with mode: 0644]
instructionAPI/src/amdgpu_insn_entry.h [new file with mode: 0644]
instructionAPI/src/amdgpu_opcode_tables.C [new file with mode: 0644]
parseAPI/CMakeLists.txt
parseAPI/src/IA_IAPI.C
parseAPI/src/IA_amdgpu.C [new file with mode: 0644]
parseAPI/src/IA_amdgpu.h [new file with mode: 0644]
parseAPI/src/IndirectAnalyzer.C
parseAPI/src/Parser.C
parseAPI/src/SymbolicExpression.C
proccontrol/src/process.C