From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (NAM02-BL2-obe.outbound.protection.outlook.com [40.107.75.47]) by mx.groups.io with SMTP id smtpd.web11.10052.1592493784863331489 for ; Thu, 18 Jun 2020 08:23:05 -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=eIOEaNIW; spf=none, err=SPF record not found (domain: amd.com, ip: 40.107.75.47, mailfrom: garrett.kirkendall@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DLvqn4KicGDkOqTEHumNmJm1j1XaqMe/IfOZFr8DeWXuNz8IyFMeGS4kW+R6lKOzzQ8HVlr9ys+lwqrIyOLnoI45kw3ECoPOhVj5ABv7FzX/QQx70steoL6uOSGqypLSymcx6EZkqjjs63NSyUDod0Ec3h6+Qr38p3xiMlvhbH2zCfMiL9atIMs5Q3dSnmQskG+5q6oIkdje+Ind7lzlUhsYr/81ykCeMUx+CHe8BFYJJAvcDKMIxMII3K47DvkxqIzEbTsiyw3uSMdY1mZ06CAYpmUmThJnYnqvvNtqfRX8ZUEy90ADQwEq8gqEdbPlUrK9vskw0eDOJU+GNPd2gQ== 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=aOE7n0XkA/3SpihxMc1JAPPzaljq69HQEWEzjFKXuHE=; b=CIql2QGlk1hEUmfEyrbY2z5xQMNYJ8tbCNtYA36xwjhnoZBALj6nq3ZHfj8W13V/SWLqne1lLJR5kWMVNoJc4kjTMejkCO9D3YVpb31orc8VV1LvTZLfNHZ3D33EbdHZOHWbPVt+Zl2xolQ/KyGz+b3iPh7sUqxeh0bouxSm7DFZ9XZCBbieRfla8GdZvfbq1kabgyrefmya1InQ9zubJglCN6y1Sgd92XxYzVeq7v4slyBFDPi2TWv0ihIgiywwZqAf3bv1/T1gicIEqCWhZ4A46dilGLD/llQAjR8Nr3VXnxW/C+ASqPivecNtkZzpIp86LwtF3cPowlpboSOJ1g== 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=aOE7n0XkA/3SpihxMc1JAPPzaljq69HQEWEzjFKXuHE=; b=eIOEaNIW8wSCrEIDpseriY9LJzHgYkR+QNg/rSRc6JXfZ0ANBe/rbt9Qv/xagAvSeiIo4pIRxoOw47cIDnFfA+Zxm6C56mYFXZUdyeIzLX2rcjO0ZdNPO2YTDQNBPltFS4o/QFSvG2fByCBHuZSLylX8CRZlZNUOD1zF2QSO6NY= 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 SN1PR12MB2573.namprd12.prod.outlook.com (2603:10b6:802:2b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Thu, 18 Jun 2020 15:23:02 +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; Thu, 18 Jun 2020 15:23:02 +0000 From: "Kirkendall, Garrett" To: devel@edk2.groups.io CC: Eric Dong , Ray Ni , Laszlo Ersek Subject: [PATCH v2 0/2] AMD procesor MSR_IA32_MISC_ENABLE Date: Thu, 18 Jun 2020 10:22:43 -0500 Message-ID: <20200618152245.6483-1-Garrett.Kirkendall@amd.com> X-Mailer: git-send-email 2.27.0 X-ClientProxiedBy: DM5PR20CA0042.namprd20.prod.outlook.com (2603:10b6:3:13d::28) 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 DM5PR20CA0042.namprd20.prod.outlook.com (2603:10b6:3:13d::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Thu, 18 Jun 2020 15:23:01 +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: 29c4d399-bab8-461d-f33b-08d8139b7dbc X-MS-TrafficTypeDiagnostic: SN1PR12MB2573: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-Forefront-PRVS: 0438F90F17 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9a+HfAIJlEGxT7AfPaqGUp4XDjU+zekSOgjCQPR4rsqTpho+5zWa5rV1mkqdoM1ielz1EG4ZmswkYfFHxz7Kn+YelGhF3JP7OqNeVsr2AHd1IrbECU2VXrqgmnGrDW1HCdimyzJmcoI9Dwwq/lQqbdV0RG06KYkd+aOP4+5zIqCotn7nIuu2WmPe4+7EH1D9nSTDfat7nRUAHp7HK46Mscwy3Uk6fVPG2/LRf3rgXOz//RQ8tOkUaI/otdCh9DM0R3fYf39iii1opyWNRf7pngEPUQo/4dEoX3T/Dh6rcZVgO4yMw9fDQcp5Sw5k/DvjsS/5CXPWULpJJ1apTaRa2ndNm4NQARNUJ/EX/5pcpfhb7SpEpjpSuUwi4TmWtLDFE1A7SUXVx9rL2i/40bWoDw== 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)(39860400002)(376002)(346002)(396003)(136003)(4326008)(1076003)(956004)(6666004)(966005)(478600001)(52116002)(7696005)(316002)(54906003)(16526019)(186003)(26005)(2616005)(86362001)(6916009)(66476007)(8936002)(8676002)(83380400001)(36756003)(19627235002)(2906002)(66556008)(5660300002)(66946007)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: M3acvgsdjSbkZrtX1tm6ZEjrlX/RIcSB+KfIZgzYl9jxuiZx4y+8qHD8i2FbyuQ9iHkcBqnMJlw/LZGmKJMv5ZHYumvJTr4SVQAFGS2dXwq2o25xxWov4C05yJPz/Jb9uIxFHEMj+UwYxlNyjmrm0h7eeV0hLlFFfXTg1L+mRO3cQpEctRbo8Hkd60Vhw5y0thWRej6kDGUo0zjIvrS16AftCGrxQV05yYfSTup+zCM6/2ebkLrKJjWReiCb7bdK96PZIDDOc0lm+KC3Y9Iw/TtJ3+N0NSd1L9N7VUsab4UJp/vij6wp+BKU7HU36xV1tB0J3g4dK2IRPAUrwbciO03rZEW0qGFFxnR4rrK27hvBAAW9QoKyQ9p1VRPaFxbn8kj/tlQS1cGW4MTuru3uma4QAgxWsG+W5Dh75NmxreB6yi39/8lZF/I1ssmtN0vRlj01uatPhmEcpdCTzudwrSJFaXcJcPyHWXs0MmSaCnQ= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 29c4d399-bab8-461d-f33b-08d8139b7dbc X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2020 15:23:02.8216 (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: dAU5NtMKRnWAlwkF/5c4mOiElUjCG4tq2POT3KdkCKt3UYtTqsSZUhp/QJna3hF2AvgIphtVaXFSWXaLmOxMRg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB2573 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. First, to distinguish between AMD and other processors, refactor StandardSignatureIsAuthenticAMD into BaseUefiCpuLib. So there is only one copy in the source. All changed modules already include UefiCpuLib either directly or indirectly so could not easly split first patch. Second, 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. Garrett Kirkendall (2): UefiCpuPkg: Move StandardSignatureIsAuthenticAMD to BaseUefiCpuLib UefiCpuPkg: PiSmmCpuDxeSmm skip MSR_IA32_MISC_ENABLE manipulation on AMD 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 ++++++++= +-- 12 files changed, 113 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_v2 Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Signed-off-by: Garrett Kirkendall --=20 2.27.0