[edk2-devel] [PATCH v3 14/35] OvmfPkg/AcpiPlatformDxe: Use XenPlatformLib

Anthony PERARD posted 35 patches 5 years, 4 months ago
There is a newer version of this series
[edk2-devel] [PATCH v3 14/35] OvmfPkg/AcpiPlatformDxe: Use XenPlatformLib
Posted by Anthony PERARD 5 years, 4 months ago
This patch replace the XenDetected() function by the one in
XenPlatformLib.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1689
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---

Notes:
    v3:
    - new patch, splited from the next patch
      (which was OvmfPkg/AcpiPlatformDxe: Use PVH RSDP if exist)

 OvmfPkg/OvmfPkgIa32.dsc                     |  1 +
 OvmfPkg/OvmfPkgIa32X64.dsc                  |  1 +
 OvmfPkg/OvmfPkgX64.dsc                      |  1 +
 OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf |  2 +-
 OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h      |  6 +-----
 OvmfPkg/AcpiPlatformDxe/Xen.c               | 24 ---------------------
 6 files changed, 5 insertions(+), 30 deletions(-)

diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
index d60bcd5e54..1b116fe3b3 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -202,6 +202,7 @@ [LibraryClasses]
   SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf

   OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf

   XenHypercallLib|OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf

+  XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf

 

 !if $(TPM2_ENABLE) == TRUE

   Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf

diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
index ded3e8a464..bd8625a075 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -207,6 +207,7 @@ [LibraryClasses]
   SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf

   OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf

   XenHypercallLib|OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf

+  XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf

 

 !if $(TPM2_ENABLE) == TRUE

   Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf

diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index 131f2b0b47..db9ba7cc15 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -207,6 +207,7 @@ [LibraryClasses]
   SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf

   OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf

   XenHypercallLib|OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf

+  XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf

 

 !if $(TPM2_ENABLE) == TRUE

   Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf

diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf
index 24634eeae2..eadace366d 100644
--- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf
+++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf
@@ -44,13 +44,13 @@ [LibraryClasses]
   DebugLib

   UefiBootServicesTableLib

   UefiDriverEntryPoint

-  HobLib

   QemuFwCfgLib

   QemuFwCfgS3Lib

   MemoryAllocationLib

   BaseLib

   DxeServicesTableLib

   OrderedCollectionLib

+  XenPlatformLib

 

 [Protocols]

   gEfiAcpiTableProtocolGuid                     # PROTOCOL ALWAYS_CONSUMED

diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h
index 3037afcf18..9597e028e4 100644
--- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h
+++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h
@@ -19,6 +19,7 @@
 #include <Library/UefiBootServicesTableLib.h>

 #include <Library/DebugLib.h>

 #include <Library/PcdLib.h>

+#include <Library/XenPlatformLib.h>

 

 #include <IndustryStandard/Acpi.h>

 

@@ -52,11 +53,6 @@ QemuInstallAcpiTable (
   OUT  UINTN                         *TableKey

   );

 

-BOOLEAN

-XenDetected (

-  VOID

-  );

-

 EFI_STATUS

 EFIAPI

 InstallXenTables (

diff --git a/OvmfPkg/AcpiPlatformDxe/Xen.c b/OvmfPkg/AcpiPlatformDxe/Xen.c
index e4e47bf0e8..82794b933e 100644
--- a/OvmfPkg/AcpiPlatformDxe/Xen.c
+++ b/OvmfPkg/AcpiPlatformDxe/Xen.c
@@ -9,8 +9,6 @@
 **/ 

 

 #include "AcpiPlatform.h"

-#include <Library/HobLib.h>

-#include <Guid/XenInfo.h>

 #include <Library/BaseLib.h>

 

 #define XEN_ACPI_PHYSICAL_ADDRESS         0x000EA020

@@ -18,28 +16,6 @@
 

 EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER  *XenAcpiRsdpStructurePtr = NULL;

 

-/**

-  This function detects if OVMF is running on Xen.

-

-**/

-BOOLEAN

-XenDetected (

-  VOID

-  )

-{

-  EFI_HOB_GUID_TYPE         *GuidHob;

-

-  //

-  // See if a XenInfo HOB is available

-  //

-  GuidHob = GetFirstGuidHob (&gEfiXenInfoGuid);

-  if (GuidHob == NULL) {

-    return FALSE;

-  }

-

-  return TRUE;

-}

-

 /**

   Get the address of Xen ACPI Root System Description Pointer (RSDP)

   structure.

-- 
Anthony PERARD


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

View/Reply Online (#43288): https://edk2.groups.io/g/devel/message/43288
Mute This Topic: https://groups.io/mt/32308706/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v3 14/35] OvmfPkg/AcpiPlatformDxe: Use XenPlatformLib
Posted by Laszlo Ersek 5 years, 4 months ago
On 07/04/19 16:42, Anthony PERARD wrote:
> This patch replace the XenDetected() function by the one in
> XenPlatformLib.
> 
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1689
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> ---
> 
> Notes:
>     v3:
>     - new patch, splited from the next patch
>       (which was OvmfPkg/AcpiPlatformDxe: Use PVH RSDP if exist)

Reviewed-by: Laszlo Ersek <lersek@redhat.com>


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

View/Reply Online (#43403): https://edk2.groups.io/g/devel/message/43403
Mute This Topic: https://groups.io/mt/32308706/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v3 14/35] OvmfPkg/AcpiPlatformDxe: Use XenPlatformLib
Posted by Laszlo Ersek 5 years, 4 months ago
On 07/08/19 16:38, Laszlo Ersek wrote:
> On 07/04/19 16:42, Anthony PERARD wrote:
>> This patch replace the XenDetected() function by the one in
>> XenPlatformLib.
>>
>> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1689
>> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
>> ---
>>
>> Notes:
>>     v3:
>>     - new patch, splited from the next patch
>>       (which was OvmfPkg/AcpiPlatformDxe: Use PVH RSDP if exist)
> 
> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
> 

Sorry, I missed a cleanup option: please remove "gEfiXenInfoGuid" from
[Guids] in "AcpiPlatformDxe.inf".

(You can pick up the R-b with that.)

Thanks
Laszlo

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

View/Reply Online (#43470): https://edk2.groups.io/g/devel/message/43470
Mute This Topic: https://groups.io/mt/32308706/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-