From nobody Sat May 4 05:15:44 2024 Delivered-To: importer@patchew.org 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+54798+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 1582663797367795.8378672206766; Tue, 25 Feb 2020 12:49:57 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id qcrLYY1788612xrHt2nIrOuw; Tue, 25 Feb 2020 12:49:56 -0800 X-Received: from NAM11-BN8-obe.outbound.protection.outlook.com (NAM11-BN8-obe.outbound.protection.outlook.com [40.107.236.82]) by mx.groups.io with SMTP id smtpd.web10.372.1582659639814377326 for ; Tue, 25 Feb 2020 11:40:40 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Iu4gAP6VzhZe2G4MF3nbwMo9CtLXqsmGcuR7xJVqQQDJ10n9hovNtWe1xGYd39GqIXcSWeDqsr8aIxiSnWDcx9ryVR/wTj6QK8DHiz60ylU4ybSUuMV0POCErNzP9QyYfAO8qBu07xFoHOEcYdwX2XB0B57RFyJvVCPzory4B/jdbiM8KBFUWzWYwYoPtka823MAT45U9VshqAg7XRZ5O4sNjpJk0RBhWiFIat9xZYly45+f3rhaV51NPZC9yAEdhzHtTqvulWie6FfQlS1d0TgQT2Gb1tzVrk2Pf7FNAhqU3stDWEDT1FsA8BUkTmA3zjQALK/nenLv8MyP2F13ow== 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=gAWROY++aGByz+ae2DQ5bAN0W2lZelpRggLV6jKlCv4=; b=ZyToynsBoySNezsiW2w/NNZlL/pAygfR8jlJ+SO+rC/SXhA0IsVBKmJFQFH6oErVLwS0XSmK3pUOekRLAbFf0IxjKEEtlsb3rD3djw70/alVc2YvrNQtVka230KhERtdO/zeQDqEJfh8+PJK84nLKDZM0kJ1OJWWmvz9nb+GCc4YxUcnLoISRBhGg24G7ksJ+eDQWv/NdN0+NRuKOpGQKJc2KX2tGDACDSFO+xDyyNDROkyBJcKiJFhQKFDTs4ITsuSa8+sx6Hmdh/M0EI2UJJuX798H2buzoddzHhWKbev4d7yC+T9thBTU8Lv6dAKUMCij2RZjIHPNfqIsWkOshA== 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 BN6PR12MB1922.namprd12.prod.outlook.com (2603:10b6:404:106::14) by BN6PR12MB1410.namprd12.prod.outlook.com (2603:10b6:404:18::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2750.17; Tue, 25 Feb 2020 19:40:36 +0000 X-Received: from BN6PR12MB1922.namprd12.prod.outlook.com ([fe80::d931:1942:a6b5:d74c]) by BN6PR12MB1922.namprd12.prod.outlook.com ([fe80::d931:1942:a6b5:d74c%7]) with mapi id 15.20.2750.021; Tue, 25 Feb 2020 19:40:36 +0000 From: Leo Duran To: devel@edk2.groups.io Cc: Leo Duran , Eric Dong , Ray Ni , Laszlo Ersek Subject: [edk2-devel] [PATCH 1/2] UefiCpuPkg: LocalApicLib: Export StandardSignatureIsAuthenticAMD function Date: Tue, 25 Feb 2020 13:39:25 -0600 Message-Id: <1582659566-9893-2-git-send-email-leo.duran@amd.com> In-Reply-To: <1582659566-9893-1-git-send-email-leo.duran@amd.com> References: <1582659566-9893-1-git-send-email-leo.duran@amd.com> X-ClientProxiedBy: SN4PR0801CA0024.namprd08.prod.outlook.com (2603:10b6:803:29::34) To BN6PR12MB1922.namprd12.prod.outlook.com (2603:10b6:404:106::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from leduran-Precision-WorkStation-T5400.amd.com (165.204.78.2) by SN4PR0801CA0024.namprd08.prod.outlook.com (2603:10b6:803:29::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2750.17 via Frontend Transport; Tue, 25 Feb 2020 19:40:36 +0000 X-Originating-IP: [165.204.78.2] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d059e507-343b-428a-d8dd-08d7ba2a9602 X-MS-TrafficTypeDiagnostic: BN6PR12MB1410:|BN6PR12MB1410: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; 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+54798+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: xhIJnJPSVvRgjdPaAapK3tQy5f2POy2ljD7dZcH1TS/btnxhptIV38tWw10gATGRkpWEHmwb2AStyaMfRzJMI+jsdCf5Rhv6Mn5MfY8/wF2FfzKXdgL8p5YKL9bQliV/a38J6pNNjpqe3vCpzO7zep880lOcRuyAL44ygV0IKt6Piklw0r/Q7IY4cTGIKAfc8ChR0g5F7htkbrxPoEQ2vSiSiVU61aJFx9Qn3wlwqNSAElZohcG03vcg7HEcXfzoCoBfAdthz4S6co6W0XTweaP7u4aQqs2YIGz7zjBxK+tQhlzO20hYzEBv0lPmaR44+gWEJt6GR5srvHvFP+wyDJRFFa7rU2fKl0Ld4nUjR8cOLiXTK8jl2yZAKqRaMXkIXYhBB4N1XHEveq//3rTa96c/y91Sl3DoRiQMUyPEDvXQJx9rmJgKASD3fw3ZAuHZdXX61jEZ6JTNGl9y18ubSq2Ep9B3xZBAbISmnhZAUWN/i0cwXnnBN9S9IEwYhT0KHa+DWCBWvyzAgmSy4xrVLA== X-MS-Exchange-AntiSpam-MessageData: HHEEECFW8DpE8JVlkEG2Mb3wmcAgJMHCRjH107Cu/wtcrLFoU22eHDeXGxQi8IkvvM32loeLkHUc/HB+7C3j2z1aNu2NH6RBxgrY9kB4AJlB4ss5pgOR98XM4VdXU5Z7y5i0RQAOLSFYGSm6nu1yuA== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: d059e507-343b-428a-d8dd-08d7ba2a9602 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Feb 2020 19:40:36.6915 (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: oMXlbzcK8PpDvYUkwB5/+paxxGetrzQ+45ShV1z2m0n6tZEW5t2bWmpZ5E5n6bEl X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1410 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,leo.duran@amd.com X-Gm-Message-State: xPgDR0H4IQZgLv562emiqjG2x1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1582663796; bh=45LTbvQwqrXPafP/+2H1em/OouPME18JRy295GNqr8k=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=h8CAfQ6/2wIJSO3EKwe4uuAo21aV2okWTqc9st5WOFSW4RVk3VbTjYQEXXzifp/sGVu QYVq3+nv/yxMd+fl0Xtl/2qLmh1S3fSiyN7mO+Pp/xofzJ8g2ALcdW6E473EdqqVXIF7D x5qfdixDrCIJQGUv4un+SFPJ3Lx3z5ZhyOE= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2556 The StandardSignatureIsAuthenticAMD function was introduced locally to help divert code paths pertinent (or not) to AMD processors. This patch exports that function so that it may serve the same purpose in other modules that consume LocalApicLib. Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Signed-off-by: Leo Duran Acked-by: Laszlo Ersek --- UefiCpuPkg/Include/Library/LocalApicLib.h | 15 +++++++ UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.c | 47 +++++++++++-------= ---- .../BaseXApicX2ApicLib/BaseXApicX2ApicLib.c | 47 +++++++++++-------= ---- 3 files changed, 63 insertions(+), 46 deletions(-) diff --git a/UefiCpuPkg/Include/Library/LocalApicLib.h b/UefiCpuPkg/Include= /Library/LocalApicLib.h index 96b93aa..a6e9dc6 100644 --- a/UefiCpuPkg/Include/Library/LocalApicLib.h +++ b/UefiCpuPkg/Include/Library/LocalApicLib.h @@ -5,6 +5,8 @@ handles cases where local APIC is disabled. =20 Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.
+ Copyright (c) 2020, AMD Inc. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -16,6 +18,19 @@ #define LOCAL_APIC_MODE_X2APIC 0x2 ///< x2APIC mode. =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 + ); + +/** Retrieve the base address of local APIC. =20 @return The base address of local APIC. diff --git a/UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.c b/UefiCpuPkg/Li= brary/BaseXApicLib/BaseXApicLib.c index 33ea15c..cebf1b3 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 @@ -27,28 +27,6 @@ // =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 @retval TRUE The CPU supports the Local APIC Base Address MSR. @@ -76,6 +54,29 @@ LocalApicBaseAddressMsrSupported ( } =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 + ) +{ + 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); +} + +/** Retrieve the base address of local APIC. =20 @return The base address of local APIC. diff --git a/UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.c b/U= efiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.c index d0f92b3..01996b1 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 @@ -28,28 +28,6 @@ // =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 @retval TRUE The CPU supports the Local APIC Base Address MSR. @@ -77,6 +55,29 @@ LocalApicBaseAddressMsrSupported ( } =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 + ) +{ + 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); +} + +/** Retrieve the base address of local APIC. =20 @return The base address of local APIC. --=20 2.7.4 -=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 (#54798): https://edk2.groups.io/g/devel/message/54798 Mute This Topic: https://groups.io/mt/71541518/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 4 05:15:44 2024 Delivered-To: importer@patchew.org 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+54799+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 1582663797818995.8393204879831; Tue, 25 Feb 2020 12:49:57 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 1kcwYY1788612xpzyiBXJaU8; Tue, 25 Feb 2020 12:49:56 -0800 X-Received: from NAM11-BN8-obe.outbound.protection.outlook.com (NAM11-BN8-obe.outbound.protection.outlook.com [40.107.236.77]) by mx.groups.io with SMTP id smtpd.web12.372.1582659641066393603 for ; Tue, 25 Feb 2020 11:40:41 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QEqz0ofuWEhpDvnB+VQOdIn8XHprHVRMvMRb16xxSOQACvzETz4J5cdWaVFGUQcFrrN8G4z3Bz65nynjo2GGVUEkRUGaK/+qxxr/Mcm2Y9wo5rXtDp3V6kOaX5hZ6oKHSmxHpG/ilHU6IXkrraTJOtjoe57f12liLx1ciENhAyo7NBqlHzyJKOl6SasAWQKw+qCp8XZnLjEPffXkYD3csbWciyMbQiyJSFth0wftBtIXsnuKzE+k3nhXsxVzrDy1X/20/2bMgKXjDk//d92cXV1ZfvkBFuLcF2Bj9XV0Ok1+TupSicW7H5DgsauOeEEkpkAXVuZ0+Y70CDFQVRfzjA== 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=FyNiL3zTHcEYmjL8UI8mNHAGWqP19yQZJXplISMFsZo=; b=ARsvg3PUN89Bdg1k4QOZqPc14eHgmuEEBqlYNX7yJSjwcOntEDxgs8oVnPvXDfua4q6zSjFdaG69fSRk822NmQEG1W2eUDFM2u4bv9ng0KHAA+36vUAbZYVc9eAvv7tnDux3hOFJTXoJ9KTmzzhrNl8GCb2VygDYfshcpSafxM0hOUQb6yhIx8j4RLCAAb0+JHVFk5cxcb3xuubxTKqgE0QIcRBCwskK5g3OAif0Tlz6R3YDCwhbIep+9zZEWUFkySX9P0zQdzvabtCK7/QOQeSG7ev/19IzncIhY5YKNHGKeXlmNZDqY2Mq3iJAbKOuMcCwmC/U+soyG+np9LF58g== 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 BN6PR12MB1922.namprd12.prod.outlook.com (2603:10b6:404:106::14) by BN6PR12MB1410.namprd12.prod.outlook.com (2603:10b6:404:18::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2750.17; Tue, 25 Feb 2020 19:40:39 +0000 X-Received: from BN6PR12MB1922.namprd12.prod.outlook.com ([fe80::d931:1942:a6b5:d74c]) by BN6PR12MB1922.namprd12.prod.outlook.com ([fe80::d931:1942:a6b5:d74c%7]) with mapi id 15.20.2750.021; Tue, 25 Feb 2020 19:40:39 +0000 From: Leo Duran To: devel@edk2.groups.io Cc: Leo Duran , Eric Dong , Ray Ni , Laszlo Ersek Subject: [edk2-devel] [PATCH 2/2] UefiCpuPkg: MpInitLib: Exclude code no pertinent to AMD processors. Date: Tue, 25 Feb 2020 13:39:26 -0600 Message-Id: <1582659566-9893-3-git-send-email-leo.duran@amd.com> In-Reply-To: <1582659566-9893-1-git-send-email-leo.duran@amd.com> References: <1582659566-9893-1-git-send-email-leo.duran@amd.com> X-ClientProxiedBy: SN4PR0801CA0024.namprd08.prod.outlook.com (2603:10b6:803:29::34) To BN6PR12MB1922.namprd12.prod.outlook.com (2603:10b6:404:106::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from leduran-Precision-WorkStation-T5400.amd.com (165.204.78.2) by SN4PR0801CA0024.namprd08.prod.outlook.com (2603:10b6:803:29::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2750.17 via Frontend Transport; Tue, 25 Feb 2020 19:40:39 +0000 X-Originating-IP: [165.204.78.2] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 4a886e81-3bfd-40a0-2159-08d7ba2a97d1 X-MS-TrafficTypeDiagnostic: BN6PR12MB1410:|BN6PR12MB1410: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; 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+54799+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: nIzFU/NXXC/KoacPTUaW0gkev6jg1XKt1AJEqdbeEKeVmxs9j4d1EW1LTShWIhfbJSUpn8IKTvKzKxpQDyMUj7qnvN3sdj61/qxwJDIQI7UrN8VWGfR8Bu3/HIoo7LwAow19HHSOhFudecHW6QuepTVrLXOWpXR1SyHs+9qkhco3K04KzDAGK5X3b11a4FUK8vS+jXijnFHYdGmYnpGxD/WRF5uGOMd15vd/VllSxxjp86yEXpVWC6AqUO0A7YLHMoKTS3DxJlfj58JSJ7owHi4bSKrKwqkJXiAXV37RFF5tAxtuttt2/CEzld8bAr204AFiuIqdewwpeYYeMRmp7IFN/0QD8KuSbhdxJ8IV4NQXXOzWCtNX+/MLtUOsNXcrpgxkSCu5Nb6AliiM6vQiMVD+S6QuAl+S/k8cvCodlw42XlYmxRNy2tfwfBfvzvQm95G21dNegIMi+2/YgI2DsgUVCs43nWL6mrL5M8GvL13zqUYSGLFQm/GvG/e4KTVrI+Va9Xe/G52j0/meEAcsNg== X-MS-Exchange-AntiSpam-MessageData: AVV5mLjHhH6A6mJtb4N03GNrHEu/CdWthvKj+VUyrNuPQgVmNq50OhR4Lre+cs+6Ygch7lY9fj+61QEuPOVRI2cXsZQ7KS0EmjbQL3yoTxhnk9AJcX4+vEYoV1GoT89BPYp/aqw5mBVpjxq2UudbaQ== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4a886e81-3bfd-40a0-2159-08d7ba2a97d1 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Feb 2020 19:40:39.7261 (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: DXZTfIEQ3fjissxaghHCUMhlT+zpRhtikdTjM2icf+TdNW8CAgpHh9JqYmrPzQk3 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1410 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,leo.duran@amd.com X-Gm-Message-State: EIRRBwCKCmyeE34Jt1yKlnMbx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1582663796; bh=xLN5lNIqPjkc8NtXhSZR1ozliTTK1qtsIT7xk9X9UAc=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=JEZHHMZgXNOSHRJzBywZ1M0tdJdSVpsT9Ak0OeQ9nlk/kzpVAozWN+85eTf1r1WQSKi GnR9F631dIXYsqslC/kLV/p0ZrPSNypeRmgKiliOEkBnQrbZ8hhEwfYJD9XTPragGBiVt diYbn+P1xoc8dT6UkRA8Zx3nvVR48ehpBA0= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2556 This patch uses the newly exported StandardSignatureIsAuthenticAMD function from LocalApicLib, to divert code paths not pertinent to AMD processors. Specifically, the PlatformId MSR and embedded Microcode patches are not relevant on AMD-based platforms. Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Signed-off-by: Leo Duran Acked-by: Laszlo Ersek Acked-by: Siyuan Fu --- UefiCpuPkg/Library/MpInitLib/Microcode.c | 17 +++++++++++++++-- UefiCpuPkg/Library/MpInitLib/MpLib.c | 11 +++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/UefiCpuPkg/Library/MpInitLib/Microcode.c b/UefiCpuPkg/Library/= MpInitLib/Microcode.c index 1562959..750681d 100644 --- a/UefiCpuPkg/Library/MpInitLib/Microcode.c +++ b/UefiCpuPkg/Library/MpInitLib/Microcode.c @@ -2,6 +2,8 @@ Implementation of loading microcode on processors. =20 Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.
+ Copyright (c) 2020, AMD Inc. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -97,9 +99,13 @@ MicrocodeDetect ( UINT32 ThreadId; BOOLEAN IsBspCallIn; =20 - if (CpuMpData->MicrocodePatchRegionSize =3D=3D 0) { + // + // NOTE: Embedded Microcode patches are not relevant on AMD platforms. + // + if (CpuMpData->MicrocodePatchRegionSize =3D=3D 0 || + StandardSignatureIsAuthenticAMD ()) { // - // There is no microcode patches + // There are no microcode patches // return; } @@ -350,6 +356,13 @@ IsProcessorMatchedMicrocodePatch ( UINTN Index; CPU_AP_DATA *CpuData; =20 + // + // NOTE: PlatformId or embedded Microcode patches are not relevant on AM= D platforms. + // + if (StandardSignatureIsAuthenticAMD ()) { + return FALSE; + } + for (Index =3D 0; Index < CpuMpData->CpuCount; Index++) { CpuData =3D &CpuMpData->CpuData[Index]; if ((ProcessorSignature =3D=3D CpuData->ProcessorSignature) && diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpIn= itLib/MpLib.c index d0fbc17..290e7bf 100644 --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c @@ -2,6 +2,8 @@ CPU MP Initialize Library common functions. =20 Copyright (c) 2016 - 2020, Intel Corporation. All rights reserved.
+ Copyright (c) 2020, AMD Inc. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -564,8 +566,13 @@ InitializeApData ( CpuMpData->CpuData[ProcessorNumber].Waiting =3D FALSE; CpuMpData->CpuData[ProcessorNumber].CpuHealthy =3D (BistData =3D=3D 0) ?= TRUE : FALSE; =20 - PlatformIdMsr.Uint64 =3D AsmReadMsr64 (MSR_IA32_PLATFORM_ID); - CpuMpData->CpuData[ProcessorNumber].PlatformId =3D (UINT8) PlatformIdMsr= .Bits.PlatformId; + // + // NOTE: PlatformId is not relevant on AMD platforms. + // + if (!StandardSignatureIsAuthenticAMD ()) { + PlatformIdMsr.Uint64 =3D AsmReadMsr64 (MSR_IA32_PLATFORM_ID); + CpuMpData->CpuData[ProcessorNumber].PlatformId =3D (UINT8)PlatformIdMs= r.Bits.PlatformId; + } =20 AsmCpuid ( CPUID_VERSION_INFO, --=20 2.7.4 -=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 (#54799): https://edk2.groups.io/g/devel/message/54799 Mute This Topic: https://groups.io/mt/71541520/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-