Skip to content

aarch64 Support #198

@retrage

Description

@retrage

This issue tracks aarch64 support.

I am working on an experimental implementation of aarch64 support for Rust Hypervisor Firmware.
The code is available at:

Current Status

The changes in this branch have been tested to work using QEMU aarch64 virt.
Similar to x86_64, you can boot the Linux image by specifying the firmware with -kernel. The major changes are as follows:

  • Add target and linker scripts for aarch64.
  • Add BootInfo for FDT.
  • Support for PCI configuration space access using MMIO on aarch64
  • Add virtio-mmio driver (only for QEMU)

I will propose these changes in multiple PRs.

To-Do

Known Issues

This aarch64 support has the following issues.

Cloud Hypervisor is not yet supported.

This aarch64 support does not yet support Cloud Hypervisor. This is because I do not have an aarch64 machine that supports GICv3 or later and cannot test it. Please let me know if there is a good test environment available.

Update: It works with a custom Ubuntu bionic cloud image.

objcopy is required as post-processing after build.

QEMU aarch64 virt has an emulator loader that behaves differently depending on the type of binary passed with -kernel. When the binary is not ELF, QEMU executes the binary with the first address of the FDT passed in the x0 register. You need to run objcopy as a post-processing step to convert it to raw binary, as follows:
This post process is not needed by generating as a raw binary at link time. See eaed071.

Run QEMU with the binary as follows:

qemu-system-aarch64 \
  -machine virt \
  -cpu cortex-a53 \
  -m 8G \
  -nographic \
  -serial mon:stdio \
  -drive id=disk,file=$(AARCH64_IMG),if=none \
  -device virtio-blk-pci,drive=disk,disable-legacy=on \
  -kernel target/aarch64-unknown-none/debug/hypervisor-fw

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions