Memory Layout

x86-64 guest physical memory map

This is a survey of the existing memory layout for crosvm on x86-64 when booting a Linux kernel. Some of these values are different when booting a BIOS image or when compiled with features=direct (ManaTEE); see the source. All addresses are in hexadecimal.

Name/source linkAddressEnd (exclusive)SizeNotes
00007000RAM (may start at 0x1000 for crosvm-direct)
ZERO_PAGE_OFFSET7000Linux boot_params structure
BOOT_STACK_POINTER8000Boot SP value
boot_pml4_addr9000Boot page table
boot_pdpte_addrA000Boot page table
boot_pde_addrB000Boot page table
CMDLINE_OFFSET2_000020_0000~1.87 MiBLinux kernel command line
ACPI_HI_RSDP_WINDOW_BASEE_0000ACPI RSDP table (TODO: technically overlaps command line buffer; check CMDLINE_MAX_SIZE)
KERNEL_START_OFFSET20_0000Linux kernel image load address
END_ADDR_BEFORE_32BITS20_0000D000_0000~3.24 GiBRAM (<4G)
END_ADDR_BEFORE_32BITSD000_0000F400_0000576 MiBLow (<4G) MMIO allocation area
PCIE_CFG_MMIO_STARTF400_0000F800_000064 MiBPCIe enhanced config (ECAM)
RESERVED_MEM_SIZEF800_00001_0000_0000128 MiBLAPIC/IOAPIC/HPET/…
TSS_ADDRFFFB_D000Boot task state segment
1_0000_0000RAM (>4G)
(end of RAM)High (>4G) MMIO allocation area

aarch64 guest physical memory map

All addresses are IPA in hexadecimal.

Common layout

These apply for all boot modes.

Name/source linkAddressEnd (exclusive)SizeNotes
SERIAL_ADDR[3]2e82f08 bytesSerial port MMIO
SERIAL_ADDR[1]2f83008 bytesSerial port MMIO
SERIAL_ADDR[2]3e83f08 bytesSerial port MMIO
SERIAL_ADDR[0]3f84008 bytesSerial port MMIO
AARCH64_RTC_ADDR200030004 KiBReal-time clock
AARCH64_PCI_CFG_BASE1_00002_000064 KiBPCI configuration (CAM)
AARCH64_MMIO_BASE200_0000400_000032 MiBLow MMIO allocation area
AARCH64_GIC_CPUI_BASE3ffd_00003fff_0000128 KiBvGIC
AARCH64_GIC_DIST_BASE3fff_00004000_000064 KiBvGIC
AARCH64_AXI_BASE4000_0000Seemingly unused? Is this hard-coded somewhere in the kernel?
AARCH64_PVTIME_IPA_START7fd0_00007fe0_000064 KiBParavirtualized time
AARCH64_PROTECTED_VM_FW_START7fe0_00008000_00002 MiBpVM firmware (if running a protected VM)
AARCH64_PHYS_MEM_START8000_0000--mem sizeRAM (starts at IPA = 2 GiB)
plat_mmio_baseafter RAM+0x8000008 MiBPlatform device MMIO region
high_mmio_baseafter plat_mmiomax phys addrHigh MMIO allocation area

Layout when booting a kernel

These apply when no bootloader is passed, so crosvm boots a kernel directly.

Name/source linkAddressEnd (exclusive)SizeNotes
AARCH64_KERNEL_OFFSET8080_0000Kernel load location in RAM
initrd_addrafter kernelLinux initrd location in RAM
fdt_offsetbefore end of RAM2 MiBFlattened device tree in RAM

Layout when booting a bootloader

These apply when a bootloader is passed with --bios.

Name/source linkAddressEnd (exclusive)SizeNotes
AARCH64_FDT_OFFSET_IN_BIOS_MODE8000_00008020_00002 MiBFlattened device tree in RAM
AARCH64_BIOS_OFFSET8020_0000Bootloader image in RAM