Course: Cloud Computing Technologies
Professor: Fulvio Risso, Politecnico di Torino
Source: Computing Virtualization Technologies, based on a previous version by Alex Palesandro.
Length: 90 PDF pages; printed slide numbers run from 1 to 94 with gaps.
Study session: 26 October 2026. Lecture date: not stated. 04 preserves the supplied filename identifier.

Source and scope

Original slides: Computing Virtualization Technologies - source PDF. Supplied from 04 - Computing virtualization technologies.pdf.

This is a separate deck from Lecture 03 - Computing Virtualization Technologies and Tools, which has 116 PDF pages. Their content overlaps, so these notes reuse the existing concept notes in their primary lecture folders. Page references here refer only to the 90-page Lecture 04 PDF, not Lecture 03 or printed slide numbers.

The session covered the main mechanisms and follow-up explanations, particularly EPT/NPT, DMA isolation and hardware-assisted virtualization. The source also includes detailed ring-deprivileging, DBT, VMCS and shadow-table examples; documenting those details is not evidence that each was independently practised. Analogies, numerical scenarios and qualifications below are added study explanations. Historical product and performance claims remain source context.

Lecture summary

Virtualization lets several operating systems share one physical computer while each sees a controlled set of virtual resources. A host provides the hardware, a guest OS runs inside each VM, and a hypervisor or Virtual Machine Monitor (VMM) controls access. Virtual hardware need not match physical hardware one-for-one: one physical network card can support several virtual interfaces. Virtual Machines and Hypervisors

Efficient CPU virtualization lets ordinary guest instructions execute directly. Operations requiring supervision transfer control so the hypervisor can supply the appropriate virtual effect. Classical trap and emulate runs into trouble on older x86 because some sensitive behavior does not trap when the guest is deprivileged. CPU Virtualization and Trap and Emulate

There are three principal responses. Rewrite problematic binary instructions during execution; adapt the guest kernel to cooperate; or use processor extensions for controlled guest execution. These correspond to Dynamic Binary Translation, Paravirtualization and Hypercalls and Hardware-Assisted Virtualization and VMCS.

Memory introduces two mappings: the guest maps virtual addresses to its apparent physical memory, and the hypervisor maps that memory to real machine locations. Shadow tables compose the mappings in software; EPT/NPT lets hardware follow both stages. Caches make that practical despite costly uncached walks. Memory Virtualization - Shadow Page Tables and EPT

Devices can be emulated, exposed through cooperative drivers, or assigned directly. DMA from an assigned device needs IOMMU translation and protection, while SR-IOV lets supporting hardware expose several assignable functions. I-O Virtualization - Emulation PV and Passthrough

The same control problems recur when a VM runs another hypervisor: L1 can manage L2 only within resources controlled by L0. Where the hypervisor sits is a separate architecture question; moving a VM between machines is a state-preservation question. Nested Virtualization, Hypervisor Architectures, VM Migration - Cold Hot and Live.

Material map

PDF pagesPrinted slidesMaterial
1-61, 3-7Attribution, history, host/guest/VMM, virtual hardware
7-228-18, 20-24CPU execution, emulation, rings, T&E, sensitive instructions
23-3025-32DBT, classical PV, source-level versus binary-level changes
31-3833-35, 37-41Hardware assistance, VMX modes, VMCS and exits
39-5242-55Paging, shadow tables, EPT/NPT, walks and tagged TLBs
53-6656-69I/O, PV drivers, ballooning, passthrough, IOMMU, SR-IOV
67-7370-76Nested virtualization, combined VMCS and EPT
74-7977-82Type 1, Type 2 and lecture’s hybrid architecture
80-8783-90Mobility, VM state, cold/hot/live migration
88-9092-94Conclusions and references

CPU: execute directly while retaining control

The Popek-Goldberg framing on PDF page 9 requires an equivalent execution environment, efficient execution of a dominant portion of instructions on the real processor, and VMM control of resources.

PDF pages 10-11 contrast instruction emulation with native execution. An emulator fetches and decodes guest instructions and reproduces their effects on a software CPU-state representation. With compatible processor architectures and virtualization support, the real CPU executes most guest instructions directly. Running a different Instruction Set Architecture (ISA) needs emulation or translation.

Added example: VM A can calculate 5 + 7 using the real CPU because the operation changes its own execution state. An attempt to access VM B’s memory must fail the configured memory protections. The hypervisor sets up those protections; it does not inspect each arithmetic operation or ordinary memory access itself.

Why classical trap and emulate was insufficient

Traditional x86 uses ring 0 for the kernel and ring 3 for applications. Older approaches put the VMM above a deprivileged guest kernel. A privileged instruction traps without the required privilege; a sensitive instruction reveals or affects state relevant to virtualization. Some older x86 sensitive behavior does not reliably trap, so the hypervisor cannot simply wait for an exception and emulate everything problematic.

ResponseWhat changesConstraint
Dynamic binary translationExecutable instruction blocks are rewritten and cached at runtimeTranslation and dispatch work
Classical paravirtualizationGuest kernel cooperates through hypercalls and related interfacesRequires adapting the guest OS
Hardware-assisted virtualizationProcessor supplies controlled guest execution modes and exitsRequires suitable CPU support

Added scenario: for an unmodifiable guest on a processor without virtualization extensions, DBT can handle problematic instructions without changing guest source. Interpretation is another possible but typically slower approach; the three-way comparison does not make DBT the only conceivable implementation.

Hardware assistance: the recall explanation

Intel VT-x and AMD SVM supply CPU virtualization mechanisms. In Intel terminology, the guest runs in VMX non-root mode. Its kernel can still use ring 0, while its applications use ring 3. VMX mode and ring are separate dimensions: guest ring 0 does not confer authority over the real host.

Hypervisor -- VM entry --> guest execution
Hypervisor <-- VM exit -- event requiring host supervision

The hypervisor configures controls, while the architecture also imposes some exit conditions. Most ordinary instructions execute directly. Guest application syscalls can remain within the guest; they are not automatically VM exits. Intel’s Virtual Machine Control Structure (VMCS) stores selected guest/host state and controls; AMD uses a Virtual Machine Control Block (VMCB) with a different interface. These structures are not a claim that every general-purpose register is automatically saved there.

Memory: keep the address domains separate

Guest virtual address (GVA)
  -- guest page tables --> guest physical address (GPA)
  -- hypervisor EPT/NPT --> host/machine physical address (HPA)

GPA is not inherently HPA with either implementation. Shadow page tables provide a composed GVA-to-HPA shortcut for CPU use; they do not make guest physical addresses equal to machine physical addresses.

EPT/NPT in more depth

Intel Extended Page Tables and AMD Nested Page Tables let hardware perform the second stage. The guest OS maintains GVA-to-GPA page tables; the hypervisor maintains GPA-to-HPA mappings. The processor walks them.

Added example: virtual page 10 maps to guest physical page 20, which EPT maps to machine page 80. Accessing byte 100 within the original page reaches byte 100 within machine page 80, assuming the illustrated equal page sizes. A different VM’s guest physical page 20 can have entirely different physical backing.

The guest page tables themselves occupy guest physical memory. On an uncached walk, reading each guest page-table level therefore requires locating that table through EPT. After resolving the final GPA, hardware uses EPT again to find the data. This is why a cache miss can involve lookups inside lookups.

For the source’s simplified four-level case on PDF page 50:

(4 guest table reads + 1 final data access) × 4 EPT reads
  = 20 additional EPT table reads
4 guest table reads + 20 EPT reads + 1 data access
  = 25 total memory accesses in this fully uncached model

This is not the cost of every load. The Translation Lookaside Buffer (TLB) caches translations; page-walk caches also reduce work. Tagged TLB entries distinguish virtual-processor contexts, reducing unnecessary flushing. Larger pages can increase the memory covered by cached translations.

EPT/NPT avoids much software synchronization required by shadow tables. An ordinary guest page-table update generally need not exit merely to synchronize a shadow copy. Translation still has costs, and faults or configured protections can require intervention.

Added protection distinction: a guest access must satisfy both stages’ permissions. A guest page fault normally belongs to the guest OS; an EPT violation concerns the hypervisor-controlled stage and normally transfers control to the hypervisor. An intentional protection violation can support tracking changed pages, rather than indicating malicious behavior.

Devices: compatibility, cooperation or assignment

TechniqueGuest-side interfaceHow it works
EmulationOrdinary driver for the modeled deviceSoftware reproduces its hardware interface
Paravirtualized deviceVirtualization-aware frontend driverFrontend communicates with a host backend using a purpose-built protocol
Direct assignment / passthroughDriver for the assigned hardwareVM controls the allocated device with less software mediation

PV device drivers can coexist with hardware-assisted CPU virtualization. They do not require converting the entire OS to classical PV. The lecture also introduces Memory Ballooning: a cooperating driver helps manage/reclaim guest memory; it is distinct from EPT address translation.

DMA, IOMMU and SR-IOV

Direct Memory Access (DMA) lets a device transfer data to or from RAM without having the CPU copy each byte. Those transfers do not use the guest CPU’s ordinary EPT translation path. A device-visible address must be mapped and restricted correctly, or it could reach the wrong machine memory.

The Input/Output Memory Management Unit (IOMMU) supplies DMA address translation and isolation. Device-visible I/O addresses need not simply be identical to GPAs, and IOMMU mappings should not be assumed to share the CPU EPT tables.

Single Root I/O Virtualization (SR-IOV) lets supporting hardware expose Virtual Functions (VFs) assigned to different VMs. The physical device handles multiplexing. Added example: one NIC exposes one VF to VM A and another to VM B. They still share its physical capacity; more VFs do not create more bandwidth. SR-IOV provides assignable functions; the IOMMU protects DMA.

Nested virtualization: L0 retains final authority

Physical hardware
  L0: outer hypervisor
    L1: VM running an inner hypervisor
      L2: VM created by the inner hypervisor

These are nesting levels, not privilege rings. Uses include OS/driver testing and security experiments. L0 mediates L1’s virtualization operations and combines relevant control state. The source distinguishes VMCS0-1, VMCS1-2 and effective VMCS0-2; shadow VMCS reduces selected control-access exits.

Memory conceptually follows L2 virtual -> L2 physical -> L1 physical -> machine physical. L0 can compose EPT mappings so the effective hardware path does not walk every conceptual layer separately. L1 changes, faults and invalidations must remain consistent with that composed mapping. L1 can allocate to L2 only within memory L0 supplies.

Hypervisor placement is a separate question

Lecture architectureArrangementSource examples
Type 1Hardware -> hypervisor -> guestsESXi, Xen, Hyper-V
Type 2Hardware -> host OS -> hosted hypervisor -> guestsVirtualBox, VMware Workstation
HybridHost kernel integrates virtualization supportLinux KVM

Preserve the professor’s hybrid label for KVM when answering this lecture. Architecture does not determine the CPU technique: a hosted hypervisor can use hardware assistance. Source performance and Windows 10 coexistence remarks are contextual, not current installation advice.

Migration: move a consistent running environment

Type in the sourceProcessRunning state
ColdShut down, move required files, boot elsewherePrevious execution need not survive
HotPause, move, resumePreserve RAM and relevant CPU/device state
LiveCopy during execution, then hand overTrack changes during copying and preserve a consistent final state

Copying a disk alone does not preserve application variables, processes, open sockets or processor state. Required storage must be available at the destination; network delivery must follow the VM. Shared storage can reduce copying. Assigned physical devices complicate preserving or recreating device state.

Added pre-copy explanation:

  1. Copy memory while the VM runs.
  2. Track pages changed during copying: dirty pages.
  3. Repeat copying changed pages.
  4. Briefly pause, transfer final state and resume on the destination.

If the VM changes memory faster than the network can transfer the changing working set, repeated copying may fail to converge. The outstanding state does not shrink enough. Finishing requires a different condition or strategy, such as throttling writes, more bandwidth or a longer final pause. The source’s “without stopping” wording describes continued execution during most migration, not a universal zero-interruption guarantee.

Revision questions

  • Why can arithmetic run directly while an access to another VM’s memory must be blocked?
  • Which assumptions make classical trap and emulate work, and what broke on older x86?
  • Why can a guest kernel use ring 0 without controlling the physical host?
  • What changes in DBT, classical PV and hardware assistance respectively?
  • Why does shadow paging not make GPA equal HPA?
  • Why must EPT translate accesses to the guest’s page tables as well as the final data?
  • What distinguishes a guest page fault, EPT violation and device DMA translation fault?
  • Why does passthrough still need DMA isolation even if EPT is enabled?
  • How can PV device drivers coexist with hardware-assisted CPU execution?
  • What does SR-IOV share, and what physical capacity remains limited?
  • Why must L0 retain authority over L1’s allocation to L2?
  • What state must move for hot/live migration that cold migration can discard?
  • Why might pre-copy never catch up with a running VM?

The original source’s Rosetta “MIPS to Intel” example on PDF page 8 is a known typo; the existing Lecture 03 source-caveat section records the PowerPC-to-Intel correction and its primary source. Its historical benchmark percentages and implementation lists are not newly verified current claims. Early PV compatibility restrictions concern that model, not all guest OS or driver support.

Lecture 03 - Computing Virtualization Technologies and Tools additionally covers QEMU and KVM, Libvirt virsh and virt-manager and Virtio Virtqueues and vhost-net. Those tool-specific topics are not present in this Lecture 04 deck and were not taught in this session.