[edk2-devel] [PATCH V3 2/6] OvmfPkg/AcpiPlatformDxe: Use local variable in CloudHvAcpi.c

Boeuf, Sebastien sebastien.boeuf at intel.com
Thu Jan 12 10:04:23 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
> 
> The handle of mChAcpiHandle is not needed for anything, beyond the
> scope of the InstallCloudHvTablesTdx (). A local variable
> (ChAcpiHandle)
> suffices for storing the handle.
> 
> Cc: Laszlo Ersek <lersek at redhat.com>
> 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>
> Reported-by: Laszlo Ersek <lersek at redhat.com>
> Signed-off-by: Min Xu <min.m.xu at intel.com>
> ---
>  OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c
> b/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c
> index ad39e4253478..8f90ea23996d 100644
> --- a/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c
> +++ b/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c
> @@ -20,8 +20,6 @@
>  
>  #include "AcpiPlatform.h"
>  
> -EFI_HANDLE  mChAcpiHandle = NULL;
> -
>  EFI_STATUS
>  EFIAPI
>  InstallCloudHvTablesTdx (
> @@ -30,6 +28,7 @@ InstallCloudHvTablesTdx (
>  {
>    EFI_STATUS  Status;
>    UINTN       TableHandle;
> +  EFI_HANDLE  ChAcpiHandle;
>  
>    EFI_PEI_HOB_POINTERS         Hob;
>    EFI_ACPI_DESCRIPTION_HEADER  *CurrentTable;
> @@ -89,8 +88,9 @@ InstallCloudHvTablesTdx (
>    // Install a protocol to notify that the ACPI table provided by CH
> is
>    // ready.
>    //
> +  ChAcpiHandle = NULL;
>    gBS->InstallProtocolInterface (
> -         &mChAcpiHandle,
> +         &ChAcpiHandle,
>           &gQemuAcpiTableNotifyProtocolGuid,
>           EFI_NATIVE_INTERFACE,
>           NULL

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 (#98351): https://edk2.groups.io/g/devel/message/98351
Mute This Topic: https://groups.io/mt/96191591/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