# au-ts/libvmm architecture

> Architecture diagram of the GitHub repository au-ts/libvmm, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/au-ts/libvmm
- Repository: https://github.com/au-ts/libvmm

## Overview

libvmm is a seL4/Microkit virtual-machine monitor library. A VMM uses it to create and manage a guest, select architecture-specific boot and interrupt facilities, and expose guest devices through VirtIO transports. The README documents Linux and EFI boot, ARM PSCI/GIC support, x86 ACPI/APIC, and storage, networking, and console capabilities. The tree also contains a Linux UIO sound driver; its sampled code maps shared queues and updates streams. Most library wiring was not sampled, so only documented relationships are shown.

Main entry points: [`include/libvmm/guest.h`](https://github.com/au-ts/libvmm/blob/main/include/libvmm/guest.h) (Guest management), [`src/virtio/virtio.c`](https://github.com/au-ts/libvmm/blob/main/src/virtio/virtio.c) (VirtIO core), [`tools/linux/uio_drivers/snd/stream.c`](https://github.com/au-ts/libvmm/blob/main/tools/linux/uio_drivers/snd/stream.c) (ALSA stream handling), [`tools/linux/uio_drivers/snd/main.c`](https://github.com/au-ts/libvmm/blob/main/tools/linux/uio_drivers/snd/main.c) (Linux UIO sound driver)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_lifecycle["Guest lifecycle"]
  node_library["VM management API<br/>[libvmm.h]"]
  node_guest["Guest management<br/>[guest.h]"]
end

subgraph group_architecture["Architecture support"]
  node_arm_boot["ARM Linux boot<br/>[linux.c]"]
  node_arm_psci["PSCI multicore<br/>[psci.c]"]
  node_arm_vgic["Hardware GIC"]
  node_x86_boot["x86 Linux boot<br/>[linux.c]"]
  node_x86_uefi["EFI boot<br/>[uefi.c]"]
  node_x86_acpi["ACPI tables<br/>[acpi.c]"]
  node_x86_apic["Software APIC<br/>[apic.c]"]
end

subgraph group_devices["Guest devices"]
  node_pci["PCI bus<br/>[pci.c]"]
  node_virtio_core["VirtIO core<br/>[virtio.c]"]
  node_virtio_pci["PCI transport<br/>[pci.c]"]
  node_virtio_mmio["MMIO transport<br/>[mmio.c]"]
  node_block["Block device<br/>[block.c]"]
  node_network["Network device<br/>[net.c]"]
  node_console["Console device<br/>[console.c]"]
  node_sound["VirtIO sound<br/>[sound.c]"]
end

subgraph group_sound["Sound UIO tool"]
  node_linux_sound["Linux UIO sound driver<br/>[main.c]"]
  node_sound_stream["ALSA stream handling<br/>[stream.c]"]
  node_sound_convert["Format conversion<br/>[convert.c]"]
end

node_vmm_user(("VMM application"))
node_host_audio(("Host ALSA"))

node_vmm_user -->|"uses"| node_library
node_library -->|"manages"| node_guest
node_guest -->|"boots Linux"| node_arm_boot
node_guest -->|"starts VCPUs"| node_arm_psci
node_guest -->|"virtualizes GIC"| node_arm_vgic
node_guest -->|"boots Linux"| node_x86_boot
node_guest -->|"boots EFI"| node_x86_uefi
node_guest -->|"provides ACPI"| node_x86_acpi
node_guest -->|"virtualizes APIC"| node_x86_apic
node_guest -->|"exposes transport"| node_virtio_pci
node_guest -->|"exposes transport"| node_virtio_mmio
node_virtio_pci -->|"transports devices"| node_virtio_core
node_virtio_mmio -->|"transports devices"| node_virtio_core
node_virtio_core -->|"serves storage"| node_block
node_virtio_core -->|"serves networking"| node_network
node_virtio_core -->|"serves console"| node_console
node_virtio_core -->|"serves sound"| node_sound
node_linux_sound -->|"updates streams"| node_sound_stream
node_sound_stream -->|"converts formats"| node_sound_convert
node_sound_stream -.->|"uses ALSA"| node_host_audio
node_linux_sound -.->|"handles device queues"| node_sound

click node_library "https://github.com/au-ts/libvmm/blob/main/include/libvmm/libvmm.h"
click node_guest "https://github.com/au-ts/libvmm/blob/main/include/libvmm/guest.h"
click node_arm_boot "https://github.com/au-ts/libvmm/blob/main/src/arch/aarch64/linux.c"
click node_arm_psci "https://github.com/au-ts/libvmm/blob/main/src/arch/aarch64/psci.c"
click node_arm_vgic "https://github.com/au-ts/libvmm/tree/main/src/arch/aarch64/vgic"
click node_x86_boot "https://github.com/au-ts/libvmm/blob/main/src/arch/x86_64/linux.c"
click node_x86_uefi "https://github.com/au-ts/libvmm/blob/main/src/arch/x86_64/uefi.c"
click node_x86_acpi "https://github.com/au-ts/libvmm/blob/main/src/arch/x86_64/acpi.c"
click node_x86_apic "https://github.com/au-ts/libvmm/blob/main/src/arch/x86_64/apic.c"
click node_pci "https://github.com/au-ts/libvmm/blob/main/src/pci.c"
click node_virtio_core "https://github.com/au-ts/libvmm/blob/main/src/virtio/virtio.c"
click node_virtio_pci "https://github.com/au-ts/libvmm/blob/main/src/virtio/pci.c"
click node_virtio_mmio "https://github.com/au-ts/libvmm/blob/main/src/virtio/mmio.c"
click node_block "https://github.com/au-ts/libvmm/blob/main/src/virtio/block.c"
click node_network "https://github.com/au-ts/libvmm/blob/main/src/virtio/net.c"
click node_console "https://github.com/au-ts/libvmm/blob/main/src/virtio/console.c"
click node_sound "https://github.com/au-ts/libvmm/blob/main/src/virtio/sound.c"
click node_linux_sound "https://github.com/au-ts/libvmm/blob/main/tools/linux/uio_drivers/snd/main.c"
click node_sound_stream "https://github.com/au-ts/libvmm/blob/main/tools/linux/uio_drivers/snd/stream.c"
click node_sound_convert "https://github.com/au-ts/libvmm/blob/main/tools/linux/uio_drivers/snd/convert.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_library,node_guest toneBlue
class node_arm_boot,node_arm_psci,node_arm_vgic,node_x86_boot,node_x86_uefi,node_x86_acpi,node_x86_apic toneAmber
class node_pci,node_virtio_core,node_virtio_pci,node_virtio_mmio,node_block,node_network,node_console,node_sound toneMint
class node_linux_sound,node_sound_stream,node_sound_convert toneRose
class node_vmm_user,node_host_audio toneIndigo
```

## Components

### Guest lifecycle

- [VM management API](https://github.com/au-ts/libvmm/blob/main/include/libvmm/libvmm.h): `include/libvmm/libvmm.h`
- [Guest management](https://github.com/au-ts/libvmm/blob/main/include/libvmm/guest.h): `include/libvmm/guest.h`

### Architecture support

- [ARM Linux boot](https://github.com/au-ts/libvmm/blob/main/src/arch/aarch64/linux.c): `src/arch/aarch64/linux.c`
- [PSCI multicore](https://github.com/au-ts/libvmm/blob/main/src/arch/aarch64/psci.c): `src/arch/aarch64/psci.c`
- [Hardware GIC](https://github.com/au-ts/libvmm/tree/main/src/arch/aarch64/vgic): `src/arch/aarch64/vgic`
- [x86 Linux boot](https://github.com/au-ts/libvmm/blob/main/src/arch/x86_64/linux.c): `src/arch/x86_64/linux.c`
- [EFI boot](https://github.com/au-ts/libvmm/blob/main/src/arch/x86_64/uefi.c): `src/arch/x86_64/uefi.c`
- [ACPI tables](https://github.com/au-ts/libvmm/blob/main/src/arch/x86_64/acpi.c): `src/arch/x86_64/acpi.c`
- [Software APIC](https://github.com/au-ts/libvmm/blob/main/src/arch/x86_64/apic.c): `src/arch/x86_64/apic.c`

### Guest devices

- [PCI bus](https://github.com/au-ts/libvmm/blob/main/src/pci.c): `src/pci.c`
- [VirtIO core](https://github.com/au-ts/libvmm/blob/main/src/virtio/virtio.c): `src/virtio/virtio.c`
- [PCI transport](https://github.com/au-ts/libvmm/blob/main/src/virtio/pci.c): `src/virtio/pci.c`
- [MMIO transport](https://github.com/au-ts/libvmm/blob/main/src/virtio/mmio.c): `src/virtio/mmio.c`
- [Block device](https://github.com/au-ts/libvmm/blob/main/src/virtio/block.c): `src/virtio/block.c`
- [Network device](https://github.com/au-ts/libvmm/blob/main/src/virtio/net.c): `src/virtio/net.c`
- [Console device](https://github.com/au-ts/libvmm/blob/main/src/virtio/console.c): `src/virtio/console.c`
- [VirtIO sound](https://github.com/au-ts/libvmm/blob/main/src/virtio/sound.c): `src/virtio/sound.c`

### Sound UIO tool

- [Linux UIO sound driver](https://github.com/au-ts/libvmm/blob/main/tools/linux/uio_drivers/snd/main.c): `tools/linux/uio_drivers/snd/main.c`
- [ALSA stream handling](https://github.com/au-ts/libvmm/blob/main/tools/linux/uio_drivers/snd/stream.c): `tools/linux/uio_drivers/snd/stream.c`
- [Format conversion](https://github.com/au-ts/libvmm/blob/main/tools/linux/uio_drivers/snd/convert.c): `tools/linux/uio_drivers/snd/convert.c`

### Other components

- **VMM application**
- **Host ALSA**

## Connections

- VMM application → VM management API: uses
- VM management API → Guest management: manages
- Guest management → ARM Linux boot: boots Linux
- Guest management → PSCI multicore: starts VCPUs
- Guest management → Hardware GIC: virtualizes GIC
- Guest management → x86 Linux boot: boots Linux
- Guest management → EFI boot: boots EFI
- Guest management → ACPI tables: provides ACPI
- Guest management → Software APIC: virtualizes APIC
- Guest management → PCI transport: exposes transport
- Guest management → MMIO transport: exposes transport
- PCI transport → VirtIO core: transports devices
- MMIO transport → VirtIO core: transports devices
- VirtIO core → Block device: serves storage
- VirtIO core → Network device: serves networking
- VirtIO core → Console device: serves console
- VirtIO core → VirtIO sound: serves sound
- Linux UIO sound driver → ALSA stream handling: updates streams (evidence: `tools/linux/uio_drivers/snd/main.c`)
- ALSA stream handling → Format conversion: converts formats (evidence: `tools/linux/uio_drivers/snd/stream.c`)
- ALSA stream handling → Host ALSA: uses ALSA
- Linux UIO sound driver → VirtIO sound: handles device queues
