Dynamic Binary Translation (DBT) is a key enabler for cross-ISA emulation, system virtualization, runtime instrumentation, and many other important applications. Among several critical requirements for DBT, it is important to provide equivalent semantics for atomic synchronization instructions such as Load - Link / Store - Conditional (LL/SC), which are mostly included in the reduced-instruction set architectures (RISC) and Compare-and-Swap(CAS), which is mostly in the complex instruction set architectures (CISC). However, the state-of-the-art DBT tools often do not provide a fully correct translation of these atomic instructions, in particular, from RISC atomic instructions (i.e. LL/SC) to CISC atomic instructions (i.e. CAS), due to performance concerns. As a result, some may cause the well-known ABA problem, which could lead to wrong results or program crashes. In our experimental studies on QEMU, a state-of-the-art DBT, that runs multi-threaded lock-free stack operations implemented with ARM instruction set (i.e. using LL/SC) on Intel x86 platforms (i.e. using CAS), it often crashes within 2 seconds. Although attempts have been made to provide correct emulation for such atomic instructions, they either result in heavy execution overheads or require additional hardware support. In this paper, we propose several schemes to address those issues and implement them on QEMU to evaluate their performance overheads. The results show that all of the proposed schemes can provide correct emulation and, for the best solution, can achieve a min, max, geomean speedup of 1.25x, 3.21x, 2.03x respectively, over the best existing software-based scheme.
|Original language||English (US)|
|Title of host publication||CGO 2021 - Proceedings of the 2021 IEEE/ACM International Symposium on Code Generation and Optimization|
|Editors||Jae W. Lee, Mary Lou Soffa, Ayal Zaks|
|Publisher||Institute of Electrical and Electronics Engineers Inc.|
|Number of pages||12|
|State||Published - Feb 27 2021|
|Event||19th IEEE/ACM International Symposium on Code Generation and Optimization, CGO 2021 - Virtual, Korea, Korea, Republic of|
Duration: Feb 27 2021 → Mar 3 2021
|Name||CGO 2021 - Proceedings of the 2021 IEEE/ACM International Symposium on Code Generation and Optimization|
|Conference||19th IEEE/ACM International Symposium on Code Generation and Optimization, CGO 2021|
|Country/Territory||Korea, Republic of|
|Period||2/27/21 → 3/3/21|
Bibliographical notePublisher Copyright:
© 2021 IEEE.
- Dynamic Binary Translation