From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (NAM11-BN8-obe.outbound.protection.outlook.com [40.107.236.72]) by mx.groups.io with SMTP id smtpd.web10.7785.1592575995384894727 for ; Fri, 19 Jun 2020 07:13:15 -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=qQw9rxHq; spf=none, err=SPF record not found (domain: amd.com, ip: 40.107.236.72, mailfrom: garrett.kirkendall@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ez5Q6rA7EgrUk9IE3mymcz+1aq/qF0IyONNu5gWe9NVjxNlC/DufHRU4i7wNc1PQ7wkhvAF4udyphPzJY5u/FP4OPtUum9io3u2k3UnqU5QJoqy1ToR391QJLvRcChzC9UcdjEQgUMl0L/X47s4CnqlzHwo9mrpIS+11ugGsyan7+KLjidrnGSeUZM56yMGe9K9oo+/eDx84pBvzyEs1ZM4TyJGi39Lt5I5kr/AlKEHq8a2xB0Vrxdjv/8jwh0a+SezRBBv+SVOS4CD942IxpB81XLK5rRGo1JxKezyxkquBrHtGZAbtG2FV7sgkXu9q+abgfk7CK2R+/05Jk4J0lg== 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=dt+RIwPKOsabFxrA/Q23rhsoOyVML2fAy9obrsuBvSQ=; b=diR9FSKAdpqYLRXy9s7pafEjfItniJmpRAusdDxd6dWJfvOPjrTPHs0YHleJWSTDUQz1dq7969KKvF6DzZMehbLIlyeg2l0oesN8IVmy6P3LBzahnMXcVTM/u94YhVXXOSWJdr6up6xZ9jPCQxftaVUpGi6YXVvC9COLhCLuc03RxP95Lp1weaoq1lQN7Nc8L3K+F7bcJAmxhLBJB5RuDNW8nU9Fl0xqyziRDw2YqOuqozLd3hVt5g4M8HZ/37nz8TccrpDore3LsufLrGXMfxfAB05CzId/sddIxJhtRwLx+NACjIpEPZtz5EYPpOV2kEqOZS/FwXg4t/RQq9WfDA== 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=dt+RIwPKOsabFxrA/Q23rhsoOyVML2fAy9obrsuBvSQ=; b=qQw9rxHqampMZ8dOiCNoocygVP/NoDom3obVDyfRxkEQzTA55HNTXSF7OObFYDS+WP+OjpAerCwPIGlGf4OZhyXWIw1DNexOVJaO+zVgr+lWm7DO7tDNqk+Yc01V6xLOMYyxbKz9dUZzlx5de/1lQlQujIj6L4gC1mm6awWU/Tc= 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 SA0PR12MB4576.namprd12.prod.outlook.com (2603:10b6:806:93::13) 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 14:13:14 +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 14:13:13 +0000 From: "Kirkendall, Garrett" To: devel@edk2.groups.io CC: Eric Dong , Ray Ni , Laszlo Ersek Subject: [PATCH v4 0/3] AMD processor MSR_IA32_MISC_ENABLE Date: Fri, 19 Jun 2020 09:12:56 -0500 Message-ID: <20200619141259.8828-1-Garrett.Kirkendall@amd.com> X-Mailer: git-send-email 2.27.0 X-ClientProxiedBy: DM5PR2201CA0022.namprd22.prod.outlook.com (2603:10b6:4:14::32) 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 DM5PR2201CA0022.namprd22.prod.outlook.com (2603:10b6:4:14::32) 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 14:13:13 +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: 1db6284c-3e6b-440a-d5a3-08d8145ae76e X-MS-TrafficTypeDiagnostic: SA0PR12MB4576: 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: 0AZMPnoPxYdJ+z9OziU8A18d9iwby5HebMJF0wb/MfLF0P8EVdBy+RdjXPxHgBo6JHlLTZ3BigZHocyH8J16SC3xuIZ3PIxBrlhJmdg391keSUZF7aMuv/uvuBmphUOLAvu+dVhGmDXxUFiB47U8Y9QCBAz3WUCSow5gussp7qF86h28++FDkYGgS83hbQAypfSxf1KOht62qm1zaggF1VEo/VmRPj8/Lw5UZQJExrzkpZr/kY74mkwcnCe/cJiVG3lT/MLytNO6mcbgzFZtQXpqj/hqi3xhKEmkrPYHqrP+y5m9oc+Q6bdbWXODOK+B1nuyXtS5AATlmj60Wc9MdrlkeuoSXfTWA9dQF7KjGpQaF3MGgq3vkU1O691uXhSSm4W+PwqRw0zfC9dFGeFZyQ== 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)(346002)(396003)(136003)(376002)(366004)(39860400002)(54906003)(186003)(316002)(16526019)(66946007)(8936002)(26005)(66476007)(2906002)(66556008)(8676002)(6916009)(83380400001)(966005)(7696005)(52116002)(6666004)(6486002)(1076003)(36756003)(86362001)(2616005)(956004)(478600001)(4326008)(5660300002)(19627235002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: wYqUIzqanrRO1CRjKREHfBBr/Ll6zsbpJ1s14TBsWWNsog5x6lnEDu1hWqOD9Cxmz5qoLuxgu3gglXQc4H85uC4KDi7SZkB5cVpQz8LVpdJkXvxwmvviF6/NSI+QW97Hqcoe7TkW7BSfqlW2S1umymDvAMO444udKocBLxExLUiT7wO5lyaoSXElb19XphzI+7dcrE4Bxo6pAWw7ObrMb9VkklMo7WoCxZsCYs7jPQPc9KHVTov7UObBDR7124DGdsoMI0P0WphvJbv44TE/9/lBdV6y9euI9MLNsS3Lh7SAsAdtMoJPQtyuUoFPSwUK45Wgd2Cf2kIP1m5puXteFtV5sxHak4bQN813XgxGqqawHAa/B3b5pP9J2myqrVRo1Py93N8BHE7i7f95j5u05k01rLn1LPPJOkMrbfaqlzm7qShHW03lCEfivxFQQkGuxeELFhWMW+hcgJLjmgRf5ZX8bW2Yo3at1/H/KK05g24= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1db6284c-3e6b-440a-d5a3-08d8145ae76e X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2020 14:13:13.7406 (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: 1MEWee33kzgcJLqEjYy2MuQq6sf4hYijUxS6uCx37EU383q4xtGFwFwdvJhCoQ0WqWjVoKAZm85S0T10ODTkuA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4576 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 Garrett Kirkendall (3): PcAtChipsetPkg: PcAtChipsetPkg.dsc add UefiCpuLib LibraryClass UefiCpuPkg: Move StandardSignatureIsAuthenticAMD to BaseUefiCpuLib UefiCpuPkg: PiSmmCpuDxeSmm skip MSR_IA32_MISC_ENABLE manipulation on AMD PcAtChipsetPkg/PcAtChipsetPkg.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 ++++++++= +-- 13 files changed, 115 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_v4 Pull Request: https://github.com/tianocore/edk2/pull/712 Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Signed-off-by: Garrett Kirkendall --=20 2.27.0