操作系統(tǒng)-清華向勇、參考5-s2e qemu_第1頁
操作系統(tǒng)-清華向勇、參考5-s2e qemu_第2頁
操作系統(tǒng)-清華向勇、參考5-s2e qemu_第3頁
操作系統(tǒng)-清華向勇、參考5-s2e qemu_第4頁
操作系統(tǒng)-清華向勇、參考5-s2e qemu_第5頁
免費預覽已結(jié)束,剩余10頁可下載查看

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

1、QEMUOverviewCreated by Fabrice Bellard in 2003 Function-level emulationFaster than “cycle-accurate” simulators.Good enough to use applications written for another CPU.Just-in-time (JIT) compilation support to achieve high performance (400 500 MIPS)Lots of peripherals support (VGA, serial, and Ethern

2、et, etc)Lots ofhosts ands support (full system emulation)x86, arm, mips, sh4, cris, sparc, powerpc, nds32, qemu/hw/* contain all of the supported boards.Good enough to use applications written for another CPU.User mode emulation: can run applications compiled for anotherCPU.2QEMUoverviewUpdate statu

3、s0.9.1 (Jan 6, 2008)Stable and stop for a long time0.10 (Mar 5, 2009)TCG support (a new general JIT framework)0.11 (Sep 24, 2009)KVM support0.12More KVM support.Code refactoringnew peripheral framework to support dynamic board configuration3QEMUJITTCG (Tiny Code Generator)a generic backend for a C c

4、ompiler. It was simplified to be used in QEMU.Translation Block (TB)A TCG basic block corresponds to a list of instructions terminated by a branch instruction.16Mb code cache size4QEMUJIT Prologue, EpilogueWhen the-machine is ARM5QEMUJITcpu exec() called each time around main loop. Program executes

5、until an unchained block is encountered.Returns to cpu exec() through epilogue. Enter the code cache:Linux: Set buffer executable and jump to Buffer & Execute6QEMUJIT code genflowFront-end: qemu/tcg/tcg.c gen_intermediate_code disas_insnInterprete source instruction and translate to micro-ops.Transl

6、ation stops when a conditional branch is encountered.7QEMUJIT code genflowtcg_liveness_ysisRemove dead code.Ex. and_i32 t0, t0, $0 xffffffffEx. add_i32 t0, t1, t2 add_i32 t0, t0, $1mov_i32 t0, $18QEMUJIT code genflowRegister mapregister struct CPUNDS32State *env asm(r14);registerregisterregister_ulo

7、ng T0 asm(r15);_ulong T1 asm(r12);_ulong T2 asm(r13);9QEMUJIT Block chainingAvoid context-switch overheadEvery time a block returns, try to chain it.tb_add_jump(): back-patch the native jump address10QEMUJIT SummaryLook up TBTranslate one TBChain it to existed TBsExecute Code cacheException happen a

8、nd handlingCached?NoS2E: platformforyzingsoftwaresystems12CG-R TLCG-RTL服務器生成關(guān)系文件源代碼編譯函數(shù)調(diào)用圖生成函數(shù)調(diào)用關(guān)系列表生成Html緩存機制瀏覽器數(shù)據(jù)預處理源代碼編譯中間結(jié)果13CG-R TL 的處理流程基于編譯的中間結(jié)果獲取函數(shù)信息-準確的函數(shù)調(diào)用關(guān)系調(diào)用圖與調(diào)用關(guān)系列表及函數(shù)注釋的有機結(jié)合與源代碼查看工具lxr的結(jié)合,使用靈活step 1step 3轉(zhuǎn)編譯的中間結(jié)果step 2提取函數(shù)定義和函數(shù)調(diào)用信息生成函數(shù)調(diào)用關(guān)系文件step 4生成函數(shù)調(diào)用圖形和關(guān)系列表流程14DCG-RTL確定內(nèi)核工具 Systemtap ftrace,S2E數(shù)據(jù)處理算法 DCGRTL明確動態(tài)靜態(tài)結(jié)范圍 合的函數(shù)調(diào)用圖函數(shù)調(diào)用圖生成DCGRTL算法流程15Refer

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論