HV: init efi info with multiboot2

Initialize efi info of acrn mbi when boot from multiboot2 protocol, with
this patch hypervisor could get host efi info and pass it to Linux zeropage,
then make guest Linux possible to boot with efi environment;

Tracked-On: #4419

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Victor Sun
2020-02-19 16:12:55 +08:00
committed by wenlingz
parent 69da0243f5
commit da3d181f62
6 changed files with 97 additions and 3 deletions

View File

@@ -12,10 +12,15 @@
#include <multiboot2.h>
#endif
#include <e820.h>
#include <zeropage.h>
#define MAX_BOOTARGS_SIZE 2048U
#define MAX_MODULE_COUNT 4U
/* extended flags for acrn multiboot info from multiboot2 */
#define MULTIBOOT_INFO_HAS_EFI_MMAP 0x00010000U
#define MULTIBOOT_INFO_HAS_EFI64 0x00020000U
struct acrn_multiboot_info {
uint32_t mi_flags; /* the flags is back-compatible with multiboot1 */
@@ -32,11 +37,14 @@ struct acrn_multiboot_info {
struct multiboot_mmap mi_mmap_entry[E820_MAX_ENTRIES];
void *mi_acpi_rsdp;
struct efi_info mi_efi_info;
};
/* boot_regs store the multiboot info magic and address */
extern uint32_t boot_regs[2];
extern char *efiloader_sig;
static inline bool boot_from_multiboot1(void)
{
return ((boot_regs[0] == MULTIBOOT_INFO_MAGIC) && (boot_regs[1] != 0U));

View File

@@ -126,6 +126,22 @@ struct multiboot2_tag_new_acpi
uint8_t rsdp[0];
};
struct multiboot2_tag_efi64
{
uint32_t type;
uint32_t size;
uint64_t pointer;
};
struct multiboot2_tag_efi_mmap
{
uint32_t type;
uint32_t size;
uint32_t descr_size;
uint32_t descr_vers;
uint8_t efi_mmap[0];
};
#endif /* ASSEMBLER */
#endif /* MULTIBOOT2_H */