TY - GEN
T1 - Efficient LLVM-based dynamic binary translation
AU - Engelke, Alexis
AU - Okwieka, Dominik
AU - Schulz, Martin
N1 - Publisher Copyright:
© 2021 ACM.
PY - 2021/4/16
Y1 - 2021/4/16
N2 - Emulation of other or newer processor architectures is necessary for a wide variety of use cases, from ensuring compatibility to offering a vehicle for computer architecture research. This problem is usually approached using dynamic binary translation, where machine code is translated, on the fly, to the host architecture during program execution. Existing systems, like QEMU, usually focus on translation performance rather than the overall program execution, and extensions, like HQEMU, are limited by their underlying implementation. Conversely, performance-focused systems are typically used for binary instrumentation. E.g., DynamoRIO reuses original instructions where possible, while Instrew utilizes the LLVM compiler infrastructure, but only supports same-Architecture code generation. In this short paper, we generalize Instrew to support different guest and host architectures by refactoring the lifter and by implementing target-independent optimizations to re-use host hardware features for emulated code. We demonstrate this flexibility by adding support for RISC-V as guest architecture and AArch64 as host architecture. Our performance results on SPEC CPU2017 show significant improvements compared to QEMU, HQEMU as well as the original Instrew.
AB - Emulation of other or newer processor architectures is necessary for a wide variety of use cases, from ensuring compatibility to offering a vehicle for computer architecture research. This problem is usually approached using dynamic binary translation, where machine code is translated, on the fly, to the host architecture during program execution. Existing systems, like QEMU, usually focus on translation performance rather than the overall program execution, and extensions, like HQEMU, are limited by their underlying implementation. Conversely, performance-focused systems are typically used for binary instrumentation. E.g., DynamoRIO reuses original instructions where possible, while Instrew utilizes the LLVM compiler infrastructure, but only supports same-Architecture code generation. In this short paper, we generalize Instrew to support different guest and host architectures by refactoring the lifter and by implementing target-independent optimizations to re-use host hardware features for emulated code. We demonstrate this flexibility by adding support for RISC-V as guest architecture and AArch64 as host architecture. Our performance results on SPEC CPU2017 show significant improvements compared to QEMU, HQEMU as well as the original Instrew.
KW - Architecture Simulation
KW - Dynamic Binary Translation
KW - LLVM
KW - Optimization
KW - RISC-V
UR - http://www.scopus.com/inward/record.url?scp=85104609945&partnerID=8YFLogxK
U2 - 10.1145/3453933.3454022
DO - 10.1145/3453933.3454022
M3 - Conference contribution
AN - SCOPUS:85104609945
T3 - VEE 2021 - Proceedings of the 17th ACM SIGPLAN/SIGOPS International Conference on Virtual Execution Environments
SP - 165
EP - 171
BT - VEE 2021 - Proceedings of the 17th ACM SIGPLAN/SIGOPS International Conference on Virtual Execution Environments
A2 - Titzer, Ben L.
A2 - Xu, Harry
A2 - Zhang, Irene
PB - Association for Computing Machinery, Inc
T2 - 17th ACM SIGPLAN/SIGOPS International Conference on Virtual Execution Environments, VEE 2021
Y2 - 16 April 2021 through 16 April 2021
ER -