From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=helo; client-ip=104.47.32.89; helo=nam01-sn1-obe.outbound.protection.outlook.com; envelope-from=leo.duran@amd.com; receiver=edk2-devel@lists.01.org Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0089.outbound.protection.outlook.com [104.47.32.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C023121F38856 for ; Sat, 14 Oct 2017 09:00:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=45t8okpjiBdg3WbIdBuDJFXo9griOjUf34wkAb+oZ7U=; b=o8zsxFASo1vVBiRH+Rg4zh1/VE+l0afYCFmZ19o6snWHCFHXy9aaQsIic/EXeAuTCyiq6WJJZQhpj7S046skETcLqUCtyKcN3UTS7OEjF8WDQ0B5DB4qfUcBF+VgWMzJS2INLs9ot6qsLhlanY99fvW2Xetajf53cp1RnovR/lQ= Received: from DM5PR12MB1243.namprd12.prod.outlook.com (10.168.237.22) by DM5PR12MB1243.namprd12.prod.outlook.com (10.168.237.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Sat, 14 Oct 2017 16:04:09 +0000 Received: from DM5PR12MB1243.namprd12.prod.outlook.com ([10.168.237.22]) by DM5PR12MB1243.namprd12.prod.outlook.com ([10.168.237.22]) with mapi id 15.20.0077.022; Sat, 14 Oct 2017 16:04:09 +0000 From: "Duran, Leo" To: "Yao, Jiewen" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [PATCH v5 0/2] Enhanced SMM support for AMD-based x86 systems. Thread-Index: AQHTQsmGEES8Mp+Sr0GSX5QnxHcxuKLhBlYAgAJ9CXA= Date: Sat, 14 Oct 2017 16:04:08 +0000 Message-ID: References: <1507751131-32404-1-git-send-email-leo.duran@amd.com> <74D8A39837DF1E4DA445A8C0B3885C503A9E505E@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <74D8A39837DF1E4DA445A8C0B3885C503A9E505E@SHSMSX104.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=leo.duran@amd.com; x-originating-ip: [24.55.35.68] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM5PR12MB1243; 20:g7UVJ/06ZohQ7zkojlOnE364j6XbHjIvo8+7wMxMyZXc9LVpSNVxOe5yqQVCHxUIq8fmU5kHcGzNKS0Z4TEx08dvwBWc4mXKsag4CtxrmX5alVqtTWXVdHC8J1bYvSTl9yUiVwbK/RnvtLJ4ZBM700mbP6y/FwagoFqe2RQIK2IR5W2d3q7BDWbQEvSeG+dgORY1lF3bEr5cXJKBtUrb48zy97hFB504+yULYdDne5tx6Mex6a8AaFQszt2DABsh x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: fe8b27e7-b2ef-4449-412c-08d5131d3413 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DM5PR12MB1243; x-ms-traffictypediagnostic: DM5PR12MB1243: x-exchange-antispam-report-test: UriScan:(767451399110)(788757137089)(162533806227266)(228905959029699); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6041248)(20161123558100)(20161123562025)(20161123564025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR12MB1243; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR12MB1243; x-forefront-prvs: 046060344D x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(39860400002)(346002)(377454003)(189002)(199003)(13464003)(45984002)(33656002)(53936002)(76176999)(54356999)(77096006)(2900100001)(6436002)(7736002)(74316002)(6506006)(55016002)(305945005)(99286003)(105586002)(5660300001)(101416001)(106356001)(6246003)(189998001)(50986999)(7696004)(229853002)(68736007)(25786009)(8936002)(316002)(53546010)(3280700002)(3660700001)(2950100002)(97736004)(966005)(9686003)(81156014)(81166006)(2501003)(478600001)(6306002)(8676002)(110136005)(2906002)(3846002)(102836003)(66066001)(14454004)(86362001)(6116002)(19627235001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB1243; H:DM5PR12MB1243.namprd12.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Oct 2017 16:04:08.9887 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1243 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: Sat, 14 Oct 2017 16:00:38 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Yao, Jiewen [mailto:jiewen.yao@intel.com] > Sent: Thursday, October 12, 2017 8:53 PM > To: Duran, Leo ; edk2-devel@lists.01.org > Subject: RE: [edk2] [PATCH v5 0/2] Enhanced SMM support for AMD-based > x86 systems. >=20 > HI Leo > Thank you very much. This patch looks good to me in general. >=20 > Some minor comment: >=20 > 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. >=20 > I recommend we move AMD_SMRAM_SAVE_STATE_MAP_OFFSET to > UefiCpuPkg\Include\Register\Amd\SmramSaveStateMap.h, because it is > standard. Hi Yao, Sure thing, I will do that. Leo > +// > +// 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 >=20 > We can leave AMD_SMM_PSD_OFFSET in UefiCpuPkg/PiSmmCpuDxeSmm, > if it is implementation specific. > +#define AMD_SMM_PSD_OFFSET 0xfc00 >=20 >=20 >=20 > 2) For Intel save state, I assume you already did some test to make sure > there 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? >=20 > If you did any other test, please also add. >=20 Hi Yao, I have not done runtime validation testing. Instead, I tested the assembly code snippets in a vacuum (in their .asm, .n= asm, and .S forms), to ensure the source produced the expected compiled code, and the expected = execution. So any runtime 'Tested-by' would be greatly appreciated Thanks, Leo. > Thank you > Yao Jiewen >=20 >=20 > > -----Original Message----- > > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > > Leo 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. > > > > This patch-set replaces Intel-specific macros with global variables to > > provide support for AMD-based x86 systems. > > > > The replaced macros are: > > 1) SRAM_SAVE_STATE_MAP_OFFSET > > 2) TXT_SMM_PSD_OFFSET > > 3) SMM_PSD_OFFSET > > > > Changes since v4: > > Make runtime CPUID checks and use global variables instead of PCD's. > > > > Changes since v3: > > Correction on cover letter. > > > > 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. > > > > Changes since v1: > > Revision to Cc list for UefiCpuPkg. > > > > Leo Duran (2): > > UefiCpuPkg/SmmCpuFeaturesLib: Use global variables to replace macros > > UefiCpuPkg/PiSmmCpuDxeSmm: Use global variables to replace macros > > > > .../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 > > > > -- > > 2.7.4 > > > > _______________________________________________ > > edk2-devel mailing list > > edk2-devel@lists.01.org > > https://lists.01.org/mailman/listinfo/edk2-devel