Fundamentals 7 min read

Understanding Type‑1 vs Type‑2 Hypervisors on ARM64

The article explains how Type‑1 and Type‑2 hypervisors differ in their use of ARM64 exception levels, outlines their shared responsibilities such as resource, scheduling, and device management, and compares their architectures and performance through a serial‑port example, highlighting the trade‑offs of each approach.

Linux Kernel Journey
Linux Kernel Journey
Linux Kernel Journey
Understanding Type‑1 vs Type‑2 Hypervisors on ARM64

On ARM64 there are four exception levels (EL3‑EL0). The operating system runs at EL1, applications at EL0, and the hypervisor runs at EL2. Hypervisors are classified as Type‑1 or Type‑2; KVM is an example of a Type‑2 hypervisor.

Both types perform three core functions: VM resource management (unified address‑space handling), VCPU scheduling and context switching , and virtual device management (interrupt handling for virtual devices).

The key distinction lies in where these functions are executed. A Type‑1 hypervisor carries out all work at EL2, while a Type‑2 hypervisor performs most work at EL1 and uses EL2 only for a mode‑switch that loads the prepared guest context into registers.

Figure 1.1 shows the architecture of a Type‑1 hypervisor: EL2 runs the hypervisor, EL1 runs the guest OS, and the hierarchy is clear. Figure 1.2 depicts a Type‑2 hypervisor: EL2 provides only virtualization support, while resource management resides in a host OS at EL1. In the Linux + KVM scenario (Figure 1.3), the host OS with KVM enabled acts as the EL1 host, handling system resources and guest OS management.

In terms of trade‑offs, Type‑1 hypervisors generally offer higher efficiency because all operations stay in EL2. Type‑2 hypervisors are less efficient but can reuse the host OS’s existing memory, process, and driver frameworks (e.g., Linux’s mature ecosystem and QEMU), providing easier integration and hardware acceleration extensions.

A concrete serial‑port example illustrates the performance gap. In a Type‑1 setup (Figure 1.4), a guest’s access triggers an EL1 synchronous exception that EL2 captures, simulates the serial output, and returns—requiring a single exception transition. In a Type‑2 setup (Figure 1.5), the same access undergoes multiple exception‑level switches, making the path more complex but allowing the host OS’s mechanisms and ecosystem to be reused.

The discussion concludes that the architectural differences lead to distinct efficiency characteristics, and the article will subsequently focus on the Type‑2 case, specifically KVM.

Figure 1.1 Architecture of a Type‑1 hypervisor
Figure 1.1 Architecture of a Type‑1 hypervisor
Figure 1.2 Architecture of a Type‑2 hypervisor
Figure 1.2 Architecture of a Type‑2 hypervisor
Figure 1.3 Linux + KVM virtualization framework
Figure 1.3 Linux + KVM virtualization framework
Figure 1.4 Type‑1 serial‑port output flow
Figure 1.4 Type‑1 serial‑port output flow
Figure 1.5 Type‑2 serial‑port output flow
Figure 1.5 Type‑2 serial‑port output flow
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

VirtualizationARM64KVMhypervisortype1type2
Linux Kernel Journey
Written by

Linux Kernel Journey

Linux Kernel Journey

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.