Re: [edk2-devel] [PATCH v3 15/35] OvmfPkg/AcpiPlatformDxe: Use Xen PVH RSDP if it exist

2019-07-08 Thread Laszlo Ersek
On 07/04/19 16:42, Anthony PERARD wrote:
> If the firmware have been started via the Xen PVH entry point, a RSDP
> pointer would have been provided. Use it.
> 
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1689
> Signed-off-by: Anthony PERARD 
> ---
> 
> Notes:
> v3:
> - patch splited from the previous one
> - Fix DEBUG format string, use %p for pointers.
>   and use gEfiCallerBaseName to print module name
> 
>  OvmfPkg/AcpiPlatformDxe/Xen.c | 17 +
>  1 file changed, 17 insertions(+)
> 
> diff --git a/OvmfPkg/AcpiPlatformDxe/Xen.c b/OvmfPkg/AcpiPlatformDxe/Xen.c
> index 82794b933e..376a6bd3cb 100644
> --- a/OvmfPkg/AcpiPlatformDxe/Xen.c
> +++ b/OvmfPkg/AcpiPlatformDxe/Xen.c
> @@ -36,10 +36,27 @@ GetXenAcpiRsdp (
>EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER   *RsdpStructurePtr;
>UINT8  *XenAcpiPtr;
>UINT8  Sum;
> +  EFI_XEN_INFO   *XenInfo;
>  
>//
>// Detect the RSDP structure
>//
> +
> +  //
> +  // First look for PVH one
> +  //
> +  XenInfo = XenGetInfoHOB ();
> +  ASSERT (XenInfo != NULL);
> +  if (XenInfo->RsdpPvh != NULL) {
> +DEBUG ((DEBUG_INFO, "%a: Use ACPI RSDP table at 0x%p\n",
> +gEfiCallerBaseName, XenInfo->RsdpPvh));

(1) Please fix the indentation here; "gEfiCallerBaseName" should start
under the "B" in "DEBUG".

With that updated:

Reviewed-by: Laszlo Ersek 

Thanks
Laszlo

> +*RsdpPtr = XenInfo->RsdpPvh;
> +return EFI_SUCCESS;
> +  }
> +
> +  //
> +  // Otherwise, look for the HVM one
> +  //
>for (XenAcpiPtr = (UINT8*)(UINTN) XEN_ACPI_PHYSICAL_ADDRESS;
> XenAcpiPtr < (UINT8*)(UINTN) XEN_BIOS_PHYSICAL_END;
> XenAcpiPtr += 0x10) {
> 


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

View/Reply Online (#43404): https://edk2.groups.io/g/devel/message/43404
Mute This Topic: https://groups.io/mt/32308713/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH v3 15/35] OvmfPkg/AcpiPlatformDxe: Use Xen PVH RSDP if it exist

2019-07-04 Thread Anthony PERARD
If the firmware have been started via the Xen PVH entry point, a RSDP
pointer would have been provided. Use it.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1689
Signed-off-by: Anthony PERARD 
---

Notes:
v3:
- patch splited from the previous one
- Fix DEBUG format string, use %p for pointers.
  and use gEfiCallerBaseName to print module name

 OvmfPkg/AcpiPlatformDxe/Xen.c | 17 +
 1 file changed, 17 insertions(+)

diff --git a/OvmfPkg/AcpiPlatformDxe/Xen.c b/OvmfPkg/AcpiPlatformDxe/Xen.c
index 82794b933e..376a6bd3cb 100644
--- a/OvmfPkg/AcpiPlatformDxe/Xen.c
+++ b/OvmfPkg/AcpiPlatformDxe/Xen.c
@@ -36,10 +36,27 @@ GetXenAcpiRsdp (
   EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER   *RsdpStructurePtr;

   UINT8  *XenAcpiPtr;

   UINT8  Sum;

+  EFI_XEN_INFO   *XenInfo;

 

   //

   // Detect the RSDP structure

   //

+

+  //

+  // First look for PVH one

+  //

+  XenInfo = XenGetInfoHOB ();

+  ASSERT (XenInfo != NULL);

+  if (XenInfo->RsdpPvh != NULL) {

+DEBUG ((DEBUG_INFO, "%a: Use ACPI RSDP table at 0x%p\n",

+gEfiCallerBaseName, XenInfo->RsdpPvh));

+*RsdpPtr = XenInfo->RsdpPvh;

+return EFI_SUCCESS;

+  }

+

+  //

+  // Otherwise, look for the HVM one

+  //

   for (XenAcpiPtr = (UINT8*)(UINTN) XEN_ACPI_PHYSICAL_ADDRESS;

XenAcpiPtr < (UINT8*)(UINTN) XEN_BIOS_PHYSICAL_END;

XenAcpiPtr += 0x10) {

-- 
Anthony PERARD


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

View/Reply Online (#43293): https://edk2.groups.io/g/devel/message/43293
Mute This Topic: https://groups.io/mt/32308713/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-