With nested VMX, L2 runs on the page tables that L1 has made for it.
When L2 gets to an address that is not memory of the VM, such as the
local APIC or a device that bhyve(8) emulates, the VM was suspended as
after a triple fault. On a CPU L2 would get to L1's device.
The instruction is now emulated as it is for L1: vmx_exit_process()
makes the exit for the instruction emulation from L2's state in vmcs02,
and vmx_run_nested() continues with L2's %rip afterwards, as it does
for I/O ports.
AI assistance: as D61708, this change was developed with an AI assistant (Anthropic's Claude) under my direction. The assistant wrote the code and this description. The tests in the test plan were run on real hardware.
Signed-off-by: Wanpeng Qian <wanpengqian@gmail.com>
Sponsored by: keelos.dev