Font Size: a A A

Research On Key Technologies Of Binary Translation For The Domestic CPU

Posted on:2015-11-01Degree:DoctorType:Dissertation
Country:ChinaCandidate:X N LiuFull Text:PDF
GTID:1108330482979093Subject:Computer Science and Technology
Abstract/Summary:PDF Full Text Request
With the advance of information technology and the ever-changing of computer processors in today’s world, the domestic general-purpose processors with independent intellectual property rights have also been developing rapidly. Against this background, the following urgent problems need to be solved: the matching the development of hardware platforms and the rapid growth of requirements for software applications, the widespread use of domestic processers, and the expanding of the ecological environments for domestic supercomputers. Then, the software and code migration technology becomes the effective solution for these problems. Binary translation technology is an important means to realize software and code migration. It has great significance for passive code inheritance, application optimization, software system safety analysis and other aspects. It is one of the hotspot researches on modern compiler technology, also is one of the important components for software reverse engineering. Static binary translation has inherent advantages in the execution speed and efficiency of the translation generation program, and dynamic binary translation has remarkable effects in the universality and completeness of software migration. However, the method of static and dynamic combined binary translation can learn from the advantages of both methods and fully reflect the characteristics of binary translation technology, and it is also one of the future researches.To realize the code migration of binary applications on different source platforms to the domestic processor platform, the concept of multi-source integration binary translation is presented, the complete framework of multi-source integration translation system is also given, and the key technologies in the framework and the hardware and software collaborative translation technology are systematically and deeply studied in the thesis.The main content and contributions of this PhD thesis are as followings.1. The technology of unified decoding and semantic mapping for multi-source is proposed.Currently, in the field of binary translation, there is not yet a holistic and universal solution to the problems of unified decoding and semantic mapping for the program migration from multi-source to a specific target processor. The method to resolve unified decoding and unified semantic mapping in the framework of multi-source integration translation is proposed. For the problem of the complexity and difficulty of the unified decoding for multi-source heterogeneous platforms, a localization method of unified coding and decoding language is presented, which realizes the unified decoding for multi-source heterogeneous platforms. For the lack of unified semantics description language for multi-source in current related technologies, a semantic equivalence transform method of effective minimum operating is proposed. In the method, the standard definition of the unified minimum semantics is given, the unified minimum semantics description language that fits for multi-source integration translation is constructed, and the unified description and transform of multi-source semantics are achieved. In the experiments for the translation system supported by the methods described above on the cases including SPEC CPU2006, all the test cases for each source platform can be carried out with proper instruction decoding and semantic conversion, and the execution results on Shen Wei(referred to as SW) platform for the generated translation programs are same with the results on the source platform. The experiment results show that the methods presented above are effective, technically complete and correct.2. The technology of procedure data recovery for multi-source integration binary translation is proposed.It is must to resolve the problem of procedure data recovery from heterogeneous source platforms to a specific target platform in the multi-source integration binary translation. One problem is that it is difficult to recover the types and access modes of data for user procedures. To solve this problem, a data recovery method of user procedure based on semantic mirroring operations and stack frame dynamic maintenance operations is proposed. From the perspective of program instruction semantics, it is effectively solved for the data recovery of user procedures from multi-source heterogeneous platforms to SW platform. The other problem is that it is difficult to translate library functions in a unified way because of the large differences in calling conventions of library functions among heterogeneous source platforms. For this problem, a data recovery method of the library functions based on function package and sequential distribution is also advanced, which can achieve the unified fusion process for parameter passing differences of library functions and multi-source integration migration of library functions. Through the test on the whole binary translation system, the effectiveness and correctness of the proposed method for user procedure data recovery is proved. In the experiments for the method of function package and sequential distribution for library functions, the average reduction rate of the sizes reaches 17.29% for the generated translation programs, which proves that the method can effectively reduce the source code size of the translated program files and decrease the code expansion.3. The code optimization method for flag simplify translation is put forward.Existing flag optimization translation methods can not completely solve the problem of flag simulation from X86 to SW processor. To resolve this problem, the flag optimization translation method based on the multi-stage optimization strategy is proposed. One of the problems is that there are a large number of redundant operations in flag condition check. For this problem, a redundant operation simplification method based on adjacent condition check is presented, which effectively solves the code expansion, consequences of redundant conditions verification in the semantic mapping stage. For the other problem of existing lots of reference and the value operations of invalid flags, a flag optimization translation method is proposed, which is based on the combination of semantic patterns discovery for source platform and invalid flags elimination cross function boundary. The method achieves the simplified translation of instruction semantic modes in the semantic transforming stage by using the equivalent semantic characteristics among heterogeneous platforms, and the static flag optimized translation in the code optimization phase by gradually removing invalid flag operations. By using the above code optimization translation technology, the average code reduction rate of the generated programs reached 12.11%.4. The framework of a novel combining static and dynamic binary translation is presented.In existing binary translation modes, the technology is incomplete for static binary translation and the efficiency is poor for dynamic binary translation. To solve this problem, the framework of combining static and dynamic binary translation based on the technologies of incremental feedback and several rounds of maintenance is presented and the implementation of the framework is described. The framework realize the organic interaction of static and dynamic binary translation with the basis of static analysis, the auxiliary support of dynamic collaborative translation, and guided by profiling information and static translated information. Experiment results show that the combining translation method can basically solve the problems of static binary translation caused by indirect branch instruction, and can form a relatively complete and independent program after several feedback, the efficiency of the implementation of which is the same with the program generated by static translation, when translating programs with relatively fixed parameter types and algorithms.5. A software and hardware collaborative translation technology for SW platform is put forward.The optimizing ability of current dynamic binary translation systems in the pure software mode is limited. To improve the efficiency of dynamic binary translations from X86 to SW processor, after having deeply studied the architecture of X86 and SW, the performance bottlenecks of dynamic binary translation in the pure software mode are thoroughly analyzed. Then based on the analysis, the software and hardware collaborative binary translation technology for the SW platform is presented and the implementation framework and solutions of the technology are also described.At last, a binary translation system of multi-source integration translation is implemented. Related methods and techniques presented in this thesis are integrally tested on the system, and the correctness and effectiveness of these methods are proved.
Keywords/Search Tags:Binary Translation, Decompile, Unified Decode, Sematic Mapping, Date Recovery, Code Optimization, combination of static and dynamic translation, Collaborative Translation
PDF Full Text Request
Related items