From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web10.18912.1688349631597128884 for ; Sun, 02 Jul 2023 19:00:31 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=HUv92OO7; spf=pass (domain: intel.com, ip: 192.55.52.88, 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=1688349631; x=1719885631; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=XtjEWaQPp9bKdlfJuHnTNaNXPEkBDhDsGLQ3OjVTSak=; b=HUv92OO7qw5DVv3LHhruSdoeSBGqhhAaoAM5OCkLqvdUE3wURhW7qbCk f4cu/bX1FOGU1cpVW2Y4rOSiZbg7waEJHCo4u9ppvIOeJrA/4fQIwG1xI PpmE0SRLqhhp7mwuvrraBGRnae4JQKhEWMVeZBXSvcfx7gZ0iXkQb/HUd nnYLHt46bPGj0JGb+XlN/Nm8ZaE5j7/GrQ5OdPDqcM/DlcqbRqwC4mU6V 8RSMaHuyLk4rFdqdSmnsubgmxupzrmhHZo9k3ASWFp6NErhtP98a4MpNs Hey9vFGcve3RkMWKt7rnnHaoMt2iYi+EaShQsLwDFueh2xyM+BvmJIIOm w==; X-IronPort-AV: E=McAfee;i="6600,9927,10759"; a="393510774" X-IronPort-AV: E=Sophos;i="6.01,177,1684825200"; d="scan'208";a="393510774" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2023 19:00:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10759"; a="862909403" X-IronPort-AV: E=Sophos;i="6.01,177,1684825200"; d="scan'208";a="862909403" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga001.fm.intel.com with ESMTP; 02 Jul 2023 19:00:30 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Sun, 2 Jul 2023 19:00:29 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Sun, 2 Jul 2023 19:00:29 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend Transport; Sun, 2 Jul 2023 19:00:29 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.174) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Sun, 2 Jul 2023 19:00:29 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MacGvMMXozwODyziczGsfuI12SG9vZ5OICBAs77fDuAUqUSEW69Ee35IUtq3APkjqiB+0w2gh1RwSxhGGQrCsQQbz3Ia3816w9iOw+n9XI7I8lrKlpgA/oYI13RamnZKms1WnMkRoBAnqw02ckEC/VLQ7r8NMYq3dPyHRTm/RTloL04Yu1OIrU0j06yCWJr6NuX9VIUirtdLOf32mzfRQiLf2L3YmVWxdKPtAFWBaF/+zb86QMpXwrm9VQj4Vaj+On/j4P3IVLA6aFhlNdL02jY0kCsGagK7FBq4u5l3FJlClIH4yS7bmZulrLSTrVwTnrlfVwj4+iXffEwkEKJrYw== 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=08OaG3KE4ounXIOF8+Db3WQi0bI7vL+0RqMl9WmvjVg=; b=ILhD2i1jFS08d/NHMqtMPf/9gd4uIQkX1D6UV/UlWLmCO3Ps5n3rpFUAwyXUMcLRLtSr+XCkcWRTmt975qXk9ky7yesCErkHtyUq142bm91auS6XWRDtEoTqzQ/Vzp3tc72c9mmssTCdgRrxlyVlbRLiMLTl7OaNixv/TzK4M+m59fWdJUDJcrtVaQiPZ+0T7hTYetmsaYkOYJeXqsSQbaRBratK1GsxBwyvKT4yGJf/Fk26k0ftA4S7PprWO5tyqBqZx0Tu/IsejVhlnvrJv9yoPx1OgTSqb6X5eItFDzKpAsLtOHC4TcWsE9RMb5LfSXLVm9cMjsDeYXK4/Po68g== 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 CY5PR11MB6283.namprd11.prod.outlook.com (2603:10b6:930:21::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 3 Jul 2023 02:00:27 +0000 Received: from MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::5542:6ddb:ea31:33df]) by MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::5542:6ddb:ea31:33df%4]) with mapi id 15.20.6544.024; Mon, 3 Jul 2023 02:00:26 +0000 From: "Ni, Ray" To: Abdul Lateef Attar , "devel@edk2.groups.io" 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: [PATCH v15 0/8] Adds AmdSmmCpuFeaturesLib and MmSaveStateLib Thread-Topic: [PATCH v15 0/8] Adds AmdSmmCpuFeaturesLib and MmSaveStateLib Thread-Index: AQHZrJu0wk1bFjxXy0K/VN5nKENBd6+nSVfA Date: Mon, 3 Jul 2023 02:00:26 +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_|CY5PR11MB6283:EE_ x-ms-office365-filtering-correlation-id: 8f7292f4-e67a-453b-0dd1-08db7b6944ee 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: F1RXk0aR1caLjmsM5vWHf3o+Y7JVStz5CEWDSzLjMjJFEAPLHVplNIBmHwX5UwGmb9W4ENf+ec2OCVDX3alpgUG2ub8tfRoXOvR5MNwWuDulQOMGKK9tiDaUueEGKH3A/I119nuWQWDCB3dypbwfPuVNruK8NTyBa0OaUk3fnVADNX9RjV5Ij50ZIcjfgVyRFGi44Pn7a5qkhR3w3+9mM7o1IVb9MpRy6yFPUmg8/2CzGsx0FKJh03l6TdfVO/cD3a5tEofeRN8AZN12dqU28L6ahDbJvzoMM3rzpA54029OX946FkV8JhjbHzo8WNC8rvO54H9ZgPNc0LvFyRhDW0W3ddkw0zUSWBUc/8zQyAB3+X3CUi6RYaKAwGsJtSN5UVBDH03mGgvN3Hjh0NzQ0R7YgRgmiAtSD3WGBD5XTcT55K/jG8wzxEFmjXhXhQUm0HaRTQzG5y1FMXtjSlhu6AkHS0Fg9AMdw+8eq+x8EZdvkp53FKMbE6ri8pWNGQ8ludt8sJuRueC16e8lOCzMYp2s8E7f86Jrx4Bqsu4jCaXb2JFiq6QdfrF/RjroWJvBfG/fdWXYD+nUzrgvlQt1uLv7qU4Jh1Y/KCPLWrFdZhdp5e72yqIcLPWjYmVXsk7iruzJpqRQbThYgY38Dd+WmmRmoxFk+8DYLRiq4vwIgjk= 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)(39860400002)(396003)(346002)(136003)(376002)(451199021)(107886003)(316002)(41300700001)(7696005)(966005)(83380400001)(53546011)(6506007)(9686003)(186003)(478600001)(110136005)(54906003)(82960400001)(19627235002)(71200400001)(122000001)(38100700002)(66446008)(66476007)(66556008)(66946007)(64756008)(55016003)(76116006)(4326008)(52536014)(5660300002)(33656002)(86362001)(38070700005)(8676002)(8936002)(2906002)(213903007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?oK4xh2U39wxxaWc4ZXdBdnyQ/K+lnnADDn4zK0IN69ioFO5EpDOibNonBF2S?= =?us-ascii?Q?TR3GXxXoYDEgIIEgDpsTzLAqzndj9VdhCl7vjbL6Kpupd50ZZ1kv8coTvJ6J?= =?us-ascii?Q?fg1IBXT0u6R+wLLX7y3Js7g9XFIqETNwOeEldHTWAfMwhvxYQpa7L2kjgdbc?= =?us-ascii?Q?fAMRd7nNE+uphbymJtKF24o7ap7QaM6S6u979UdOr4n598u3fmyCTJdzW36Q?= =?us-ascii?Q?+n5Fa+J35QeUPjn0AbEuOdAptK1zux14nA7pM7cmCyYYqWT5cTkGRt3tzIlP?= =?us-ascii?Q?OS41viJ8t23lzjUmNziDq7WmKB6zaDkyRLM/IX9cbe4w6OlTPh8zovOts9yt?= =?us-ascii?Q?qf89Z2MGJxXdAd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nB4hgYbo1pk?= =?us-ascii?Q?nwRxNO2tUPw3LhuQzi/uHIPG8wqdZqlIVRANMXmfWhE3Gk7oivQ6J+HCwRXt?= =?us-ascii?Q?jZEK6Shsv9brMmERS4pTJLDLJiAL/7LWoEOGMqQ9V2gJO8Hinp78MjVUu7u9?= =?us-ascii?Q?8At/tNkLf2HsbWVDDGjiix29OyqNlTLqXT3XsBDlex2Rywfq7Az6B0GmqzNF?= =?us-ascii?Q?r0LwVL7CgRE33tYk1gbSP7r/GXBilgYfMyZn26JL9Qsf6FuqBj6H2KxRrqWe?= =?us-ascii?Q?QWVTugtHoktpvBnhEt7bAwBq9kULDWaDOqw26AOPl0w6GQnFBu4fdbLd1Q?= =?us-ascii?Q?=3D=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: 8f7292f4-e67a-453b-0dd1-08db7b6944ee X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jul 2023 02:00:26.1018 (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: eqHw50iVNKvsUXgoLDMLz3hGTsfK4bXdTnJ6urMn77VqQyA6YmxksMZCtCBVZXmiR9oO0eFvGxTr5YedZ5sSgQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR11MB6283 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 Thanks for reposting. I will merge it today through this PR: https://github.com/tianocore/edk2/pu= ll/4599 I tried to use your PR but there is a merge-commit there that failed in CI = PatchCheck step. Thanks, Ray > -----Original Message----- > From: Abdul Lateef Attar > Sent: Sunday, July 2, 2023 12:14 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: [PATCH v15 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/4597 >=20 > V15: Delta changes > Rebase the branch and fix the merge conflicts. > 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 | 12 + > .../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, 1809 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