=== FreeBSD/ARM64 on Xen

Links: +
link:https://www.xenproject.org/[Xen Project] URL: link:https://www.xenproject.org/[https://www.xenproject.org/] +
link:https://wiki.freebsd.org/Xen[FreeBSD wiki page on Xen] URL: link:https://wiki.freebsd.org/Xen[https://wiki.freebsd.org/Xen]

Contact: Elliott Mitchell <ehem+freebsd@m5p.com>

Xen is an open source hypervisor.
Xen is one of the earliest hypervisors and has support for many OSes.
Since FreeBSD 8.0, GENERIC FreeBSD/x86 has been able to run on Xen.
Near the time FreeBSD was ported to run on Xen, work was started on running Xen on ARM.
For a number of years Linux has run fine on Xen/ARM, but FreeBSD hasn't been available.

Having FreeBSD/ARM64 on Xen means any system capable of having Xen can also have FreeBSD in operation.
Of note, the Raspberry PI 4B has hardware (GICv3) which Xen works with.
If you're okay with Linux handling the hardware, you can use all the hardware of a Raspberry PI 4B.

In 2014 a proof of concept of running FreeBSD/ARM64 on Xen was done by Julien Grall, but this was never polished for release.
During the past 2 years I've been working towards having this in FreeBSD's tree, so released versions of FreeBSD/ARM64 would run on Xen.
At this point all changes which need to be shared with the x86 Xen source code have been reviewed (not all reviews are on Phabricator).
This now awaits testing by Roger Pau Monné before being committed to FreeBSD's tree.

I now urgently need someone with a high level of familiarity with the interrupt subsystem of FreeBSD on ARM64 to review (and commit) the ARM-specific portions.
My builds are functional far more often than they fail, and most failures are temporary problems in FreeBSD's tree.
Some significant issues will need to be addressed regarding FreeBSD's interrupt subsystem.

There is substantial hope of having FreeBSD/ARM64 available for "DomU" (unprivileged) operation for FreeBSD 14.0.
There is potential for FreeBSD/ARM and FreeBSD/RISC-V to run on Xen in short order.
No plans currently exist for having FreeBSD/ARM64 operating as the controlling VM (someone could try to sponsor this).

==== Thanks

Thanks to Julien Grall <julien@xen.org> for the Proof of Concept. +
Thanks to Roger Pau Monné <royger@FreeBSD.org> for reviewing changes involving x86. +
Thanks to Mitchell Horne <mhorne@FreeBSD.org> for helping with various FreeBSD/ARM64 issues and addressing a key problem with FreeBSD/ARM64.
