HV: add efi memory map parsing function

When hypervisor boot from efi environment, the efi memory layout should be
considered as main memory map reference for hypervisor use. This patch add
function that parses the efi memory descriptor entries info from efi memory
map pointer and stores the info into a static hv_memdesc[] array.

Tracked-On: #5626

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
This commit is contained in:
Victor Sun
2021-05-27 19:09:32 +08:00
committed by wenlingz
parent 4c2213594c
commit dbc86a005c
4 changed files with 98 additions and 0 deletions

View File

@@ -7,6 +7,15 @@
#ifndef EFI_H
#define EFI_H
struct efi_memory_desc {
uint32_t type;
uint32_t pad;
uint64_t phys_addr;
uint64_t virt_addr;
uint64_t num_pages;
uint64_t attribute;
};
struct efi_info {
uint32_t efi_loader_signature; /* 0x1c0 */
uint32_t efi_systab; /* 0x1c4 */