From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (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 5EC4F21130E66 for ; Fri, 14 Sep 2018 13:08:39 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 267B182A5; Fri, 14 Sep 2018 20:08:39 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-126-242.rdu2.redhat.com [10.10.126.242]) by smtp.corp.redhat.com (Postfix) with ESMTP id 34CE0600C3; Fri, 14 Sep 2018 20:08:35 +0000 (UTC) To: Jian J Wang , edk2-devel@lists.01.org Cc: Eric Dong , Star Zeng References: <20180914071153.5416-1-jian.j.wang@intel.com> <20180914071153.5416-2-jian.j.wang@intel.com> From: Laszlo Ersek Message-ID: Date: Fri, 14 Sep 2018 22:08:34 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180914071153.5416-2-jian.j.wang@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 14 Sep 2018 20:08:39 +0000 (UTC) Subject: Re: [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 20:08:41 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 09/14/18 09:11, Jian J Wang wrote: >> 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)); > The indentation of the DEBUG macro invocation is not idiomatic. It should be: DEBUG (( DEBUG_ERROR, "ERROR:%a(): HOB(gEfiAcpiVariableGuid=%g) needed by S3 resume doesn't exist!\n", __FUNCTION__, &gEfiAcpiVariableGuid )); It's OK with me if you fix that up before you push the series. (Please wait for Eric's and Star's reviews as well.) With that update: series Reviewed-by: Laszlo Ersek Thanks Laszlo