libkrun
libkrun copied to clipboard
Implement support for HVF Nested Virtualization
Apple introduced Nested Virt (EL2) support in macOS Sequoia, available
on Apple Silicon devices based on M3 and later SoCs.
This commit introduces the infrastructure to enable Nested Virt on
libkrun. The biggest change is setting up the vCPU reset registers to
values that are acceptable in EL2 according. This isn't easy since HVF
doesn't document its expectations, but the current implementation allows
the guest to boot in EL2 and run a nested guest.
Instead of linking directly against the new functions, we're using
libloader again to find the new symbols, to avoid breaking the binaries
in Sonoma.
This depends on #280, creating this as a draft until it's merged.
Rebased, working and ready to be reviewed!