[GSOC] bhyve port on ARM - weekly status report

Mihai Carabas mihai.carabas at gmail.com
Mon Jul 6 15:00:37 UTC 2015

Hi everyone,

In the last week I copied the vmm code from amd64 platform and I stripped
> it down to only basic operations (vmm init/cleanup, vminit/cleanup and
> vmrun). I've written some code for mapping operation [1] (PL-2 stage1
>  and PL1 stage-2 - combined) for LPAE format (this is the only format
> supported in HYP-mode). Unfortunatelly the FreeBSD pmap code doesn't
> support LPAE format and I couldn't integrate memory management in the PMAP
> infrastructure (like it is currently in amd64 - this will be handled after
> this basic implementation because is an entire project that needs to be
> tackled).
> I've also been writing the low-level initialization code for the
> hypervisor to replace the stub code installed at boot time. Right now we
> are able to insert the vmm-arm.ko module which performs all the necesary
> initialization (installs the new exception vector, activates the MMU). When
> we remove the vmm-arm module the stub exception vector is reinstalled and
> the MMU deactivated, bringing the host to the initial state.
> In the last week I've started writing low-level ASM code which is
saving/restoring the guest/host state. I've created a logic for a full pass
from the host to the guest and back [1]:
- when the host is calling the "HYP" instruction, causes a trap in hyp-mode
where it can run different functions specific to this mode. An example is
hyp_enter_guest function which saves the host state, loads the guest state
and jumps to the guest pc with an eret instruction (back to svc mode
- when the guest executes an instruction that causes a trap (e.g. wfi which
was configured by us) the code is saving the guest state, loading the host
state and than is returning to host svc-mode with the exception of the
guest to manage it
- I've also implemented a call to panic function in host if the abort
exceptions in hyp-mode are raised.

There are still some configuration registers that need to be tackled (like
VCTBR - defines the guest configuration for the stage 2 address

In the next week I have to write the C code which is calling the ASM
methods in arm_vmrun and the init code which allocates the context
structure (arm_vminit) and maps it in HYP-Mode. I will try to integrate
these operations with bhyve userspace tools to ease the development.

Thank you,


More information about the soc-status mailing list