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.65; helo=mga03.intel.com; envelope-from=jian.j.wang@intel.com; receiver=edk2-devel@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 44B142113071F for ; Fri, 14 Sep 2018 00:12:14 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Sep 2018 00:12:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,372,1531810800"; d="scan'208";a="232824633" Received: from shwdeopenpsi777.ccr.corp.intel.com ([10.239.158.27]) by orsmga004.jf.intel.com with ESMTP; 14 Sep 2018 00:11:56 -0700 From: Jian J Wang To: edk2-devel@lists.01.org Cc: Star Zeng , Benjamin You , Eric Dong , Laszlo Ersek Date: Fri, 14 Sep 2018 15:11:52 +0800 Message-Id: <20180914071153.5416-2-jian.j.wang@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: <20180914071153.5416-1-jian.j.wang@intel.com> References: <20180914071153.5416-1-jian.j.wang@intel.com> Subject: [PATCH v2 1/2] UefiCpuPkg/PiSmmCpuDxeSmm: add message for S3 config error X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Sep 2018 07:12:14 -0000 > v2 > a. Refine the error message > b. Use CpuDeadLoop to replace ASSERT(FALSE) for release build BZ#: https://bugzilla.tianocore.org/show_bug.cgi?id=1165 HOB gEfiAcpiVariableGuid is a must have data for S3 resume if PcdAcpiS3Enable is set to TRUE. Current code in CpuS3.c doesn't embody this strong binding between them. An error message and CpuDeadLoop are added in this patch to warn platform developer about it. Cc: Star Zeng Cc: Benjamin You Cc: Eric Dong Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang --- UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c index abd8a5a07b..0f6b6ef587 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c @@ -714,7 +714,13 @@ InitSmmS3ResumeState ( } GuidHob = GetFirstGuidHob (&gEfiAcpiVariableGuid); - if (GuidHob != NULL) { + if (GuidHob == NULL) { + DEBUG ((DEBUG_ERROR, + "ERROR:%a(): HOB(gEfiAcpiVariableGuid=%g) needed by S3 resume doesn't exist!\n", + __FUNCTION__, + &gEfiAcpiVariableGuid)); + CpuDeadLoop (); + } else { SmramDescriptor = (EFI_SMRAM_DESCRIPTOR *) GET_GUID_HOB_DATA (GuidHob); DEBUG ((EFI_D_INFO, "SMM S3 SMRAM Structure = %x\n", SmramDescriptor)); -- 2.16.2.windows.1