From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.31; helo=mga06.intel.com; envelope-from=eric.dong@intel.com; receiver=edk2-devel@lists.01.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 5064620945BA6 for ; Thu, 12 Oct 2017 01:31:38 -0700 (PDT) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP; 12 Oct 2017 01:35:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,365,1503385200"; d="scan'208";a="159651699" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga005.jf.intel.com with ESMTP; 12 Oct 2017 01:35:08 -0700 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 12 Oct 2017 01:35:08 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx109.amr.corp.intel.com (10.18.116.9) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 12 Oct 2017 01:35:08 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.175]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.213]) with mapi id 14.03.0319.002; Thu, 12 Oct 2017 16:35:06 +0800 From: "Dong, Eric" To: "Dong, Eric" , "edk2-devel@lists.01.org" CC: "Ni, Ruiyu" , Laszlo Ersek , "Yao, Jiewen" Thread-Topic: [edk2] [Patch] UefiCpuPkg/S3Resume2Pei: Handle Communicate Ppi not exist issue. Thread-Index: AQHTQzTkNeo8X50NpE6DfWsriRFEEKLf428A Date: Thu, 12 Oct 2017 08:35:06 +0000 Message-ID: References: <1507797200-7652-1-git-send-email-eric.dong@intel.com> In-Reply-To: <1507797200-7652-1-git-send-email-eric.dong@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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: , X-List-Received-Date: Thu, 12 Oct 2017 08:31:39 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi all, please ignore this patch, please this is not a full fix. Will send a new on= e soon. -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Eric= Dong Sent: Thursday, October 12, 2017 4:33 PM To: edk2-devel@lists.01.org Cc: Ni, Ruiyu ; Laszlo Ersek ; Yao, = Jiewen Subject: [edk2] [Patch] UefiCpuPkg/S3Resume2Pei: Handle Communicate Ppi not= exist issue. Current code assume Communicate Ppi always existed, so it adds ASSERT to co= nfirm 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 --- UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c | 20 +++++++++----------= - 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c b/UefiCpuPkg= /Universal/Acpi/S3Resume2Pei/S3Resume.c index c2171cb..975bb6f 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=20 + failure (%r)!\n", Status)); } =20 + DEBUG ((DEBUG_INFO, "SignalEndOfS3Resume - Exit (%r)\n", Status)); return Status; } =20 -- 2.7.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel