From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.68]) by mx.groups.io with SMTP id smtpd.web10.37867.1674101161001924383 for ; Wed, 18 Jan 2023 20:06:01 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=baHpviUr; 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.92.68, mailfrom: abner.chang@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hrcd9IHGlvfB+HmD+fADm0/vbVmqunIV2d3/4KfjHkrLBdLknppVmK4PQkDM7kBpWQJns/nZxaSEK+/mBUVKGAztk9FObZQEUo5zQuKBwM8yJs+03WRgcGtTSfZe7o2JfafNljCwlsIJ8sHoFK9ZE5L2911LMiR/evlpOpnQwc6XvjBiI3zzKRCF75ic/LApF1du5P6Pwe1l1ug9kOq5G9ebS5Al70xIsk6MuWyrjD1pnZCYEP2P2NML4oG6aqG1ZE5l/DdQH4sNeqRZZHP5LOr4RJl0NuAVDZBnuwlNWh/3v3Sjoel2p9jJ9l7nT/iB24hodnO/bZ3Zmbm5NaLLag== 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=J81BsBRW97LEE7EQcAXqOds+L79x5gBkvqcoNlS5dmA=; b=fYcIGjxgVucykncqUpJ/mZxCQBsNT61UVFBIlYuR0EuZVGIc0YpNrgDzJ0s3e/IRLygmEJP3fDUU2YcrcQ7RQV39O2we7kzDdl42YLpzI3FBcIxmvoih3ZmDgvCgzdTAfISxtv2aSup3N3S3N1eY2Jn4Ax1wX0af5uSYqMxjlD/ycovYoZbc2lHzCRXGJkVsyZPlIlH+oUqNn/z5gAi/kRR8MEL1pNQO8ywiHAgSNios/as2WN3ZrW7eaknE70OZBFGpgvurKa1crAyGXl8vihsjWFtOp9AQK6dw0DZDSAca4HBbtwJGbOaiFP6AhTe8/H5cmg0rbg6/ghWRMgdX9g== 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=J81BsBRW97LEE7EQcAXqOds+L79x5gBkvqcoNlS5dmA=; b=baHpviUrwyP9gA3hcZjQrik8lk6OMpTRjRsGAWX9pxqNFjxid64PzRXZr1kf5OWDcXZz8b8dRpTErJb/9Q+XHqvfTHaC+u1tY4Sp+/pm06Wt3pYXH7tsHnfnBPM3fasR3kTdTytM3gRLOB+XS6AndBBYT9P9loTMs0Zrn+WmmyY= Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by MW4PR12MB6899.namprd12.prod.outlook.com (2603:10b6:303:208::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13; Thu, 19 Jan 2023 04:05:58 +0000 Received: from MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::d606:ab63:cf3:5d36]) by MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::d606:ab63:cf3:5d36%7]) with mapi id 15.20.6002.024; Thu, 19 Jan 2023 04:05:58 +0000 From: "Chang, Abner" To: "Attar, AbdulLateef (Abdul Lateef)" , "devel@edk2.groups.io" CC: "Attar, AbdulLateef (Abdul Lateef)" , "Grimes, Paul" , "Kirkendall, Garrett" , Eric Dong , Ray Ni , Rahul Kumar , Gerd Hoffmann Subject: Re: [PATCH v3 2/6] UefiCpuPkg: Adds SmmSmramSaveStateLib library class Thread-Topic: [PATCH v3 2/6] UefiCpuPkg: Adds SmmSmramSaveStateLib library class Thread-Index: AQHZK16EcpoYi7HuZU+S4GQRwKOhu66lH+nA Date: Thu, 19 Jan 2023 04:05:58 +0000 Message-ID: References: <3496af23f5bdc7847148150cd7b97fb5d2b54702.1674060385.git.abdattar@amd.com> In-Reply-To: <3496af23f5bdc7847148150cd7b97fb5d2b54702.1674060385.git.abdattar@amd.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2023-01-19T04:05:56Z; 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_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=18ac09d1-2c79-4ab9-9d06-7539421eda85; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=1 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_|MW4PR12MB6899:EE_ x-ms-office365-filtering-correlation-id: e3537834-2d28-4ffd-e469-08daf9d2787b x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ccCbJOMTD6qN4NKijdwGdrfE/2dZ37xId13kkSvodv06Q8jAihJ4MnTSttesIRlBozqKNQtvURKZq2z6iv8n0Wr4eFBawlh0t2ZkyDrXgoFyM89GzsXsQufmtfVrQ6Wtf0RIg/ylMYqEVvMRLeLNNByJDGoST1eOgeC2PpyKTxgcsEqRQlTHH8F2a5pzFOza76agRw2j8UyW2AbU9fGOFKbqxbZjvftdKM03x9bUfAaA0cJbho+z20YRVtshOr6sCTcEmEvEe2BA2kPlz6kWf8727DuhxM209i6w/JmghDyqeKIyyofXedSbAye6XOXcXOPZsLWQfhkQ1ggE9hL/RI8tOdBHG2o4Hww6lk8pTJ83LxbQV0l75vnAlv+smC+NW0LX9vGlEwxYgrmzi+lt5+r36KxfDvm9tWp5VPrCmPzxunzpXEedG5LXs4rLoX5GKxmFGxuVeoanMghvGh0A4UlRb5ibMlKQZcwsoFpq5eus+7aNveGDZYaRSCyQ+61/o2anwjYxoNsN1BJSWzZ8hETTWckWfL2Jv4PF9uLHkB48vi4GebWuMG13OCeaajFwaljJTfrxMLRLntDx39m8pPlGCBGZFc+dXBV99S5m5MW703ghG/16BH5eSJgeb1lSCRNGVmEfla+roVzJipK/0jndr2a34dG4zX/l8PNNIQsXA8B3hAWbo3FIkNAPed9JzGjyiUMJDYX1OhNOCeFqQJj7QfBf8mw2jnE21UshrJxN/22ZQlStqBNAiRcuH4FG 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:(13230022)(4636009)(396003)(136003)(376002)(39860400002)(346002)(366004)(451199015)(38100700002)(2906002)(122000001)(55016003)(33656002)(86362001)(7696005)(110136005)(54906003)(38070700005)(316002)(71200400001)(64756008)(66556008)(66946007)(4326008)(66446008)(76116006)(83380400001)(5660300002)(41300700001)(66476007)(8676002)(6506007)(9686003)(53546011)(26005)(186003)(966005)(52536014)(8936002)(478600001)(213903007);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?mviV3jZBq58Juun1YXRFj9y8LaVKDxNSxalLaTCVW7u9m3ORr5l+WzyCED01?= =?us-ascii?Q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RMZdvNW3smbXi?= =?us-ascii?Q?yDhhl9GIcDPpA3AsWRzC1wVr5ttMzv9MSHmpbR2GcKYm1Qe4RHOdM2YvF5YD?= =?us-ascii?Q?G0JMPLoJbb1PrOFCnQRvy+3j6gKhQkb6NphNayZXRklyLMsMgXdpfS9yzUB6?= =?us-ascii?Q?NryecWJ1a86mm6tKeGfcTbHQyN5RqB75S1f+ErQOu+vTpjEGV00OyOPLwUbZ?= =?us-ascii?Q?fJhVPRCL+xH6R7z/R3OLU5n1I5K1timYlLDFUxyMS3iFclUjnCvDVH/8X+UC?= =?us-ascii?Q?b3l7HGqk5fC5fjVdHecNvOQnlEylAS+33aQrkKs9Gw+WL2II4CmK/mi9lGVP?= =?us-ascii?Q?r9Eoonku4uaC1npFk0sM8/ULnsKmg+7d/G4fZtogLJOzb1GSkBeHcR8OLBH3?= =?us-ascii?Q?1FTxKchYxlVq5hgNa7yPThn0iCEPoY7d/cYSI0J7ogERKvy2UDDJL0L9QkKV?= =?us-ascii?Q?DkXIZG3Ka3ZQdeVMeHDC4vzo4iv02FuEmML7YHVgYWIhlDTvPu7lHBjXX1Tl?= =?us-ascii?Q?NFkoF41xcrphRqseemQenGB3LPZSvkKzStH2VOCAGG75UKAE/IIQEJHqT6yS?= =?us-ascii?Q?Um4vkD2egFa3U6LaoiXZM8uIFNCEr50scgJY6XeNgcYLKRVE3t856Bt/kPwM?= =?us-ascii?Q?dOt0A2W0yneF9hXEObZO5NRg+Tmep6SKv5B3tK93?= 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: e3537834-2d28-4ffd-e469-08daf9d2787b X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jan 2023 04:05:58.5555 (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: vbNaYFzNVwWAHeNS3GL/ZgArs0ou+M+qoVaRrmrVVlMYt99pWx6LMef5wpaaCGaw0DNaXmm3yzm7T7BWTDA1sg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6899 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable [AMD Official Use Only - General] Reviewed-by: Abner Chang > -----Original Message----- > From: Abdul Lateef Attar > Sent: Thursday, January 19, 2023 1:01 AM > To: devel@edk2.groups.io > Cc: Attar, AbdulLateef (Abdul Lateef) ; > Grimes, Paul ; Kirkendall, Garrett > ; Chang, Abner ; > Eric Dong ; Ray Ni ; Rahul Kumar > ; Gerd Hoffmann > Subject: [PATCH v3 2/6] UefiCpuPkg: Adds SmmSmramSaveStateLib library > class >=20 > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4182 >=20 > Adds SmmSmramSaveStateLib Library class in UefiCpuPkg.dec. > Adds function declaration header file. >=20 > Cc: Paul Grimes > Cc: Garrett Kirkendall > Cc: Abner Chang > Cc: Eric Dong > Cc: Ray Ni > Cc: Rahul Kumar > Cc: Gerd Hoffmann >=20 > Signed-off-by: Abdul Lateef Attar > --- > UefiCpuPkg/UefiCpuPkg.dec | 4 ++ > .../Include/Library/SmmSmramSaveStateLib.h | 70 > +++++++++++++++++++ > 2 files changed, 74 insertions(+) > create mode 100644 UefiCpuPkg/Include/Library/SmmSmramSaveStateLib.h >=20 > diff --git a/UefiCpuPkg/UefiCpuPkg.dec b/UefiCpuPkg/UefiCpuPkg.dec > index cff239d5283e..1de90b677828 100644 > --- a/UefiCpuPkg/UefiCpuPkg.dec > +++ b/UefiCpuPkg/UefiCpuPkg.dec > @@ -2,6 +2,7 @@ > # This Package provides UEFI compatible CPU modules and libraries. # # > Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.
+# > Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
= # # > SPDX-License-Identifier: BSD-2-Clause-Patent #@@ -65,6 +66,9 @@ > [LibraryClasses.IA32, LibraryClasses.X64] > ## @libraryclass Provides function for manipulating x86 paging struc= tures. > CpuPageTableLib|Include/Library/CpuPageTableLib.h + ## @libraryclass > Provides functions for manipulating Smram savestate registers.+ > SmmSmramSaveSateLib|Include/Library/SmmSmramSaveStateLib.h+ [Guids] > gUefiCpuPkgTokenSpaceGuid =3D { 0xac05bf33, 0x995a, 0x4ed4, { 0xaa, = 0xb8, > 0xef, 0x7a, 0xe8, 0xf, 0x5c, 0xb0 }} gMsegSmramGuid =3D= { 0x5802bce4, > 0xeeee, 0x4e33, { 0xa1, 0x30, 0xeb, 0xad, 0x27, 0xf0, 0xe4, 0x39 }}diff -= -git > a/UefiCpuPkg/Include/Library/SmmSmramSaveStateLib.h > b/UefiCpuPkg/Include/Library/SmmSmramSaveStateLib.h > new file mode 100644 > index 000000000000..46bc6381bcde > --- /dev/null > +++ b/UefiCpuPkg/Include/Library/SmmSmramSaveStateLib.h > @@ -0,0 +1,70 @@ > +/** @file+Library that provides service to read/write CPU specific smram > save state registers.++Copyright (c) 2010 - 2019, Intel Corporation. All = rights > reserved.
+Copyright (C) 2023 Advanced Micro Devices, Inc. All rights > reserved.
++SPDX-License-Identifier: BSD-2-Clause- > Patent++**/++#ifndef SMM_SMRAM_SAVE_STATE_LIB_H_+#define > SMM_SMRAM_SAVE_STATE_LIB_H_++#include > +#include ++/**+ Read an > SMM Save State register on the target processor. If this function+ retu= rns > EFI_UNSUPPORTED, then the caller is responsible for reading the+ SMM > Save Sate register.++ @param[in] CpuIndex The index of the CPU to read > the SMM Save State. The+ value must be between 0 = and the > NumberOfCpus field in+ the System Management Syste= m Table > (SMST).+ @param[in] Register The SMM Save State register to read.+ > @param[in] Width The number of bytes to read from the CPU save state= .+ > @param[out] Buffer Upon return, this holds the CPU register value read= + > from the save state.++ @retval EFI_SUCCESS The register was re= ad > from Save State.+ @retval EFI_INVALID_PARAMTER Buffer is NULL.+ > @retval EFI_UNSUPPORTED This function does not support reading > Register.+ @retval EFI_NOT_FOUND If desired Register not > found.+**/+EFI_STATUS+EFIAPI+SmramSaveStateReadRegister (+ IN > UINTN CpuIndex,+ IN EFI_SMM_SAVE_STATE_REGISTER > Register,+ IN UINTN Width,+ OUT VOID > *Buffer+ );++/**+ Writes an SMM Save State register on the target > processor. If this function+ returns EFI_UNSUPPORTED, then the caller i= s > responsible for writing the+ SMM Save Sate register.++ @param[in] > CpuIndex The index of the CPU to write the SMM Save State. The+ > value must be between 0 and the NumberOfCpus field in+ = the > System Management System Table (SMST).+ @param[in] Register The > SMM Save State register to write.+ @param[in] Width The number of > bytes to write to the CPU save state.+ @param[in] Buffer Upon entry, = this > holds the new CPU register value.++ @retval EFI_SUCCESS The re= gister > was written to Save State.+ @retval EFI_INVALID_PARAMTER Buffer is > NULL.+ @retval EFI_UNSUPPORTED This function does not support > writing Register.+ @retval EFI_NOT_FOUND If desired Register not > found.+**/+EFI_STATUS+EFIAPI+SmramSaveStateWriteRegister (+ IN > UINTN CpuIndex,+ IN EFI_SMM_SAVE_STATE_REGISTER > Register,+ IN UINTN Width,+ IN CONST VOID > *Buffer+ );++#endif-- > 2.25.1