From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (NAM10-MW2-obe.outbound.protection.outlook.com [40.107.94.89]) by mx.groups.io with SMTP id smtpd.web10.15177.1684823256788281267 for ; Mon, 22 May 2023 23:27:37 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=NIPpNcKM; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: 40.107.94.89, mailfrom: abner.chang@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KJpkPnokuJSxCNibFfyObtHrKEWQiq46goyB7JhgF3GveWchLuDzPw96rMta0ZbzebMYZEPmDN6ssd+3BH76gKOP9nHMvQbAykispAN4QaFvVIi5qgK7KzQ/2QZug70zkE/F7yozab7snJyhK3B7y2tBUXSQCL6YXvPvmolTv9FmGCjCqCXqKA4ssejBGo10JdVLB0wjWCaBKgRPMOWxLsZmSm5TtoSGvEhTlW9h1Qg33GIUxAMggLjvFOP3mQHXPKQWmuVrtv7OMmuk5GiUG3sw1gaJMqI0oBY3euFtRmg7+BLYgiPG3lC+tG4m5lkL1X6XNOGPyeBhuQL7Y0/bSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1bMQoqng4obZv+K50aUjcf8zyuR8Eqn6RechsduH3nQ=; b=e9/jMWHzH77EsTPJSJB0U9RXgtZjhWWeiueRC6hqGfgzAjKdlRRTPSS/hZJSz2VL2hV/fDpo/xl4YRKFZlrj9IOgM6AkfpoO0he6SkzCQci+s/IlsIKkmHI7LkfhWuzhNN01PtFgTD8MrhNcoE1WyymkGCU5C7uDXfDSPLmbUAhuAyjKCHcGgk1O/VJwG+21A+a+2PCdLW/ST2Xty2OhfkPd03i+xMemFkrhboRnH/rVUEXqwx17Cl+OmD0UQpLOphyWY5XmYFbG/Z9F9SXG2RMgRbKEuRvLZloU9XHG1TOfWX5ZzxJJ+2LIA0dnqlRZ2Zc1C58hn1ndcXtKVZIpSw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1bMQoqng4obZv+K50aUjcf8zyuR8Eqn6RechsduH3nQ=; b=NIPpNcKMc5OgBOqUakhYxVKplqFVqIFGOKv6NqwkJOOh238Z81JrGcJ89tcqeA35g9FAT5e5hMJKcIY6Bp3avgZwymADMQpZbBOLIQ6kIuwAm0c1pqRgucjb6j/3h9sObUt1nA17avD28GId8cQo5u6yxojRk1K2CaQGWZuNT6k= Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by BL3PR12MB6546.namprd12.prod.outlook.com (2603:10b6:208:38d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Tue, 23 May 2023 06:27:34 +0000 Received: from MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::edb0:bed8:c650:5040]) by MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::edb0:bed8:c650:5040%6]) with mapi id 15.20.6411.028; Tue, 23 May 2023 06:27:34 +0000 From: "Chang, Abner" To: "Attar, AbdulLateef (Abdul Lateef)" , "devel@edk2.groups.io" , Ray Ni CC: "Attar, AbdulLateef (Abdul Lateef)" , "Grimes, Paul" , Eric Dong , Rahul Kumar , Gerd Hoffmann , Michael D Kinney , Liming Gao , Zhiguang Liu , Ard Biesheuvel , Jiewen Yao , Jordan Justen Subject: Re: [PATCH v13 0/8] Adds AmdSmmCpuFeaturesLib and MmSaveStateLib Thread-Topic: [PATCH v13 0/8] Adds AmdSmmCpuFeaturesLib and MmSaveStateLib Thread-Index: AQHZhM3TjIZwTFXAgku0S65Be5MRHK9ndS4A Date: Tue, 23 May 2023 06:27:33 +0000 Message-ID: References: In-Reply-To: Accept-Language: zh-CN, en-US X-Mentions: ray.ni@intel.com X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=478c6dbc-e316-401d-a0df-7b5093ac5fd4;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=0;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2023-05-23T06:25:39Z;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN2PR12MB3966:EE_|BL3PR12MB6546:EE_ x-ms-office365-filtering-correlation-id: deafb6db-7dc6-4276-dd76-08db5b56cb0a x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: CFYWhhzk6n3qJKt/Z8V6TmjunwDH1eAA//tae7U1qRb31qV06hGUYaIWsgvb4zmqIBUwoPtdmQMgAoD8jxcyBPbyYRJMh0EKp+RfdZ40n1Y+63JhZ+x+ngqwtCSyQ4+PkLbq4YO74HIGTYisrOxi9NNgIAFpTY8gN51TBW9NrXIOVUAtGwc7myEavv1+o989G6j65AwinVpgtYVULw05ZWeenZiG30NfzfhjloJz4ImoprmG87tgbvYaZjiKKmVZddAm+vdyguHRlhfGCHJmGtt466J13wXPk4H9P47PcJFs8Jh7+D/srpMP5nrPLcm53o4GUNCFuSeWLHDAEgsg5FgN1Bu3AdoAqXHKEFaXGh1GirKEubSGAAmZe9NLixw3Fkxp4HltpLkD+23OxWt7CGaUOmnfj3WtrBN+EdTGWg/2mSGTxByOWYAVXonJWWSjffeUH2bckmxLlhVDOUfNPJB+IaWXxQx056YEvaT7cwuAwNXUMby8ZuKpf7K6RKFdFXfzL4U4zVfTXBxi1AJQzesEqp5hu3qdEW8ATJM/M8muv3MJglrTslnmXIIxkJ7LW2GQW/hAoLCBLWg65gH3RLELlEmxOAi/lSPuiLLGszv8wGyueFi5SrU/9PKfFy/7 x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR12MB3966.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(6029001)(4636009)(366004)(39860400002)(396003)(376002)(346002)(136003)(84040400005)(451199021)(122000001)(38100700002)(8676002)(8936002)(38070700005)(7416002)(5660300002)(52536014)(9686003)(53546011)(6506007)(55016003)(26005)(186003)(2906002)(83380400001)(33656002)(966005)(86362001)(316002)(54906003)(110136005)(71200400001)(19627235002)(66446008)(66476007)(64756008)(4326008)(66556008)(66946007)(76116006)(478600001)(41300700001)(7696005)(213903007);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?IGhKMi+nTnLyU54oP9aJLLJ32LdWXbXRyhUzssGCWd/4H77ODF1Vkxwcqs6L?= =?us-ascii?Q?N9v7bBqnoqNGC8ktPBibU4I7sCf8sO7LLUHNFbpyGk7iwVeFcI7AjMtJdYVG?= =?us-ascii?Q?0WVnhEJx2MybJErpm59AgozVBqrTWc2X8svn69ApK/1sWPkJCCShiKGioOyG?= =?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7CzNdq9aZQxo?= =?us-ascii?Q?h+KabKYQFIpXad1/jeSlLMB29/fguzZTttn7zlYbYeJA/z9ycEu4EW5acyMi?= =?us-ascii?Q?yUYFwGHdy0j+w2g3SJU2L+avNZum6s+DOiroyDFR1QQdJHEU1adHpH/KF55c?= =?us-ascii?Q?kRtIdA/L6vUAyVezS1vIOz37LQRDUWkvY3ONI1Hc2Mlo+UfolHJ4Kad9xV/b?= =?us-ascii?Q?LhMWjeI++YmJxCFun0aOy9B3wxpG5PP665txPEULVK+HddTlWkKF4rxdy60J?= =?us-ascii?Q?fcQH/OZCPKl6z7BXcW8gsHleZ7kEG5tIskIFYDi4kYyP5rp/yrSvzZ5I35zk?= =?us-ascii?Q?Y+F2AB8ocl3etrOfu3VxFnMyH67Fii3bFw1Mvs51L8kKZEjGv5P4pfoF2LLK?= =?us-ascii?Q?xqOQONbHWcDuPP8Rzwfz5l1k0J/nJqawtsmxBA0CcR+7b75+/W5N2NHXEi72?= =?us-ascii?Q?wxw5Itwf0zhz+6uZWCH9S2qjuqMsO5RiTaSTyLPSXijfWqEpNNqXWYeDwk5T?= =?us-ascii?Q?w6QzBk7BViif3cjJvs8=3D?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB3966.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: deafb6db-7dc6-4276-dd76-08db5b56cb0a X-MS-Exchange-CrossTenant-originalarrivaltime: 23 May 2023 06:27:33.4246 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: PneLAMJRVOadLTATR3zIJ62FrA27NpXRlLJj0art0BWZqIWB2oPOX0/RhuX4VrTnSYsC5xT5ptWg9Kzc8G54wQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR12MB6546 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable [AMD Official Use Only - General] Hi @Ray Ni, We are almost there... We need your help to review this patch set as we nee= d this library to be part of 202305 stable release. Thanks Abner > -----Original Message----- > From: Abdul Lateef Attar > Sent: Friday, May 12, 2023 8:32 PM > To: devel@edk2.groups.io > Cc: Attar, AbdulLateef (Abdul Lateef) ; Grimes= , > Paul ; Chang, Abner ; Eric > Dong ; Ray Ni ; Rahul Kumar > ; Gerd Hoffmann ; Michael D > Kinney ; Liming Gao > ; Zhiguang Liu ; Ard > Biesheuvel ; Jiewen Yao > ; Jordan Justen > Subject: [PATCH v13 0/8] Adds AmdSmmCpuFeaturesLib and > MmSaveStateLib > > Backward-compatibility changes: > This patch series removes the SmmCpuFeaturesReadSaveStateRegister > and SmmCpuFeaturesWriteSaveStateRegister interface/function. > SmmReadSaveState() and SmmWriteSaveState() now directly invokes > MmSaveStateLib > routines to save/restore registers. > > PR: https://github.com/tianocore/edk2/pull/4392 > > V13: Delta changes > Address review comments from Ray Ni > Changed the BASE _NAME of AmdSmmCpuFeaturesLib. > Removed EFIAPI from local function. > Removed CpuIndex parameter from MmSaveStateGetRegisterLma > Modifed MmSaveStateGetRegisterIndex () to accept RegOffset > as second parameter. > Removed FILE_GUID library instance for intel implemention from > UefiCpuPkg.dsc. > > V12: > Addressed review comments from Michael. > Added LibraryClasses to .inf file. > removed duplicate MACRO definations. > Moved related MACRO defination to respective file. > V11: Delta changes > Drop the OVMF implementation of MmSaveStateLib > V10: Delta changes: > Addressed review comments from Abner. > V9: Delta changes: > Addressed review comments. > Rename to MmSaveStateLib. > Also rename SMM_ defines to MM_. > Implemented OVMF MmSaveStateLib. > Removes SmmCpuFeaturesReadSaveStateRegister and > SmmCpuFeaturesWriteSaveStateRegister > function interface. > V8 delta changes: > Addressed review comments from Abner, > Fix the whitespace error. > Seperate the Ovmf changes to another patch > V7 delta changes: > Adds SmmSmramSaveStateLib for Intel processor. > Integrate SmmSmramSaveStateLib library. > V6 delta changes: > Addressed review comments for Ray NI. > removed unnecessary EFIAPI. > V5 delta changes: > rebase to master branch. > updated Reviewed-by > V4 delta changes: > rebase to master branch. > added reviewed-by. > V3 delta changes: > Addressed review comments from Abner chang. > Re-arranged patch order. > > Cc: Paul Grimes > Cc: Abner Chang > Cc: Eric Dong > Cc: Ray Ni > Cc: Rahul Kumar > Cc: Gerd Hoffmann > Cc: Michael D Kinney > Cc: Liming Gao > Cc: Zhiguang Liu > Cc: Ard Biesheuvel > Cc: Jiewen Yao > Cc: Jordan Justen > Cc: Abdul Lateef Attar > > Abdul Lateef Attar (8): > MdePkg: Adds AMD SMRAM save state map > UefiCpuPkg: Adds MmSaveStateLib library class > UefiCpuPkg: Implements MmSaveStateLib library instance > UefiCpuPkg/SmmCpuFeaturesLib: Restructure arch-dependent code > UefiCpuPkg: Implements SmmCpuFeaturesLib for AMD Family > UefiCpuPkg: Implements MmSaveStateLib for Intel > UefiCpuPkg: Removes SmmCpuFeaturesReadSaveStateRegister > OvmfPkg: Uses MmSaveStateLib library > > UefiCpuPkg/UefiCpuPkg.dec | 4 + > OvmfPkg/OvmfPkgIa32.dsc | 1 + > OvmfPkg/OvmfPkgIa32X64.dsc | 3 + > OvmfPkg/OvmfPkgX64.dsc | 1 + > UefiCpuPkg/UefiCpuPkg.dsc | 13 + > .../MmSaveStateLib/AmdMmSaveStateLib.inf | 34 + > .../MmSaveStateLib/IntelMmSaveStateLib.inf | 34 + > .../AmdSmmCpuFeaturesLib.inf | 38 + > UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf | 2 + > .../Include/Register/Amd/SmramSaveStateMap.h | 194 +++++ > UefiCpuPkg/Include/Library/MmSaveStateLib.h | 70 ++ > .../Include/Library/SmmCpuFeaturesLib.h | 52 -- > .../Library/MmSaveStateLib/MmSaveState.h | 94 +++ > UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h | 56 +- > .../SmmCpuFeaturesLib/SmmCpuFeaturesLib.c | 767 ------------------ > .../Library/MmSaveStateLib/AmdMmSaveState.c | 309 +++++++ > .../Library/MmSaveStateLib/IntelMmSaveState.c | 410 ++++++++++ > .../MmSaveStateLib/MmSaveStateCommon.c | 132 +++ > .../SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.c | 387 +++++++++ > .../IntelSmmCpuFeaturesLib.c | 70 ++ > .../SmmCpuFeaturesLibCommon.c | 128 --- > UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c | 11 +- > UefiCpuPkg/PiSmmCpuDxeSmm/SmramSaveState.c | 500 +----------- > MdePkg/MdePkg.ci.yaml | 4 +- > 24 files changed, 1806 insertions(+), 1508 deletions(-) > create mode 100644 > UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveStateLib.inf > create mode 100644 > UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveStateLib.inf > create mode 100644 > UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.inf > create mode 100644 MdePkg/Include/Register/Amd/SmramSaveStateMap.h > create mode 100644 UefiCpuPkg/Include/Library/MmSaveStateLib.h > create mode 100644 UefiCpuPkg/Library/MmSaveStateLib/MmSaveState.h > create mode 100644 > UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveState.c > create mode 100644 > UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveState.c > create mode 100644 > UefiCpuPkg/Library/MmSaveStateLib/MmSaveStateCommon.c > create mode 100644 > UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.c > > -- > 2.25.1