[edk2-devel] [PATCH V3 6/6] OvmfPkg/AcpiPlatformDxe: Return error if installing NotifyProtocol failed

Boeuf, Sebastien sebastien.boeuf at intel.com
Thu Jan 12 10:04:40 UTC 2023


On Wed, 2023-01-11 at 09:22 +0800, Min Xu wrote:
> From: Min M Xu <min.m.xu at intel.com>
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4237
> 
> Installation of gQemuAcpiTableNotifyProtocol may fail. The error code
> should be returned so that the caller can handle it.
> 
> Cc: Erdem Aktas <erdemaktas at google.com>
> Cc: James Bottomley <jejb at linux.ibm.com>
> Cc: Jiewen Yao <jiewen.yao at intel.com>
> Cc: Gerd Hoffmann <kraxel at redhat.com>
> Cc: Tom Lendacky <thomas.lendacky at amd.com>
> Cc: Sebastien Boeuf <sebastien.boeuf at intel.com>
> Signed-off-by: Min Xu <min.m.xu at intel.com>
> ---
>  OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c | 16 ++++++++++------
>  1 file changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c
> b/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c
> index 8f90ea23996d..d56eb074a987 100644
> --- a/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c
> +++ b/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c
> @@ -89,12 +89,16 @@ InstallCloudHvTablesTdx (
>    // ready.
>    //
>    ChAcpiHandle = NULL;
> -  gBS->InstallProtocolInterface (
> -         &ChAcpiHandle,
> -         &gQemuAcpiTableNotifyProtocolGuid,
> -         EFI_NATIVE_INTERFACE,
> -         NULL
> -         );
> +  Status       = gBS->InstallProtocolInterface (
> +                        &ChAcpiHandle,
> +                        &gQemuAcpiTableNotifyProtocolGuid,
> +                        EFI_NATIVE_INTERFACE,
> +                        NULL
> +                        );
> +  if (EFI_ERROR (Status)) {
> +    ASSERT_EFI_ERROR (Status);
> +    return Status;
> +  }
>  
>    return EFI_SUCCESS;
>  }

Looks good and I've tested Cloud Hypervisor with both CloudHvX64 and
IntelTdxX64 targets.

Reviewed-by: Sebastien Boeuf <sebastien.boeuf at intel.com>
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 5 208 026.16 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#98352): https://edk2.groups.io/g/devel/message/98352
Mute This Topic: https://groups.io/mt/96191603/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