Paravirtualization and Hypercalls
Definition
Paravirtualization makes guest software cooperate with the virtualization layer. A hypercall requests a service from the hypervisor through a defined interface.
Classical PV in the lecture
The guest kernel is modified ahead of time to replace problematic operations with virtualization-aware equivalents. The illustrated design de-privileges the guest kernel to ring 1, uses synchronous guest-to-hypervisor calls and asynchronous host-to-guest notifications, and paravirtualizes page-table access.
The guest can boot directly in its desired 32/64-bit mode without reproducing the conventional BIOS/16-bit startup sequence.
Study clarification: who changes?
The guest kernel changes; the application ABI can remain the same, so ordinary applications need not be rewritten. A guest application syscall still requests a guest-kernel service. Hypercalls are the guest-kernel-to-hypervisor interface; they should not be understood as replacing every application syscall one-for-one.
PV CPU versus PV devices
| Scope | Change |
|---|---|
| Classical whole-kernel PV | Modify core guest OS behavior for virtualization |
| PV device driver | Add a cooperating driver/frontend for a particular device |
An otherwise hardware-virtualized guest can use PV devices. The two techniques can coexist.
Important rules
- Explicit cooperation gives up complete guest unawareness in the classical PV model.
- Source availability and ability to modify the OS constrain classical PV compatibility.
- The slide’s Linux/BSD versus Windows discussion belongs to the early whole-kernel PV model, not a claim that Windows cannot run as a VM or use PV drivers.
- Reduced translation/emulation work improves the potential for performance, but does not promise zero overhead.
Common mistakes
- Confusing an application syscall with a hypercall.
- Assuming PV drivers require redesigning every part of the kernel.
- Assuming full CPU virtualization forbids cooperative devices.
Related: Dynamic Binary Translation, Hardware-Assisted Virtualization and VMCS, I-O Virtualization - Emulation PV and Passthrough, Virtio Virtqueues and vhost-net.
Source
Lecture 03 PDF pages 26-29 and 55-57 (printed slides 28-31 and 58-60). Context: Lecture 03 - Computing Virtualization Technologies and Tools. The interface distinction and common mistakes are study clarifications.