From mboxrd@z Thu Jan 1 00:00:00 1970 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.web10.423.1592585801690453260 for ; Fri, 19 Jun 2020 09:56:41 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=WehgqxNI; spf=none, err=SPF record not found (domain: amd.com, ip: 40.107.77.75, mailfrom: garrett.kirkendall@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ln6/3y20/g6YLP/NrDp+wHxOSYBJAjCQg7us7wxEPTsC4gHTcFZrSYPNmal7F+xW6bsQdDFc7pdrqZ4y96ddBjwwMBiDUq0pBbI9uo315FxHqApPFCiCVIF+eVgQg5SFdCTejGISn4/r2D55cWVuTf09NfUjaFMIP7651scmk6/bpaqpIjulCvpQKUbS+GdhcXNYnUTa+9EYECLQKAsf6oBk20ktxPD0cGkzRg/Dwd8HyAt/WtKHpe2H/twF2ayKPlqWB9vDRSuMTWN2FX8+04dwqHlHsFh63wckGUFvyLrHwBWTXRJ/4YHsMH+u0AkksH/I4jfzcv0KPSe67pLBEA== 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=jFBoh6KR0lmeOT7GjmjNMg12YPSIljiVYswPwiAaqeo=; b=EhlLSU3MvEonjbeliJbuSLLMQ+8LL8vssnYAMtKS15uPV4x5mc9//ep0EF0F/3DZbTQuvpdgeDKmgdisuHdDEDRpxUifeAwz66DTg5JilvaGWwd+Az1Mn+8tJAl0gUpDF0zMGQ/+nT+vckEgvMrxJ++9OqQaDfVaJcB65Pm8HvHPoPpxpfStQ2WrVj+Zb82hY4iHHKvtaY0UvuLEx+425v63VEtET8WsQpO+6RvpQp2MudESvlK1cASPr8+nbSB+9fFNueWrRmbOi5MF2IB2954rJksUJJZsOjtrb7EsnzAaQM9k059sVYv4m5MT9t/L0y4smOeKwHyixYlX+wv8TA== 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=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jFBoh6KR0lmeOT7GjmjNMg12YPSIljiVYswPwiAaqeo=; b=WehgqxNIP2T5yCHoQEbMGH5fOQYaReSsuMRTzwgesaVLNPJpOHyUe9/bmfVFW6LOpEWXRvE/WHpXZLV/3fEFI7OjvngVyVI6sszIidaQrdwyPvFKKeSUygtn0Od5v4gBfizbCPXpb49QR4VdAE3TVlUO/JjaFuoxhxKUh6i6n9o= Authentication-Results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=amd.com; 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:40 +0000 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:40 +0000 From: "Kirkendall, Garrett" To: devel@edk2.groups.io CC: Eric Dong , Ray Ni , Laszlo Ersek , Hao A Wu Subject: [PATCH v5 0/4] AMD processor MSR_IA32_MISC_ENABLE Date: Fri, 19 Jun 2020 11:56:25 -0500 Message-ID: <20200619165629.9545-1-Garrett.Kirkendall@amd.com> X-Mailer: git-send-email 2.27.0 X-ClientProxiedBy: SN6PR01CA0024.prod.exchangelabs.com (2603:10b6:805:b6::37) To SN1PR12MB2352.namprd12.prod.outlook.com (2603:10b6:802:25::13) Return-Path: Garrett.Kirkendall@amd.com MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 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-Mailer: git-send-email 2.27.0 X-Originating-IP: [165.204.78.2] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 454c1a10-6a27-43cc-d90f-08d81471bcc4 X-MS-TrafficTypeDiagnostic: SA0PR12MB4448: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-Forefront-PRVS: 0439571D1D X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: J6NBPQi0F7QZVgQnc++RKGlXasyJkWEG4X18C+903yBVl+2M0YuUJdjbAqkzffI6jKjty7WwcwQwaazbKZ9HOnvEURoa4JW7btErXDhA0cwwVi4T7Jft1LJDiEyuQEZvMf6JhBqnAY7TX7WtNH1UweO8fOpu5LeSXgJwv+dlF6Zwzo9dV7gAcBAhQDvLpyVX+6e4kxUzcvpJw1JOZWUjzJ5wM5hYH9nD+n3veO3BbW7otAwtypJuGKTU+oKCB68qnpKXMn8U3ULqenSalF2gDoC2UkcnF3BC6nBVrINyg8Ch9g1w4veOUCpx0sNcIuUZY6/22s6gEQZRdGhusswDcCdTAgWCYL8yPAxosa/yEzkHxni/puuIySzGxd+aoSqL3tlezJrUyy+Ed40bdj3W4Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN1PR12MB2352.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(366004)(346002)(39860400002)(136003)(376002)(396003)(83380400001)(478600001)(52116002)(7696005)(66946007)(5660300002)(6666004)(66556008)(66476007)(86362001)(316002)(6486002)(186003)(26005)(4326008)(8676002)(19627235002)(2906002)(8936002)(54906003)(2616005)(966005)(1076003)(36756003)(16526019)(6916009)(956004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: hh0P0uCqbLnPZtYl0NpB9S/ft/aI/VJmZQWl/jlLNoZAwx/+ni3aocG5Ku/55ghdgTmP5VB2g7yjfeSQeZMBA0w0YOR17sUUuVI9zu84EdRpHozlNPZyXtHGrYsnNYzFgVGxZbGhLmMU3S19CncDFITZivijxTWiC2JT8C2jHpYULbAxBEysGWcFcQ940k5x1yWnlrEzCi2eIj4bJ+aPtXqUKYedeMC8LNJILfMkDwc5K0VGyyak20/hQcsmJc18DsPGtsXnpB6qve8G2RYsNWoEzmUAW29pncLUqBliEHqANFHYgXxWLiM3sL8lWkPQ6tHpN89m3pXUF29/lALEzhmQrDRLRwVLz8rrW3X2+A99YryJyUqFj3frtCYjZLn76LpbnJVG/qvK4NPOaXZmn9iiUYwUDLP4U0CDcXkyTXUo9vAqkTUPeldfYn0GH9Xcb3e0t3FfenKsGff8vjxAZ+r86FD2fvnmU6i8C9mdTQo= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 454c1a10-6a27-43cc-d90f-08d81471bcc4 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2020 16:56:40.5751 (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: KiXJxMa8bmdYIBb8WHlXpQ6RvUMHPIRNMShynRWRsauUFm0pFcIt7cOUw0hu2gSgfsxqw5/xgDAljj7z3+a24w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4448 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain AMD processor does not support MSR_IA32_MISC_ENABLE register. Accessing this register on AMD causes an unhandled exception in SmmEntry.nasm and a subsequent failure to boot since this is too early in SMM path for the exception handler to be loaded. 1. Prepare PcAtChipsetPkg/PcAtChipsetPkg.dsc to move StandardSignatureIsAuthenticAMD into UefiCpuLib LibraryClass BaseUefiCpuLib in UefiCpuPkg. 2. To distinguish between AMD and other processors, refactor StandardSignatureIsAuthenticAMD into BaseUefiCpuLib. So there is only one copy in the source. 3. Skip manipulation of MSR_IA32_MISC_ENABLE register if running on an AMD processor. Tested on AMD X64 hardware. OvmfIa32 and OvmfIa32X64 on Intel hardware. v1: Move StandardSignatureIsAuthenticAMD. Handle MSR_IA32_MISC_ENABLE v2: Incorporate Laszlo's feedback v3: Typo, not sent v4: Patch in to add UefiCpuLib to PcAtChipsetPkg.dsc v5: Patch in to add UefiCpuLib to SourceLevelDebugPkg.dsc Garrett Kirkendall (4): PcAtChipsetPkg: PcAtChipsetPkg.dsc add UefiCpuLib LibraryClass SourceLevelDebugPkg: SourceLevelDebugPkg.dsc add UefiCpuLib LibraryClass UefiCpuPkg: Move StandardSignatureIsAuthenticAMD to BaseUefiCpuLib UefiCpuPkg: PiSmmCpuDxeSmm skip MSR_IA32_MISC_ENABLE manipulation on AMD PcAtChipsetPkg/PcAtChipsetPkg.dsc | 2 ++ SourceLevelDebugPkg/SourceLevelDebugPkg.dsc | 2 ++ 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/PiSmmCpuDxeSmm/SmmProfileInternal.h | 3 ++ UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.c | 38 ++++++++= ++++++++++++ UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.c | 25 ++------= ----- UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.c | 25 ++------= ----- UefiCpuPkg/Library/MpInitLib/MpLib.c | 23 --------= ---- UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c | 9 ++++- UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmiEntry.nasm | 19 ++++++++= -- UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm | 20 ++++++++= +-- 14 files changed, 117 insertions(+), 74 deletions(-) create mode 100644 UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.c Changes at: https://github.com/gkirkendall-amd/edk2/tree/smmentry_nasm_skip_msr_xd_bit_= on_amd_v5 Pull Request: https://github.com/tianocore/edk2/pull/715 Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Cc: Hao A Wu Signed-off-by: Garrett Kirkendall --=20 2.27.0