From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.107.93.46]) by mx.groups.io with SMTP id smtpd.web12.5359.1588856830404711144 for ; Thu, 07 May 2020 06:07:10 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=GjZbN3hc; spf=none, err=SPF record not found (domain: amd.com, ip: 40.107.93.46, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jX6XydrEI+cbIisa+zT94eOyeoROf/vndywt/EQwa8UVauHdeerk+Ggmb2K36n134fA3Lx0sWKkBOf5RKOEx8hgGDyNwKWXMgyPtJQNSsfZsTrXqmlcLz/++R6g8uuvcDzb0f6oBWoLaEd34q6jDo/4xL1HrpuJms4x5eoaJ290lU+1xEVSN/LhrWMTUNyCcZ1EcHoeXO+AaxsWgfMeg+gFLd1iK61vfRAs0keVNaESL2ewi5glxvc0Rb9F0shZGyCi3PPxdtq29GX2qv1gQiX5Ch9mx/INfLPUkhLwS3+u6xCLc0rZ3BlBoilakabzSSQ+JfwoY+O+XJTIltFEpDA== 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=6bclM3QZeuzp4DAA/yvxC9a0s0GZlw9AD20woLtvev8=; b=j/szHmOp2478qdqVeWP4pYhxsmy9ZsQ++V/5577t52RPUw/8jwoEPrIMF5Y0gmGgjOKq48OhHGKswc+deUEoYuVi2zqiIQ6gduwPEs2aH5prc1B+tTkqXHDKrz7z6r4Z70EFMaEfLQhKfxM2U2kuIgvYDoBBxGbQ/S5r8SZG6QWziggnFDgQ0clNlfCiulxqw78SAUJb8juVPebYJNFSiZjbebcbhQEmNgiWi0OMxG5KNueW+5O/f28FayhC2+71o3x4h3g+iLrURPHnVrv4b15qOiKpqKF0uHGfD5X/YTgzAEnJdhOZP8l24Eimt+Q1JVeK9bjgsieGT9ZnPosADA== 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=6bclM3QZeuzp4DAA/yvxC9a0s0GZlw9AD20woLtvev8=; b=GjZbN3hcvbyvPEl25aD82zgagu/fIgHhVGJ8eLRsT+94f+CqbfKUQWeOLdq2GdGBgGM/nDVJdCUanKxDKOsWkkv6qEJ89LgnhAtcLNSlGzZrR1oUVdA21sphZKY8HMIua3JMQXUMtHfPzW6c9/8yxdtsA1jwdPTTNY8xtstB9ws= 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 DM5PR12MB1355.namprd12.prod.outlook.com (2603:10b6:3:6e::7) by DM5PR12MB1819.namprd12.prod.outlook.com (2603:10b6:3:113::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20; Thu, 7 May 2020 13:07:08 +0000 Received: from DM5PR12MB1355.namprd12.prod.outlook.com ([fe80::4ce1:9947:9681:c8b1]) by DM5PR12MB1355.namprd12.prod.outlook.com ([fe80::4ce1:9947:9681:c8b1%10]) with mapi id 15.20.2958.034; Thu, 7 May 2020 13:07:08 +0000 From: "Lendacky, Thomas" To: devel@edk2.groups.io Cc: Jordan Justen , Laszlo Ersek , Ard Biesheuvel , Liming Gao , Eric Dong , Ray Ni , Anthony Perard , Julien Grall , Brijesh Singh , Andrew Fish Subject: [PATCH v3 0/3] XCODE5 toolchain binary patching fix Date: Thu, 7 May 2020 08:06:47 -0500 Message-Id: X-Mailer: git-send-email 2.17.1 X-ClientProxiedBy: SN1PR12CA0109.namprd12.prod.outlook.com (2603:10b6:802:21::44) To DM5PR12MB1355.namprd12.prod.outlook.com (2603:10b6:3:6e::7) Return-Path: thomas.lendacky@amd.com MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from tlendack-t1.amd.com (165.204.77.1) by SN1PR12CA0109.namprd12.prod.outlook.com (2603:10b6:802:21::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.28 via Frontend Transport; Thu, 7 May 2020 13:07:07 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [165.204.77.1] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 256bc06f-25f2-4d9e-5d2c-08d7f2878bf8 X-MS-TrafficTypeDiagnostic: DM5PR12MB1819:|DM5PR12MB1819: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-Forefront-PRVS: 03965EFC76 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nPs+t7rMQvl0Knylg8M+Ru3H4YY0U5D34LVfXU8s5PlF9IKjPf7FedJs1TsLQBOZxu2+Su/Ntm6QvisKCNpnrzNTbVBihP3qEwmuPsiNT6OszopvmpdaIpbKf4m6JthjxHeid3rxvd5ke4zHHxUst2IwfQL9GXxGkEuuL2HY9oqtHZDX1fNz5jL7N8hfbr4eGUChlZCyG5YZz8EvnDTDNiDn3ATZZrHKIGedHew1WdHP87CxRROT5rwzGwsYzMPLaoH88uuVM0yrxuOJKYNlISy6YN4GeOaCWmr6q3yCZR9GJxqjdRLuq1BQd2ThGj0BV7Ir0hAKdiC27jHCKkUWL9rwdznQDR9oGGU5B0hu2qyLMsHmGF8VRrmiNSWeoWg5ndFYdUfImKfOsyMU3sPLP2GlT2P0VK1eloyK6ae1bN8bQf9OnWXayG/Ze3PRJilIL1XkSKJlCX+cyz4TTxrJmdiXWmwbnedwKNyeaq1X4fIse+7mfrYpY+8J15pTYE+ihC8v6WA5YUQFiMgJHCSNFNmJn93F1IsaN+C96TdTaS+DzSQk7w9L2Iha/MtJNGJZOqDPZ2aBEckKK0mC95seGMd5o6PNAsAcjt2xNT6MnS8XL327AuMSYyT4lrQE+yE/Y7dRVRJTlkMGkb63/e7sYg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR12MB1355.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(366004)(136003)(39860400002)(396003)(376002)(346002)(33430700001)(33440700001)(86362001)(83320400001)(478600001)(4326008)(6666004)(66946007)(83300400001)(316002)(83310400001)(83280400001)(83290400001)(54906003)(36756003)(966005)(2616005)(956004)(7416002)(7696005)(26005)(6916009)(2906002)(5660300002)(52116002)(16526019)(6486002)(8936002)(8676002)(19627235002)(66556008)(66476007)(186003)(136400200001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: GYzPXjTvILv8qraJdF/oaruc7CvXwLIAsKwh1HE/mojSEHH1iXbuZxJtxuO9vHCqmNYtX2gb0JKKofLo4ZmCtFhSo1cicNOzP564rl+SdGswEEu8/g2YS7O92/E4DkWJjlWToHuMehIUcJOELFt2b1E81yOXheEDuc6s3QN+1VkjkDkJL9Ey+Rttms3e1uWSF6AklHaRhJsqEdmPO8fP3zYN/18PdsZqoHgcHkUe27r/+XpglP7q54Ng8pKD+6Fl8o5CpXLrpSf2RYjlJQ0uf9puLTjx4Udxcnz5qo6noNFgoAQk5He1Nim5/AGFIXaEFdjjrRAwEK9hs3Pey0RwPLLAo7JzeIwgHHiZRJaqaHc+1n0Aszre04TnXMUGECCcfrig2E+aUuJ5Yn3Lp37ige+gf1IYli0qITPxOHFQe2jHv2oIV5jFYpVY+oGLK6lxTglQLt8EsJy90DDAfjTL42tFgzxK9dXgqU1/E4qg+/T0xmM2cb+fKurMzp/V/D81R7kMSXgho3PPBNGZ972x7cOKhn7BSAJHYeyXjXb9amrLQgz5s67bI42jgx3nTPDLBJFGnlNr3P2Gvc85rrHkbagsTiqvHtmWkdjotlPN6ERzxBxans3uvtFnBXVmCKzm3apiAq/ATMZIhERX8OclIrrFWcVOrMSKLO48MyFYjAo6RNgo5ea5sdZk/GLgP7WxqeldA5Y4K26GIGcHKPjePk+v4xAN7hbHovu1ylKBfANbkSwPmJyBrrKMddQ0MVRHr/4Mgh5efB47nJmmAhG53d4xs/Zab5zrLuMf08eHbRQ= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 256bc06f-25f2-4d9e-5d2c-08d7f2878bf8 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 May 2020 13:07:08.1470 (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: 6jBDDLp0oaDu4CXvb2PMJGnPrIujk+LoY0XCJJbkD5G1kjYwo5xXYXdBt6KivfzrgUNpphqpEa2hkekr2mW/Kg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1819 Content-Type: text/plain BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2340 Commit 2db0ccc2d7fe ("UefiCpuPkg: Update CpuExceptionHandlerLib pass XCODE5 tool chain") introduced binary patching in the ExceptionHandlerAsm.nasm in order to support the XCODE5 toolchain. However, the CpuExceptionHandlerLib can be used during SEC phase which would result in binary patching of flash. This series creates a new CpuExceptionHandlerLib file to support the required binary patching for the XCODE5 toolchain, while reverting the changes from commit 2db0ccc2d7fe in the standard file. As the Pei, Dxe and SMM versions of the library operate in memory (as opposed to flash), only the SEC/PEI version is of the library is updated to use the version of the ExceptionHandlerAsm.nasm that does not perform binary patching. This is accomplished in phases: - Create a new XCODE5 specific version of the ExceptionHandlerAsm.nasm file and update all CpuExceptionHandler INF files to use it while also creating a new SEC/PEI CpuExceptionHandler INF file specifically for the XCODE5 toolchain. - Update all package DSC files that use the SecPeiCpuExceptionHandlerLib version of the library to use the XCODE5 version of the library, Xcode5SecPeiCpuExceptionHandlerLib, when the XCODE5 toolchain is used. - Revert the changes made by commit 2db0ccc2d7fe in the standard file and update the SecPeiCpuExceptionHandlerLib.inf file to use the standard file. I don't have access to an XCODE5 toolchain setup, so I have not tested this with XCODE5. I would like to request that someone who does please test this. --- These patches are based on commit: faef5a367c83 ("ShellPkg: acpiview: Check if SBBR mandatory ACPI tables are installed") Cc: Andrew Fish Cc: Anthony Perard Cc: Ard Biesheuvel Cc: Brijesh Singh Cc: Eric Dong Cc: Jordan Justen Cc: Julien Grall Cc: Laszlo Ersek Cc: Liming Gao Cc: Ray Ni Changes since v2: - Updated [Components] section of UefiCpuPkg.dsc to conditionally exclude SecPeiCpuExceptionHandlerLib.inf for the XCODE5 toolchain. - Added some missed Reviewed-by: and Acked-by: tags from previous versions. Changes since v1: - Only apply the revert to the Sec/Pei CpuExceptionHandler library and leave the Pei, Dxe and Smm versions using the binary patching version. - Generate a unique file GUID for the new library INF file and create a corresponding UNI file. - Remove any references to SEV-ES (original patches accidentally submitted from wrong tree). Tom Lendacky (3): UefiCpuPkg/CpuExceptionHandler: Make XCODE5 changes toolchain specific OvmfPkg: Use toolchain appropriate CpuExceptionHandlerLib UefiCpuPkg/CpuExceptionHandler: Revert CpuExceptionHandler binary patching OvmfPkg/OvmfPkgIa32.dsc | 4 +++ OvmfPkg/OvmfPkgIa32X64.dsc | 4 +++ OvmfPkg/OvmfPkgX64.dsc | 4 +++ OvmfPkg/OvmfXen.dsc | 4 +++ UefiCpuPkg/UefiCpuPkg.dsc | 7 ++++++ .../DxeCpuExceptionHandlerLib.inf | 2 +- .../PeiCpuExceptionHandlerLib.inf | 2 +- .../SmmCpuExceptionHandlerLib.inf | 2 +- ...=> Xcode5SecPeiCpuExceptionHandlerLib.inf} | 13 +++++++--- .../X64/ExceptionHandlerAsm.nasm | 25 +++++-------------- ...sm.nasm => Xcode5ExceptionHandlerAsm.nasm} | 0 .../Xcode5SecPeiCpuExceptionHandlerLib.uni | 18 +++++++++++++ 12 files changed, 59 insertions(+), 26 deletions(-) copy UefiCpuPkg/Library/CpuExceptionHandlerLib/{SecPeiCpuExceptionHandlerLib.inf => Xcode5SecPeiCpuExceptionHandlerLib.inf} (64%) copy UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/{ExceptionHandlerAsm.nasm => Xcode5ExceptionHandlerAsm.nasm} (100%) create mode 100644 UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerLib.uni -- 2.17.1