Hi Samuel,

Nice to see you were able to get a VM up and going. I will look at adding that as a config option when I have a chance. The major downside to qemu is the lack of IOMMU, if you're willing to go through a more complicated build procedure you can use vmware, which provides emulation of both vt-x and the IOMMU.

Adrian

On Thu 16-Jun-2016 3:18 AM, Samuel Weiser wrote:
Hi,

I just want to share some information which I needed to run camkes-vm with qemu, especially addressing one issue which prevented the guest vm to boot. I basically follow the recommendations of Adrian in [1] and only focus on the simple case without vt-d.

1. use the 'optiplex9020_onevm' configuration as it basically just specifies physical RAM.
2. enable nested KVM [2,3]
3. run QEMU with enough RAM:
qemu-system-i386 -nographic \
    -m 3GB \
    -enable-kvm \
    -cpu host \
    -kernel images/kernel-ia32-pc99 -initrd images/capdl-loader-experimental-image-ia32-pc99

Following the above steps gives you a booting camkes vmm, however it fails to eventually activate Intel vt-x, needed to run the guest vm. The reason for that is that the seL4 kernel requires the IA32_FEATURE_CONTROL MSR to have VMXON enabled (bit 2) and locked (bit 0) (i.e. a value of 5). Normally, it's the job of the BIOS to do so, however I couldn't find an appropriate QEMU BIOS ROM which does so. The quick workaround is to enable VMXON within the seL4 kernel itself. The corresponding diff is attached. With this minor change, the recompiled kernel works like a charm.

PS:
One could consider making a separate option in Kconfig for that purpose.


Best,
Sammey

[1] https://sel4.systems/pipermail/devel/2016-March/000717.html
[2] http://www.rdoxenham.com/?p=275
[3] https://wiki.archlinux.org/index.php/QEMU#Enabling_KVM


_______________________________________________
Devel mailing list
Devel@sel4.systems
https://sel4.systems/lists/listinfo/devel




The information in this e-mail may be confidential and subject to legal professional privilege and/or copyright. National ICT Australia Limited accepts no liability for any damage caused by this email or its attachments.