From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 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 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,365,1503385200"; d="scan'208";a="159652472" 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 From: Eric Dong To: edk2-devel@lists.01.org Cc: Ruiyu Ni , Jiewen Yao , Laszlo Ersek 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: [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:34:31 -0000 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 --- 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; - DEBUG ((EFI_D_INFO, "SignalEndOfS3Resume - Enter\n")); + DEBUG ((DEBUG_INFO, "SignalEndOfS3Resume - Enter\n")); // // This buffer consumed in DXE phase, so base on DXE mode to prepare communicate buffer. @@ -484,29 +484,27 @@ SignalEndOfS3Resume ( } CopyGuid (CommBuffer, &gEdkiiSmmEndOfS3ResumeProtocolGuid); - // - // Get needed resource - // Status = PeiServicesLocatePpi ( &gEfiPeiSmmCommunicationPpiGuid, 0, NULL, (VOID **)&SmmCommunicationPpi ); - ASSERT_EFI_ERROR (Status); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "Locate Smm Communicate Ppi failed (%r)!\n", Status)); + return Status; + } - // - // Send command - // Status = 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)); + } + DEBUG ((DEBUG_INFO, "SignalEndOfS3Resume - Exit (%r)\n", Status)); return Status; } @@ -587,8 +585,7 @@ S3ResumeBootOs ( // // Signal EndOfS3Resume event. // - Status = SignalEndOfS3Resume (); - ASSERT_EFI_ERROR (Status); + SignalEndOfS3Resume (); // // report status code on S3 resume -- 2.7.0.windows.1