Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support more VMMs (QEMU, crosvm, XEN) #6

Closed
2 tasks
josephlr opened this issue May 12, 2019 · 1 comment · Fixed by #26
Closed
2 tasks

Support more VMMs (QEMU, crosvm, XEN) #6

josephlr opened this issue May 12, 2019 · 1 comment · Fixed by #26

Comments

@josephlr
Copy link
Contributor

Right now it's not possible to run the firmware with any non-Firecracker VMM. Ideally we would support a wide range of VMMs. There are many small changes that would fix this:

  • In the ELF binary, advertise support for a common boot specification. This would allow any VMM supporting that spec to run the firmware. Our options are:

    • Mutliboot/Multiboot2: this is an older FSF common boot standard. It would also let us work with QEMU's -kernel option (might also work with Xen).
    • PVH direct boot: This standard started with XEN, but support was added to QEMU recently. To use this, we just need to advertise XEN_ELFNOTE_PHYS32_ENTRY as an ELFNOTE. Not supporting PVH is why running QEMU with -kernel does not work:
      > qemu-system-x86_64 -kernel target/target/release/hypervisor-fw   
      qemu-system-x86_64: Error loading uncompressed kernel without PVH ELF Note
      
    • Note that both of these specs would (probably) require a separate 32-bit entry point. The firmware would then need to setup paging before jumping to the normal 64-bit ELF entry point (i.e. _start).
  • Issue Support building as flat BIOS image #5: support building the firmware as a flat BIOS binary (like OVMF.fd), allowing it to be directly loaded/executed by any VMM that supports SeaBIOS/OVMF.

Implementing either of these would let the firmware work on QEMU. I'm not sure about how to get it working for crosvm (it should "just work" with any ELF binary). I can ask around at work Monday to see what the deal is.

@rbradford
Copy link
Member

PVH would be my strongest preference as I think it will require the least code to program the appropriate state. That being said patches will be accepted for all options.

Note that both of these specs would (probably) require a separate 32-bit entry point. The firmware would then need to setup paging before jumping to the normal 64-bit ELF entry point (i.e. _start).

Sounds fine.

I'm not sure about how to get it working for crosvm (it should "just work" with any ELF binary). I can ask around at work Monday to see what the deal is.

Last time I looked it had a hardcoded jump into 0x200 + text segment (for the Linux kernel setup64 entry point)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants