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-06-09 10:07:09 +08:00
committed by wenlingz
parent 4e1deab3d9
commit 9ac8e292fd
4 changed files with 99 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 loader_signature; /* 0x1c0 */
uint32_t systab; /* 0x1c4 */