From nobody Sat May 11 02:20:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+61529+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+61529+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 15925858046311001.9327268692354; Fri, 19 Jun 2020 09:56:44 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id dGaNYY1788612xq3nef0zIfL; Fri, 19 Jun 2020 09:56:44 -0700 X-Received: from NAM02-SN1-obe.outbound.protection.outlook.com (NAM02-SN1-obe.outbound.protection.outlook.com []) by mx.groups.io with SMTP id smtpd.web10.423.1592585801690453260 for ; Fri, 19 Jun 2020 09:56:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TStvqRlqxVswe7C8mKMy00RYQzQ0yCkT+NdoVrzKK1RCKmN4iPRh66DpybUaJX+5o7Ee9fsQgjAJguSi0L4JvGrW9soPXoCeQtsWy/vjDfkOpbPqfDvmgRVlBUp2N/xhX7y7d0tWmdOmsLmPjcjr/bkDEFm//6FugQBUBOraghbuP+AJNFP48WTiMM7WNKeE5qLVGfQCm33a+JeyevhMGKL3dLnToUebUOaCFWy8CEXEnnhO+rm5/R5lsP6oN9G/lDJPuQ8ZD3JNXhUwNnXabVdmmYhmOgtq7hKUqeKkFU3SnubA+iXmu7KXvCav3OXnazfE9ZSMu+4Ge3Jgf12WjQ== 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-SenderADCheck; bh=nL4sxRS9yl2hdNYZpGBFxugT7S+skPiMWcvcsZNaGVQ=; b=H0kBaOWBjpqyzqb7w13HFqCM6TA4VKcnBQI+iUgokAyY0AvTQda8ryTbUroLVVJO1nQBXOCfUVUDNL1lXp+Qpi+w1gqRLoNiD8qzyqBYONK6dfQmeT4rWnb6CfsuwW7ubJSIg3a7ETVXgMnbwK11elAH3DQ3Hk/ee6Q9zFsAXhKvVRZu/ria43y9f3KBGHytr2jqMXXOXSCUWEBV8laprPfWRgOSkVxN1aFFnfuVBkfsCWFJPLenqh2+sUblHWhpKwWbWq3Xbf3b38Yaik1DVpTpsVjt+lYHHuweUOk6gytvxv/p7aGpcpfIi1dtZLZJg+WDnwm/LksqdhygW3UrIA== 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 X-Received: from SN1PR12MB2352.namprd12.prod.outlook.com (2603:10b6:802:25::13) by SA0PR12MB4448.namprd12.prod.outlook.com (2603:10b6:806:94::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Fri, 19 Jun 2020 16:56:41 +0000 X-Received: from SN1PR12MB2352.namprd12.prod.outlook.com ([fe80::156e:ce6d:a148:274e]) by SN1PR12MB2352.namprd12.prod.outlook.com ([fe80::156e:ce6d:a148:274e%7]) with mapi id 15.20.3109.021; Fri, 19 Jun 2020 16:56:41 +0000 From: "Kirkendall, Garrett" To: devel@edk2.groups.io Cc: Ray Ni Subject: [edk2-devel] [PATCH v5 1/4] PcAtChipsetPkg: PcAtChipsetPkg.dsc add UefiCpuLib LibraryClass Date: Fri, 19 Jun 2020 11:56:26 -0500 Message-Id: <20200619165629.9545-2-Garrett.Kirkendall@amd.com> In-Reply-To: <20200619165629.9545-1-Garrett.Kirkendall@amd.com> References: <20200619165629.9545-1-Garrett.Kirkendall@amd.com> X-ClientProxiedBy: SN6PR01CA0024.prod.exchangelabs.com (2603:10b6:805:b6::37) To SN1PR12MB2352.namprd12.prod.outlook.com (2603:10b6:802:25::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from biosdev-01.amd.com (165.204.78.2) by SN6PR01CA0024.prod.exchangelabs.com (2603:10b6:805:b6::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Fri, 19 Jun 2020 16:56:40 +0000 X-Originating-IP: [165.204.78.2] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 5b3de93a-cf52-4470-f2a8-08d81471bd07 X-MS-TrafficTypeDiagnostic: SA0PR12MB4448: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1923; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: kcKQjm/n6/HuwZn4xTasyN2TCE3WC+e+4WhDzYiFCIGLr1jqWTKBV/I5/Q3YVBvYwTeK+pZY7rTie5npvihrrVFrT5LMKscpMTG55I71rpBh5+Rbcyn2At87BPGaG675GD8K/iwnJ8X2omIPegFcSff49KEtZ4DihlXCmBo94bi/fJSsyEFxYseP60rF631Y6h45Tv6Q7ZYyra3juQ1yryyjy0bEt4lMytmrF0JDHM9aPuDCtGmtGd7sSM6vR3Ei+7UjZm0FkEm2RG++dBH/WTWBKnfMsDEP8iASplvv/aFDtmBr17epEa86rBCu7atL X-MS-Exchange-AntiSpam-MessageData: YqQpKHxW+RXQfwOpNukJ6Yz8JGGwUqxlI3mdGAREeKlh1V2xnexhxFcNBLbdIQ8uJz9MzSjv/L15WdQXvjFgF0e2Phrg5tjLgJQHpsBuJCaM1KeXloetavfiOYVTfdUmH+09PBHAvnotj8qRB+eSRSeU3e9MrYKF1FsK7C5OGGbe+57vQ3MXPzb3ZTJwl5h8Yfv3kprp9314rdvwOh9UHDcWiL04q42ZuLp9HW+BhI0r4TyLZ+x9ugl1k+13s3mcVlBGOWB4bCAHexoi+tL6X+YUh/1LWPtpAIvr8+N3bB/sRKlrXiuc5jVOidRbEcldYdRNH9fc93xriQ5YzsGHvoyheTNuc8+pSdXa+oNHHsANOzvAG9PQRU5gHPJAyI7HXGFe1lkKPH2U2s4Tjr6gjsvHXAyQbiwhO1cakeT6rzWlz0s7j3eoPTTbhMnWZa/6j3YxH4eIwzB2xnPbhiyrHKjHU3T0WNoBhM1Jve0+2FM= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5b3de93a-cf52-4470-f2a8-08d81471bd07 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2020 16:56:41.0708 (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: LpUQCysytYR5bHvt081DfY4UBvIZDWWCTLnA0VdTkhIYzk00LbMs+Ejg0GlxvX40PAWDDBCRCFJO5wHdstHe9g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4448 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,garrett.kirkendall@amd.com X-Gm-Message-State: by4y9WMqOQ2w41xkyHQM4qCHx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1592585804; bh=S20MooQAueB0yuYgiYoeljciys4G8aeeE4Kth2d+rEs=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=JxhDBOsEDCZg5XBHiA8ddLm58p0it4fU7YkDZCHJlDC43AwGKYC3QrcGz1j3sxRvDBJ jUVROJZCyHBnLfP/fYC1Qeh6O9OL5WElwR58/jwWuoSIaJZYqK43xyOULZGYCPpqSnI1M ytvT6fDSjRQmUnGpLvnQ2NP6q8qZHxWAoGI= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" In preparation for moving StandardSignatureIsAuthenticAMD to UefiCpuLib in UefiCpuPkg, PcAtChipset/PcAtChipsetPkg.dsc needs LibraryClass UefiCpuLib. LocalApicLib|UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.inf will need UefiCpuLib LibraryClass. Likely most "real" platforms will be using BaseX2XApicLib instance which already required UefiCpuLib. Cc: Ray Ni Signed-off-by: Garrett Kirkendall --- PcAtChipsetPkg/PcAtChipsetPkg.dsc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PcAtChipsetPkg/PcAtChipsetPkg.dsc b/PcAtChipsetPkg/PcAtChipset= Pkg.dsc index 01a3ee716a98..b61b7d1f528e 100644 --- a/PcAtChipsetPkg/PcAtChipsetPkg.dsc +++ b/PcAtChipsetPkg/PcAtChipsetPkg.dsc @@ -2,6 +2,7 @@ # PC/AT Chipset Package # # Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.
+# Copyright (c) 2020, AMD Incorporated. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -39,6 +40,7 @@ [LibraryClasses] ResetSystemLib|PcAtChipsetPkg/Library/ResetSystemLib/ResetSystemLib.inf IoApicLib|PcAtChipsetPkg/Library/BaseIoApicLib/BaseIoApicLib.inf LocalApicLib|UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.inf + UefiCpuLib|UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseRepor= tStatusCodeLibNull.inf HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf =20 --=20 2.27.0 -=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 (#61529): https://edk2.groups.io/g/devel/message/61529 Mute This Topic: https://groups.io/mt/74983840/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sat May 11 02:20:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+61530+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+61530+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1592585804705281.36193684698515; Fri, 19 Jun 2020 09:56:44 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 8UaeYY1788612xilfeQgfYzr; Fri, 19 Jun 2020 09:56:44 -0700 X-Received: from NAM02-SN1-obe.outbound.protection.outlook.com (NAM02-SN1-obe.outbound.protection.outlook.com [40.107.77.75]) by mx.groups.io with SMTP id smtpd.web11.404.1592585802996773386 for ; Fri, 19 Jun 2020 09:56:43 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D6VpW4ytxMROkJeGtVWrP3/HmSkqr/EN1D+YccWCz+HUC1IuZCQWrex2DIursFZT9CUzF+o8BMy96J3/LwogZEwTs4lFyg6jaz7ouRIFTn/xMN6i7alS0VTqAn2o99+3tEK4/qsJx+9tQKFMOHEiUmBfU+KrU2FmOEJN9AQ2eKqeXxoRTv7kw4k8m38qb7VJ67MM64ls1qNAm6ywiP3SSt4PH5NpQe0Mx2d+tJsRxR84eLP/zcnRAzvM74+7THsAJbBIvSNJM04QzGgov38DfhNnA2Eyq3UBdPnYMUZq8Nuyu8zjpRYwgT4tAoy0fFIZWcdmBW3DT4BIzUJ6IcQaQw== 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-SenderADCheck; bh=S5owCZ+vPV7rnA5weJAuwTwK34rl//aXA92dIY+Thg0=; b=MeKLeSE1d/zyuWJak6ZPHqbsexSI3bFTWNKL2sS6Q37+RAdyGCSurGmbXN8nrU5NLHvEcIu9bUY9Zsfb4ARFlZB1v4O+TIypX41TC7mxPewIJMkEEVZKuAA+ayQRbHSRl0UKyA01h3/E1PeXoh5D94GnyCKHDilfMBPdFwiMwXLIY9hz0NXt3rLjFUD7iyHAbp8qsIZJ/meit0fQENh97ve6TfJ77vmZD7W5wJ9OQU9FfAEj2BtkbHePgb7VQDVhyYACQDxnMoCsLV2GCDmApKW7DAuBgPvxK1oxKciG3F2h6iXH1NJr23Eg8ZUj43Te2rCBYq03+fn4OwiwtiI9/g== 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 X-Received: from SN1PR12MB2352.namprd12.prod.outlook.com (2603:10b6:802:25::13) by SA0PR12MB4448.namprd12.prod.outlook.com (2603:10b6:806:94::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Fri, 19 Jun 2020 16:56:41 +0000 X-Received: from SN1PR12MB2352.namprd12.prod.outlook.com ([fe80::156e:ce6d:a148:274e]) by SN1PR12MB2352.namprd12.prod.outlook.com ([fe80::156e:ce6d:a148:274e%7]) with mapi id 15.20.3109.021; Fri, 19 Jun 2020 16:56:41 +0000 From: "Kirkendall, Garrett" To: devel@edk2.groups.io Cc: Hao A Wu Subject: [edk2-devel] [PATCH v5 2/4] SourceLevelDebugPkg: SourceLevelDebugPkg.dsc add UefiCpuLib LibraryClass Date: Fri, 19 Jun 2020 11:56:27 -0500 Message-Id: <20200619165629.9545-3-Garrett.Kirkendall@amd.com> In-Reply-To: <20200619165629.9545-1-Garrett.Kirkendall@amd.com> References: <20200619165629.9545-1-Garrett.Kirkendall@amd.com> X-ClientProxiedBy: SN6PR01CA0024.prod.exchangelabs.com (2603:10b6:805:b6::37) To SN1PR12MB2352.namprd12.prod.outlook.com (2603:10b6:802:25::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from biosdev-01.amd.com (165.204.78.2) by SN6PR01CA0024.prod.exchangelabs.com (2603:10b6:805:b6::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Fri, 19 Jun 2020 16:56:41 +0000 X-Originating-IP: [165.204.78.2] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 20b3e548-8aa8-46f0-a201-08d81471bd68 X-MS-TrafficTypeDiagnostic: SA0PR12MB4448: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:660; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: j6idEFzk47szyiU4XLqTvQF8w0UsgUAMZLwh2t/3XZqjhsO8B5jh2rg0UK677hpgSPO5sGUh3NLYmd3tdjMDhBivgz5mg3OIIMHe67dKXhc2DEi83WQjpsqO/eHgTCXt7w3+OdYc88v9zLaZiSkD2hozKBQoCW7kzQaiUs53D1HEwvBlzh5j07IQA0tTFZDLWxHdfmJmRCzCbeEEPt/cPKU3RjXva27GR2KNo8yJVl2Qw1A1lNZf7quZMfdtt5RQZUl5K8uVyYwwXI8UBRJL8/c73WHsnAUOeQDb7c7RB2sHKE5wVtAwX0VIv2js7uSa X-MS-Exchange-AntiSpam-MessageData: 2OjY/2Qbti/tvRiTipqorS9a5bjFYR2RMffvUosJd2wUiaW+Q28nfvQ8OQN8iVIapHdmwkZImjzY4A5tVxeLXqxcum2MKOnzSysyNipVXZoIqI9NDaLaHDo4+kIn/31k7JlrNNQW+Wt9eBCtNCYmkidfvMbLdCaDiuHwx9qVIWQLslH24DgG/koE0n/B+31HJBaiP/XkR3R2HyBRE4rOGN2Y98W3hWYVgXFiiGzFr8lISXitgNSEvLxzrjozaInVPgUs7WLLi0IEt+Pnex+Aq0xOKEqEeJAj6UL3lkJ5l/3W2jiDqIigPK0Ocn9mf1RB4MDw7AQp10KDAnNlbNQikC6hUgVDmUS3Y+qGa/BtzxEjyzd/PKLdXV285WJY6K1JrsetXZlooimM2O7BIFlw38TyKEbeUBy5zFs1pIFV22VOUhQi/ccjOj8wmmALOanBt0rA4vNix1P5hO+JVnMHqfu4ITtM0lwV1mcKZ2+7kR4= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 20b3e548-8aa8-46f0-a201-08d81471bd68 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2020 16:56:41.6265 (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: /uIrKQKt39bt6UUYCmnn2H4DYkAlZXWd9bBFR3awuSSCYMcb4zECzTdsgUAb07RWaslV9GdZKl3aBcjfmud3Vw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4448 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,garrett.kirkendall@amd.com X-Gm-Message-State: 860p1epHGDh19AMoUszVrPhlx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1592585804; bh=Q1ZqKRPXs3Zlo6QXf+6wP4lnZ/CDHMiXwAHIg6E3qOc=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=I4NK2R/+Nn/kp7eWkdNAqLVk0uU2aR4MgGe0GyzJ7QeZLc3bgXtYXLNCKcPdJWjWblo kqPWmdzuz+XK0tX5eD5pRb1pvXbiVBqHM0OXgVwUgYnQXSwvrzMxDjU1jBI0fIbxxqQ1t 9dYlmo4TgyaUDXd4twt3wRWK0cr9LFa2wa0= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" In preparation for moving StandardSignatureIsAuthenticAMD to UefiCpuLib in UefiCpuPkg, SourceLevelDebugPkg/SourceLevelDebugPkg.dsc needs LibraryClass UefiCpuLib. LocalApicLib|UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.inf will need UefiCpuLib LibraryClass. Likely most "real" platforms will be using BaseX2XApicLib instance which already required UefiCpuLib. Cc: Hao A Wu Signed-off-by: Garrett Kirkendall --- SourceLevelDebugPkg/SourceLevelDebugPkg.dsc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SourceLevelDebugPkg/SourceLevelDebugPkg.dsc b/SourceLevelDebug= Pkg/SourceLevelDebugPkg.dsc index a1a1b81d03cb..20eb10ba07f8 100644 --- a/SourceLevelDebugPkg/SourceLevelDebugPkg.dsc +++ b/SourceLevelDebugPkg/SourceLevelDebugPkg.dsc @@ -2,6 +2,7 @@ # Source Level Debug Package. # # Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2020, AMD Incorporated. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -32,6 +33,7 @@ [LibraryClasses.common] IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchroniza= tionLib.inf LocalApicLib|UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.inf + UefiCpuLib|UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeC= offGetEntryPointLib.inf SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPort= Lib16550.inf PeCoffExtraActionLib|SourceLevelDebugPkg/Library/PeCoffExtraActionLibDeb= ug/PeCoffExtraActionLibDebug.inf --=20 2.27.0 -=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 (#61530): https://edk2.groups.io/g/devel/message/61530 Mute This Topic: https://groups.io/mt/74983841/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sat May 11 02:20:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+61531+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+61531+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1592585806097492.2516913927428; Fri, 19 Jun 2020 09:56:46 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 1lp6YY1788612xzhaOmwWyyu; Fri, 19 Jun 2020 09:56:45 -0700 X-Received: from NAM02-SN1-obe.outbound.protection.outlook.com (NAM02-SN1-obe.outbound.protection.outlook.com []) by mx.groups.io with SMTP id smtpd.web11.404.1592585802996773386 for ; Fri, 19 Jun 2020 09:56:43 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ljcYefYdj0chLh5C5m4bG87HbF0p6zHCCBrWgh20fpo8xTOwOdFKsKZg6Le7PbuhvCvIuem/yE7nAIG0mJJLhh6YQMBdjFQn9ULtPiJa7EOLBkJ2m+cujlJe/IyvzLOsShooY5KL+9P/PCaJrzdi6ypOLiV4PMls/UC17TaQpsEQn8Tzs5K/jGB/yT7GOhrYFaVVgXG1JDlIJQY6qKHjok0vzNLwrl3EB6sU4FVsGp7K9o3CvuKlaHE2fLaCWnlgu25RzDdicnnhNhWgDhj4WU90HN3aT88lJgfTGVYkK8ACuAQ+f1Mt5TvYk6RTfGZXJWJjgmlhg03qLjCTYkweqw== 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-SenderADCheck; bh=zUM81YlBi07HOtoSezUaDT+XKTXGL4kLfBpgX+sXwuA=; b=Eoaz87SnIaXTegyK9l5rlxZFtuSFVNeL33lhtOYAMUczemQDVwT81NoENlsSyVZsJw0cm2xuQHK2d4mDgxMSni7p40nBL1nEylgc8tbp3ywzKjmhssE7SfQaox5g3rdu47t9uDe2Q6VzrpbkVahxq/Deymp/JxoD0R3d9ITo8+bqf+DurLlVxGwRHDpesH6+RkPxqsHp+HhRlyAlfXBle6BTel9UQgDtLX4TpeJL0Uip0MCHLHoQDHLv6yHyi2em4NrfP/hW2+MkC6R9v1WxbCv5yphVQSwrPaR1GVJU3rI1lcBvNRodyTyQWo6ahEk2pt5l3vIR5VflPPO9fAwJSg== 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 X-Received: from SN1PR12MB2352.namprd12.prod.outlook.com (2603:10b6:802:25::13) by SA0PR12MB4448.namprd12.prod.outlook.com (2603:10b6:806:94::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Fri, 19 Jun 2020 16:56:42 +0000 X-Received: from SN1PR12MB2352.namprd12.prod.outlook.com ([fe80::156e:ce6d:a148:274e]) by SN1PR12MB2352.namprd12.prod.outlook.com ([fe80::156e:ce6d:a148:274e%7]) with mapi id 15.20.3109.021; Fri, 19 Jun 2020 16:56:42 +0000 From: "Kirkendall, Garrett" To: devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Laszlo Ersek Subject: [edk2-devel] [PATCH v5 3/4] UefiCpuPkg: Move StandardSignatureIsAuthenticAMD to BaseUefiCpuLib Date: Fri, 19 Jun 2020 11:56:28 -0500 Message-Id: <20200619165629.9545-4-Garrett.Kirkendall@amd.com> In-Reply-To: <20200619165629.9545-1-Garrett.Kirkendall@amd.com> References: <20200619165629.9545-1-Garrett.Kirkendall@amd.com> X-ClientProxiedBy: SN6PR01CA0024.prod.exchangelabs.com (2603:10b6:805:b6::37) To SN1PR12MB2352.namprd12.prod.outlook.com (2603:10b6:802:25::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from biosdev-01.amd.com (165.204.78.2) by SN6PR01CA0024.prod.exchangelabs.com (2603:10b6:805:b6::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Fri, 19 Jun 2020 16:56:41 +0000 X-Originating-IP: [165.204.78.2] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 73f6c1cb-a8a0-466b-4a51-08d81471bdb2 X-MS-TrafficTypeDiagnostic: SA0PR12MB4448: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: PkwMQ0xRW99y1cyK+xEMGkkk1KWENRkGKP/aRFkiSyPEvVqZ6wrUd7Gk/e9TYDTTT4LbEJGKN5eNICVKE5Pd5IrR0mE77r4I9tGUmAXG936BToMkhcU1DXVGYi6YDgvIPDZfSvWZPezVhhYInBwbRmYzH0IfCjrY8LSocVShNxnkCndWdPU5YS922OFAcnhhNFXG/VhRw26HQUkG2rWrKBZE47RdjFN52uReWG6QnrmujTfTDSb77tIFehjdGlS1elrvu75c4qM9cjPmQpvhNRQcTNcjPuzjtxWyfdwTkvs5g8duUIQuVDxFQNGoPdHdsPmhhPRWPIaP1tC4T3Td1g== X-MS-Exchange-AntiSpam-MessageData: yjcH2eB6JPJXgRls+njB4sbELNzTKk/NYKpVS/7eal/NHvyBrZDfJRnWmr85BA0lEsNofUNo/BFpr/YLV1n/umszdwlDK/FLLtUHfxMGBLa2UurA587yzTxRClmiz7EBKftmUK+8kY2QKmwqdYWGjuiEW5OEXOw+2gTGJFUZvHKLaYFhmOi4vRdtqq62zdDN2CCHqfFmVjBbRKN9wR82NPaX9CFrUaR/G50ujj4feqs24f/icmqVddK/sOiXQZRUZUcyFBfNlKhyurtFqMaSqBjdbXc9jCSr0wxCiXtUVsfaIPMucQ1VkIJAMAr2H4Mp01imz3ZBRo+39okPUZEeNxtn6LGDHJ6pgVARTFyswFaws0ORt02v7smQ1IzLnIFQqbfsqkz8fEyAKVzXtn6iJyZ5YwSATU3Hx4eBagSS9DY0JvsQQpmBOa8SvpFwLnGJtapdPuzzCqOgPMZhc0Vplq0rjb2UEypIipMexoysvqI= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 73f6c1cb-a8a0-466b-4a51-08d81471bdb2 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2020 16:56:42.1162 (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: RfOa55BtyAHKtmxJcAuBzFjTpL4kd7ftqmGlN85JIOgyqtJwBba+m0Khn063CGc01V6DzvIfBglIMiA4ANdeSw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4448 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,garrett.kirkendall@amd.com X-Gm-Message-State: kJvIs7xZMMPUdXt5cEziXyLxx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1592585805; bh=1ozfWxNk5/Qx2XSU4y5eGTTnH6k2k+SKZANU1RgHZG8=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=E6SG4laq5x+oMpTbWZfPOa1rvpUoJQsBVnSI+JqsIAFm+yLm+VL1Z8cGEWDXRp1ct8j x8DqR7YBHUqW2t8WoCMlijkh/+tk6ii7PFeYHOZFdR4EvwuxnWH57QdYQbDcu5E+9MP2p tlv/6F143ihE4GS1E+zDQpRzqYg7vQF0L/A= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Refactor StandardSignatureIsAuthenticAMD into BaseUefiCpuLib from separate copies in BaseXApicLib, BaseXApicX2ApicLib, and MpInitLib. This allows for future use of StandarSignatureIsAuthinticAMD without creating more instances in other modules. This function allows IA32/X64 code to determine if it is running on an AMD brand processor. UefiCpuLib is already included directly or indirectly in all modified modules. Complete move is made in this change. Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Signed-off-by: Garrett Kirkendall Reviewed-by: Laszlo Ersek Reviewed-by: Eric Dong --- UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf | 7 ++++ UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.inf | 2 ++ UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf | 2 ++ UefiCpuPkg/Include/Library/UefiCpuLib.h | 14 ++++++++ UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.c | 38 ++++++++= ++++++++++++ UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.c | 25 ++------= ----- UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.c | 25 ++------= ----- UefiCpuPkg/Library/MpInitLib/MpLib.c | 23 --------= ---- 8 files changed, 67 insertions(+), 69 deletions(-) diff --git a/UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf b/UefiCpu= Pkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf index 006b7acbf14e..34d3a7bb4303 100644 --- a/UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf +++ b/UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf @@ -4,6 +4,7 @@ # The library routines are UEFI specification compliant. # # Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2020, AMD Inc. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -29,6 +30,12 @@ [Sources.IA32] [Sources.X64] X64/InitializeFpu.nasm =20 +[Sources] + BaseUefiCpuLib.c + [Packages] MdePkg/MdePkg.dec UefiCpuPkg/UefiCpuPkg.dec + +[LibraryClasses] + BaseLib diff --git a/UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.inf b/UefiCpuPkg/= Library/BaseXApicLib/BaseXApicLib.inf index bdb2ff372677..561baa44b0e6 100644 --- a/UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.inf +++ b/UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.inf @@ -5,6 +5,7 @@ # where local APIC is disabled. # # Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2020, AMD Inc. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -37,6 +38,7 @@ [LibraryClasses] TimerLib IoLib PcdLib + UefiCpuLib =20 [Pcd] gUefiCpuPkgTokenSpaceGuid.PcdCpuInitIpiDelayInMicroSeconds ## SOMETIMES= _CONSUMES diff --git a/UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf b= /UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf index ac1e0a1c9896..1e2a4f8b790f 100644 --- a/UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf +++ b/UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf @@ -5,6 +5,7 @@ # where local APIC is disabled. # # Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2020, AMD Inc. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -37,6 +38,7 @@ [LibraryClasses] TimerLib IoLib PcdLib + UefiCpuLib =20 [Pcd] gUefiCpuPkgTokenSpaceGuid.PcdCpuInitIpiDelayInMicroSeconds ## SOMETIMES= _CONSUMES diff --git a/UefiCpuPkg/Include/Library/UefiCpuLib.h b/UefiCpuPkg/Include/L= ibrary/UefiCpuLib.h index 82e53bab3a0f..5326e7246301 100644 --- a/UefiCpuPkg/Include/Library/UefiCpuLib.h +++ b/UefiCpuPkg/Include/Library/UefiCpuLib.h @@ -5,6 +5,7 @@ to be UEFI specification compliant. =20 Copyright (c) 2009, Intel Corporation. All rights reserved.
+ Copyright (c) 2020, AMD Inc. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -29,4 +30,17 @@ InitializeFloatingPointUnits ( VOID ); =20 +/** + Determine if the standard CPU signature is "AuthenticAMD". + + @retval TRUE The CPU signature matches. + @retval FALSE The CPU signature does not match. + +**/ +BOOLEAN +EFIAPI +StandardSignatureIsAuthenticAMD ( + VOID + ); + #endif diff --git a/UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.c b/UefiCpuPk= g/Library/BaseUefiCpuLib/BaseUefiCpuLib.c new file mode 100644 index 000000000000..c2cc3ff9a709 --- /dev/null +++ b/UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.c @@ -0,0 +1,38 @@ +/** @file + This library defines some routines that are generic for IA32 family CPU. + + The library routines are UEFI specification compliant. + + Copyright (c) 2020, AMD Inc. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include + +#include +#include + +/** + Determine if the standard CPU signature is "AuthenticAMD". + + @retval TRUE The CPU signature matches. + @retval FALSE The CPU signature does not match. + +**/ +BOOLEAN +EFIAPI +StandardSignatureIsAuthenticAMD ( + VOID + ) +{ + UINT32 RegEbx; + UINT32 RegEcx; + UINT32 RegEdx; + + AsmCpuid (CPUID_SIGNATURE, NULL, &RegEbx, &RegEcx, &RegEdx); + return (RegEbx =3D=3D CPUID_SIGNATURE_AUTHENTIC_AMD_EBX && + RegEcx =3D=3D CPUID_SIGNATURE_AUTHENTIC_AMD_ECX && + RegEdx =3D=3D CPUID_SIGNATURE_AUTHENTIC_AMD_EDX); +} diff --git a/UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.c b/UefiCpuPkg/Li= brary/BaseXApicLib/BaseXApicLib.c index 33ea15ca2916..52bd90d33428 100644 --- a/UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.c +++ b/UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.c @@ -4,7 +4,7 @@ This local APIC library instance supports xAPIC mode only. =20 Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.
- Copyright (c) 2017, AMD Inc. All rights reserved.
+ Copyright (c) 2017 - 2020, AMD Inc. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -21,33 +21,12 @@ #include #include #include +#include =20 // // Library internal functions // =20 -/** - Determine if the standard CPU signature is "AuthenticAMD". - - @retval TRUE The CPU signature matches. - @retval FALSE The CPU signature does not match. - -**/ -BOOLEAN -StandardSignatureIsAuthenticAMD ( - VOID - ) -{ - UINT32 RegEbx; - UINT32 RegEcx; - UINT32 RegEdx; - - AsmCpuid (CPUID_SIGNATURE, NULL, &RegEbx, &RegEcx, &RegEdx); - return (RegEbx =3D=3D CPUID_SIGNATURE_AUTHENTIC_AMD_EBX && - RegEcx =3D=3D CPUID_SIGNATURE_AUTHENTIC_AMD_ECX && - RegEdx =3D=3D CPUID_SIGNATURE_AUTHENTIC_AMD_EDX); -} - /** Determine if the CPU supports the Local APIC Base Address MSR. =20 diff --git a/UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.c b/U= efiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.c index d0f92b33dc8c..cdcbca046191 100644 --- a/UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.c +++ b/UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.c @@ -5,7 +5,7 @@ which have xAPIC and x2APIC modes. =20 Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.
- Copyright (c) 2017, AMD Inc. All rights reserved.
+ Copyright (c) 2017 - 2020, AMD Inc. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -22,33 +22,12 @@ #include #include #include +#include =20 // // Library internal functions // =20 -/** - Determine if the standard CPU signature is "AuthenticAMD". - - @retval TRUE The CPU signature matches. - @retval FALSE The CPU signature does not match. - -**/ -BOOLEAN -StandardSignatureIsAuthenticAMD ( - VOID - ) -{ - UINT32 RegEbx; - UINT32 RegEcx; - UINT32 RegEdx; - - AsmCpuid (CPUID_SIGNATURE, NULL, &RegEbx, &RegEcx, &RegEdx); - return (RegEbx =3D=3D CPUID_SIGNATURE_AUTHENTIC_AMD_EBX && - RegEcx =3D=3D CPUID_SIGNATURE_AUTHENTIC_AMD_ECX && - RegEdx =3D=3D CPUID_SIGNATURE_AUTHENTIC_AMD_EDX); -} - /** Determine if the CPU supports the Local APIC Base Address MSR. =20 diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpIn= itLib/MpLib.c index ab7a8ed6633a..9b0660a5d4ea 100644 --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c @@ -13,29 +13,6 @@ EFI_GUID mCpuInitMpLibHobGuid =3D CPU_INIT_MP_LIB_HOB_GUID; =20 =20 -/** - Determine if the standard CPU signature is "AuthenticAMD". - - @retval TRUE The CPU signature matches. - @retval FALSE The CPU signature does not match. - -**/ -STATIC -BOOLEAN -StandardSignatureIsAuthenticAMD ( - VOID - ) -{ - UINT32 RegEbx; - UINT32 RegEcx; - UINT32 RegEdx; - - AsmCpuid (CPUID_SIGNATURE, NULL, &RegEbx, &RegEcx, &RegEdx); - return (RegEbx =3D=3D CPUID_SIGNATURE_AUTHENTIC_AMD_EBX && - RegEcx =3D=3D CPUID_SIGNATURE_AUTHENTIC_AMD_ECX && - RegEdx =3D=3D CPUID_SIGNATURE_AUTHENTIC_AMD_EDX); -} - /** The function will check if BSP Execute Disable is enabled. =20 --=20 2.27.0 -=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 (#61531): https://edk2.groups.io/g/devel/message/61531 Mute This Topic: https://groups.io/mt/74983842/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sat May 11 02:20:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+61532+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+61532+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1592585805650612.7916083109116; Fri, 19 Jun 2020 09:56:45 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id vrGAYY1788612xfYz3PRAB2n; Fri, 19 Jun 2020 09:56:45 -0700 X-Received: from NAM02-SN1-obe.outbound.protection.outlook.com (NAM02-SN1-obe.outbound.protection.outlook.com []) by mx.groups.io with SMTP id smtpd.web11.404.1592585802996773386 for ; Fri, 19 Jun 2020 09:56:43 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ffj4X+tD0CgkAVPLdsaROJIzWiULKF/FvhC+EdzQrNctA9vZS9Mtlq6LTjm6Bfr0/OXU9RuWkdWlCS+QSshZZgoVcCnnweyUwuRYtFt2L4xsYWLNDXh8/o23E0ciSXYpRNmWCTOAersOo7IE7akJKa9eKV+5dkqT31/x18fn5JHOH348KVj+leWA7nieNWHQsDLgAv3OU3yaMCLb4KNmokyrSoqVD2/9ZenEn+BhXNzW/2DyYS8GVSyDfbdsIA/bwoD/OSsa6/xs/VgYEufyQpaK27nTJdllANSsSFil1gCLc/X6hLJ7GmGFzoZJoSKntzBf71AvsK/8ZTJssCvFPA== 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-SenderADCheck; bh=1NLHDuEFPzi/20dWgoH9c7qGh7aP86ISLepDCVRV4qA=; b=OhPeyZjamNUm+z5wfRpqR0021cRu1ZB2mOehZ5HXv97KzHJlZEpNgF3zFf6skpX6LE13uNoQsJ4ELCi+s6faUiXQNxhsLifcv9tHhq0mH0lD6B/Q6s2EYDeCGsSOpLbynnAo1myM/NIxm0EEMgbZDwZVSEJPAsB+5jtOL3Jthcw/okw0dnEnWkL0oowobucIBItO6JFaF2Eqlg71jwhrdPMjO1hrUar7wn8+/ngEme5wzTakd+vXqJMjnR03WU31xrmp04nbn5Zap/7H0vlDrUGlKESeZ/W5MrNbJWEKikAt5G4VZa/44nr6bqIWUUjR82gMHSNGkCbxfH3qKR/3pw== 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 X-Received: from SN1PR12MB2352.namprd12.prod.outlook.com (2603:10b6:802:25::13) by SA0PR12MB4448.namprd12.prod.outlook.com (2603:10b6:806:94::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Fri, 19 Jun 2020 16:56:42 +0000 X-Received: from SN1PR12MB2352.namprd12.prod.outlook.com ([fe80::156e:ce6d:a148:274e]) by SN1PR12MB2352.namprd12.prod.outlook.com ([fe80::156e:ce6d:a148:274e%7]) with mapi id 15.20.3109.021; Fri, 19 Jun 2020 16:56:42 +0000 From: "Kirkendall, Garrett" To: devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Laszlo Ersek Subject: [edk2-devel] [PATCH v5 4/4] UefiCpuPkg: PiSmmCpuDxeSmm skip MSR_IA32_MISC_ENABLE manipulation on AMD Date: Fri, 19 Jun 2020 11:56:29 -0500 Message-Id: <20200619165629.9545-5-Garrett.Kirkendall@amd.com> In-Reply-To: <20200619165629.9545-1-Garrett.Kirkendall@amd.com> References: <20200619165629.9545-1-Garrett.Kirkendall@amd.com> X-ClientProxiedBy: SN6PR01CA0024.prod.exchangelabs.com (2603:10b6:805:b6::37) To SN1PR12MB2352.namprd12.prod.outlook.com (2603:10b6:802:25::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from biosdev-01.amd.com (165.204.78.2) by SN6PR01CA0024.prod.exchangelabs.com (2603:10b6:805:b6::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Fri, 19 Jun 2020 16:56:42 +0000 X-Originating-IP: [165.204.78.2] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: f2d298c7-851b-4a5b-9159-08d81471be15 X-MS-TrafficTypeDiagnostic: SA0PR12MB4448: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: +F8Cjmgk/gtVNho5CgJ+zMCqaOq15UoMCog1xE42rs62aT7k7yBpZLW4ueLdTdsrr0qVq1AypbtanC1Qy6wtowSp49Cr8yBY1oGeSb7EvGCWLsBvhyrFFpqktFl4MpV7aTMq1PAGfYKdviyjjk82aFn8V8hRVfkxfiA3JoKaSS4IBE+Wjq48FBMeuxjqT0qkHt/QewDRbV3P1LUizinZTmPJuoiUE4dPloZp5wR3X4meRh0s3ru/+PFZy+eI8R/9S+xzr3hyv8+DRgVW374c+ehwJZofCheHUdQhzbE/KPsccG2XkFnN/3H6GvjVeN6iOiqbmuEzrBtnmtghTobzlw== X-MS-Exchange-AntiSpam-MessageData: BdPxOHfioQH7OioNvVxXvyOtOciqcOn2xvuE+eazqWHLV5ZHtxTgMfyXzKeTQhnFV4Fu0h+BEb1lNn5WhOQ1DwHfF2JiAkXVYecUYXGW8eCuMihoBRf0Ta4zNAG65ECtn9X4wBrbe7o2iBUKnm/AhKHisdaPufLbu7lqWaUhRcJ71a4nAD2DFLBmVA2ZSSPVoVQVti0hqKhSGfSrbgWh2IbC7USckfCn9hUGYxDjCi23amZTSXcLO7LSB/ovWmT7aTRblX3bm51rn+AjUEljX/EUxajACIyDkxqpKlSmlvTN2MQ8DisSIgmQyH/2qwAAJYZKzWs7IYcAboomHN8Wrch7srYRpQWX2Rvw8YJL3ON0tltY/GJ55hoXHIRCkjEiAfTPoisazqT7xldZBXBLo8NUQi7gvP6P1uH4uRRspQ+1AQhTbOFsPSJkAuAwp/KtJnpf+OgsgCpZm+BM6ekkdUQDxZChMOw2aJbWkkg4q8E= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: f2d298c7-851b-4a5b-9159-08d81471be15 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2020 16:56:42.7828 (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: 96rGfHpaP7Y2AVqu9JBrIrr7iA2ssd/rvzAN9w4vszzwvMrrFKTOvG0/OROldVSinbi2e6Laal4gpDpi3xnmVA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4448 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,garrett.kirkendall@amd.com X-Gm-Message-State: 9DzvGqv8XoPNmAMjByjACM7kx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1592585805; bh=6cSrK3544v+MdxRD/t8sunPYybt+IA8FLhwjXVZBib8=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=mEEnxmVc8p/fB/zsLS/w9yJqLwON6BZaJOTlyTFv8v/DPlRYRlB0KVzYJ8ztix4q9zp ItbE02GmP9o6WcHY96jSqNS763II03Zs53XXbjPY2CQiaqsHKklfA2biNHR5xWjSlYNAU /MNiErsu/fca4awqAP5JpsZ/4epnaFyk8d0= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" AMD does not support MSR_IA32_MISC_ENABLE. Accessing that register causes and exception on AMD processors. If Execution Disable is supported, but if the processor is an AMD processor, skip manipulating MSR_IA32_MISC_ENABLE[34] XD Disable bit. Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Signed-off-by: Garrett Kirkendall Reviewed-by: Laszlo Ersek Tested-by: Laszlo Ersek --- Notes: Tested on Intel hardware with Laszlo Ersek's help =20 (1) downloaded two Linux images from provided links. (2) Test using a 32-bit guest on an Intel host (standing in your edk2 t= ree, with the patches applied): =20 $ build -a IA32 -b DEBUG -p OvmfPkg/OvmfPkgIa32.dsc -t GCC5 -D SMM_REQU= IRE =20 $ qemu-system-i386 \ -cpu coreduo,-nx \ -machine q35,smm=3Don,accel=3Dkvm \ -m 4096 \ -smp 4 \ -global driver=3Dcfi.pflash01,property=3Dsecure,value=3Don \ -drive if=3Dpflash,format=3Draw,unit=3D0,readonly=3Don,file=3DBuild= /OvmfIa32/DEBUG_GCC5/FV/OVMF_CODE.fd \ -drive if=3Dpflash,format=3Draw,unit=3D1,snapshot=3Don,file=3DBuild= /OvmfIa32/DEBUG_GCC5/FV/OVMF_VARS.fd \ -drive id=3Dhdd,if=3Dnone,format=3Dqcow2,snapshot=3Don,file=3Dfedor= a-30-efi-systemd-i686.qcow2 \ -device virtio-scsi-pci,id=3Dscsi0 \ -device scsi-hd,drive=3Dhdd,bus=3Dscsi0.0,bootindex=3D1 =20 (Once you get a login prompt, feel free to interrupt QEMU with Ctrl-C.) =20 (3) Test using a 64-bit guest on an Intel host: =20 $ build -a IA32 -a X64 -b DEBUG -p OvmfPkg/OvmfPkgIa32X64.dsc -t GCC5 -= D SMM_REQUIRE =20 $ qemu-system-x86_64 \ -cpu host \ -machine q35,smm=3Don,accel=3Dkvm \ -m 4096 \ -smp 4 \ -global driver=3Dcfi.pflash01,property=3Dsecure,value=3Don \ -drive if=3Dpflash,format=3Draw,unit=3D0,readonly=3Don,file=3DBuild= /Ovmf3264/DEBUG_GCC5/FV/OVMF_CODE.fd \ -drive if=3Dpflash,format=3Draw,unit=3D1,snapshot=3Don,file=3DBuild= /Ovmf3264/DEBUG_GCC5/FV/OVMF_VARS.fd \ -drive id=3Dhdd,if=3Dnone,format=3Dqcow2,snapshot=3Don,file=3Dfedor= a-31-efi-grub2-x86_64.qcow2 \ -device virtio-scsi-pci,id=3Dscsi0 \ -device scsi-hd,drive=3Dhdd,bus=3Dscsi0.0,bootindex=3D1 =20 Tested on real AMD Hardware UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfileInternal.h | 3 +++ UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c | 9 ++++++++- UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmiEntry.nasm | 19 +++++++++++++++++-- UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm | 20 ++++++++++++++++++-- 4 files changed, 46 insertions(+), 5 deletions(-) diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfileInternal.h b/UefiCpuPkg/Pi= SmmCpuDxeSmm/SmmProfileInternal.h index 43f6935cf9dc..993360a8a8c1 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfileInternal.h +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfileInternal.h @@ -2,6 +2,7 @@ SMM profile internal header file. =20 Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2020, AMD Incorporated. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -13,6 +14,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include +#include #include =20 #include "SmmProfileArch.h" @@ -99,6 +101,7 @@ extern SMM_S3_RESUME_STATE *mSmmS3ResumeState; extern UINTN gSmiExceptionHandlers[]; extern BOOLEAN mXdSupported; X86_ASSEMBLY_PATCH_LABEL gPatchXdSupported; +X86_ASSEMBLY_PATCH_LABEL gPatchMsrIa32MiscEnableSupported; extern UINTN *mPFEntryCount; extern UINT64 (*mLastPFEntryValue)[MAX_PF_ENTRY_COUNT]; extern UINT64 *(*mLastPFEntryPointer)[MAX_PF_ENTRY_COUN= T]; diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c b/UefiCpuPkg/PiSmmCpuDx= eSmm/SmmProfile.c index c47b5573e366..d7ed9ab7a770 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c @@ -2,7 +2,7 @@ Enable SMM profile. =20 Copyright (c) 2012 - 2019, Intel Corporation. All rights reserved.
-Copyright (c) 2017, AMD Incorporated. All rights reserved.
+Copyright (c) 2017 - 2020, AMD Incorporated. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -1015,6 +1015,13 @@ CheckFeatureSupported ( mXdSupported =3D FALSE; PatchInstructionX86 (gPatchXdSupported, mXdSupported, 1); } + + if (StandardSignatureIsAuthenticAMD ()) { + // + // AMD processors do not support MSR_IA32_MISC_ENABLE + // + PatchInstructionX86 (gPatchMsrIa32MiscEnableSupported, FALSE, 1); + } } =20 if (mBtsSupported) { diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmiEntry.nasm b/UefiCpuPkg/PiSm= mCpuDxeSmm/Ia32/SmiEntry.nasm index f96de9bdeb43..167f5e14dbd4 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmiEntry.nasm +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmiEntry.nasm @@ -1,5 +1,6 @@ ;-------------------------------------------------------------------------= ----- ; ; Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.
+; Copyright (c) 2020, AMD Incorporated. All rights reserved.
; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Module Name: @@ -59,6 +60,7 @@ global ASM_PFX(gPatchSmiStack) global ASM_PFX(gPatchSmbase) extern ASM_PFX(mXdSupported) global ASM_PFX(gPatchXdSupported) +global ASM_PFX(gPatchMsrIa32MiscEnableSupported) extern ASM_PFX(gSmiHandlerIdtr) =20 extern ASM_PFX(mCetSupported) @@ -153,17 +155,30 @@ ASM_PFX(gPatchSmiCr3): ASM_PFX(gPatchXdSupported): cmp al, 0 jz @SkipXd + +; If MSR_IA32_MISC_ENABLE is supported, clear XD Disable bit + mov al, strict byte 1 ; source operand may be patched +ASM_PFX(gPatchMsrIa32MiscEnableSupported): + cmp al, 1 + jz MsrIa32MiscEnableSupported + +; MSR_IA32_MISC_ENABLE not supported + xor edx, edx + push edx ; don't try to restore the XD Disa= ble bit just before RSM + jmp EnableNxe + ; ; Check XD disable bit ; +MsrIa32MiscEnableSupported: mov ecx, MSR_IA32_MISC_ENABLE rdmsr push edx ; save MSR_IA32_MISC_ENABLE[63-32] test edx, BIT2 ; MSR_IA32_MISC_ENABLE[34] - jz .5 + jz EnableNxe and dx, 0xFFFB ; clear XD Disable bit if it is set wrmsr -.5: +EnableNxe: mov ecx, MSR_EFER rdmsr or ax, MSR_EFER_XD ; enable NXE diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm b/UefiCpuPkg/PiSmm= CpuDxeSmm/X64/SmiEntry.nasm index 8bfba55b5d08..0e154e5db949 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm @@ -1,5 +1,6 @@ ;-------------------------------------------------------------------------= ----- ; ; Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.
+; Copyright (c) 2020, AMD Incorporated. All rights reserved.
; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Module Name: @@ -67,6 +68,7 @@ extern ASM_PFX(CpuSmmDebugExit) global ASM_PFX(gPatchSmbase) extern ASM_PFX(mXdSupported) global ASM_PFX(gPatchXdSupported) +global ASM_PFX(gPatchMsrIa32MiscEnableSupported) global ASM_PFX(gPatchSmiStack) global ASM_PFX(gPatchSmiCr3) global ASM_PFX(gPatch5LevelPagingNeeded) @@ -152,18 +154,32 @@ SkipEnable5LevelPaging: ASM_PFX(gPatchXdSupported): cmp al, 0 jz @SkipXd + +; If MSR_IA32_MISC_ENABLE is supported, clear XD Disable bit + mov al, strict byte 1 ; source operand may be patched +ASM_PFX(gPatchMsrIa32MiscEnableSupported): + cmp al, 1 + jz MsrIa32MiscEnableSupported + +; MSR_IA32_MISC_ENABLE not supported + sub esp, 4 + xor rdx, rdx + push rdx ; don't try to restore the XD Disa= ble bit just before RSM + jmp EnableNxe + ; ; Check XD disable bit ; +MsrIa32MiscEnableSupported: mov ecx, MSR_IA32_MISC_ENABLE rdmsr sub esp, 4 push rdx ; save MSR_IA32_MISC_ENABLE[63-32] test edx, BIT2 ; MSR_IA32_MISC_ENABLE[34] - jz .0 + jz EnableNxe and dx, 0xFFFB ; clear XD Disable bit if it is set wrmsr -.0: +EnableNxe: mov ecx, MSR_EFER rdmsr or ax, MSR_EFER_XD ; enable NXE --=20 2.27.0 -=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 (#61532): https://edk2.groups.io/g/devel/message/61532 Mute This Topic: https://groups.io/mt/74983843/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-