UEFI: bug fix on delivering RSDP

With current code, memcpy rsdp to 0x500 maybe overwrite uefi
code/data region.

So remove the legacy BIOS deliver method of RSDP, which need copy
the RSDP to EBDA space which is addressed by the 16bit pointer
at 0x40E or upper memory BIOS space 0xe0000-0xfffff. And just
deliver the pointer of RSDP, which is already saved in UEFI system
table, to hypervisor.

Create a function named efi_init() to separate efi initialize code.

Signed-off-by: Zheng, Gen <gen.zheng@intel.com>
This commit is contained in:
Zheng, Gen
2018-03-24 14:17:23 +08:00
committed by Jack Ren
parent 8d67f292ef
commit 1f3acb3dd9
5 changed files with 43 additions and 16 deletions

View File

@@ -35,6 +35,9 @@
#include <hv_arch.h>
#include <hv_debug.h>
#include "acpi.h"
#ifdef CONFIG_EFI_STUB
#include <acrn_efi.h>
#endif
#define ACPI_SIG_RSDP "RSD PTR " /* Root System Description Ptr */
#define ACPI_OEM_ID_SIZE 6
@@ -140,6 +143,12 @@ static void *get_rsdp(void)
struct acpi_table_rsdp *rsdp = NULL;
uint16_t *addr;
#ifdef CONFIG_EFI_STUB
rsdp = get_rsdp_from_uefi();
if (rsdp)
return rsdp;
#endif
/* EBDA is addressed by the 16 bit pointer at 0x40E */
addr = (uint16_t *)0x40E;