From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.81]) by mx.groups.io with SMTP id smtpd.web12.8529.1588937350800585457 for ; Fri, 08 May 2020 04:29:11 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=euPk4Gt9; spf=pass (domain: redhat.com, ip: 207.211.31.81, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588937349; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wCBiZWPuUwWapvZGr4pUKI0I1qpFZA54cvzNX+z4iHU=; b=euPk4Gt9XJIe+8VDwuLPwIh0+YfOm1CZcngzXqHaR0PWeTt+BxNj3xXTDv/4rn1udpZbot jlf0nGiyS/Tvt+JtcMVUDqd/kFOQYyWqAdqNZXN6oSc9UFjkLlJe8KUM4547UFlulSTKj6 pQ5gwKIC8rXB84A+3+J2OaSwgGx60hU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-235-VTV2bqKdMfSqxSjuIX5Buw-1; Fri, 08 May 2020 07:28:59 -0400 X-MC-Unique: VTV2bqKdMfSqxSjuIX5Buw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2DB7C19057A1; Fri, 8 May 2020 11:28:57 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-60.ams2.redhat.com [10.36.114.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id 52ED65D9CA; Fri, 8 May 2020 11:28:53 +0000 (UTC) Subject: Re: [PATCH v3 0/3] XCODE5 toolchain binary patching fix To: Jordan Justen , Liming Gao , Eric Dong , Ray Ni Cc: Tom Lendacky , devel@edk2.groups.io, Ard Biesheuvel , Anthony Perard , Julien Grall , Brijesh Singh , Andrew Fish , Chasel Chiu , Kelly Steele , Michael D Kinney , Nate DeSimone , Yi Qian , Zailiang Sun References: From: "Laszlo Ersek" Message-ID: <8d38706c-1d89-88ca-1760-935566fd62e7@redhat.com> Date: Fri, 8 May 2020 13:28:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Eric, Ray, Liming -- do you have comments please? I'm ready to push the series (it has two UefiCpuPkg patches and one OvmfPkg patch). Please consider specifically whether we should push the last patch at once. The last patch would prevent the following "edk2-platforms" DSC files from building with XCODE5: Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc Platform/Intel/QuarkPlatformPkg/Quark.dsc Platform/Intel/QuarkPlatformPkg/QuarkMin.dsc Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgX64.dsc That could be prevented if Tom sent patches for them like the middle (OvmfPkg) patch in this series. But we don't know if those platforms above are ever built with XCODE5. Adding their maintainers to the CC list as well. Thanks, Laszlo On 05/07/20 15:06, Tom Lendacky wrote: > > 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 >