mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-13 11:33:58 +00:00
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:
@@ -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));
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user