Font Size: a A A

Research And Implementation Of QEMU-based Hotspot Code Detection And Dynamic Optimization Model

Posted on:2014-03-07Degree:MasterType:Thesis
Country:ChinaCandidate:S Y ZhangFull Text:PDF
GTID:2268330401965573Subject:Computer software and theory
Abstract/Summary:PDF Full Text Request
Binary translation technology is the core technology of software portable acrossplatforms and hardware simulation, which enables the executable object file of differenthardware/software platforms to be executed on another one, and is convenient forhardware logic verification and system software debugging as well.Dynamic binary translation technology is currently the most popular binarytranslation technology. It takes the strategy of real-time translation and execution totransform the binary code of the object CPU architecture into the local one, and equipswith characteristics of real-time translation, rapid response, multi-sources andmulti-targets and so on. Dynamic binary translation, however, is still on the stage ofcontinuous development and needed to be perfected. For example, combines withdifferent hardware technologies to accelerate the execution speed of the emulator,introduces novel and efficient optimization algorithm to improve quality of translatedcode etc. How to translate and optimize it fast has been the hot research point for a longtime.QEMU is a typical dynamic binary translation system, it uses dynamic binarytranslation technology to achieve real-time translation and execution on the targetbinary code, and have multi-sources and multi-targets, rapid translation, supportself-referencing/self-modifying code and other characteristics. Compared to the fasttranslation, however, the host code generated by QEMU often exist many unnecessarymemory access and register move operations, these will lead to significant executionoverhead. Besides that, QEMU translates, optimizes and executes the object binary codein a serialized way, which leads many advanced optimization algorithms to be hardlyused, because of these algorithms do optimization needs for time-consumingoptimization operation, and optimization overhead often outweighs the benefits.The paper studies the TCG translation engine in details, and put forwards, based onthe research, a model of hotspot code detection and dynamic optimization: combinationwith multi-cores of processes and multi-threads technologies, implementation to detectthe hotspot code of QEMU through code instrumentation and NET algorithm, and merge them into a super block. When a super block is generated, the depth optimizationwill be processed for generating simplified host codes. The paper makes consolidationand optimization routines to be executed in different threads on different CPU cores byusing multi-threads technology, which makes the core simulation thread will not beconsidered the overhead of the optimization algorithm. Threads can be executedparalleled at the same time in different processor cores makes the serialized executionof original QEMU converted into parallelized execution, it effectively improves theutilization of the processor, so as to the performance of QEMU. In addition, the paperproposes a novel optimization method called Delegate Mechanism, which caneffectively eliminates the memory load operation code and a register move operation forenhancing the quality of the translated code, so as to achieve the purpose of codeoptimization. Experiment based on QEMU-ARM indicates that the model caneffectively improve the QEMU average execution performance by about10%.
Keywords/Search Tags:Binary Translation, QEMU, Hotspot Detection, Delegate Mechanism
PDF Full Text Request
Related items