SPIRE: improving dynamic binary translation through SPC-indexed indirect branch redirecting

  • Authors:
  • Ning Jia;Chun Yang;Jing Wang;Dong Tong;Keyi Wang

  • Affiliations:
  • Department of Computer Science and Technology, Peking University, Beijing, China;Department of Computer Science and Technology, Peking University, Beijing, China;Department of Computer Science and Technology, Peking University, Beijing, China;Department of Computer Science and Technology, Peking University, Beijing, China;Department of Computer Science and Technology, Peking University, Beijing, China

  • Venue:
  • Proceedings of the 9th ACM SIGPLAN/SIGOPS international conference on Virtual execution environments
  • Year:
  • 2013

Quantified Score

Hi-index 0.00

Visualization

Abstract

Dynamic binary translation system must perform an address translation for every execution of indirect branch instructions. The procedure to convert Source binary Program Counter (SPC) address to Translated Program Counter (TPC) address always takes more than 10 instructions, becoming a major source of performance overhead. This paper proposes a novel mechanism called SPc-Indexed REdirecting (SPIRE), which can significantly reduce the indirect branch handling overhead. SPIRE doesn't rely on hash lookup and address mapping table to perform address translation. It reuses the source binary code space to build a SPC-indexed redirecting table. This table can be indexed directly by SPC address without hashing. With SPIRE, the indirect branch can jump to the originally SPC address without address translation. The trampoline residing in the SPC address will redirect the control flow to related code cache. Only 2-6 instructions are needed to handle an indirect branch execution. As part of the source binary would be overwritten, a shadow page mechanism is explored to keep transparency of the corrupt source binary code page. Online profiling is adopted to reduce the memory overhead. We have implemented SPIRE on an x86 to x86 DBT system, and discussed the implementation issues on different guest and host architectures. The experiments show that, compared with hash lookup mechanism, SPIRE can reduce the performance overhead by 36.2% on average, up to 51.4%, while only 5.6% extra memory is needed. SPIRE can cooperate with other indirect branch handling mechanisms easily, and we believe the idea of SPIRE can also be applied on other occasions that need address translation.