From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.120]) by mx.groups.io with SMTP id smtpd.web12.7635.1588715408879264675 for ; Tue, 05 May 2020 14:50:10 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=T9IUFgJn; spf=pass (domain: redhat.com, ip: 205.139.110.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588715408; 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=8wahpeYdGOHotuD7znpv7iafTdDfOrDnj+5rZigZHCE=; b=T9IUFgJnRjpvUAF7c9Ds7LjXL5W/k53xQvMViiY04AoCNbW5rFOnRI/LUOfTWpuLH2dctI 6s8Dy4c9Oc6iDgaEMuYNSQKV0at8dVoFrGshkLosZrnz3qucXGvIDWawmZWhxG7putDTFe sgEFEfL92SQiXLMV2yW12cFnwoDNKOQ= 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-6-QuzBKstcP72dllmF905I4g-1; Tue, 05 May 2020 17:50:04 -0400 X-MC-Unique: QuzBKstcP72dllmF905I4g-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C11CB1840420; Tue, 5 May 2020 21:50:01 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-134.ams2.redhat.com [10.36.114.134]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8C2A71C950; Tue, 5 May 2020 21:49:58 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH 3/4] OvmfPkg: Use toolchain appropriate CpuExceptionHandlerLib To: devel@edk2.groups.io, thomas.lendacky@amd.com Cc: Jordan Justen , Ard Biesheuvel , Liming Gao , Eric Dong , Ray Ni , Brijesh Singh , Anthony Perard , Benjamin You , Guo Dong , Julien Grall , Maurice Ma , Andrew Fish , Ard Biesheuvel References: <6f8347c43bd5c8641397c66ba59b56bb81869da3.1588364261.git.thomas.lendacky@amd.com> From: "Laszlo Ersek" Message-ID: Date: Tue, 5 May 2020 23:49:57 +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: <6f8347c43bd5c8641397c66ba59b56bb81869da3.1588364261.git.thomas.lendacky@amd.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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 On 05/01/20 22:17, Lendacky, Thomas wrote: > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2340 > > Use the XCODE5 CpuExceptionHandlerLib library in place of the standard > library when building with the XCODE5 toolchain. The XCODE5 version of > the library performs binary patching and should only be used when building > with the XCODE5 toolchain. > > Cc: Jordan Justen > Cc: Laszlo Ersek > Cc: Ard Biesheuvel > Cc: Anthony Perard > Cc: Julien Grall > Cc: Liming Gao > Signed-off-by: Tom Lendacky > --- > OvmfPkg/OvmfPkgIa32.dsc | 20 ++++++++++++++++++++ > OvmfPkg/OvmfPkgIa32X64.dsc | 20 ++++++++++++++++++++ > OvmfPkg/OvmfPkgX64.dsc | 20 ++++++++++++++++++++ > OvmfPkg/OvmfXen.dsc | 16 ++++++++++++++++ > 4 files changed, 76 insertions(+) > > diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc > index fcd9779b5ba2..f27fcd7e1087 100644 > --- a/OvmfPkg/OvmfPkgIa32.dsc > +++ b/OvmfPkg/OvmfPkgIa32.dsc > @@ -245,7 +245,11 @@ [LibraryClasses.common.SEC] > PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf > PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf > MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf > +!if $(TOOL_CHAIN_TAG) != "XCODE5" > CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf > +!else > + CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerLib.inf > +!endif (1) In accordance with my point (1) under patch#1, please keep the SEC phase hunks only, for all four DSC files, and drop the rest of the hunks. Only SecPeiCpuExceptionHandlerLib needs to be conditionalized. (2) Style request: given that we have an "!else" branch too, please use the "==" operator with the "!if". I think that the double-negation arising from testing "!=" first, and then having an "!else", is hard to read. Thanks! Laszlo