[edk2-devel] [PATCH v3 11/35] OvmfPkg/XenPlatformPei: Use mXenHvmloaderInfo to get E820

Anthony PERARD anthony.perard at citrix.com
Thu Jul 4 14:42:09 UTC 2019


Use the already checked pointer mXenHvmloaderInfo to retrieve the E820
table produced by hvmloader.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1689
Signed-off-by: Anthony PERARD <anthony.perard at citrix.com>
Acked-by: Laszlo Ersek <lersek at redhat.com>
---
 OvmfPkg/XenPlatformPei/Xen.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/OvmfPkg/XenPlatformPei/Xen.c b/OvmfPkg/XenPlatformPei/Xen.c
index d6361da306..9c2ff6324d 100644
--- a/OvmfPkg/XenPlatformPei/Xen.c
+++ b/OvmfPkg/XenPlatformPei/Xen.c
@@ -53,18 +53,18 @@ XenGetE820Map (
   UINT32 *Count

   )

 {

-  EFI_XEN_OVMF_INFO *Info =

-    (EFI_XEN_OVMF_INFO *)(UINTN) OVMF_INFO_PHYSICAL_ADDRESS;

+  //

+  // Get E820 produced by hvmloader

+  //

+  if (mXenHvmloaderInfo != NULL) {

+    ASSERT (mXenHvmloaderInfo->E820 < MAX_ADDRESS);

+    *Entries = (EFI_E820_ENTRY64 *)(UINTN) mXenHvmloaderInfo->E820;

+    *Count = mXenHvmloaderInfo->E820EntriesCount;

 

-  if (AsciiStrCmp ((CHAR8 *) Info->Signature, "XenHVMOVMF")) {

-    return EFI_NOT_FOUND;

+    return EFI_SUCCESS;

   }

 

-  ASSERT (Info->E820 < MAX_ADDRESS);

-  *Entries = (EFI_E820_ENTRY64 *)(UINTN) Info->E820;

-  *Count = Info->E820EntriesCount;

-

-  return EFI_SUCCESS;

+  return EFI_NOT_FOUND;

 }

 

 /**

-- 
Anthony PERARD


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43298): https://edk2.groups.io/g/devel/message/43298
Mute This Topic: https://groups.io/mt/32308722/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list