Date: Mon, 6 Jul 2015 18:00:35 +0300 From: Mihai Carabas <mihai.carabas@gmail.com> To: soc-status@freebsd.org Subject: Re: [GSOC] bhyve port on ARM - weekly status report Message-ID: <CANg1yUt4tGB%2Bh6ZBQPqvQcbt66PM3qZmTdrCTKHQYREhz3P4aw@mail.gmail.com> In-Reply-To: <CANg1yUsAifBweEKHBZbMrEpYmTd60ACq-H6aJ9Px%2BRb6ZK8moQ@mail.gmail.com> References: <CANg1yUspT8uHtX4bu0kO5dWLssvv-5457kSBovdyNKpi-OQ1kw@mail.gmail.com> <CANg1yUvgvtp5asPXLmtjwkROZ4Kf=mrOxXFcwvwdseYoQkcivA@mail.gmail.com> <CANg1yUsT=RRiNffq6cEXZArR4dYg9RiRc3dgc%2BCXMaY8JYir2Q@mail.gmail.com> <CANg1yUvyjTezxURAJi2EnYh6WLGVwSJbMSQNUEV0A2Un7kKNjA@mail.gmail.com> <CANg1yUsAifBweEKHBZbMrEpYmTd60ACq-H6aJ9Px%2BRb6ZK8moQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 basically) - 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 translation). 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, Mihai [1] https://svnweb.freebsd.org/socsvn/soc2015/mihai/bhyve-on-arm-head/sys/arm/vmm/hyp.S?view=markup
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANg1yUt4tGB%2Bh6ZBQPqvQcbt66PM3qZmTdrCTKHQYREhz3P4aw>