From nobody Wed Dec 25 12:56:14 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1507797485400390.0549270406998; Thu, 12 Oct 2017 01:38:05 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 41EB521F3C1A3; Thu, 12 Oct 2017 01:34:33 -0700 (PDT) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6BB3520945BA6 for ; Thu, 12 Oct 2017 01:34:31 -0700 (PDT) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Oct 2017 01:38:01 -0700 Received: from ydong10-win10.ccr.corp.intel.com ([10.239.158.57]) by orsmga005.jf.intel.com with ESMTP; 12 Oct 2017 01:37:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=eric.dong@intel.com; receiver=edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,365,1503385200"; d="scan'208";a="159652472" From: Eric Dong To: edk2-devel@lists.01.org Date: Thu, 12 Oct 2017 16:37:58 +0800 Message-Id: <1507797478-13028-1-git-send-email-eric.dong@intel.com> X-Mailer: git-send-email 2.7.0.windows.1 Subject: [edk2] [Patch] UefiCpuPkg/S3Resume2Pei: Handle Communicate Ppi not exist issue. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ruiyu Ni , Laszlo Ersek , Jiewen Yao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Current code assume Communicate Ppi always existed, so it adds ASSERT to confirm it. Ovmf platform happened not has this Ppi, so the ASSERT been trig. This patch handle Ppi not existed case. Cc: Ruiyu Ni Cc: Jiewen Yao Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Eric Dong Reviewed-by: Laszlo Ersek Tested-by: Laszlo Ersek --- UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c | 23 ++++++++++---------= ---- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c b/UefiCpuPkg= /Universal/Acpi/S3Resume2Pei/S3Resume.c index c2171cb..e0c2d36 100644 --- a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c +++ b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c @@ -465,7 +465,7 @@ SignalEndOfS3Resume ( SMM_COMMUNICATE_HEADER_64 Header64; VOID *CommBuffer; =20 - DEBUG ((EFI_D_INFO, "SignalEndOfS3Resume - Enter\n")); + DEBUG ((DEBUG_INFO, "SignalEndOfS3Resume - Enter\n")); =20 // // This buffer consumed in DXE phase, so base on DXE mode to prepare com= municate buffer. @@ -484,29 +484,27 @@ SignalEndOfS3Resume ( } CopyGuid (CommBuffer, &gEdkiiSmmEndOfS3ResumeProtocolGuid); =20 - // - // Get needed resource - // Status =3D PeiServicesLocatePpi ( &gEfiPeiSmmCommunicationPpiGuid, 0, NULL, (VOID **)&SmmCommunicationPpi ); - ASSERT_EFI_ERROR (Status); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "Locate Smm Communicate Ppi failed (%r)!\n", Stat= us)); + return Status; + } =20 - // - // Send command - // Status =3D SmmCommunicationPpi->Communicate ( SmmCommunicationPpi, (VOID *)CommBuffer, &CommSize ); - ASSERT_EFI_ERROR (Status); - - DEBUG ((EFI_D_INFO, "SignalEndOfS3Resume - Exit (%r)\n", Status)); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "SmmCommunicationPpi->Communicate return failure = (%r)!\n", Status)); + } =20 + DEBUG ((DEBUG_INFO, "SignalEndOfS3Resume - Exit (%r)\n", Status)); return Status; } =20 @@ -587,8 +585,7 @@ S3ResumeBootOs ( // // Signal EndOfS3Resume event. // - Status =3D SignalEndOfS3Resume (); - ASSERT_EFI_ERROR (Status); + SignalEndOfS3Resume (); =20 // // report status code on S3 resume --=20 2.7.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel