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.76]) by mx.groups.io with SMTP id smtpd.web10.4189.1588782813874018471 for ; Wed, 06 May 2020 09:33:34 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=MHSIBMqQ; spf=none, err=SPF record not found (domain: amd.com, ip: 40.107.236.76, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RBk1+0JdWRyPXBjNC40cq/ActruRCJ6qf0xofvp5e6VMTq//nQf8LYSoJjWc8j+XYdi5Eaz4inSP8ThZ6qKklPO1X1oH6Mufk9EbsCPiH7P1GrqEWzimCVcK52mCMYLxhHBgOR4ELHM2IrfQOaot4IhmbgioZdBJNaoRy5I/nPTKnoy36xetPVPSlHAew+yeU7746rBICMjr4RGFbAUNOEbFUuyzqaEWX6AuWhRY22BA/2RPz98Y0DQGJu5Xy45eEvJDrQSB/ZvA/KxQ3I0tVA581c9kHVm8dW4Sa2ATtHuyafTOqHfRQujGqS7KxpIgQTI0ZRv26mVHm0ilUsadKw== 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=WDrpq7/TfDqFWPUerHl+9h19M6hHNjH6526JlC24rGM=; b=l9p8BYyiC9Ay0gu1JioKq7GjLMUFy2ATng1upgKC2NxgTMa9J02/7givsXqAPefKKCMOYHTouggxOx8XGoIM5IeCLtiTyhznWAJD1dvo6C9NNRSiQoMGngN0xnn9hIEJ93/rBwO9O8FwHU5GPjCP510la36DVmHizYgQajqEdj0TtFnbTDiLAORaJQL2FhQDAgsJb52bsxT7cl7h1N6cEo1hirXLDAd4+on3OoTa7OEkwJUMr8y4B4ZAA0LI6dGDMULToW7M7tFSMZfaDP2IqlmolpgHOJMLAaOYHr7AmMWyTvI3mOZ1wa0LCMIWAk0UAM+NzQDZaZZwKVrMrhndRg== 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=WDrpq7/TfDqFWPUerHl+9h19M6hHNjH6526JlC24rGM=; b=MHSIBMqQppaeJ72OCHwA85KBCgqtiijVVT8k8Ce61QNYsWjc/091wwrUZFF/++0cB/3qHx+M5LsfYe+h7kB7ftXHRPcvXz05A6ceVOBqqDmLgaRiaNpBj2ZCiuS2XVHWl3Rz/XDHTJ/6LTKuYpQk7LFOh8IBi6fBq46lRfnZ+HY= 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 DM5PR12MB2470.namprd12.prod.outlook.com (2603:10b6:4:b4::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20; Wed, 6 May 2020 16:33:31 +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.030; Wed, 6 May 2020 16:33:31 +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 v2 0/3] XCODE5 toolchain binary patching fix Date: Wed, 6 May 2020 11:32:59 -0500 Message-Id: X-Mailer: git-send-email 2.17.1 X-ClientProxiedBy: DM5PR04CA0049.namprd04.prod.outlook.com (2603:10b6:3:ef::11) 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 DM5PR04CA0049.namprd04.prod.outlook.com (2603:10b6:3:ef::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26 via Frontend Transport; Wed, 6 May 2020 16:33:30 +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: 0d021aa0-6afc-44b0-3506-08d7f1db36a2 X-MS-TrafficTypeDiagnostic: DM5PR12MB2470:|DM5PR12MB2470: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-Forefront-PRVS: 03950F25EC X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HXM20hVsOyBTkeVdFORXrzqdS02skRNZ9Wxc+CiS2dxR5UQkk/P3jGlyOpKxhdp3qTgVJBm4dqz7ikwN3QrstxwgJQeEd6yIeKtNwiO5L2HPOf1crpCpVhx/tYFzWvZ2cu5kHNOc+YxkEjhNuiLWyMQFrm1Lxbtqqwq2JACeVm0AOPyMLtoNWrUYH7H0Og+R/q1T8KOSpCdhTTZT+bQ46aDCWOpkt40O9Z+Iw3PkWM0RnabkR4pwNlqD8Fc1t0VmzA+zxB4O3JxFZydC/7YY+uqChJlKe5264L9h330Saxyst4mclG/7OamUKMD2UNM46KR72pPxikYsxjOQQlvkcPbvOGFHM3UhQrDilqhmF3rw2FUIn2uZmEG8/5dUZeAmrUAhD+PVzBo1xdPVOICmDD6T4TXziHhqx5hFxD0kDJInyAQ4eCRmR3GSSSjtnW2w308W8gIkdDsJXs+n/a+07su8VnQ0IyGgw38924PTrGMEclpYdRgD42Oa9yLn7ypwwi/1dMFsH3cXFD7IH6pf7cIqQtLBxEXbHJkJ6kwXC7jzWzm3VWu9Ll80gibmEhk8n9KSd7E/iP+ZJifDG4+621L+mkb5qHsfwDRYA2etiP1Wn9OtM5UVfRiDLD9NSisTi4NANKDjyxFPjPwpilp4Dw== 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)(366004)(346002)(39860400002)(136003)(396003)(33430700001)(2616005)(6666004)(8676002)(956004)(7416002)(478600001)(8936002)(26005)(6486002)(66556008)(966005)(66946007)(4326008)(7696005)(52116002)(36756003)(186003)(16526019)(19627235002)(54906003)(316002)(6916009)(86362001)(2906002)(5660300002)(33440700001)(66476007)(136400200001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 7gX1LzIlWzUF3nRKJFkPGcPr6elb4OJkymf3WlVyOaXBXvM5kkcm/dnhMQyUHGwP4JSz5P3MkJb+aMpGSaWc7uCsiYYabMJet1g96dYqh72leI728r54/f88S+ga27RHqA6BFeKxNLK6blXj5eN1BPHBQr0H9NlqPajcD7A5cahABOm7J5VJbps/5Q+tirYEPogLH8sI9RI2Vkrb9oU5t0JM2CZsP2j5KwWS4o/3zb34YwgP/hLt5+lPSRObKhCT3d/I+jXDVNDda9vCBEEAEZqsQmZTwd+3L+MKPcy0ea8JO/GT42itF/XzuBAG2CFIYU6Owx+d4ILcmiAcg9O5WHDzP4/OUGRpyVwKoQQcGZY/OoKexiodQR2FEJ3B6EDgfNHk12KwY4QYkumu0eXk56Cz7gML8Pgvv4y2wYV2d3Sf44C4y6qlWI8d1y2qZBwJNZn0BEFXfZRSv4frShRo9AcYeuJLuBpp/jTUq/ZEu8YtKygXxQYfN7ScjFwOAHqq2qFaZtqtixonfQv4BZKqG5x5VD8+riQhHS6qP7xeH4b499iJJ3W/pyBF/buYOrPfkNV8puCtq30Ut+FKJGJL88pc4u91FoCNSmv4JhMM39l8xtc/pSWkm5f4e2z6dn2WUS9meTg28uHxaxjjEe88DtYUzISiawwS3lnSld+aqLWobu6bSGe2FnIZF3LZjDJuKMw0iNgz9XKtF5dYurL0LEKkN3VDLn6zQDGyJl6zXQ6h7LAbuq0m0tSBUB5tkK4zg0nrqYjZIDbtARs4uM9Cx2PW9I7gsNxOWlf5MNI4qzo= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0d021aa0-6afc-44b0-3506-08d7f1db36a2 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2020 16:33:31.5335 (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: P+1i8WAfJUa2iTP/7sS4t1gS3VUXhh6eRCQARqjyFHdvnstwUwRRdAQlGcJi+obF9BROJjlKmss6mZhkkOGKNw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB2470 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. Also, will this change have an impact on any of the platform builds outside of this tree? In other words, should the new INF be the one that uses the reverted ExceptionHandlerAsm.nasm file and it be called something like BaseSecPeiCpuExceptionHandlerLib.inf? --- These patches are based on commit: befd18fca68b ("EmbeddedPkg/EmbeddedPkg.dsc: remove some stale component references") 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 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 | 5 + .../DxeCpuExceptionHandlerLib.inf | 2 +- .../PeiCpuExceptionHandlerLib.inf | 2 +- .../SmmCpuExceptionHandlerLib.inf | 2 +- .../Xcode5SecPeiCpuExceptionHandlerLib.inf | 54 +++ .../X64/ExceptionHandlerAsm.nasm | 25 +- .../X64/Xcode5ExceptionHandlerAsm.nasm | 396 ++++++++++++++++++ .../Xcode5SecPeiCpuExceptionHandlerLib.uni | 17 + 12 files changed, 497 insertions(+), 22 deletions(-) create mode 100644 UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerLib.inf create mode 100644 UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/Xcode5ExceptionHandlerAsm.nasm create mode 100644 UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerLib.uni -- 2.17.1