Dynamic Binary Translation
Definition
DBT rewrites guest binary instruction blocks at runtime into code the virtualization layer can safely execute. It changes execution code rather than requiring guest OS source changes.
Intuition
The VMM cannot wait for a trap that never occurs. It identifies problematic behavior in the instruction stream and substitutes a controlled sequence before executing it.
The lecture’s basic-block example
On PDF page 24 / printed slide 26, a mov and inc can remain unchanged, but a call needs special treatment because translation changes code locations. The translated sequence preserves the guest return address, updates virtual execution state, and jumps through dispatch. Actual execution uses the translation cache and a backmapping relates it to guest instructions.
Guest basic block -> translate -> cached safe block -> execute
^ reuse laterImportant rules
- “Dynamic” means translation during execution; “binary” means operating on compiled code.
- Caching amortizes repeated translation of blocks.
- The original VMware model combines DBT with direct execution / T&E; it does not translate every instruction indiscriminately.
- DBT can solve same-ISA virtualization problems. Translation between different ISAs is a separate use of related machinery, illustrated by QEMU.
- Some rewritten operations need VMM help; others can execute without re-entering it.
Common mistakes
- Equating binary translation with source-code patching.
- Assuming same-ISA translation is impossible or unnecessary.
- Assuming cached translated code eliminates all overhead.
- Reading Lecture 02’s 1999 timeline and Lecture 03’s 1998 proposal date as identical claims. Keep each date attached to its source framing.
Related: CPU Virtualization and Trap and Emulate, Paravirtualization and Hypercalls, QEMU and KVM, x86 Virtualization Techniques.
Source
Lecture 03 PDF pages 22-25 and 29 (printed slides 24-27 and 31). Context: Lecture 03 - Computing Virtualization Technologies and Tools. Intuition, flow, and cautions are study explanations.