Hi Dorjoy,

On 18/5/24 10:07, Dorjoy Chowdhury wrote:
An EIF (Enclave Image Format)[1] image is used to boot an AWS nitro
enclave[2] virtual machine. The EIF file contains the necessary
kernel, cmdline, ramdisk(s) sections to boot.

This commit adds support for loading EIF image using the microvm
machine code. For microvm to boot from an EIF file, the kernel and
ramdisk(s) are extracted into a temporary kernel and a temporary
initrd file which are then hooked into the regular x86 boot mechanism
along with the extracted cmdline.

Although not useful for the microvm machine itself, this is needed
as the following commit adds support for a new machine type
'nitro-enclave' which uses the microvm machine type as parent. The
code for checking and loading EIF will be put inside a 'nitro-enclave'
machine type check in the following commit so that microvm cannot load
EIF because it shouldn't.

[1] https://github.com/aws/aws-nitro-enclaves-image-format

The documentation is rather scarse...

[2] https://aws.amazon.com/ec2/nitro/nitro-enclaves/

Signed-off-by: Dorjoy Chowdhury <dorjoychy...@gmail.com>
---
  hw/i386/eif.c       | 486 ++++++++++++++++++++++++++++++++++++++++++++
  hw/i386/eif.h       |  20 ++
  hw/i386/meson.build |   2 +-

... still it seems a generic loader, not restricted to x86.

Maybe better add it as hw/core/loader-eif.[ch]?

  hw/i386/microvm.c   | 134 +++++++++++-
  4 files changed, 640 insertions(+), 2 deletions(-)
  create mode 100644 hw/i386/eif.c
  create mode 100644 hw/i386/eif.h


Reply via email to