From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (NAM12-MW2-obe.outbound.protection.outlook.com [40.107.244.59]) by mx.groups.io with SMTP id smtpd.web08.4539.1666155528054763565 for ; Tue, 18 Oct 2022 21:58:48 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=fv/i6kmY; 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.244.59, mailfrom: abner.chang@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=acq/HpQ+FRAAbbNK18tjiYkmAVKvJnp9eoRlP4FbisDJF7eE9h6eSDnpSUW2Sgp3VXOKD087TpFVn7rXjyax6LUVuSfmduc5Ktl3umoxqxjFjuTFn7eRpvMvHS2DVyV1likcaI+ErMA1o/17srKkwHqpVreGRcHyOvFBVcaiINZRLLjXS+zKe5V/9B/oDjEiACCLAYah687UUW1MCwqNPm6vqfXBFmIapbJKOn97lWSji791KjaCyl7jcyWJUWAssw9wRq95NEC2fZYFbb+FMv95ZR7EznD9MArF3ZOLMfqe3Sk+TuNUiuyIXRNPECEImFLxpWs84jGzeL75N/OnpA== 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=8JbC8va9NTi2OCjn84E/iguyAj35pQeBW3OZHmSNDcA=; b=VP+rZpgexSulKmdaoCWuehy1pMDyTc0Ew480H6y38mb/EnbLUmd/th1+AtYpbOHG10a3fTg+XcNQKcoUG86skeeiOIwZcZDVWu4qranAAmi7d+TK2uvpooot8jGRqjp0Ixhezyna+dNzkjz3B0XdAd8l4nHquOaG7TrGqsDqs1mlb+BFQmEiNmsekeUdu/CSaDPKiuLYbmkwQkOIimGZQ6+Fq8U4Pi6dqe+qZP7KCOlc7l4uVNl1y9nB1XX5t21kNrfeU/Y75gYnVW3lw+u79LoQse+vPJoKEfy/DYzit5RkrxFqTv4OXCD4dRpwqmUrAprKpN5RzOXWiV7ZNgWGIw== 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=8JbC8va9NTi2OCjn84E/iguyAj35pQeBW3OZHmSNDcA=; b=fv/i6kmYGoJvPqGjZUjI2mOK53u/Cy0n8G6uMG8/maSvPDmTeRuRSickRT9zftG9YvJEIzCToQSt+N+M/S7BmeKdMFFwO1LV5pqnBwdNxtPRw/TMl3/tB0gl5n9+PGn6P0Few3ihlU4V60td4poji8UlxiGRJz6O4liTX4ay+2A= Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by MW3PR12MB4441.namprd12.prod.outlook.com (2603:10b6:303:59::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.20; Wed, 19 Oct 2022 04:58:41 +0000 Received: from MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::2eab:b851:827c:1d88]) by MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::2eab:b851:827c:1d88%3]) with mapi id 15.20.5723.034; Wed, 19 Oct 2022 04:58:41 +0000 From: "Chang, Abner" To: "devel@edk2.groups.io" , "Chang, Abner" , "Kinney, Michael D" CC: "Attar, AbdulLateef (Abdul Lateef)" , "Kirkendall, Garrett" , "Grimes, Paul" , "Dong, Eric" , "Ni, Ray" , "Kumar, Rahul R" Subject: Re: [edk2-devel] [PATCH 0/2] Reconstruction on SmmCpuFeaturesLibFrom Subject Received Size Categories Thread-Topic: [edk2-devel] [PATCH 0/2] Reconstruction on SmmCpuFeaturesLibFrom Subject Received Size Categories Thread-Index: AQHY43d1fhTEOujemUiNq1H4Olbg8Q== Date: Wed, 19 Oct 2022 04:58:41 +0000 Message-ID: References: <20220930095156.1827-1-abner.chang@amd.com> <1719FC274E2659D9.30932@groups.io> In-Reply-To: <1719FC274E2659D9.30932@groups.io> Accept-Language: zh-CN, en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2022-10-19T04:58:26Z; 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=43cdec44-efcf-4a5c-8b6c-4705c77e3ed1; 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_|MW3PR12MB4441:EE_ x-ms-office365-filtering-correlation-id: 206bbc11-feb0-4e6e-f0a4-08dab18e9795 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: K2xzmxF48hRcadfqrtKnfMPj5f5uaomqWbJRloEvzgzJtZgujnUOVe0p0EQ0/DmvmasmcDspLch2LaRR91ubpZ+vbTzv1kJXLxHB4yBFrYWf0dASak5ozhj0sMPscTPkOmQ+zsL1u+smr15yqQcjMOulwUvT4f5fNRbgUloTqf7644wqvNLQOATCIuK64XUiVMLnfRI+B+k20f332cIDQivsS+UphRLe+QNjMKDvUqL9AXl+oUNtVkJpohBqgbVzFveMYVW7Yqiud5hBxY5PVyPfRzuJUYLs3kx1pHZAvBluc61++waiyoS9Sf0fG0SLgfObQVE42XTg3TckfTw+VNErDT8etoK3v1cvEsejE75RfMbDz+C2zwsK7+pOdSkrVht31RwgYQG+7fowWG3m6FCKGZLgXM1uDgZ05e16SJ3+vTWCKoeU/q6kHIXmy07ANsCOwbechLN37o1c3QpPQ8Du5qcvz2od1uVNY93QjmUMNEeit5TtD9LFTyMcyq3uFbnCpN4Pl2o+2rje/z199kUB5V+IZcXkKsrZf0CMhQsk8B321wKze/ZtUAqJ51eykCkzJUBNVClHOwwGc/RrDX6lVPQqJsKAXW/oJw9WQ5PsrGSeIkRmnCFJmfRQKqBp5KGevbZFZcIHsKWBJixGpqghM+Mmw5bYASJuk0Hie4EFupnxFgDqM5aja01lJnhwbfRbwf3ekfebaf7VnFC649KwQJgFYZtveYiXODwm0G14/mK+qHJhoDIKCWfkBIt+sGVSYSqjPdDkRgQ1fI85y4fPy3uJxfVppDQYerwlwuo= 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)(366004)(376002)(136003)(346002)(39860400002)(451199015)(38070700005)(83380400001)(99936003)(33656002)(86362001)(55016003)(122000001)(38100700002)(76116006)(66556008)(316002)(66899015)(54906003)(110136005)(5660300002)(71200400001)(8936002)(186003)(966005)(66476007)(2906002)(45080400002)(6506007)(53546011)(66946007)(478600001)(7696005)(64756008)(26005)(52536014)(41300700001)(9686003)(66446008)(4326008)(213903007);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?BA5PHXTowuF4sW1tYCOGNvXJ4Ic4Cxl5AJ6/xIEtbQ1NmWgTtZHOlrdM0Wpq?= =?us-ascii?Q?b39Jb59RooGW811j6weitRHqExNh9sp8sXeN6xKv4jWFU/IlIzpE65eW1LN3?= =?us-ascii?Q?4YkI1bJ1/aL8h7rCmXEFo8JKPsP8f+yx1q2KmWQFCAZCcYQJ+pL963UzgnS+?= =?us-ascii?Q?Q2IQnVgTXBiIPRXAqhueOj5QK+6HcfEK/iqhqpkfNYwWABGMlMiN3j592pp8?= =?us-ascii?Q?UJH8W92SruK2UiCsbD0g7vtWqGcJonzMoBklhP7ZtP7b7yN850fCHPGgMIlj?= =?us-ascii?Q?ckcEeyn+A4a3NJbkD7NsfWhF2xIRAkTNANX+58ORqq4dSSNyVnDm18LSZQMm?= =?us-ascii?Q?f+j1vCW2mWKeIWBrMPApiPCP6r0YiEosaiKzQRAApDzgTZRThxWc/Fp2Cqgb?= =?us-ascii?Q?9+lhW3lZZrYrOerLzN7EA+hOCHo2yMaQHKJdHzRYNjTxkbhyZkFdK5ZlAsZd?= =?us-ascii?Q?ajo0zvec/dChuw0PJPLZAMhBSY3PN436RtxZCNTifmBf9/mAlwXXzyytYDX/?= =?us-ascii?Q?uJdQuUw7/nzuIMWSqLV6/p51Id3O3CVbPbjzk4b+kArdD14Gm0a4LNCjSDKf?= =?us-ascii?Q?iqpYLb/+xrDvw5tFx8556OVR30ezwVHvkRj1ADG9FLLhCr1QLUmfnta1uN94?= =?us-ascii?Q?zL24R2btPY0YZZ2yTFhAeXyuna0qZMTdEjstse/u2ODSk8/lxob8bWWrh0B1?= =?us-ascii?Q?F5171zPYKVCJrm1Ib8RHoyYErJcYsQ2NTcZzpfqdqhwF4+NMZKlQzQ9PyzKT?= =?us-ascii?Q?ArxODOocH2fHxuZLmAsCbCIvzxGqgstRSZ0E/ktxBfowAoHkUimtF7TrJhv2?= =?us-ascii?Q?MbZx0AXN8+hpQ/xVuqejl1Q/rZRJ0wMoKvD+98yQIfITRhJqkyNTElmys4Uh?= =?us-ascii?Q?91t1l60EkgPuKXuqR6Y7lTjcMiRP6ZtPa1HguVtyWDtJj3Y5VmbgtUI1JuOP?= =?us-ascii?Q?UVLImLkEU656rsO1pUJCIJvXshsjS/4zyq8/VOsstizl9LLkfMp1UULywwvk?= =?us-ascii?Q?xY46wUvLNDaNUzjc9jzeivHg/iuEk7HHS8Bl6tKxa0guDZ+qHzAeQnvCXk4q?= =?us-ascii?Q?K50Mpw33rdED0dtLtZLmzNgbEFKvISrxj9K8PzXgIej/omk/9Z4q/LerrCSW?= =?us-ascii?Q?6Zvi33Hs4hthPjfV39hYcD15eoJE8ug/h5uGt3L5kY4ubeJT+b/FztK4dPPM?= =?us-ascii?Q?2dNgmPeUaDGWIRMvHimL9v4MTZPq5RPuqXpr05SEkEYBg7Z0TWICwaTdtnHr?= =?us-ascii?Q?0wDqHpbxNVaV1QinQMkFa0qLeIL83xvb7S5E0DFK0H2IixeSMB5rBmYdMMLN?= =?us-ascii?Q?eyMQiX631gc5iyiR9YSQq0FY8plkcTvIjRS8EC99WZ6i+1OCoGx5+/DtD1Kz?= =?us-ascii?Q?yvzaH9AzBdGFBd1ha8YEb+m1+Rb2zQlQXrw7f4ElOo00vqSzVwHzWyzzu+i9?= =?us-ascii?Q?RQ/BkM/hMw0Ftv7tPPEe890F5PXvTgw0Gi9wFbyHjcQLn7HhI6UNtC7SidwB?= =?us-ascii?Q?qnoBFi7Fdfa8vYLVllfKFmCW8emw1tlknMOr8myaRmjh7h21LklZE6V3SVti?= =?us-ascii?Q?wxesbEh1QRwZ5sr/8ELH6YqfJ1buVuHcYkSHhj68?= 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: 206bbc11-feb0-4e6e-f0a4-08dab18e9795 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Oct 2022 04:58:41.2536 (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: LiROq8pAWVpoD0VakPbyWtqn4deVw1iIeKYefEt4l/LgeozB6/kCd58AmnVyGd2gy00XfodJyguh23mE7eqJQQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4441 X-Groupsio-MsgNum: 95364 Content-Language: en-US Content-Type: multipart/mixed; boundary="_003_MN2PR12MB3966D99E824C993ACFF2B5F7EA2B9MN2PR12MB3966namp_" --_003_MN2PR12MB3966D99E824C993ACFF2B5F7EA2B9MN2PR12MB3966namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable [AMD Official Use Only - General] Hi Ray and module maintainers, I think this patch set should be no problem as we agreed with the guidance = added to edk2 coding standard for the module source file naming that suppor= t different processor archs/vendors. Patches are attached, please help to review it. Thanks Abner > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Chang, > Abner via groups.io > Sent: Saturday, October 1, 2022 11:40 PM > To: Kinney, Michael D ; devel@edk2.groups.io > Cc: Attar, AbdulLateef (Abdul Lateef) ; > Kirkendall, Garrett ; Grimes, Paul > ; Dong, Eric ; Ni, Ray > ; Kumar, Rahul R > Subject: Re: [edk2-devel] [PATCH 0/2] Reconstruction on > SmmCpuFeaturesLib >=20 > Caution: This message originated from an External Source. Use proper > caution when opening attachments, clicking links, or responding. >=20 >=20 > [AMD Official Use Only - General] >=20 > Hi Mike, > I think we don't need to git mv for this case. IntelSmmCpuFeaturesLib.c i= s a > new file and the content is moved from SmmCpuFeatureslibCommon.c. > SmmCpuFeatureslibCommon.c still has the complete history. Did I miss > something? >=20 > Abner >=20 > > -----Original Message----- > > From: Kinney, Michael D > > Sent: Friday, September 30, 2022 11:11 PM > > To: devel@edk2.groups.io; Chang, Abner ; > Kinney, > > Michael D > > Cc: Attar, AbdulLateef (Abdul Lateef) ; > > Kirkendall, Garrett ; Grimes, Paul > > ; Dong, Eric ; Ni, Ray > > ; Kumar, Rahul R > > Subject: RE: [edk2-devel] [PATCH 0/2] Reconstruction on > > SmmCpuFeaturesLib > > > > Caution: This message originated from an External Source. Use proper > > caution when opening attachments, clicking links, or responding. > > > > > > Hi Abner, > > > > Did you use git mv to rename the file. It can help track history of ch= anges. > > > > Mike > > > > > -----Original Message----- > > > From: devel@edk2.groups.io On Behalf Of > > > Chang, Abner via groups.io > > > Sent: Friday, September 30, 2022 2:52 AM > > > To: devel@edk2.groups.io > > > Cc: Abdul Lateef Attar ; Garrett Kirkendall > > > ; Paul Grimes ; > > > Dong, Eric ; Ni, Ray ; Kumar, > > > Rahul R > > > Subject: [edk2-devel] [PATCH 0/2] Reconstruction on > > > SmmCpuFeaturesLib > > > > > > From: Abner Chang > > > > > > This patch set is part of below BZ 3860: > > > > https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fbu > > > gz > > > > > > illa.tianocore.org%2Fshow_bug.cgi%3Fid%3D3860&data=3D05%7C01%7Ca > bn > > er > > > > .chang%40amd.com%7C8e21740be3a54f50521708daa2f5f70d%7C3dd8961f > e > > 4884e60 > > > > > > 8e11a82d994e183d%7C0%7C0%7C638001474543728133%7CUnknown%7CTW > F > > pbGZsb3d8 > > > > > > eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3 > D% > > 7C3 > > > > > > 000%7C%7C%7C&sdata=3DtJUZ5hTCB0sBXd4bx5HG5XDV%2FWyU1dKwID > DzI > > KNjegA%3 > > > D&reserved=3D0 > > > > > > This is the reconstruction on SmmCpuFeaturesLib to accommodate AMD > > > implementation of SmmCpuFeaturesLib. Intel specific implementation > > > is stripped away from SmmCpuFeaturesLibCommon.c and put into > > > IntelSmmCpuFeaturesLib.c. > > > > > > This patch set is the preparation for AMD SmmCpuFeaturesLib upstream. > > > In the follow up pacthes, AMD will create a new INF file > > > SmmAmdSmmCpuFeaturesLib.inf under \SmmCpuFeaturesLib, > > > AmdSmmCpuFeaturesLib.c for the AMD specific implementation. > > > > > > Signed-off-by: Abner Chang > > > Cc: Abdul Lateef Attar > > > Cc: Garrett Kirkendall > > > Cc: Paul Grimes > > > Cc: Eric Dong > > > Cc: Ray Ni > > > Cc: Rahul Kumar > > > > > > Abner Chang (2): > > > UefiCpuPkg/SmmCpuFeaturesLib: Abstract arch dependent code > > > UefiCpuPkg/SmmCpuFeaturesLib: Clean up header file inclusion in > > > SmmStm.c > > > > > > .../SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf | 1 + > > > .../SmmCpuFeaturesLibStm.inf | 1 + > > > .../StandaloneMmCpuFeaturesLib.inf | 1 + > > > .../SmmCpuFeaturesLib/CpuFeaturesLib.h | 6 + > > > .../IntelSmmCpuFeaturesLib.c | 403 ++++++++++++++++= ++ > > > .../SmmCpuFeaturesLibCommon.c | 391 +---------------= - > > > UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmStm.c | 3 - > > > 7 files changed, 413 insertions(+), 393 deletions(-) create mode > > > 100644 > UefiCpuPkg/Library/SmmCpuFeaturesLib/IntelSmmCpuFeaturesLib.c > > > > > > -- > > > 2.37.1.windows.1 > > > > > > > > > > > > > > > >=20 >=20 >=20 >=20 --_003_MN2PR12MB3966D99E824C993ACFF2B5F7EA2B9MN2PR12MB3966namp_ Content-Type: message/rfc822 Content-Disposition: attachment; creation-date="Wed, 19 Oct 2022 04:58:28 GMT"; modification-date="Wed, 19 Oct 2022 04:58:33 GMT" Received: from BY5PR12MB4193.namprd12.prod.outlook.com (2603:10b6:a03:20c::19) by MN2PR12MB3966.namprd12.prod.outlook.com with HTTPS; Fri, 30 Sep 2022 09:53:38 +0000 Received: from BN0PR02CA0052.namprd02.prod.outlook.com (2603:10b6:408:e5::27) by BY5PR12MB4193.namprd12.prod.outlook.com (2603:10b6:a03:20c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Fri, 30 Sep 2022 09:53:35 +0000 Received: from BN8NAM11FT099.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e5:cafe::9) by BN0PR02CA0052.outlook.office365.com (2603:10b6:408:e5::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.20 via Frontend Transport; Fri, 30 Sep 2022 09:53:35 +0000 Received: from mail02.groups.io (66.175.222.108) by BN8NAM11FT099.mail.protection.outlook.com (10.13.177.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.17 via Frontend Transport; Fri, 30 Sep 2022 09:53:35 +0000 From: "Chang, Abner via groups.io" To: "devel@edk2.groups.io" CC: "Attar, AbdulLateef (Abdul Lateef)" , "Kirkendall, Garrett" , "Grimes, Paul" , Eric Dong , Ray Ni , Rahul Kumar Subject: [edk2-devel] [PATCH 2/2] UefiCpuPkg/SmmCpuFeaturesLib: Clean up header file inclusion in SmmStm.c Thread-Topic: [edk2-devel] [PATCH 2/2] UefiCpuPkg/SmmCpuFeaturesLib: Clean up header file inclusion in SmmStm.c Thread-Index: AQHY1LKDpGuTGf3dbEOQsapyEP5wpw== Sender: "devel@edk2.groups.io" Date: Fri, 30 Sep 2022 09:53:03 +0000 Message-ID: <17199AAD4F5562C9.16804@groups.io> List-Help: List-Subscribe: List-Unsubscribe: Reply-To: "devel@edk2.groups.io" , "Chang, Abner" Content-Language: zh-CN X-MS-Exchange-Organization-AuthSource: BN8NAM11FT099.eop-nam11.prod.protection.outlook.com X-MS-Has-Attach: X-Auto-Response-Suppress: All X-MS-Exchange-Organization-Network-Message-Id: 418ae263-9f70-409e-3f48-08daa2c9a427 X-MS-TNEF-Correlator: X-MS-Exchange-Organization-RecordReviewCfmType: 0 received-spf: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C x-ms-exchange-organization-originalclientipaddress: 66.175.222.108 x-ms-exchange-organization-originalserveripaddress: 10.13.177.197 x-ms-publictraffictype: Email x-originating-ip: [10.180.168.240] authentication-results: spf=pass (sender IP is 66.175.222.108) smtp.mailfrom=groups.io; dkim=pass (signature was verified) header.d=groups.io;dmarc=bestguesspass action=none header.from=groups.io;compauth=pass reason=109 delivered-to: mailing list devel@edk2.groups.io mailing-list: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io list-id: dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1664531614; bh=/X+mI4aTIqlJ0YqLNLsN6IXDxzl06K5KPby4y0fJaT0=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=RG7TGAu6rM7F8KwNifb3/YInODDlFeQiPEi7oorC+6xSA/McFS2h4WkXo3LdiNZwmhp e/92J28HR5dI4JRp02B1GGvPon/SdOS8IyHizrwkzesbAMuoeX0XWzG7NmCI4lVcSOeuX HDNIS8YARUkNlAfd4q6DPoJJzMv8PbGirsE= x-ms-office365-filtering-correlation-id: 418ae263-9f70-409e-3f48-08daa2c9a427 x-ms-traffictypediagnostic: DM6NAM11FT057:EE_|DS0PR12MB6629:EE_|BN8NAM11FT099:EE_|BY5PR12MB4193:EE_ x-forefront-antispam-report: CIP:66.175.222.108;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail02.groups.io;PTR:mail02.groups.io;CAT:NONE;SFS:(13230022)(4636009)(451199015)(36736006)(118246002)(7596003)(4326008)(8676002)(356005)(7636003)(6486002)(76796012)(7846003)(966005)(956004)(2616005)(336012)(7696005)(33656002)(107886003)(6666004)(26005)(54906003)(19810500001)(9316004)(36756003)(83380400001)(5660300002)(6862004)(1096003)(66899015)(34756004);DIR:INB; x-microsoft-antispam: BCL:0; x-ms-exchange-crosstenant-network-message-id: 418ae263-9f70-409e-3f48-08daa2c9a427 x-ms-exchange-crosstenant-originalarrivaltime: 30 Sep 2022 09:53:35.0320 (UTC) x-ms-exchange-crosstenant-fromentityheader: Internet x-ms-exchange-crosstenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d x-ms-exchange-transport-crosstenantheadersstamped: BY5PR12MB4193 x-ms-exchange-transport-endtoendlatency: 00:00:03.7324040 x-ms-exchange-processed-by-bccfoldering: 15.20.5676.023 x-eopattributedmessage: 1 x-ms-exchange-crosstenant-authas: Anonymous x-ms-exchange-crosstenant-authsource: BN8NAM11FT099.eop-nam11.prod.protection.outlook.com x-received: from TPE-L1-ABNCHANG.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Fri, 30 Sep 2022 04:53:20 -0500 arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M+VxJG0CT8TVUqc5XAVSMh7j5+N8lLR3F51zNC/Z9sOCTbQFzmseM7WhnQOQh4jcM7lvN/CZvdypEJlqai0np2EyrdzjeCeCWIOsz5U1O4JeJnw5C7EzPOCVR/iJjhL0XlYEYVZJSy42pK4gAKQ/Sk0X6iCY+fi6+GqU2WEOwg7ApFd5OIp4rXOkz/sumuXp6N7g9OTsHqZeRQDvKDyIMFBzUdS7vgg72RtdRN3LuTGx1l9BXl/js7fgS8BfLxo8CMnMFt5JaQjXMvCE9SAb3nyLZiVdTCE0LFy3Ahkc31J72/+77eMRsTn2aBqya6rJ3elug64HEuv0GBeLhT0HIQ== 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=SqknzyrwbVtpVbz/6rnG5nyfErPASkHXrsuEJZVBFUM=; b=VdztPCK7FBPbG8INgk0dmcqyHhjGsSkLgFXL5jZNFfnsHmg4wdiKjy9LZD6Sb0YYI0dxSQVh1pIiXrCg9dcxem5xxECyboOehNHckaD3VTnwPx1ipsCpgzjqCrjqSXwQlJCliELOPDfRP5R/hXp1qPBI7h0YjTQQ0RYoQJLt28XJQp1psMhQy8uoWYUHNaRGSXGgZXB220mOL7ZqNcAVE43LemhKZupSP2tUbQraJNU0spFD7x4++9QJPwvpoqsD1nTkJVs+mkIIPrL9l+gwPqd3O32oc1tBai+c4pQni53SUGSus0ofzoWytwmeFbj5idpmL0r69+zDYh6qyltMTg== arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info-original: yDpe6VG/IxdQ6zbDdtMpY/PgLOdqbLF5kka8tHzGW8jC+cW1tJrxxPTDOtOKeBjV9RhY6y8uEt6QSxko99vrkth2BMqGD5Or0vKsqjgR5wG6Xg4VTr3yihwkyPuaPIWfpv7ifhmvcU2SUem9Hjxt52vemZuSyT1ZklOc4Mv1wqT8vTqyubppwv0NR14bn9nuMC0IzN1CGHdJvw4PrTFVPD6Cgak+6ol0LKZpsuN4WHqrls4ue3q+8oS68VUSAt+cp+hTaDMKFaRiFARskGQk0DES9SMBAMB82XCRmOP8BBYIEG/aN+T4rkhyLyvPFXCsMKKSYMKvbCP8+bm55kJNPC0Xq9xIHusUKUcEAI9jbrAXlF1Vya8revfkMadZdLwYAMGnEz7VMAWGAJQbTPoNG18e7qZf2Ll5Jq+GXhF5wpm7hPWmQjXgPXUZZwLQfWrbxusghR24UdIVY9xcjCInluEbpehS6q+09FTjbc8xKBGa2PpKzmLG1OOXj7peXEAzqrznrAXoL+gwoQhn9ZfA3xBL1UvGbYeeMlkoRgg7fMBk6dWD5Ii/C/RtanaY0fgdnavRFhPURIJJOc4StL8G2Lre+Bt8H5gVI6kqhojL/CSGK12eEx5tBNrdBmE89pjOXrJD1jVIRUDqU7OzluBP9Cm8q0Kb/ssfQrz9i/8SmiuaRhatPL5MgOAI7CO0+Pn7KQRM5CF9LB8k4Q+s1F/VI5qq0IraGGAvfzlAeDu8cFFW4FF2SAN0lliOlN15lHI9D2eWHLeLGDVKcIhX03rZEZoleBeY65fSEcP1Ok0cYpGiWr6k5jBftvayqfDQV7aC x-ms-exchange-transport-crosstenantheadersstripped: BN8NAM11FT099.eop-nam11.prod.protection.outlook.com x-ms-office365-filtering-correlation-id-prvs: 841ab042-794a-4bd1-78b6-08daa2c99d36 x-ms-exchange-antispam-relay: 0 x-gm-message-state: 5EnbPAPP8F2F9o3UzN3iD2T9x7039027AA= x-clientproxiedby: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) x-ms-exchange-atpmessageproperties: SA|SL X-Microsoft-Antispam-Mailbox-Delivery: ucf:0;jmr:0;auth:0;dest:I;ENG:(910001)(944506478)(944626604)(920097)(930097); X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?+/yTSimhhQaZxTSMStELo8L68WPLZvc+uU0S/+gL2oy2J2wv7XbQB2p0ZDf7?= =?us-ascii?Q?SvxQodBJ5kMZx9D2GwQYd/Z6D44hpPOBrPOP8QKWqMkSZnPE0bpIDAYWqlUs?= =?us-ascii?Q?ukSbFOqiOjk8duhZ4GniEw38DKuxbE0SguE3zEbHc3XggxMF28j52VX5MBYS?= =?us-ascii?Q?h+Oq5HAhPm5Kk0Auax6tMFOtWBWFFsID8fI47PWVIj6DUJcWp0o4ln4yjAd7?= =?us-ascii?Q?GR/xjA3DaXhH6dZijN7c2f/Uel/Yb5NckQbbMUj5S08UMr0A48HeBIwxPEmr?= =?us-ascii?Q?lvFzta4iZguYz03NE6bsd7TQiPeKBwuHQkCJcYiE2ysp6A0wCZA7UfuatRMG?= =?us-ascii?Q?rbBVfltRY+H8tgIBMHf6nYCd2D/vSnUWkkTkC4sjTWQBmnFTl3PxlAYL0tt2?= =?us-ascii?Q?oiX8rVDCbEl4OfTdrSI8dKMY7m+2EPQRWwYDk8eNSA0hVpahg072vNLwCkGe?= =?us-ascii?Q?pjEouVUAACWwCRaUcrL+jjsezl/qpvTmuBUOkIVtMkAtVd3BFI9t+78U7wcU?= =?us-ascii?Q?0FB+L4Mc1Lnqhb8X8lLgJkygyj8ke4KtMMWD/q+iVh4P0Z3zfAnETxto+Qwh?= =?us-ascii?Q?sSW5zys3MqyDCL7raquEC61LadbhBn284g+3CdjnzEjLLCNS+CrMPb8Hfe1+?= =?us-ascii?Q?P0+uyCk+uD85TQCi8S0Vf6OcvHdzGpwPnyCODuQdB3aj2Q4tHz4RFT424Evw?= =?us-ascii?Q?wXhqpUav7CDPSWHry4RhvZ+P+CvB/Zj9nA2o5cez4dY1TIBVL8Mr8fdVVNrT?= =?us-ascii?Q?wRK32brQmfilN2Jb4gqskrZYoNf9IjASWIbLTBHhu+2CCoTAlWqWUzRlZTEb?= =?us-ascii?Q?9hPPS1kq0xioLy2Fx4CJu1JViFP1iqzLnC8ZFUJM5WfVGSkaZogSqEUW/+p6?= =?us-ascii?Q?GQkLfUjTMZAnEsU0FWqPeLx9K/pitjxH0FKyX0984wZSDl0843cbwuqCjfQl?= =?us-ascii?Q?dv5XSImoZmPREmIe5rhMMoUkUE2h085ojys3Fz837cdoXWVS80bRmJuXscFb?= =?us-ascii?Q?yyJZQRhNs/To7mz4JTfdLcghg6tmq8YrGO+hzo8F8cxlBTqe65r2Vr5UXVmz?= =?us-ascii?Q?UQApm1mZSZurAxY9xB8FqYN8n0fjrbqo/48theXsl6rczvTTo9yV+Rw5mp4T?= =?us-ascii?Q?A3uvf7TVjklsnTHGF6TGpfe46YSvBBcrtfRskiIHIeWbrNbSU1jsMEsIm53X?= =?us-ascii?Q?0w8WLWmu6mt4JUV1lnoAf97ZN5SXE5G3yps+WcoUc8MA/wsyhbZlLwBp1xrN?= =?us-ascii?Q?iz8RqAhfLcSV+sflBakoEw7dcsQFsfRzBgiENf6FXa9YaGwJLwwj7+FmIngk?= =?us-ascii?Q?2qiI1GmT/ZpWuCVO5zoWpC5OnT4lO1GBAhLDj+vYXlPB+WvIePDL15X7OJQm?= =?us-ascii?Q?D7OkQrMKf/ygvvsEspMnGIz1gYOCdbxyeZNMzfZgVDAX68aioJIH9+LQ+bW+?= =?us-ascii?Q?R1wXRQeX7gQBFSEOBk5GyT4C4flCVlKXonkv/yPwaX7mDHIxUkHs8btUGcvT?= =?us-ascii?Q?sX+T1suldF5Zvk2rxPe+gGLiNBjLuoeN9n1KU6joqbSSBOkb0TNkSJGCf/u4?= =?us-ascii?Q?y6AH6sRM9SDS6tBtFsUrEsi12c7EYUtUM/8lWlfdxJyQG5o4TRHpPY3O/WIp?= =?us-ascii?Q?1xvOPyIG/LQw8g6mqMrj071At6VxYS9STIXngaBhgNaQi5xU9Y1RyNiErF6X?= =?us-ascii?Q?6HIJg8vYmDFqJ7N3epuVjT0Gt/fD3RJ8Y6m/TJBiYc53Pgl4+5PKs1MvbroD?= =?us-ascii?Q?u8YQE9yCkfIrSoP+kgkDfcnB3NVEttA6vnQVpFhv/ne24/rW7n52?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Caution: This message originated from an External Source. Use proper cautio= n when opening attachments, clicking links, or responding. From: Abner Chang Remove the header files those are already included in CpuFeatureLib.h. Signed-off-by: Abner Chang Cc: Abdul Lateef Attar Cc: Garrett Kirkendall Cc: Paul Grimes Cc: Eric Dong Cc: Ray Ni Cc: Rahul Kumar --- UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmStm.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmStm.c b/UefiCpuPkg/Lib= rary/SmmCpuFeaturesLib/SmmStm.c index 4e8f897f5e9..3cf162ada01 100644 --- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmStm.c +++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmStm.c @@ -7,11 +7,8 @@ **/ #include -#include #include -#include #include -#include #include #include #include -- 2.37.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#94569): https://nam11.safelinks.protection.outlook.com/= ?url=3Dhttps%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Fmessage%2F94569&data= =3D05%7C01%7Cabner.chang%40amd.com%7C418ae2639f70409e3f4808daa2c9a427%7C3dd= 8961fe4884e608e11a82d994e183d%7C0%7C0%7C638001284188893949%7CUnknown%7CTWFp= bGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%= 7C3000%7C%7C%7C&sdata=3DRh18qTEIhR%2FbfmhWTbL2CIIzmMVpyvpiZMAmvjtizhI%3= D&reserved=3D0 Mute This Topic: https://nam11.safelinks.protection.outlook.com/?url=3Dhttp= s%3A%2F%2Fgroups.io%2Fmt%2F94013091%2F7039027&data=3D05%7C01%7Cabner.ch= ang%40amd.com%7C418ae2639f70409e3f4808daa2c9a427%7C3dd8961fe4884e608e11a82d= 994e183d%7C0%7C0%7C638001284188893949%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wL= jAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&s= data=3DB0iMqWn%2FfA7fbbOm6bGLk6bmw2oT03xxR3oeDO7DuMg%3D&reserved=3D0 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A= %2F%2Fedk2.groups.io%2Fg%2Fdevel%2Funsub&data=3D05%7C01%7Cabner.chang%4= 0amd.com%7C418ae2639f70409e3f4808daa2c9a427%7C3dd8961fe4884e608e11a82d994e1= 83d%7C0%7C0%7C638001284188893949%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMD= AiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata= =3DwXmeoTALt%2FMITaI1xs548uw3L1ZYzg9o3sCTydUZwQw%3D&reserved=3D0 [abner= .chang@amd.com] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- --_003_MN2PR12MB3966D99E824C993ACFF2B5F7EA2B9MN2PR12MB3966namp_ Content-Type: message/rfc822 Content-Disposition: attachment; creation-date="Wed, 19 Oct 2022 04:58:34 GMT"; modification-date="Wed, 19 Oct 2022 04:58:40 GMT" Received: from SA0PR12MB4445.namprd12.prod.outlook.com (2603:10b6:806:95::15) by MN2PR12MB3966.namprd12.prod.outlook.com with HTTPS; Fri, 30 Sep 2022 09:53:02 +0000 Received: from MW4PR03CA0090.namprd03.prod.outlook.com (2603:10b6:303:b6::35) by SA0PR12MB4445.namprd12.prod.outlook.com (2603:10b6:806:95::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Fri, 30 Sep 2022 09:52:59 +0000 Received: from CO1NAM11FT091.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b6:cafe::f0) by MW4PR03CA0090.outlook.office365.com (2603:10b6:303:b6::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.20 via Frontend Transport; Fri, 30 Sep 2022 09:52:59 +0000 Received: from mail02.groups.io (66.175.222.108) by CO1NAM11FT091.mail.protection.outlook.com (10.13.175.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.17 via Frontend Transport; Fri, 30 Sep 2022 09:52:59 +0000 From: "Chang, Abner via groups.io" To: "devel@edk2.groups.io" CC: "Attar, AbdulLateef (Abdul Lateef)" , "Kirkendall, Garrett" , "Grimes, Paul" , Eric Dong , Ray Ni , Rahul Kumar Subject: [edk2-devel] [PATCH 1/2] UefiCpuPkg/SmmCpuFeaturesLib: Abstract arch dependent code Thread-Topic: [edk2-devel] [PATCH 1/2] UefiCpuPkg/SmmCpuFeaturesLib: Abstract arch dependent code Thread-Index: AQHY1LJu59HtVpnfdkqBhVBUjRRaTA== Sender: "devel@edk2.groups.io" Date: Fri, 30 Sep 2022 09:52:28 +0000 Message-ID: <17199AA59D1EDE0C.23184@groups.io> List-Help: List-Subscribe: List-Unsubscribe: Reply-To: "devel@edk2.groups.io" , "Chang, Abner" Content-Language: zh-CN X-MS-Exchange-Organization-AuthSource: CO1NAM11FT091.eop-nam11.prod.protection.outlook.com X-MS-Has-Attach: X-Auto-Response-Suppress: All X-MS-Exchange-Organization-Network-Message-Id: 35230bb7-98f0-4e2c-9f41-08daa2c98ebb X-MS-TNEF-Correlator: X-MS-Exchange-Organization-RecordReviewCfmType: 0 received-spf: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C x-ms-exchange-organization-originalclientipaddress: 66.175.222.108 x-ms-exchange-organization-originalserveripaddress: 10.13.175.146 x-ms-publictraffictype: Email x-originating-ip: [10.180.168.240] authentication-results: spf=pass (sender IP is 66.175.222.108) smtp.mailfrom=groups.io; dkim=pass (signature was verified) header.d=groups.io;dmarc=bestguesspass action=none header.from=groups.io;compauth=pass reason=109 delivered-to: mailing list devel@edk2.groups.io mailing-list: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io list-id: dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1664531578; bh=OG0Nj+UiRrmYJHZ7IvXRKYxiRxbUMmseMdA60+jYDyk=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=ki0x+QlJ6Z5IywdZdxjSnDFOx2tyxc8n4ejOIPyCtnQWMSP2Sq24Km+OPeKVlTFmmNR Po2EHlUz4KUYkkZmVrbyCzDq/nyiXpMLodcKbfZSRC0b8b8bGYIeb3ajSRn7s48ul3btg Fps4t3pGuF2mHgyxJnWWAbnGSx030R59TRw= x-ms-office365-filtering-correlation-id: 35230bb7-98f0-4e2c-9f41-08daa2c98ebb x-ms-traffictypediagnostic: DM6NAM11FT046:EE_|CH0PR12MB5251:EE_|CO1NAM11FT091:EE_|SA0PR12MB4445:EE_ x-forefront-antispam-report: CIP:66.175.222.108;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail02.groups.io;PTR:mail02.groups.io;CAT:NONE;SFS:(13230022)(4636009)(451199015)(36756003)(36736006)(54906003)(19810500001)(33656002)(66899015)(30864003)(356005)(336012)(956004)(2616005)(83380400001)(7636003)(7596003)(5660300002)(76796012)(26005)(6666004)(107886003)(7846003)(6486002)(966005)(8676002)(4326008)(7696005)(6862004)(1096003)(34756004)(118246002)(9316004);DIR:INB; x-microsoft-antispam: BCL:0; x-ms-exchange-crosstenant-network-message-id: 35230bb7-98f0-4e2c-9f41-08daa2c98ebb x-ms-exchange-crosstenant-originalarrivaltime: 30 Sep 2022 09:52:59.2352 (UTC) x-ms-exchange-crosstenant-fromentityheader: Internet x-ms-exchange-crosstenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d x-ms-exchange-transport-crosstenantheadersstamped: SA0PR12MB4445 x-ms-exchange-transport-endtoendlatency: 00:00:02.9223221 x-ms-exchange-processed-by-bccfoldering: 15.20.5676.023 x-eopattributedmessage: 1 x-ms-exchange-crosstenant-authas: Anonymous x-ms-exchange-crosstenant-authsource: CO1NAM11FT091.eop-nam11.prod.protection.outlook.com x-received: from TPE-L1-ABNCHANG.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Fri, 30 Sep 2022 04:52:45 -0500 arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d6mgHPb4P1A19uI9r8IFyJ2rJanVHHVKCkfd2ZSb8ExIj09dVzC9d7OyQCyuDSsCByC/HJ27Fl/sjzr8b9M41ui0otC76QXkxrUfc1BU6Jn+ygwitMm+34Ffr6ZcjNaxG/zgG1AHqqNmdoJA9REnRoXVQrxCqasjo3aLA5BBgSTLqSfguOmKzcxzBGsuLhR/EWIxsxS/o2kzPAvk/Oh0LXBjj9UmA3m5KBBgeypsdsZ1QklLJrpq5h/tmwKp218Y+BaW753iSmCLq1WNBoSbKUdv5rTN80nxNi1t/950BEOJEhzwhXoBYyFtrAxkR5/PY6Ans5VsBHj8cWNPWxp+fw== 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=DZOkNSogqT2wSOTTbQ6cu+EjyX1ZF8Whq+68UiScoO4=; b=QPqIWq51Z7r1Ngp5z1MxBYauO5eRVRJ+UNDQVV8K9Y0Y5/LQ9mBAAps/9vhLekOpo1vAdWKpuBzt348j4rMyPd5Y08qmXEOB7p6+ezyxQSO/PhgdncuGUzGDEK7Wh1p+2kyYXbaIuDR1yBOz0E6+kAnQpMPADG3Sa6D8NNsWJkKmAXp/pQaVW93WoPIm6zqbHsDPIyLbntKQlDTYcGBl9c++oc/CW5Yx8WlhJ+1/Q1ASalsUrkfRtBWhWA6WN+pnqz29qQU7o3JVDGaLOMmCj9BzFZoHQbPY4iKv06zgjVk07glb+4hXyZXkJRuh3FPYnRFLdBiIPONjnH5Jt0ce8Q== arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info-original: 7gm5V0Xob6C8mRsRUydnu0YbHAyDETDx3w8FQDvxzwJMyM+polpwmBP0tsfjitZwp4W+yauOlg68lJrcT8jaJs60hdj+oewyTEuK6h/nz933cM+IZuo0wb3D0zw+jYVXhQ65kDoxue9utw7sjidgwgLoEqr+LwKbRZNf/ACe2ghjdgnDDOx4H0ymaDlE/CjJlR3sQiT0uDuQCZdxi6KklJNdcM1lUCLau2dtZzJiQi1NJRye+dqHWOZL8pew1n/shiUUhrfWrbNEBOqU5x8CxKC3wP8ZvvXoD6Bdig5rvdbBE4LY8eNZ1DgqbiRH4UX8+xV4qiFjXdBgWV/I1YsALv7xs2cplAcMI0GvdhIF2mN+kD92gok18X1J82Dn7RypxHyx5YHP6uvfv03oF9v55KRyY1CGLnsXqFWxFeB6O+d/fD8YkEbLN3Q3jOcOiO4cgwNZgoADyhFBTYjQbDTysnLac4yxxiqkKL0C6y9S05Q5HTWSPFIRXxfhUZyAozvOV9QkgeK4nI891NKm61jbPOIwWDtqEBdvt+hnFLuRY1Oo4sDGcyyk9eYSBd3mC159Qe0TWREKLymdZRd5Oyuo9C0pyXiELXavoa55r1dGAnXLlkEpOX7oGQgv4PvzrpE0OOl4mTJuYr5IP10q7iKo53zw986c6KLK/x3u+5ZkTzVTvuVzYpV2CYdO+MqIMHW71CdZFlx4LPGKIZJA1E3NSxnBZlMck9qznmYF0ml0snHS50cNWok3zsx1yrEIvmXXaFZ/Wck7O21/vr/+urV/SdlptlFSO7OMWPe58gkChxZ1GeHPTeosXks4oIhqDyEz x-ms-exchange-transport-crosstenantheadersstripped: CO1NAM11FT091.eop-nam11.prod.protection.outlook.com x-ms-office365-filtering-correlation-id-prvs: efa44f6f-88bf-4577-aa1f-08daa2c988f6 x-ms-exchange-antispam-relay: 0 x-gm-message-state: Lp196KaZlOLmdMO4C41DXPaix7039027AA= x-clientproxiedby: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) x-ms-exchange-atpmessageproperties: SA|SL X-Microsoft-Antispam-Mailbox-Delivery: ucf:0;jmr:0;auth:0;dest:I;ENG:(910001)(944506478)(944626604)(920097)(930097); X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?CVt7H4phCoWTF59gFpBbwR6SzX1JwFm6RxY2V0sfEejfwOZsN0mly7dQ9D99?= =?us-ascii?Q?OYpvqg2I5cJ43O4PE24wlLe3DO7xqDOUb5wVAtX+OsvnuyUZJ3uBv8Mo6UQF?= =?us-ascii?Q?9Q5jGldulk3F7eu+QR06imzUczvafMb5yZ8XWfUmEuUW0hRONL1btWJgwt0y?= =?us-ascii?Q?NiDvDqI3pJngCicz4nweewoKpJgL+wXlC8XUtXDcUrPDIVLbG3ZVGjmGM5VO?= =?us-ascii?Q?e1NzyrDKA2txIRtooIUHXNmMagKVAgN6Ptk/G/FPTcXmDFQro71kUUpQgwFo?= =?us-ascii?Q?iCItOf1WEs+jkZzh9fMTRgOluhepk9vmoMKBevv0Kp67EI+B0lsoK4+ljgeZ?= =?us-ascii?Q?rjUGymijS51l7GThSP1DrkNJr+P+SonDSiaU1chMm5XkvkR+99qSxJA0uzV+?= =?us-ascii?Q?aQ6siOj0CiF2L6VaTWei0CH/rlG45GIuHnVpJoANvya8wHC5yYYEnlfCtBS/?= =?us-ascii?Q?MaoywZhWI5Y/ZPT6CeVxUnBxxBlHMHcjt3MEEZ5IR5UXmqElSkf5PWamJC6+?= =?us-ascii?Q?BojXiupAr1LxxbQqtzObKrYkyaxfkOOCzQZraR66CwF4N4tI7G0m8AOURzUF?= =?us-ascii?Q?uFwUmkvxWQaak6ecwRVXtLn8cSyUlnCyzUwp9NPYZPvvHU5Is3obm3AtBX+z?= =?us-ascii?Q?1B66XeoEUFAksRFC6L5DUmDEEEmN6PHxTqWUGbt+gCJwN7DOLoYgquhI7kOF?= =?us-ascii?Q?Aqpb/Kdhlm3+xh7WtOJZdSwMb/8OZDHMLafwB8RnFfR6N6kcEGr84jvcWnAO?= =?us-ascii?Q?2zppqESO7Rfk9u5NyFuMrx+zMSv8ECs7gEL4dMbdU5Seqay3HV8BPMdclF55?= =?us-ascii?Q?12fycqw5GcGJk1q7KyBtzIo4CCbnsKNXn5srP0wV2FzdnrYXFqW3A+938Vqs?= =?us-ascii?Q?32R6paH3aldQ9ZIxYbHM7Q/lQCSXEtyDqL3JlKzpV5+8dEzjbnkBuCwxAnHK?= =?us-ascii?Q?gg87bfKcxYgftMKmu8xLVqmL1NAkT7gCvfNbslqaalh5I53NPIp2FhijU2Iv?= =?us-ascii?Q?PrXTh3AUWWw967EWT8k415szNLWcES2df6ALyVMU1+NQVcxRSAY+irzjYrqQ?= =?us-ascii?Q?FuaFaslyCKk+fz/eNOYL+rV0vvG/8A0mTioWjybkiSiX96d8r9VxCvW6qQHc?= =?us-ascii?Q?CEv/ZrIPbNJlFIzfoIZYl95PsKDqr3Veftu6QtwHLp1wGyhqubr0TsVuRJpJ?= =?us-ascii?Q?GbAX1dbFcT5vcpsl4KS+IsM1UWzrzV3kwio7oD5lE+eB/eek8unNqp2gh8Jw?= =?us-ascii?Q?Q4PHX/SbRJPsv6hXeNEmrNgdkYBnLNJd3X9pMyzPj/GN7T4LFAmR/ZyRcT9t?= =?us-ascii?Q?y2j2CIrZE4qbWi0+3SDvrOxCvMmecJSn3wF7g7Q6UESjnolGvKxyqQ765A86?= =?us-ascii?Q?jghnFut6UIrXeZC6rcd+pq9AE0/deTOzA325VhGOH+Aju8632fdKdnm10XG6?= =?us-ascii?Q?1+PNDaqHdZB0yzKH7OYYDag2tJaivWGpRziaSLsZWX6G9Gsm6GAra1JnfM0j?= =?us-ascii?Q?pYhIH+vBbs0jQNx5ieC3uxu+rDYpEzzhP1fljviCg+gOdTShixFquSRMys8t?= =?us-ascii?Q?8/W2eDY0qxNVX5CMLVoA21HzX45xOo8/Z3CU+E3xO6+aGOuAHCVotjrSKii4?= =?us-ascii?Q?IcmW6qYZKMjoSvu0oMa88L8u5cx8Zh8Cvt3IOK2k2+SzZXQfqYFOM6JcUpFO?= =?us-ascii?Q?LBy/jDefiosmcRLU2sNUUVPkc/+b47j6btBJxMfj/RhsG/EskJtEsfb+AmLW?= =?us-ascii?Q?g546iooXdgIYKaDaCS7wsu+Oa42sx1YMH8+Zgu3GT6p/sf9EcnuDnRC/cX2y?= =?us-ascii?Q?mXsS8E845wHQQw=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Caution: This message originated from an External Source. Use proper cautio= n when opening attachments, clicking links, or responding. From: Abner Chang This change strips away Intel X86 implementation and put it in the IntelSmmCpuFeatureLib Signed-off-by: Abner Chang Cc: Abdul Lateef Attar Cc: Garrett Kirkendall Cc: Paul Grimes Cc: Eric Dong Cc: Ray Ni Cc: Rahul Kumar --- .../SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf | 1 + .../SmmCpuFeaturesLibStm.inf | 1 + .../StandaloneMmCpuFeaturesLib.inf | 1 + .../SmmCpuFeaturesLib/CpuFeaturesLib.h | 6 + .../IntelSmmCpuFeaturesLib.c | 403 ++++++++++++++++++ .../SmmCpuFeaturesLibCommon.c | 391 +---------------- 6 files changed, 413 insertions(+), 390 deletions(-) create mode 100644 UefiCpuPkg/Library/SmmCpuFeaturesLib/IntelSmmCpuFeature= sLib.c diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf b/U= efiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf index 7b5cef97008..9ac7dde78f8 100644 --- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf +++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf @@ -18,6 +18,7 @@ [Sources] CpuFeaturesLib.h + IntelSmmCpuFeaturesLib.c SmmCpuFeaturesLib.c SmmCpuFeaturesLibCommon.c SmmCpuFeaturesLibNoStm.c diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibStm.inf = b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibStm.inf index 85214ee31cd..86d367e0a09 100644 --- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibStm.inf +++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibStm.inf @@ -19,6 +19,7 @@ [Sources] CpuFeaturesLib.h + IntelSmmCpuFeaturesLib.c SmmCpuFeaturesLibCommon.c SmmStm.c SmmStm.h diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/StandaloneMmCpuFeaturesLi= b.inf b/UefiCpuPkg/Library/SmmCpuFeaturesLib/StandaloneMmCpuFeaturesLib.inf index 3eacab48db3..61890205e18 100644 --- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/StandaloneMmCpuFeaturesLib.inf +++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/StandaloneMmCpuFeaturesLib.inf @@ -20,6 +20,7 @@ [Sources] CpuFeaturesLib.h + IntelSmmCpuFeaturesLib.c StandaloneMmCpuFeaturesLib.c SmmCpuFeaturesLibCommon.c SmmCpuFeaturesLibNoStm.c diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/CpuFeaturesLib.h b/UefiCp= uPkg/Library/SmmCpuFeaturesLib/CpuFeaturesLib.h index 8a1c2adc5c4..fd3e902547c 100644 --- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/CpuFeaturesLib.h +++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/CpuFeaturesLib.h @@ -9,6 +9,12 @@ #ifndef CPU_FEATURES_LIB_H_ #define CPU_FEATURES_LIB_H_ +#include +#include +#include +#include +#include + /** Performs library initialization. diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/IntelSmmCpuFeaturesLib.c = b/UefiCpuPkg/Library/SmmCpuFeaturesLib/IntelSmmCpuFeaturesLib.c new file mode 100644 index 00000000000..cb4897b21e3 --- /dev/null +++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/IntelSmmCpuFeaturesLib.c @@ -0,0 +1,403 @@ +/** @file +Implementation shared across all library instances. + +Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.
+Copyright (c) Microsoft Corporation.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "CpuFeaturesLib.h" + +#include +#include +#include + +// +// Machine Specific Registers (MSRs) +// +#define SMM_FEATURES_LIB_IA32_MTRR_CAP 0x0FE +#define SMM_FEATURES_LIB_IA32_FEATURE_CONTROL 0x03A +#define SMM_FEATURES_LIB_IA32_SMRR_PHYSBASE 0x1F2 +#define SMM_FEATURES_LIB_IA32_SMRR_PHYSMASK 0x1F3 +#define SMM_FEATURES_LIB_IA32_CORE_SMRR_PHYSBASE 0x0A0 +#define SMM_FEATURES_LIB_IA32_CORE_SMRR_PHYSMASK 0x0A1 +#define EFI_MSR_SMRR_MASK 0xFFFFF000 +#define EFI_MSR_SMRR_PHYS_MASK_VALID BIT11 +#define SMM_FEATURES_LIB_SMM_FEATURE_CONTROL 0x4E0 + +// +// MSRs required for configuration of SMM Code Access Check +// +#define SMM_FEATURES_LIB_IA32_MCA_CAP 0x17D +#define SMM_CODE_ACCESS_CHK_BIT BIT58 + +// +// Set default value to assume IA-32 Architectural MSRs are used +// +UINT32 mSmrrPhysBaseMsr =3D SMM_FEATURES_LIB_IA32_SMRR_PHYSBASE; +UINT32 mSmrrPhysMaskMsr =3D SMM_FEATURES_LIB_IA32_SMRR_PHYSMASK; + +// +// Set default value to assume MTRRs need to be configured on each SMI +// +BOOLEAN mNeedConfigureMtrrs =3D TRUE; + +// +// Array for state of SMRR enable on all CPUs +// +BOOLEAN *mSmrrEnabled; + +/** + Performs library initialization. + + This initialization function contains common functionality shared betwen= all + library instance constructors. + +**/ +VOID +CpuFeaturesLibInitialization ( + VOID + ) +{ + UINT32 RegEax; + UINT32 RegEdx; + UINTN FamilyId; + UINTN ModelId; + + // + // Retrieve CPU Family and Model + // + AsmCpuid (CPUID_VERSION_INFO, &RegEax, NULL, NULL, &RegEdx); + FamilyId =3D (RegEax >> 8) & 0xf; + ModelId =3D (RegEax >> 4) & 0xf; + if ((FamilyId =3D=3D 0x06) || (FamilyId =3D=3D 0x0f)) { + ModelId =3D ModelId | ((RegEax >> 12) & 0xf0); + } + + // + // Check CPUID(CPUID_VERSION_INFO).EDX[12] for MTRR capability + // + if ((RegEdx & BIT12) !=3D 0) { + // + // Check MTRR_CAP MSR bit 11 for SMRR support + // + if ((AsmReadMsr64 (SMM_FEATURES_LIB_IA32_MTRR_CAP) & BIT11) !=3D 0) { + ASSERT (FeaturePcdGet (PcdSmrrEnable)); + } + } + + // + // Intel(R) 64 and IA-32 Architectures Software Developer's Manual + // Volume 3C, Section 35.3 MSRs in the Intel(R) Atom(TM) Processor Famil= y + // + // If CPU Family/Model is 06_1CH, 06_26H, 06_27H, 06_35H or 06_36H, then + // SMRR Physical Base and SMM Physical Mask MSRs are not available. + // + if (FamilyId =3D=3D 0x06) { + if ((ModelId =3D=3D 0x1C) || (ModelId =3D=3D 0x26) || (ModelId =3D=3D = 0x27) || (ModelId =3D=3D 0x35) || (ModelId =3D=3D 0x36)) { + ASSERT (!FeaturePcdGet (PcdSmrrEnable)); + } + } + + // + // Intel(R) 64 and IA-32 Architectures Software Developer's Manual + // Volume 3C, Section 35.2 MSRs in the Intel(R) Core(TM) 2 Processor Fam= ily + // + // If CPU Family/Model is 06_0F or 06_17, then use Intel(R) Core(TM) 2 + // Processor Family MSRs + // + if (FamilyId =3D=3D 0x06) { + if ((ModelId =3D=3D 0x17) || (ModelId =3D=3D 0x0f)) { + mSmrrPhysBaseMsr =3D SMM_FEATURES_LIB_IA32_CORE_SMRR_PHYSBASE; + mSmrrPhysMaskMsr =3D SMM_FEATURES_LIB_IA32_CORE_SMRR_PHYSMASK; + } + } + + // + // Intel(R) 64 and IA-32 Architectures Software Developer's Manual + // Volume 3C, Section 34.4.2 SMRAM Caching + // An IA-32 processor does not automatically write back and invalidate= its + // caches before entering SMM or before exiting SMM. Because of this b= ehavior, + // care must be taken in the placement of the SMRAM in system memory a= nd in + // the caching of the SMRAM to prevent cache incoherence when switchin= g back + // and forth between SMM and protected mode operation. + // + // An IA-32 processor is a processor that does not support the Intel 64 + // Architecture. Support for the Intel 64 Architecture can be detected = from + // CPUID(CPUID_EXTENDED_CPU_SIG).EDX[29] + // + // If an IA-32 processor is detected, then set mNeedConfigureMtrrs to TR= UE, + // so caches are flushed on SMI entry and SMI exit, the interrupted code + // MTRRs are saved/restored, and MTRRs for SMM are loaded. + // + AsmCpuid (CPUID_EXTENDED_FUNCTION, &RegEax, NULL, NULL, NULL); + if (RegEax >=3D CPUID_EXTENDED_CPU_SIG) { + AsmCpuid (CPUID_EXTENDED_CPU_SIG, NULL, NULL, NULL, &RegEdx); + if ((RegEdx & BIT29) !=3D 0) { + mNeedConfigureMtrrs =3D FALSE; + } + } + + // + // Allocate array for state of SMRR enable on all CPUs + // + mSmrrEnabled =3D (BOOLEAN *)AllocatePool (sizeof (BOOLEAN) * GetCpuMaxLo= gicalProcessorNumber ()); + ASSERT (mSmrrEnabled !=3D NULL); +} + +/** + Called during the very first SMI into System Management Mode to initiali= ze + CPU features, including SMBASE, for the currently executing CPU. Since = this + is the first SMI, the SMRAM Save State Map is at the default address of + SMM_DEFAULT_SMBASE + SMRAM_SAVE_STATE_MAP_OFFSET. The currently executi= ng + CPU is specified by CpuIndex and CpuIndex can be used to access informat= ion + about the currently executing CPU in the ProcessorInfo array and the + HotPlugCpuData data structure. + + @param[in] CpuIndex The index of the CPU to initialize. The valu= e + must be between 0 and the NumberOfCpus field = in + the System Management System Table (SMST). + @param[in] IsMonarch TRUE if the CpuIndex is the index of the CPU = that + was elected as monarch during System Manageme= nt + Mode initialization. + FALSE if the CpuIndex is not the index of the= CPU + that was elected as monarch during System + Management Mode initialization. + @param[in] ProcessorInfo Pointer to an array of EFI_PROCESSOR_INFORMAT= ION + structures. ProcessorInfo[CpuIndex] contains= the + information for the currently executing CPU. + @param[in] CpuHotPlugData Pointer to the CPU_HOT_PLUG_DATA structure th= at + contains the ApidId and SmBase arrays. +**/ +VOID +EFIAPI +SmmCpuFeaturesInitializeProcessor ( + IN UINTN CpuIndex, + IN BOOLEAN IsMonarch, + IN EFI_PROCESSOR_INFORMATION *ProcessorInfo, + IN CPU_HOT_PLUG_DATA *CpuHotPlugData + ) +{ + SMRAM_SAVE_STATE_MAP *CpuState; + UINT64 FeatureControl; + UINT32 RegEax; + UINT32 RegEdx; + UINTN FamilyId; + UINTN ModelId; + + // + // Configure SMBASE. + // + CpuState =3D (SMRAM_SAVE_STATE_MAP *)(UINTN)(SMM_DEFAULT_SMB= ASE + SMRAM_SAVE_STATE_MAP_OFFSET); + CpuState->x86.SMBASE =3D (UINT32)CpuHotPlugData->SmBase[CpuIndex]; + + // + // Intel(R) 64 and IA-32 Architectures Software Developer's Manual + // Volume 3C, Section 35.2 MSRs in the Intel(R) Core(TM) 2 Processor Fam= ily + // + // If Intel(R) Core(TM) Core(TM) 2 Processor Family MSRs are being used,= then + // make sure SMRR Enable(BIT3) of MSR_FEATURE_CONTROL MSR(0x3A) is set b= efore + // accessing SMRR base/mask MSRs. If Lock(BIT0) of MSR_FEATURE_CONTROL = MSR(0x3A) + // is set, then the MSR is locked and can not be modified. + // + if ((FeaturePcdGet (PcdSmrrEnable)) && (mSmrrPhysBaseMsr =3D=3D SMM_FEAT= URES_LIB_IA32_CORE_SMRR_PHYSBASE)) { + FeatureControl =3D AsmReadMsr64 (SMM_FEATURES_LIB_IA32_FEATURE_CONTROL= ); + if ((FeatureControl & BIT3) =3D=3D 0) { + ASSERT ((FeatureControl & BIT0) =3D=3D 0); + if ((FeatureControl & BIT0) =3D=3D 0) { + AsmWriteMsr64 (SMM_FEATURES_LIB_IA32_FEATURE_CONTROL, FeatureContr= ol | BIT3); + } + } + } + + // + // If SMRR is supported, then program SMRR base/mask MSRs. + // The EFI_MSR_SMRR_PHYS_MASK_VALID bit is not set until the first norma= l SMI. + // The code that initializes SMM environment is running in normal mode + // from SMRAM region. If SMRR is enabled here, then the SMRAM region + // is protected and the normal mode code execution will fail. + // + if (FeaturePcdGet (PcdSmrrEnable)) { + // + // SMRR size cannot be less than 4-KBytes + // SMRR size must be of length 2^n + // SMRR base alignment cannot be less than SMRR length + // + if ((CpuHotPlugData->SmrrSize < SIZE_4KB) || + (CpuHotPlugData->SmrrSize !=3D GetPowerOfTwo32 (CpuHotPlugData->Sm= rrSize)) || + ((CpuHotPlugData->SmrrBase & ~(CpuHotPlugData->SmrrSize - 1)) !=3D= CpuHotPlugData->SmrrBase)) + { + // + // Print message and halt if CPU is Monarch + // + if (IsMonarch) { + DEBUG ((DEBUG_ERROR, "SMM Base/Size does not meet alignment/size r= equirement!\n")); + CpuDeadLoop (); + } + } else { + AsmWriteMsr64 (mSmrrPhysBaseMsr, CpuHotPlugData->SmrrBase | MTRR_CAC= HE_WRITE_BACK); + AsmWriteMsr64 (mSmrrPhysMaskMsr, (~(CpuHotPlugData->SmrrSize - 1) & = EFI_MSR_SMRR_MASK)); + mSmrrEnabled[CpuIndex] =3D FALSE; + } + } + + // + // Retrieve CPU Family and Model + // + AsmCpuid (CPUID_VERSION_INFO, &RegEax, NULL, NULL, &RegEdx); + FamilyId =3D (RegEax >> 8) & 0xf; + ModelId =3D (RegEax >> 4) & 0xf; + if ((FamilyId =3D=3D 0x06) || (FamilyId =3D=3D 0x0f)) { + ModelId =3D ModelId | ((RegEax >> 12) & 0xf0); + } + + // + // Intel(R) 64 and IA-32 Architectures Software Developer's Manual + // Volume 3C, Section 35.10.1 MSRs in 4th Generation Intel(R) Core(TM) + // Processor Family. + // + // If CPU Family/Model is 06_3C, 06_45, or 06_46 then use 4th Generation + // Intel(R) Core(TM) Processor Family MSRs. + // + if (FamilyId =3D=3D 0x06) { + if ((ModelId =3D=3D 0x3C) || (ModelId =3D=3D 0x45) || (ModelId =3D=3D = 0x46) || + (ModelId =3D=3D 0x3D) || (ModelId =3D=3D 0x47) || (ModelId =3D=3D = 0x4E) || (ModelId =3D=3D 0x4F) || + (ModelId =3D=3D 0x3F) || (ModelId =3D=3D 0x56) || (ModelId =3D=3D = 0x57) || (ModelId =3D=3D 0x5C) || + (ModelId =3D=3D 0x8C)) + { + // + // Check to see if the CPU supports the SMM Code Access Check featur= e + // Do not access this MSR unless the CPU supports the SmmRegFeatureC= ontrol + // + if ((AsmReadMsr64 (SMM_FEATURES_LIB_IA32_MCA_CAP) & SMM_CODE_ACCESS_= CHK_BIT) !=3D 0) { + ASSERT (FeaturePcdGet (PcdSmmFeatureControlEnable)); + } + } + } + + // + // Call internal worker function that completes the CPU initialization + // + FinishSmmCpuFeaturesInitializeProcessor (); +} + +/** + Determines if MTRR registers must be configured to set SMRAM cache-abili= ty + when executing in System Management Mode. + + @retval TRUE MTRR registers must be configured to set SMRAM cache-abil= ity. + @retval FALSE MTRR registers do not need to be configured to set SMRAM + cache-ability. +**/ +BOOLEAN +EFIAPI +SmmCpuFeaturesNeedConfigureMtrrs ( + VOID + ) +{ + return mNeedConfigureMtrrs; +} + +/** + Disable SMRR register if SMRR is supported and SmmCpuFeaturesNeedConfigu= reMtrrs() + returns TRUE. +**/ +VOID +EFIAPI +SmmCpuFeaturesDisableSmrr ( + VOID + ) +{ + if (FeaturePcdGet (PcdSmrrEnable) && mNeedConfigureMtrrs) { + AsmWriteMsr64 (mSmrrPhysMaskMsr, AsmReadMsr64 (mSmrrPhysMaskMsr) & ~EF= I_MSR_SMRR_PHYS_MASK_VALID); + } +} + +/** + Enable SMRR register if SMRR is supported and SmmCpuFeaturesNeedConfigur= eMtrrs() + returns TRUE. +**/ +VOID +EFIAPI +SmmCpuFeaturesReenableSmrr ( + VOID + ) +{ + if (FeaturePcdGet (PcdSmrrEnable) && mNeedConfigureMtrrs) { + AsmWriteMsr64 (mSmrrPhysMaskMsr, AsmReadMsr64 (mSmrrPhysMaskMsr) | EFI= _MSR_SMRR_PHYS_MASK_VALID); + } +} + +/** + Processor specific hook point each time a CPU enters System Management M= ode. + + @param[in] CpuIndex The index of the CPU that has entered SMM. The val= ue + must be between 0 and the NumberOfCpus field in the + System Management System Table (SMST). +**/ +VOID +EFIAPI +SmmCpuFeaturesRendezvousEntry ( + IN UINTN CpuIndex + ) +{ + // + // If SMRR is supported and this is the first normal SMI, then enable SM= RR + // + if (FeaturePcdGet (PcdSmrrEnable) && !mSmrrEnabled[CpuIndex]) { + AsmWriteMsr64 (mSmrrPhysMaskMsr, AsmReadMsr64 (mSmrrPhysMaskMsr) | EFI= _MSR_SMRR_PHYS_MASK_VALID); + mSmrrEnabled[CpuIndex] =3D TRUE; + } +} + +/** + Returns the current value of the SMM register for the specified CPU. + If the SMM register is not supported, then 0 is returned. + + @param[in] CpuIndex The index of the CPU to read the SMM register. The + value must be between 0 and the NumberOfCpus field = in + the System Management System Table (SMST). + @param[in] RegName Identifies the SMM register to read. + + @return The value of the SMM register specified by RegName from the CPU + specified by CpuIndex. +**/ +UINT64 +EFIAPI +SmmCpuFeaturesGetSmmRegister ( + IN UINTN CpuIndex, + IN SMM_REG_NAME RegName + ) +{ + if (FeaturePcdGet (PcdSmmFeatureControlEnable) && (RegName =3D=3D SmmReg= FeatureControl)) { + return AsmReadMsr64 (SMM_FEATURES_LIB_SMM_FEATURE_CONTROL); + } + + return 0; +} + +/** + Sets the value of an SMM register on a specified CPU. + If the SMM register is not supported, then no action is performed. + + @param[in] CpuIndex The index of the CPU to write the SMM register. Th= e + value must be between 0 and the NumberOfCpus field = in + the System Management System Table (SMST). + @param[in] RegName Identifies the SMM register to write. + registers are read-only. + @param[in] Value The value to write to the SMM register. +**/ +VOID +EFIAPI +SmmCpuFeaturesSetSmmRegister ( + IN UINTN CpuIndex, + IN SMM_REG_NAME RegName, + IN UINT64 Value + ) +{ + if (FeaturePcdGet (PcdSmmFeatureControlEnable) && (RegName =3D=3D SmmReg= FeatureControl)) { + AsmWriteMsr64 (SMM_FEATURES_LIB_SMM_FEATURE_CONTROL, Value); + } +} + diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibCommon.c= b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibCommon.c index 75a0ec8e948..7777e52740e 100644 --- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibCommon.c +++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibCommon.c @@ -14,278 +14,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include -#include -#include -#include "CpuFeaturesLib.h" - -// -// Machine Specific Registers (MSRs) -// -#define SMM_FEATURES_LIB_IA32_MTRR_CAP 0x0FE -#define SMM_FEATURES_LIB_IA32_FEATURE_CONTROL 0x03A -#define SMM_FEATURES_LIB_IA32_SMRR_PHYSBASE 0x1F2 -#define SMM_FEATURES_LIB_IA32_SMRR_PHYSMASK 0x1F3 -#define SMM_FEATURES_LIB_IA32_CORE_SMRR_PHYSBASE 0x0A0 -#define SMM_FEATURES_LIB_IA32_CORE_SMRR_PHYSMASK 0x0A1 -#define EFI_MSR_SMRR_MASK 0xFFFFF000 -#define EFI_MSR_SMRR_PHYS_MASK_VALID BIT11 -#define SMM_FEATURES_LIB_SMM_FEATURE_CONTROL 0x4E0 - -// -// MSRs required for configuration of SMM Code Access Check -// -#define SMM_FEATURES_LIB_IA32_MCA_CAP 0x17D -#define SMM_CODE_ACCESS_CHK_BIT BIT58 - -// -// Set default value to assume IA-32 Architectural MSRs are used -// -UINT32 mSmrrPhysBaseMsr =3D SMM_FEATURES_LIB_IA32_SMRR_PHYSBASE; -UINT32 mSmrrPhysMaskMsr =3D SMM_FEATURES_LIB_IA32_SMRR_PHYSMASK; - -// -// Set default value to assume MTRRs need to be configured on each SMI -// -BOOLEAN mNeedConfigureMtrrs =3D TRUE; - -// -// Array for state of SMRR enable on all CPUs -// -BOOLEAN *mSmrrEnabled; - -/** - Performs library initialization. - - This initialization function contains common functionality shared betwen= all - library instance constructors. - -**/ -VOID -CpuFeaturesLibInitialization ( - VOID - ) -{ - UINT32 RegEax; - UINT32 RegEdx; - UINTN FamilyId; - UINTN ModelId; - - // - // Retrieve CPU Family and Model - // - AsmCpuid (CPUID_VERSION_INFO, &RegEax, NULL, NULL, &RegEdx); - FamilyId =3D (RegEax >> 8) & 0xf; - ModelId =3D (RegEax >> 4) & 0xf; - if ((FamilyId =3D=3D 0x06) || (FamilyId =3D=3D 0x0f)) { - ModelId =3D ModelId | ((RegEax >> 12) & 0xf0); - } - - // - // Check CPUID(CPUID_VERSION_INFO).EDX[12] for MTRR capability - // - if ((RegEdx & BIT12) !=3D 0) { - // - // Check MTRR_CAP MSR bit 11 for SMRR support - // - if ((AsmReadMsr64 (SMM_FEATURES_LIB_IA32_MTRR_CAP) & BIT11) !=3D 0) { - ASSERT (FeaturePcdGet (PcdSmrrEnable)); - } - } - - // - // Intel(R) 64 and IA-32 Architectures Software Developer's Manual - // Volume 3C, Section 35.3 MSRs in the Intel(R) Atom(TM) Processor Famil= y - // - // If CPU Family/Model is 06_1CH, 06_26H, 06_27H, 06_35H or 06_36H, then - // SMRR Physical Base and SMM Physical Mask MSRs are not available. - // - if (FamilyId =3D=3D 0x06) { - if ((ModelId =3D=3D 0x1C) || (ModelId =3D=3D 0x26) || (ModelId =3D=3D = 0x27) || (ModelId =3D=3D 0x35) || (ModelId =3D=3D 0x36)) { - ASSERT (!FeaturePcdGet (PcdSmrrEnable)); - } - } - - // - // Intel(R) 64 and IA-32 Architectures Software Developer's Manual - // Volume 3C, Section 35.2 MSRs in the Intel(R) Core(TM) 2 Processor Fam= ily - // - // If CPU Family/Model is 06_0F or 06_17, then use Intel(R) Core(TM) 2 - // Processor Family MSRs - // - if (FamilyId =3D=3D 0x06) { - if ((ModelId =3D=3D 0x17) || (ModelId =3D=3D 0x0f)) { - mSmrrPhysBaseMsr =3D SMM_FEATURES_LIB_IA32_CORE_SMRR_PHYSBASE; - mSmrrPhysMaskMsr =3D SMM_FEATURES_LIB_IA32_CORE_SMRR_PHYSMASK; - } - } - - // - // Intel(R) 64 and IA-32 Architectures Software Developer's Manual - // Volume 3C, Section 34.4.2 SMRAM Caching - // An IA-32 processor does not automatically write back and invalidate= its - // caches before entering SMM or before exiting SMM. Because of this b= ehavior, - // care must be taken in the placement of the SMRAM in system memory a= nd in - // the caching of the SMRAM to prevent cache incoherence when switchin= g back - // and forth between SMM and protected mode operation. - // - // An IA-32 processor is a processor that does not support the Intel 64 - // Architecture. Support for the Intel 64 Architecture can be detected = from - // CPUID(CPUID_EXTENDED_CPU_SIG).EDX[29] - // - // If an IA-32 processor is detected, then set mNeedConfigureMtrrs to TR= UE, - // so caches are flushed on SMI entry and SMI exit, the interrupted code - // MTRRs are saved/restored, and MTRRs for SMM are loaded. - // - AsmCpuid (CPUID_EXTENDED_FUNCTION, &RegEax, NULL, NULL, NULL); - if (RegEax >=3D CPUID_EXTENDED_CPU_SIG) { - AsmCpuid (CPUID_EXTENDED_CPU_SIG, NULL, NULL, NULL, &RegEdx); - if ((RegEdx & BIT29) !=3D 0) { - mNeedConfigureMtrrs =3D FALSE; - } - } - - // - // Allocate array for state of SMRR enable on all CPUs - // - mSmrrEnabled =3D (BOOLEAN *)AllocatePool (sizeof (BOOLEAN) * GetCpuMaxLo= gicalProcessorNumber ()); - ASSERT (mSmrrEnabled !=3D NULL); -} - -/** - Called during the very first SMI into System Management Mode to initiali= ze - CPU features, including SMBASE, for the currently executing CPU. Since = this - is the first SMI, the SMRAM Save State Map is at the default address of - SMM_DEFAULT_SMBASE + SMRAM_SAVE_STATE_MAP_OFFSET. The currently executi= ng - CPU is specified by CpuIndex and CpuIndex can be used to access informat= ion - about the currently executing CPU in the ProcessorInfo array and the - HotPlugCpuData data structure. - - @param[in] CpuIndex The index of the CPU to initialize. The valu= e - must be between 0 and the NumberOfCpus field = in - the System Management System Table (SMST). - @param[in] IsMonarch TRUE if the CpuIndex is the index of the CPU = that - was elected as monarch during System Manageme= nt - Mode initialization. - FALSE if the CpuIndex is not the index of the= CPU - that was elected as monarch during System - Management Mode initialization. - @param[in] ProcessorInfo Pointer to an array of EFI_PROCESSOR_INFORMAT= ION - structures. ProcessorInfo[CpuIndex] contains= the - information for the currently executing CPU. - @param[in] CpuHotPlugData Pointer to the CPU_HOT_PLUG_DATA structure th= at - contains the ApidId and SmBase arrays. -**/ -VOID -EFIAPI -SmmCpuFeaturesInitializeProcessor ( - IN UINTN CpuIndex, - IN BOOLEAN IsMonarch, - IN EFI_PROCESSOR_INFORMATION *ProcessorInfo, - IN CPU_HOT_PLUG_DATA *CpuHotPlugData - ) -{ - SMRAM_SAVE_STATE_MAP *CpuState; - UINT64 FeatureControl; - UINT32 RegEax; - UINT32 RegEdx; - UINTN FamilyId; - UINTN ModelId; - - // - // Configure SMBASE. - // - CpuState =3D (SMRAM_SAVE_STATE_MAP *)(UINTN)(SMM_DEFAULT_SMB= ASE + SMRAM_SAVE_STATE_MAP_OFFSET); - CpuState->x86.SMBASE =3D (UINT32)CpuHotPlugData->SmBase[CpuIndex]; - - // - // Intel(R) 64 and IA-32 Architectures Software Developer's Manual - // Volume 3C, Section 35.2 MSRs in the Intel(R) Core(TM) 2 Processor Fam= ily - // - // If Intel(R) Core(TM) Core(TM) 2 Processor Family MSRs are being used,= then - // make sure SMRR Enable(BIT3) of MSR_FEATURE_CONTROL MSR(0x3A) is set b= efore - // accessing SMRR base/mask MSRs. If Lock(BIT0) of MSR_FEATURE_CONTROL = MSR(0x3A) - // is set, then the MSR is locked and can not be modified. - // - if ((FeaturePcdGet (PcdSmrrEnable)) && (mSmrrPhysBaseMsr =3D=3D SMM_FEAT= URES_LIB_IA32_CORE_SMRR_PHYSBASE)) { - FeatureControl =3D AsmReadMsr64 (SMM_FEATURES_LIB_IA32_FEATURE_CONTROL= ); - if ((FeatureControl & BIT3) =3D=3D 0) { - ASSERT ((FeatureControl & BIT0) =3D=3D 0); - if ((FeatureControl & BIT0) =3D=3D 0) { - AsmWriteMsr64 (SMM_FEATURES_LIB_IA32_FEATURE_CONTROL, FeatureContr= ol | BIT3); - } - } - } - // - // If SMRR is supported, then program SMRR base/mask MSRs. - // The EFI_MSR_SMRR_PHYS_MASK_VALID bit is not set until the first norma= l SMI. - // The code that initializes SMM environment is running in normal mode - // from SMRAM region. If SMRR is enabled here, then the SMRAM region - // is protected and the normal mode code execution will fail. - // - if (FeaturePcdGet (PcdSmrrEnable)) { - // - // SMRR size cannot be less than 4-KBytes - // SMRR size must be of length 2^n - // SMRR base alignment cannot be less than SMRR length - // - if ((CpuHotPlugData->SmrrSize < SIZE_4KB) || - (CpuHotPlugData->SmrrSize !=3D GetPowerOfTwo32 (CpuHotPlugData->Sm= rrSize)) || - ((CpuHotPlugData->SmrrBase & ~(CpuHotPlugData->SmrrSize - 1)) !=3D= CpuHotPlugData->SmrrBase)) - { - // - // Print message and halt if CPU is Monarch - // - if (IsMonarch) { - DEBUG ((DEBUG_ERROR, "SMM Base/Size does not meet alignment/size r= equirement!\n")); - CpuDeadLoop (); - } - } else { - AsmWriteMsr64 (mSmrrPhysBaseMsr, CpuHotPlugData->SmrrBase | MTRR_CAC= HE_WRITE_BACK); - AsmWriteMsr64 (mSmrrPhysMaskMsr, (~(CpuHotPlugData->SmrrSize - 1) & = EFI_MSR_SMRR_MASK)); - mSmrrEnabled[CpuIndex] =3D FALSE; - } - } - - // - // Retrieve CPU Family and Model - // - AsmCpuid (CPUID_VERSION_INFO, &RegEax, NULL, NULL, &RegEdx); - FamilyId =3D (RegEax >> 8) & 0xf; - ModelId =3D (RegEax >> 4) & 0xf; - if ((FamilyId =3D=3D 0x06) || (FamilyId =3D=3D 0x0f)) { - ModelId =3D ModelId | ((RegEax >> 12) & 0xf0); - } - - // - // Intel(R) 64 and IA-32 Architectures Software Developer's Manual - // Volume 3C, Section 35.10.1 MSRs in 4th Generation Intel(R) Core(TM) - // Processor Family. - // - // If CPU Family/Model is 06_3C, 06_45, or 06_46 then use 4th Generation - // Intel(R) Core(TM) Processor Family MSRs. - // - if (FamilyId =3D=3D 0x06) { - if ((ModelId =3D=3D 0x3C) || (ModelId =3D=3D 0x45) || (ModelId =3D=3D = 0x46) || - (ModelId =3D=3D 0x3D) || (ModelId =3D=3D 0x47) || (ModelId =3D=3D = 0x4E) || (ModelId =3D=3D 0x4F) || - (ModelId =3D=3D 0x3F) || (ModelId =3D=3D 0x56) || (ModelId =3D=3D = 0x57) || (ModelId =3D=3D 0x5C) || - (ModelId =3D=3D 0x8C)) - { - // - // Check to see if the CPU supports the SMM Code Access Check featur= e - // Do not access this MSR unless the CPU supports the SmmRegFeatureC= ontrol - // - if ((AsmReadMsr64 (SMM_FEATURES_LIB_IA32_MCA_CAP) & SMM_CODE_ACCESS_= CHK_BIT) !=3D 0) { - ASSERT (FeaturePcdGet (PcdSmmFeatureControlEnable)); - } - } - } - - // - // Call internal worker function that completes the CPU initialization - // - FinishSmmCpuFeaturesInitializeProcessor (); -} +#include "CpuFeaturesLib.h" /** This function updates the SMRAM save state on the currently executing CP= U @@ -345,75 +75,6 @@ SmmCpuFeaturesSmmRelocationComplete ( { } -/** - Determines if MTRR registers must be configured to set SMRAM cache-abili= ty - when executing in System Management Mode. - - @retval TRUE MTRR registers must be configured to set SMRAM cache-abil= ity. - @retval FALSE MTRR registers do not need to be configured to set SMRAM - cache-ability. -**/ -BOOLEAN -EFIAPI -SmmCpuFeaturesNeedConfigureMtrrs ( - VOID - ) -{ - return mNeedConfigureMtrrs; -} - -/** - Disable SMRR register if SMRR is supported and SmmCpuFeaturesNeedConfigu= reMtrrs() - returns TRUE. -**/ -VOID -EFIAPI -SmmCpuFeaturesDisableSmrr ( - VOID - ) -{ - if (FeaturePcdGet (PcdSmrrEnable) && mNeedConfigureMtrrs) { - AsmWriteMsr64 (mSmrrPhysMaskMsr, AsmReadMsr64 (mSmrrPhysMaskMsr) & ~EF= I_MSR_SMRR_PHYS_MASK_VALID); - } -} - -/** - Enable SMRR register if SMRR is supported and SmmCpuFeaturesNeedConfigur= eMtrrs() - returns TRUE. -**/ -VOID -EFIAPI -SmmCpuFeaturesReenableSmrr ( - VOID - ) -{ - if (FeaturePcdGet (PcdSmrrEnable) && mNeedConfigureMtrrs) { - AsmWriteMsr64 (mSmrrPhysMaskMsr, AsmReadMsr64 (mSmrrPhysMaskMsr) | EFI= _MSR_SMRR_PHYS_MASK_VALID); - } -} - -/** - Processor specific hook point each time a CPU enters System Management M= ode. - - @param[in] CpuIndex The index of the CPU that has entered SMM. The val= ue - must be between 0 and the NumberOfCpus field in the - System Management System Table (SMST). -**/ -VOID -EFIAPI -SmmCpuFeaturesRendezvousEntry ( - IN UINTN CpuIndex - ) -{ - // - // If SMRR is supported and this is the first normal SMI, then enable SM= RR - // - if (FeaturePcdGet (PcdSmrrEnable) && !mSmrrEnabled[CpuIndex]) { - AsmWriteMsr64 (mSmrrPhysMaskMsr, AsmReadMsr64 (mSmrrPhysMaskMsr) | EFI= _MSR_SMRR_PHYS_MASK_VALID); - mSmrrEnabled[CpuIndex] =3D TRUE; - } -} - /** Processor specific hook point each time a CPU exits System Management Mo= de. @@ -456,56 +117,6 @@ SmmCpuFeaturesIsSmmRegisterSupported ( return FALSE; } -/** - Returns the current value of the SMM register for the specified CPU. - If the SMM register is not supported, then 0 is returned. - - @param[in] CpuIndex The index of the CPU to read the SMM register. The - value must be between 0 and the NumberOfCpus field = in - the System Management System Table (SMST). - @param[in] RegName Identifies the SMM register to read. - - @return The value of the SMM register specified by RegName from the CPU - specified by CpuIndex. -**/ -UINT64 -EFIAPI -SmmCpuFeaturesGetSmmRegister ( - IN UINTN CpuIndex, - IN SMM_REG_NAME RegName - ) -{ - if (FeaturePcdGet (PcdSmmFeatureControlEnable) && (RegName =3D=3D SmmReg= FeatureControl)) { - return AsmReadMsr64 (SMM_FEATURES_LIB_SMM_FEATURE_CONTROL); - } - - return 0; -} - -/** - Sets the value of an SMM register on a specified CPU. - If the SMM register is not supported, then no action is performed. - - @param[in] CpuIndex The index of the CPU to write the SMM register. Th= e - value must be between 0 and the NumberOfCpus field = in - the System Management System Table (SMST). - @param[in] RegName Identifies the SMM register to write. - registers are read-only. - @param[in] Value The value to write to the SMM register. -**/ -VOID -EFIAPI -SmmCpuFeaturesSetSmmRegister ( - IN UINTN CpuIndex, - IN SMM_REG_NAME RegName, - IN UINT64 Value - ) -{ - if (FeaturePcdGet (PcdSmmFeatureControlEnable) && (RegName =3D=3D SmmReg= FeatureControl)) { - AsmWriteMsr64 (SMM_FEATURES_LIB_SMM_FEATURE_CONTROL, Value); - } -} - /** Read an SMM Save State register on the target processor. If this functi= on returns EFI_UNSUPPORTED, then the caller is responsible for reading the -- 2.37.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#94568): https://nam11.safelinks.protection.outlook.com/= ?url=3Dhttps%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Fmessage%2F94568&data= =3D05%7C01%7Cabner.chang%40amd.com%7C35230bb798f04e2c9f4108daa2c98ebb%7C3dd= 8961fe4884e608e11a82d994e183d%7C0%7C0%7C638001283822981371%7CUnknown%7CTWFp= bGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%= 7C3000%7C%7C%7C&sdata=3DSavK8Hd8gcaNZb%2B936BKS1FrR9sFTBqUolnnPm3G5Nc%3= D&reserved=3D0 Mute This Topic: https://nam11.safelinks.protection.outlook.com/?url=3Dhttp= s%3A%2F%2Fgroups.io%2Fmt%2F94013090%2F7039027&data=3D05%7C01%7Cabner.ch= ang%40amd.com%7C35230bb798f04e2c9f4108daa2c98ebb%7C3dd8961fe4884e608e11a82d= 994e183d%7C0%7C0%7C638001283822981371%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wL= jAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&s= data=3DhZ8DVHRBl4F%2FWXxrUbBuRaLHUnmTOPGM8FnBJW1Mq0M%3D&reserved=3D0 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A= %2F%2Fedk2.groups.io%2Fg%2Fdevel%2Funsub&data=3D05%7C01%7Cabner.chang%4= 0amd.com%7C35230bb798f04e2c9f4108daa2c98ebb%7C3dd8961fe4884e608e11a82d994e1= 83d%7C0%7C0%7C638001283823137634%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMD= AiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata= =3DefUfZi%2BTunz9zd1%2BLMfOdze7N2ld00mfpaa0X%2BZWURQ%3D&reserved=3D0 [a= bner.chang@amd.com] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- --_003_MN2PR12MB3966D99E824C993ACFF2B5F7EA2B9MN2PR12MB3966namp_--