From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (NAM10-MW2-obe.outbound.protection.outlook.com [40.107.94.57]) by mx.groups.io with SMTP id smtpd.web11.3201.1588364277426705512 for ; Fri, 01 May 2020 13:17:57 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=devca7zP; spf=none, err=SPF record not found (domain: amd.com, ip: 40.107.94.57, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P9X4+UEdz0ziZ7iCKK+BBCi5tkpgpli9CcWGNprcPMu4Hhpg/USTa0v7wFjYgwyj1yEtFmZInTmJ2JIgnOoQKu0iPdfzwLDciyE3Jn07w3omV27vp0mhmZoHQJzLaXv7Z3k/jZvWdqK7kwbaWdVhzTq/Bth2gkU+rkwoHPzjAOJ8tvzopDbLaPGKzOXT7p+B8DsRdAd1lf/f7pjg53/rJH3aZlJmZda/Hte2m4YqN6dkSEezchG7pLMSqBQlSTsuYvx8iwSFDBHbSF6YJEATK0Fy9/atOeVXWd8OOtq3sxIjjiTQ7jtZoLs2SzjsfS6+tEjP7ZEj57iOlW2Stk8yeQ== 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=ovtNrBOpQrUfFot9f672yAoSmjiHt4zI+2uZLmb1tyQ=; b=TdtVzaXgvGd3/8y1gkXVYJIMjn1K/o7o3JtMAg1fl0Wnn7TZESbjFzYOV175Hh/QqvwkPfLtnAd7EHSHRA8u/KhptT+lbrXntVyQ6CQrtDAoJ+Yo/0s9FPuNTZb+SckyhTO1ZRoRU83fpOLcxYH4EW/FcuDpPIxv87x/DBHiPEpE8ZqWiNNwO4HkCMGjHxCfOzwdtwRVhvr6lG2jS/lm3+kw6uhux4ThAfrcXnjQmOEln6WCWwKuE+fRWCMQsq0F5u7b3csY0yT+ZjqA3mOJLyVSls/sqRFzoeh95PgyIfeE8ZE2bkM2sK2+8PNCFrPm4nd4HxCK7FGXXWjKYT1W8A== 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=ovtNrBOpQrUfFot9f672yAoSmjiHt4zI+2uZLmb1tyQ=; b=devca7zP91vsWOEj83tDEev5nwOtTLbubdPke9ka2WV/B8AEf9vMOoLUtDThzgamHrlEHxVtweDFqH1LlockZ1YSl9LhiMvbwVuWvtyC/c9/nwuK+qGIg9oeAd/krEjKJmW/xxzv3GRI/q7Bcznew+GSkg/54LhDuMMCg8mnmSs= 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 DM5PR12MB1676.namprd12.prod.outlook.com (2603:10b6:4:8::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.27; Fri, 1 May 2020 20:17:54 +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.2937.028; Fri, 1 May 2020 20:17:54 +0000 From: "Lendacky, Thomas" To: devel@edk2.groups.io Cc: Jordan Justen , Laszlo Ersek , Ard Biesheuvel , Liming Gao , Eric Dong , Ray Ni , Brijesh Singh , Anthony Perard , Benjamin You , Guo Dong , Julien Grall , Maurice Ma , Andrew Fish , Hao A Wu , Jian J Wang , Michael D Kinney Subject: [PATCH 0/4] XCODE5 toolchain binary patching fix Date: Fri, 1 May 2020 15:17:37 -0500 Message-Id: X-Mailer: git-send-email 2.17.1 X-ClientProxiedBy: SN1PR12CA0068.namprd12.prod.outlook.com (2603:10b6:802:20::39) 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 SN1PR12CA0068.namprd12.prod.outlook.com (2603:10b6:802:20::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19 via Frontend Transport; Fri, 1 May 2020 20:17:53 +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: c86e96f3-202d-47d0-8e07-08d7ee0cbb32 X-MS-TrafficTypeDiagnostic: DM5PR12MB1676:|DM5PR12MB1676: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-Forefront-PRVS: 0390DB4BDA X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: P0yspeqprnAHsLisvbAbCT3z+sBWlZKrfQil0tr0vr6HnxXx3Zud+DZRFhWOMuADfhYwm6zT9mw35pPovlaSyxT22vKdfLNofCqBa8fJ5UcxKhShAMEs6eXzl2JeYKrh8EUUGGt8AoVYMWk1rpl9nGk1C0jnQWDAqSX0mKRn3xT1Rk0xuZqy6VIaWp6Bfd5RufVWhT+VEGCbs5ClIgj5K0ZVNcnolbQVzxddYZ8so37Nmo2tHx1b/Yomf39IA6yKqQhwktEActlmnCpgElVIEmxZ/UPASpR7O76A4rRS9RW2uMON2mbpUHeDm66nqBy8Tn5b3qpg2aAY47z22abmhwrhaA0/tj58ene0ZzjTdRhzcpmav+8yW5wgCG/ZTQohbrL318R52sLnYabC4kyM0PpDjiqYy91bpW2QlRFI/mXtx+LV+Li1hFeC/aEkBLzexwDBuq49JudsmzfY/2KPs12jGT7JqW3M1HgLKA7UiftzP+hp6nu0qjuaBWIfsLPg6EMJEJhcbegALuFf8Iislh34hq7YQ46geM/7S8xCvgOIVpFUznKZc9wogaBL+0pUrMUKMahc3ixA5flQ8kLzWQ== 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)(376002)(396003)(136003)(346002)(366004)(39860400002)(66946007)(52116002)(26005)(7696005)(8676002)(66556008)(66476007)(16526019)(6666004)(186003)(6486002)(316002)(2906002)(966005)(86362001)(6916009)(8936002)(54906003)(4326008)(7416002)(19627235002)(478600001)(5660300002)(956004)(36756003)(2616005)(136400200001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: r5n+nMpy4PEoDQ5x7+x3ysnE/SJm6AmZSIs5EQib1NeW9lTZTpguKBf4DhjiKpTgX4dV1iCQI5XUQypRdbT7ErqYYTeBTbBo3F5ITFce9dgEh/FbH+GncsjBv0GXSyjOsNDsQ+HPBa5AzTm95e5nGk5r8KG+gXyKsY8bsbICV3MBt69HkrbAWqz4kNFC3VrkB03lntFKOnD7WMCti/THQQiENWKpVRHK8q56lHy5eSRonjGX4DOq2EpipvjUJj2PieimLOLkojq/zNx7ZvXk2qvnTyCp0sM6+ZdhLbZzTQskHPcRNq86ttdB3TtU06Iib6dG4UEX/Z7X9fcqNBsZqFqFTE0wC25wDvH7A4nY3RSEzLxFrErwe0FTrONlOn/ZInulz0/OeeU8Y7c/SeaPtMpS86rRZ22Fm9aYaW0QRPjVQuQtvSOWSEeTDN0viCcrpMDCZVhQUIAvLP4hBC0xOscJpwjrlEOj3HB9qgfe/IqLrz4zhF3MMQf/gRgq8xNKRdNeqEVgpT6Bty7kJF03ueyW2VeP91NwHBrq7CQd+zjzKG0P03bZ9Q5Fm+NeaiM9nMpcExgwAN6IXbXbGwx+z6rxjVM0A2+IKFn3fdMTPX5uu46PwvVvx086RlstpwH2lskk8G5sxzsmjghI2IlwFNxNbXx2VGcSZJOulA5Mh71T0cHY5Y7KORV9hRq6qlq5J9uBavknka0PVLL6qEPMwsKFxjLmdby3tH1X0E66xnlsWe88BbkGtxMQCVpJTEyBNif70sNnfdI3DDEnU/ogfIcTdX1NOE6Xuj55pqoDyvM= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: c86e96f3-202d-47d0-8e07-08d7ee0cbb32 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 May 2020 20:17:54.6184 (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: yr3sRRfGjHYalhjUe9RhkLR59vboC27+mlHbnsOOUE9ncAHcdDTUeepcxKRv2H3dY6iuc+l9mMgbPnwRzo6LbA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1676 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. This is accomplished in phases: - Create a new XCODE5 specific version of the ExceptionHandlerAsm.nasm file - Update the DSC files that use the CpuExceptionHandlerLib library to to use the XCODE5 version of the library when the XCODE5 toolchain is used. - Revert the changes made by commit 2db0ccc2d7fe in 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: e54310451f1a ("OvmfPkg: Add VBE2 mode info structure to LegacyVgaBios.h") Cc: Andrew Fish Cc: Anthony Perard Cc: Ard Biesheuvel Cc: Benjamin You Cc: Eric Dong Cc: Guo Dong Cc: Hao A Wu Cc: Jian J Wang Cc: Jordan Justen Cc: Julien Grall Cc: Laszlo Ersek Cc: Liming Gao Cc: Maurice Ma Cc: Michael D Kinney Cc: Ray Ni Tom Lendacky (4): UefiCpuPkg/CpuExceptionHandler: Make XCODE5 changes toolchain specific UefiPayloadPkg: Use toolchain appropriate CpuExceptionHandlerLib OvmfPkg: Use toolchain appropriate CpuExceptionHandlerLib UefiCpuPkg/CpuExceptionHandler: Revert binary patching in standard CpuExceptionHandlerLib OvmfPkg/OvmfPkgIa32.dsc | 20 + OvmfPkg/OvmfPkgIa32X64.dsc | 20 + OvmfPkg/OvmfPkgX64.dsc | 20 + OvmfPkg/OvmfXen.dsc | 16 + UefiCpuPkg/UefiCpuPkg.dsc | 23 + UefiPayloadPkg/UefiPayloadPkgIa32.dsc | 8 + .../Xcode5DxeCpuExceptionHandlerLib.inf | 64 +++ .../Xcode5PeiCpuExceptionHandlerLib.inf | 63 +++ .../Xcode5SecPeiCpuExceptionHandlerLib.inf | 55 +++ .../Xcode5SmmCpuExceptionHandlerLib.inf | 59 +++ .../X64/ExceptionHandlerAsm.nasm | 25 +- .../X64/Xcode5ExceptionHandlerAsm.nasm | 413 ++++++++++++++++++ 12 files changed, 767 insertions(+), 19 deletions(-) create mode 100644 UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5DxeCpuExceptionHandlerLib.inf create mode 100644 UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5PeiCpuExceptionHandlerLib.inf create mode 100644 UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerLib.inf create mode 100644 UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SmmCpuExceptionHandlerLib.inf create mode 100644 UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/Xcode5ExceptionHandlerAsm.nasm -- 2.17.1