高级检索

    一种高效解决间接转移的反馈式静态二进制翻译方法

    An Efficient Feedback Static Binary Translator for Solving Indirect Branch

    • 摘要: 为了在追求程序执行效率的同时解决静态二进制翻译中的间接转移问题,针对现有间接转移问题处理方法中线性遍历翻译方式代码优化较少、冗余代码较多的缺陷,提出了基于基本块翻译的反馈式静态二进制翻译方法,并结合二级地址映射表实现了间接转移目标地址的快速映射.首先,在目标可执行程序运行过程中添加监控反馈机制解决代码发现问题,对未确定的间接转移地址进行反馈,以便对源程序重新划分基本块并重新翻译执行;然后构造二级地址映射表,借助二级地址映射快速解决代码定位问题.在开源二进制翻译平台QEMU(quick emulator)上实现了反馈式静态二进制翻译框架FD-SQEMU(feedback static QEMU),并基于SPEC2006和NBENCH测试集进行测试,与QEMU相比,FD-SQEMU平均加速比分别达到3.97倍和6.94倍;与课题组之前提出的保存源程序指令全地址的静态SQEMU翻译器相比,FD-SQEMU的平均加速比达到1.18倍,最高加速比达到了1.36倍,验证了提出的框架和方法的有效性.

       

      Abstract: In order to solve the problem of indirect branch efficiently in static binary translation, a feedback static binary translation method is proposed, with two-level address mapping table to realize the fast mapping of indirect branch target address. This method can solve the problem of less code optimization and more redundant code in existing linear traversal translation. Firstly, the two-level address mapping table is used to address the code location quickly, using array address to store the target platform code block address in the order of the source platform base block start address and using array index to save the index position of the basic block start address in array address. Then, the monitoring feedback mechanism is added to the target executable program to carry on the code discovery, and the uncertain indirect branch target address would be returned so that the source code can be divided to new basic blocks and re-translated. The feedback static binary translation framework FD-QEMU is implemented based on QEMU(quick emulator), an open source binary translator. As the experimental results on SPEC2006 and NBENCH show, compared with QEMU, the speedup ratio of FD-SQEMU (feedback static QEMU) is 3.97 and 6.94 times on average; compared with SQEMU, a static translator with all instructions’ address mapping originally proposed by our group, the average acceleration ratio of FD-SQEMU is 1.18 times, and the maximum speedup ratio is 1.36 times, which verifies the effectiveness of the framework and method proposed in this paper.

       

    /

    返回文章
    返回