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.20; helo=mga02.intel.com; envelope-from=jiewen.yao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 7D4A721E781F9 for ; Thu, 12 Oct 2017 18:49:15 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Oct 2017 18:52:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,369,1503385200"; d="scan'208";a="322710327" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga004.fm.intel.com with ESMTP; 12 Oct 2017 18:52:45 -0700 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 12 Oct 2017 18:52:45 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx158.amr.corp.intel.com (10.18.116.75) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 12 Oct 2017 18:52:45 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.152]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.98]) with mapi id 14.03.0319.002; Fri, 13 Oct 2017 09:52:42 +0800 From: "Yao, Jiewen" To: Leo Duran , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [PATCH v5 0/2] Enhanced SMM support for AMD-based x86 systems. Thread-Index: AQHTQsmPPe51TIhRhEW4L1JBq+MAd6LhAIMg Date: Fri, 13 Oct 2017 01:52:42 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503A9E505E@SHSMSX104.ccr.corp.intel.com> References: <1507751131-32404-1-git-send-email-leo.duran@amd.com> In-Reply-To: <1507751131-32404-1-git-send-email-leo.duran@amd.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH v5 0/2] Enhanced SMM support for AMD-based x86 systems. 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: Fri, 13 Oct 2017 01:49:16 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable HI Leo Thank you very much. This patch looks good to me in general. Some minor comment: 1) For AMD smm save state. I saw Paolo gave the comment on how to detect AMD save state. I do not have= strong opinion on that. I think you and Paolo can make decision. I recommend we move AMD_SMRAM_SAVE_STATE_MAP_OFFSET to UefiCpuPkg\Include\R= egister\Amd\SmramSaveStateMap.h, because it is standard. +// +// Definitions for AMD systems are based on contents of the +// AMD64 Architecture Programmer's Manual +// Volume 2: System Programming, Section 10 System-Management Mode +// +#define AMD_SMRAM_SAVE_STATE_MAP_OFFSET 0xfe00 We can leave AMD_SMM_PSD_OFFSET in UefiCpuPkg/PiSmmCpuDxeSmm, if it is impl= ementation specific. +#define AMD_SMM_PSD_OFFSET 0xfc00 2) For Intel save state, I assume you already did some test to make sure th= ere is no regression. If so, would you please add some description on what test you have done? For example, If both IA32 and X64 are validated? If all three .S, .asm, .nasm are validated? If OS boot and S3 resume are validated? If you did any other test, please also add. Thank you Yao Jiewen > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Le= o > Duran > Sent: Thursday, October 12, 2017 3:45 AM > To: edk2-devel@lists.01.org > Subject: [edk2] [PATCH v5 0/2] Enhanced SMM support for AMD-based x86 > systems. >=20 > This patch-set replaces Intel-specific macros with global variables > to provide support for AMD-based x86 systems. >=20 > The replaced macros are: > 1) SRAM_SAVE_STATE_MAP_OFFSET > 2) TXT_SMM_PSD_OFFSET > 3) SMM_PSD_OFFSET >=20 > Changes since v4: > Make runtime CPUID checks and use global variables instead of PCD's. >=20 > Changes since v3: > Correction on cover letter. >=20 > Changes since v2: > The intent of this revision is to maintain compatibility with existing > packages. To that end, changes to OvmgfPkg and QuarkSocPkg are reverted. > Moreover, pertinent macros are replaced in the C code, rather than on > header files that are shared globally. >=20 > Changes since v1: > Revision to Cc list for UefiCpuPkg. >=20 > Leo Duran (2): > UefiCpuPkg/SmmCpuFeaturesLib: Use global variables to replace macros > UefiCpuPkg/PiSmmCpuDxeSmm: Use global variables to replace macros >=20 > .../Library/SmmCpuFeaturesLib/Ia32/SmiEntry.S | 28 ++++++--- > .../Library/SmmCpuFeaturesLib/Ia32/SmiEntry.asm | 29 ++++++--- > .../Library/SmmCpuFeaturesLib/Ia32/SmiEntry.nasm | 43 +++++++++---- > UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCommon.h | 48 > +++++++++++++++ > .../Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c | 59 > +++++++++++++++--- > .../SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf | 3 + > .../SmmCpuFeaturesLib/SmmCpuFeaturesLibStm.inf | 3 + > UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmStm.c | 39 ++++++++++-- > .../Library/SmmCpuFeaturesLib/X64/SmiEntry.S | 28 ++++++--- > .../Library/SmmCpuFeaturesLib/X64/SmiEntry.asm | 30 ++++++--- > .../Library/SmmCpuFeaturesLib/X64/SmiEntry.nasm | 47 ++++++++++---- > UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/Semaphore.c | 22 ++++--- > UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmiEntry.S | 28 ++++++--- > UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmiEntry.asm | 21 +++++-- > UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmiEntry.nasm | 43 > +++++++++---- > UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c | 72 > ++++++++++++++++++++-- > UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h | 17 ++++- > UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c | 18 +++--- > UefiCpuPkg/PiSmmCpuDxeSmm/SmramSaveState.c | 20 +++--- > UefiCpuPkg/PiSmmCpuDxeSmm/X64/Semaphore.c | 22 ++++--- > UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.S | 34 ++++++---- > UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.asm | 22 +++++-- > UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm | 45 > ++++++++++---- > 23 files changed, 547 insertions(+), 174 deletions(-) > create mode 100644 UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCommon.h >=20 > -- > 2.7.4 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel