From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web10.8195.1686642957428124587 for ; Tue, 13 Jun 2023 00:55:58 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=lcLgYTBj; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: ray.ni@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686642957; x=1718178957; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Of82MXICS+bm0eCJdQcerXIDI6xySEZTmo5K6cGc4MQ=; b=lcLgYTBjq0oEZ50AGkLb6olLqZvctOH+9f9tu8O3eu2xlH7Hr1ivaDB+ wXDMbGsL0Ld1qx8Ba44qhNvYAQop3q38Sr2rDkJMtEP3lLhy2cs+SzjuB LvdGFghJJXHO809gn/T+7hzhGaB6zinIuTNJ3JuZzKeliybm0Gh8mTEYD ITTwQ89b/J3GpJDpkkfHgOjWwNTc7viFK+e3VE/yMh/0DhulnRXqWJJzk BtEghgYabtInXMCUfYC3/5+h08nUbM4ijT/EBekOMmY1OmQyVqT6Z4MXh RnKd/C+KSgpIIGKVBxyWggkukZLkj/Gp2v97jH03RS9eZrtKPQGQ587ZV w==; X-IronPort-AV: E=McAfee;i="6600,9927,10739"; a="342949084" X-IronPort-AV: E=Sophos;i="6.00,239,1681196400"; d="scan'208";a="342949084" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jun 2023 00:55:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10739"; a="1041673995" X-IronPort-AV: E=Sophos;i="6.00,239,1681196400"; d="scan'208";a="1041673995" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga005.fm.intel.com with ESMTP; 13 Jun 2023 00:55:56 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 13 Jun 2023 00:55:55 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23 via Frontend Transport; Tue, 13 Jun 2023 00:55:55 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.177) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.23; Tue, 13 Jun 2023 00:55:55 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M/P1Na51BQKqrYHK9PGU4DT7OENOpLyLPpFqgNukr0vLZ6rUK5GKMpOUz0b8+yGE1HltYUippdp5DWlGJHIWwmqj4Aw9WN8L2QhhXIFLzuiSb29abF7uSQQPxCqZdWnKZ/Qj1bpqOi48iQN4QfhKHaE8vna18ScLwBqKYEjvYLlxGAbHRhsXkoXcAuuwPyUBRaYF9iLrgjD4ZFKuyhhM58q9wkM2TutXi8SPASIpQKnGejSNPG5P5tvenj6YHWns+kVBIfL4Ae46UBL5/FbePvASk4KN8ubbB9ECMju85xMEdf6YlNA4UigjYkWcir5aSf7iOYrNwUcFSmj5ibcVVQ== 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=+pGIsb4sETJJOxkwz4QuiLlOHbgUecuiqMmNZxIVVUQ=; b=kxFnNCwL+bPv8Tb9LVn5Iuxu8+QSExC4jirTnrWF8cQ4RBtpJ5rsHF3EBxPrlQKsONX45oCXtRBa7aQyHkm26nzxxgwZf6iRzm6e0uymvZQxF2oXaR2RMYOn4Epksl2aVKfZFpkGqtaQLxGPVnfeqeu/6558P7v+mbS/0yEWe6++qN0trAVWf/hfA8H/wh/btPNITIHf9rEAwu980P2Ml53SbU1POoAUKgHIlONQeOy1dooTnTNqNlUug88e0zHVf0eW097y8nlXOJ1LaHepIpKFOgxm2L+NVg3k96IOzpoiXlXMCU1r+ObGsvJ+1GTMYA/PfoLm7PxNf5CVbgOGKg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from MN6PR11MB8244.namprd11.prod.outlook.com (2603:10b6:208:470::14) by SJ0PR11MB5645.namprd11.prod.outlook.com (2603:10b6:a03:3b9::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.46; Tue, 13 Jun 2023 07:55:48 +0000 Received: from MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::892b:b8e6:bab7:635d]) by MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::892b:b8e6:bab7:635d%2]) with mapi id 15.20.6455.034; Tue, 13 Jun 2023 07:55:48 +0000 From: "Ni, Ray" To: "devel@edk2.groups.io" , "abdattar@amd.com" CC: Paul Grimes , Abner Chang , "Dong, Eric" , "Kumar, Rahul R" , Gerd Hoffmann , "Kinney, Michael D" , "Gao, Liming" , "Liu, Zhiguang" , "Ard Biesheuvel" , "Yao, Jiewen" , "Justen, Jordan L" Subject: Re: [edk2-devel] [PATCH v14 0/8] Adds AmdSmmCpuFeaturesLib and MmSaveStateLib Thread-Topic: [edk2-devel] [PATCH v14 0/8] Adds AmdSmmCpuFeaturesLib and MmSaveStateLib Thread-Index: AQHZmD1JlDbj9OpVo0u/ANYVGD6XrK+IaF4w Date: Tue, 13 Jun 2023 07:55:48 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN6PR11MB8244:EE_|SJ0PR11MB5645:EE_ x-ms-office365-filtering-correlation-id: 8da42055-04b4-4235-c380-08db6be3999e x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: cstmW7FKln0tx58lz5Kdqqa8pJB41sn/VNbET/W/oMGlD6d41boiCzAzxxm4r3YFwfgk4xNIYMMQtjSTj3Zegjo4P2tKhY0kaVeOmkTRKV7E43jLjstauUdm9dQpSTA0fzs5MVCklB+QtalmH059uqNrhoLTYmcnnuXc6nY+k+cYSsQEwMTXgyWjA6ayoKRynmgUtEU39ioS9hdrf6HMFR0QyTSdL0dWYXJsawJ2A/gvN4Y0YObe9PEuUdxm9KPXP3J6YJ0InD2LRL7UQxnS7eAqX5n0yPTnvHquWQOee6zriV/hWwXyDdilGNuXX9if50bfFbOvNPdqBEIFw4U3AgIy1UmJi1un0bjOYjJmK6P7vtdQbR/YiiE/8eE4tU8eaRw2nJNt4sMBQoQ+EZokBOV32SAoPonSqA7chzhGjBwhJLHlC47l8X7lQkpeRAxez93OqnR9Ut0G3rnFUlgq+SRqf+hxtM6tCiiLM1KH+IbwNlHU6YtSTJLtHF6XyXqHdo7gQ9f1+pHAev1+DUHgRb19W9cpfgWHzUVmVWRI7bzW3yOf46iKxfKMElik72rrtt/JEXyjGb4ZEAIPgy4+pzXAMCOBhUhcT/Ub+dL0BYKdJpLxysPB0UKY9/LrMe4tlPqvHOX/W/QRb5t6/ypKRggwN4vpC7ogTSQzNEfLR5Q= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN6PR11MB8244.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(6029001)(366004)(376002)(346002)(136003)(39860400002)(396003)(451199021)(83380400001)(55016003)(66446008)(64756008)(478600001)(76116006)(71200400001)(107886003)(53546011)(6506007)(26005)(966005)(9686003)(19627235002)(110136005)(54906003)(186003)(86362001)(7696005)(2906002)(8936002)(8676002)(52536014)(5660300002)(33656002)(82960400001)(122000001)(4326008)(38070700005)(41300700001)(38100700002)(316002)(66476007)(66556008)(66946007)(66899021)(213903007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Zplg9sWdeZrEQYgPbj54N3adeSPGVFOsvZvUpRRN7VWToF8sUpn+gqXSYeWb?= =?us-ascii?Q?nV3r0wEhjpgaSbXD/uUqyWvt6YTQjAXbKK1wQ3oB1KRDCJpucndFM8R2b+V2?= =?us-ascii?Q?WL7MdAO+xpgmANmrztPi788gla4CC3nqSBlNSa+GR9fJEDuTI83ZMgQ5rI0/?= =?us-ascii?Q?lXyLE2FBK21X006S547IUYQqB6IAkvagAGf75iW22U5scS3Z3hFryfj2yidf?= =?us-ascii?Q?rTMhIRcA7ta02srdBU9cbLrxKBKPzPteVZzX++ZcupdNEethXQxqYQPSKRCB?= =?us-ascii?Q?Q4uw86DyHGucN2eU3Ay2cmtauULuk292de3FfBZMYdzmtDhNE1bvEqunLvb3?= =?us-ascii?Q?+CgXvjrU+sFyvkR//JZU1fYWE/qZVS/hF9OqDmJ39xsVH1Q9KDm5sFL0JuvY?= =?us-ascii?Q?MS9EXRWrJFTlmEROuSkqRfincwlatc8FGD08v6TNbuVKFOye/F0Fw/5JxXUa?= =?us-ascii?Q?VkEBi0Eodg6ThG04pKDpFP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qsafgMAEmTE90u8qLjJ18JGPZkEvnSSlIHdxpNoH0ivwijpTJ2Mtj2ihJ6b?= =?us-ascii?Q?WWeEhsAOcVsxHU/xk1xgQuavMvpTpBFXLu/C3rePrVkmgXd2mid/73t2bDEz?= =?us-ascii?Q?671ZtDxpUrmjb5kn7LksVzAXNs/g4gt2ZR77u1DLo/z1OH5b6IwhLTXDkmti?= =?us-ascii?Q?03eJnLup5k7yG6DEkMU=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN6PR11MB8244.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8da42055-04b4-4235-c380-08db6be3999e X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jun 2023 07:55:48.1604 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: n1HGj0mXRxlcma12JREtRQDHGiC7KuBmgl3eLs1niZWq3qCzN7esQD7ybp4SFUZ19R96qr/CLjp0tQ6Cvhc4zw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB5645 Return-Path: ray.ni@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ray Ni > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Abdul Late= ef > Attar via groups.io > Sent: Tuesday, June 6, 2023 2:07 PM > To: devel@edk2.groups.io > Cc: Abdul Lateef Attar ; Paul Grimes > ; Abner Chang ; Dong, Eric > ; Ni, Ray ; Kumar, Rahul R > ; Gerd Hoffmann ; Kinney, > Michael D ; Gao, Liming > ; Liu, Zhiguang ; Ard > Biesheuvel ; Yao, Jiewen ; > Justen, Jordan L > Subject: [edk2-devel] [PATCH v14 0/8] Adds AmdSmmCpuFeaturesLib and > MmSaveStateLib >=20 > 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. >=20 > PR: https://github.com/tianocore/edk2/pull/4519 >=20 > V14: Delta changes > Added @note to the MmSaveStateLib.h. > SaveState(Read/Write) of > EFI_SMM_SAVE_STATE_REGISTER_PROCESSOR_ID/EFI_MM_SAVE_STATE_REGIS > TER_PROCESSOR_ID > is handled by PiSmmCpuDxeSmm driver. > Fixed PatchCheck warnings. > 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. >=20 > 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 >=20 > 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 >=20 > 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 | 74 ++ > .../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, 1810 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 >=20 > -- > 2.25.1 >=20 >=20 >=20 >=20 >=20