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

[RFC] Support PVH boot protocol #1818

Closed
wants to merge 7 commits into from

Commits on Apr 23, 2020

  1. pvh/kernel: Add ELF Note definitions

    Define ELF Note header structure and constants necessary for parsing
    the PVH entry point address encoded in kernel ELF header.
    
    Signed-off-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
    Acked-by: Liam Merwick <liam.merwick@oracle.com>
    aljimenezb committed Apr 23, 2020
    Configuration menu
    Copy the full SHA
    e694df3 View commit details
    Browse the repository at this point in the history
  2. pvh/arch_gen: Introduce hvm_start_info structure

    Introduce the layout and define the start_info, module
    list and memory map table entry structures used by the
    PVH boot protocol.
    
    The hvm_start_info structure is akin to bootparams in
    Linux boot protocol, specifying the small set of
    parameters required by the PVH protocol.
    
    Signed-off-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
    Acked-by: Liam Merwick <liam.merwick@oracle.com>
    aljimenezb committed Apr 23, 2020
    Configuration menu
    Copy the full SHA
    c9a7f5a View commit details
    Browse the repository at this point in the history
  3. pvh/kernel: Read PVH entry point address from kernel binary

    Parse the ELF header looking for a PVH Note section and retrieve
    the encoded PVH entry point address if there is one. This PVH entry
    point address is returned alongside the typical ELF entry point used
    for direct boot. The vmm crate can now determine whether a
    PVH entry point is available and choose to configure its guests
    to boot using either PVH or Linux 64-bit protocol.
    
    Signed-off-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
    Acked-by: Liam Merwick <liam.merwick@oracle.com>
    aljimenezb committed Apr 23, 2020
    Configuration menu
    Copy the full SHA
    d3a1fc7 View commit details
    Browse the repository at this point in the history
  4. pvh/arch: Introduce EntryPoint struct

    In order to properly configure the initial vCPU register state
    and boot parameters in guest memory, we must specify which
    boot protocol to use with the kernel entry point address.
    
    Create an EntryPoint struct that contains the required
    information. This structure will later be used in the vCPU
    configuration methods to set the appropriate initial
    conditions for the guest.
    
    Signed-off-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
    Acked-by: Liam Merwick <liam.merwick@oracle.com>
    aljimenezb committed Apr 23, 2020
    Configuration menu
    Copy the full SHA
    507d9ac View commit details
    Browse the repository at this point in the history
  5. pvh/arch-x86_64: Initialize vCPU regs/sregs for PVH boot

    Set the initial values of the KVM vCPU registers as specified in
    the PVH boot ABI:
    
    https://xenbits.xen.org/docs/unstable/misc/pvh.html
    
    Signed-off-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
    Acked-by: Liam Merwick <liam.merwick@oracle.com>
    aljimenezb committed Apr 23, 2020
    Configuration menu
    Copy the full SHA
    a5ab32c View commit details
    Browse the repository at this point in the history
  6. pvh/arch-x86_64: Write start_info structure to guest memory

    Fill the hvm_start_info and related structures as specified
    in the PVH boot protocol. Write the data structures to guest
    memory at the GPA that will be stored in %rbx when the guest starts.
    
    Signed-off-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
    Acked-by: Liam Merwick <liam.merwick@oracle.com>
    aljimenezb committed Apr 23, 2020
    Configuration menu
    Copy the full SHA
    85be111 View commit details
    Browse the repository at this point in the history
  7. pvh: Control PVH capabilities using optional feature

    Enable the optional "pvh" feature to build a Firecracker binary
    that is able to boot Linux guests using the PVH boot protocol.
    Build a firecracker binary with the PVH capability by running:
    
    tools/devtool build [--release] -- --features pvh
    
    and the resulting Firecracker binary will use the PVH boot
    protocol as the preferred choice for booting a guest, if the
    guest kernel supports it.
    
    Signed-off-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
    Acked-by: Liam Merwick <liam.merwick@oracle.com>
    aljimenezb committed Apr 23, 2020
    Configuration menu
    Copy the full SHA
    890af2b View commit details
    Browse the repository at this point in the history