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.93; helo=mga11.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 0853A211158FC for ; Sun, 9 Sep 2018 22:08:59 -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 fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Sep 2018 22:08:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,354,1531810800"; d="scan'208";a="231548797" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga004.jf.intel.com with ESMTP; 09 Sep 2018 22:08:07 -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; Sun, 9 Sep 2018 22:08:02 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx109.amr.corp.intel.com (10.18.116.9) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 9 Sep 2018 22:08:02 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.226]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.143]) with mapi id 14.03.0319.002; Mon, 10 Sep 2018 13:08:00 +0800 From: "Zeng, Star" To: "Wang, Jian J" , "edk2-devel@lists.01.org" CC: "You, Benjamin" , "Dong, Eric" , Laszlo Ersek , "Zeng, Star" Thread-Topic: [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: add message for S3 config error Thread-Index: AQHUSLWOlGznz9OECU+ArgEjPrCAL6To9m0g Date: Mon, 10 Sep 2018 05:07:59 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103BBB719C@shsmsx102.ccr.corp.intel.com> References: <20180910032225.10044-1-jian.j.wang@intel.com> In-Reply-To: <20180910032225.10044-1-jian.j.wang@intel.com> Accept-Language: zh-CN, 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/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: Mon, 10 Sep 2018 05:09:00 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I agree to add the ASSERT, but even with the ASSERT, I still suggest moving= =20 // // Patch SmmS3ResumeState->SmmS3Cr3 // InitSmmS3Cr3 (); into GuidHob =3D GetFirstGuidHob (&gEfiAcpiVariableGuid); if (GuidHob !=3D NULL) { ... } With that, Reviewed-by: Star Zeng Thanks, Star -----Original Message----- From: Wang, Jian J=20 Sent: Monday, September 10, 2018 11:22 AM To: edk2-devel@lists.01.org Cc: Zeng, Star ; You, Benjamin ; Dong, Eric ; Laszlo Ersek Subject: [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: add message for S3 config error BZ#: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1165 HOB gEfiAcpiVariableGuid is a must have data for S3 resume if PcdAcpiS3Enab= le is set to TRUE. Current code in CpuS3.c doesn't embody this strong bindi= ng between them. An error message and ASSERT is added by 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c b/UefiCpuPkg/PiSmmCpuDxeSmm/= CpuS3.c index abd8a5a07b..f371667c44 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c @@ -744,6 +744,9 @@ InitSmmS3ResumeState ( if (sizeof (UINTN) =3D=3D sizeof (UINT32)) { SmmS3ResumeState->Signature =3D SMM_S3_RESUME_SMM_32; } + } else { + DEBUG ((DEBUG_ERROR, "ERROR: HOB(gEfiAcpiVariableGuid) needed by S3 re= sume doesn't exist!\n")); + ASSERT (FALSE); } =20 // -- 2.16.2.windows.1