From patchwork Thu Jul 2 05:05:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 50550 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6122A214B3 for ; Thu, 2 Jul 2015 05:05:38 +0000 (UTC) Received: by lbcui10 with SMTP id ui10sf10403868lbc.0 for ; Wed, 01 Jul 2015 22:05:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mime-version:in-reply-to:references :date:message-id:from:to:cc:subject:precedence:reply-to:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :content-type:content-transfer-encoding:errors-to:x-original-sender :x-original-authentication-results:mailing-list; bh=yL9ineWcglG4LGTmo1wkVRG9reC4jGPrZreme+a5KsY=; b=VnDaVmw1bU/LuYRiN/1sK10NfDq4NiwSLHJXBqeGTSaawHzgj5g9dlPvPKFKGl8WV3 IqmaT45ajCbkTKH7W4JSM/WJ8VRgWrYQDQpifIy0SU40hfwIxcSpEwJKZLK12JonJHV2 7zdESeFx2xWZr/xcHfdtZZAiBdM7ugjKdZhzaB2/RlBfKP/CmfZeLQQJ9iul8jiXze/r yTlwgxZOgoeVWQdn2hO7AKi8ebHuQCCVTiKjiiVwqjt+6CPGtmGIXCcF8CmCYB7wKjqr jTn5kw1Ax+x9Rh6aEP2Zv05QCJTbB1Jh7Ixd5RQ40wac918SWG4GjvlwX7blYlornLtA dXew== X-Gm-Message-State: ALoCoQluucfy8dKjQ/munioRbKCuWPceLKrZWbbBlzs9p9y6asiYWC1Rm+g0lkul+xBRYyt43C8y X-Received: by 10.194.58.164 with SMTP id s4mr19020525wjq.3.1435813537371; Wed, 01 Jul 2015 22:05:37 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.115.161 with SMTP id jp1ls270359lab.96.gmail; Wed, 01 Jul 2015 22:05:37 -0700 (PDT) X-Received: by 10.152.5.2 with SMTP id o2mr28868900lao.79.1435813537074; Wed, 01 Jul 2015 22:05:37 -0700 (PDT) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com. [209.85.217.178]) by mx.google.com with ESMTPS id p7si3586433lag.32.2015.07.01.22.05.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Jul 2015 22:05:36 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by lbbpo10 with SMTP id po10so24920154lbb.3 for ; Wed, 01 Jul 2015 22:05:36 -0700 (PDT) X-Received: by 10.112.199.133 with SMTP id jk5mr29326275lbc.32.1435813536592; Wed, 01 Jul 2015 22:05:36 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp210068lbb; Wed, 1 Jul 2015 22:05:35 -0700 (PDT) X-Received: by 10.42.210.2 with SMTP id gi2mr9498464icb.58.1435813534957; Wed, 01 Jul 2015 22:05:34 -0700 (PDT) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id 25si4548065iod.5.2015.07.01.22.05.33 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 01 Jul 2015 22:05:34 -0700 (PDT) Received-SPF: pass (google.com: domain of edk2-devel-bounces@lists.sourceforge.net designates 216.34.181.88 as permitted sender) client-ip=216.34.181.88; Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ZAWgW-0003lq-6y; Thu, 02 Jul 2015 05:05:16 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ZAWgU-0003lj-R2 for edk2-devel@lists.sourceforge.net; Thu, 02 Jul 2015 05:05:14 +0000 Received-SPF: pass (sog-mx-3.v43.ch3.sourceforge.com: domain of linaro.org designates 209.85.213.178 as permitted sender) client-ip=209.85.213.178; envelope-from=ard.biesheuvel@linaro.org; helo=mail-ig0-f178.google.com; Received: from mail-ig0-f178.google.com ([209.85.213.178]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1ZAWgT-0002ec-0M for edk2-devel@lists.sourceforge.net; Thu, 02 Jul 2015 05:05:14 +0000 Received: by igblr2 with SMTP id lr2so112450814igb.0 for ; Wed, 01 Jul 2015 22:05:07 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.43.97.69 with SMTP id cj5mr8718307icc.75.1435813507654; Wed, 01 Jul 2015 22:05:07 -0700 (PDT) Received: by 10.36.138.69 with HTTP; Wed, 1 Jul 2015 22:05:07 -0700 (PDT) In-Reply-To: <20150702005429.19479.33129@jljusten-ivb> References: <1435662014-26196-1-git-send-email-ard.biesheuvel@linaro.org> <4A89E2EF3DFEDB4C8BFDE51014F606A111A88D41@shsmsx102.ccr.corp.intel.com> <2F38F90BC08E2B4182F42749E69FCDE510F65D5F@SHSMSX104.ccr.corp.intel.com> <20150701224227.12546.93632@jljusten-ivb> <4A89E2EF3DFEDB4C8BFDE51014F606A111A89F60@shsmsx102.ccr.corp.intel.com> <20150702005429.19479.33129@jljusten-ivb> Date: Thu, 2 Jul 2015 07:05:07 +0200 Message-ID: From: Ard Biesheuvel To: Jordan Justen X-Spam-Score: -1.5 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1ZAWgT-0002ec-0M Cc: "edk2-devel@lists.sourceforge.net" Subject: Re: [edk2] [PATCH] BaseTools: fix a syntax error in 4 KB aligned GNU ld linker script X-BeenThere: edk2-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list Reply-To: edk2-devel@lists.sourceforge.net List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: edk2-devel-bounces@lists.sourceforge.net X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 On 2 July 2015 at 02:54, Jordan Justen wrote: > On 2015-07-01 17:41:11, Gao, Liming wrote: >> Jordan: >> Agree. We will follow this rule, apply the patch and push it >> without any modification. > > My point is that if there is a mistake, we should not bother to update > the log message to fix that mistake. Hopefully we can just be more > careful with the patch message if we stop thinking that we can go back > and fix it later. :) > >> gcc-4k is added for new UEFI2.5 Properties Table. When enable this >> feature, gcc-4k script will be required for RUNTIME driver. It can >> be configured in [BuildOptions] of DSC file for RUNTIME driver >> only. We could update Ovmf to enable this feature, which can be >> turned on/off by build flag. Is it OK to you? > > Is there an example of how to enable it for a platform? Or, the > feature is still is not fully complete? > Hello Jordan, As I reported here: http://article.gmane.org/gmane.comp.bios.tianocore.devel/16433 I gave this a quick spin by adding this ----------8<------------ ----------8<------------ to the OvmfPkg build, and it appears to work fine. There are a couple of things to be aware of, though. - It depends on Laszlo's end-of-dxe series http://thread.gmane.org/gmane.comp.bios.tianocore.devel/16304 - Adding subsequent --script arguments to GNU ld accumulates linker scripts instead of replacing them. This works correctly in this case since the linker scripts are identical except for the section alignments, but it is something to keep in mind. - It crashes the Linux kernel at boot. The crash seems to be inside SetVirtualAddressMap (), which suggests that X64 Linux suffers from the same problem as AARCH64, i.e., that the virtual mapping does not preserve the offset between adjacent code and data regions. This is not required by the spec, though, so this feature essentially breaks backward compatibility. The latter is a huge concern imo, since the fact that it breaks older OSes will impede the adoption of an otherwise very useful security feature. Regards, Ard. >> -----Original Message----- >> From: Justen, Jordan L >> Sent: Thursday, July 2, 2015 6:42 AM >> To: Liu, Yingke D; Ard Biesheuvel >> Cc: edk2-devel@lists.sourceforge.net; Gao, Liming >> Subject: RE: [PATCH] BaseTools: fix a syntax error in 4 KB aligned GNU ld linker script >> >> On 2015-07-01 01:34:56, Liu, Yingke D wrote: >> > Hi Ard, >> > >> > Thanks for the comments, I have updated the log message. >> >> For future reference, I think you should not bother to update the >> log message. It is a bad practice, and the git archive will not see >> the updated log message anyhow. It should also be noted that it will >> not be possible to update the commit message when git is the main >> upstream repo. >> >> I think it is best just to acknowledge the mistake, and remember it >> for next time. >> >> I have a question. Where is the 4K script used? git grep gcc-4K >> shows no references to it. >> >> -Jordan >> >> > -----Original Message----- >> > From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org] >> > Sent: Wednesday, July 01, 2015 16:12 >> > To: Liu, Yingke D >> > Cc: edk2-devel@lists.sourceforge.net; Justen, Jordan L; Gao, Liming >> > Subject: Re: [PATCH] BaseTools: fix a syntax error in 4 KB aligned GNU >> > ld linker script >> > >> > On 30 June 2015 at 13:02, Gao, Liming wrote: >> > > Reviewed-by: Liming Gao >> > > >> > >> > Hello Dennis, >> > >> > Thanks for merging this. >> > >> > Next time, could you please keep the subject line as well? >> > >> > > Subject: [PATCH] BaseTools: fix a syntax error in 4 KB aligned GNU >> > > ld linker script >> > >> > You have used this instead: >> > >> > > There needs to be a space between the output section name and the >> > > colon, i.e., >> > >> > as the subject line which looks a little silly imo >> > >> > Thanks, >> > Ard. >> > >> > >> > > -----Original Message----- >> > > From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org] >> > > Sent: Tuesday, June 30, 2015 7:00 PM >> > > To: Liu, Yingke D; Gao, Liming; edk2-devel@lists.sourceforge.net >> > > Cc: Ard Biesheuvel >> > > Subject: [PATCH] BaseTools: fix a syntax error in 4 KB aligned GNU >> > > ld linker script >> > > >> > > There needs to be a space between the output section name and the >> > > colon, i.e., >> > > >> > > .text : ALIGN(0x1000) >> > > ^ >> > > >> > > Fix this for all output sections >> > > >> > > Contributed-under: TianoCore Contribution Agreement 1.0 >> > > Signed-off-by: Ard Biesheuvel >> > > --- >> > > BaseTools/Scripts/gcc-4K-align-ld-script | 10 +++++----- >> > > 1 file changed, 5 insertions(+), 5 deletions(-) >> > > >> > > diff --git a/BaseTools/Scripts/gcc-4K-align-ld-script >> > > b/BaseTools/Scripts/gcc-4K-align-ld-script >> > > index 1f23079023a6..16cf623a3362 100644 >> > > --- a/BaseTools/Scripts/gcc-4K-align-ld-script >> > > +++ b/BaseTools/Scripts/gcc-4K-align-ld-script >> > > @@ -3,12 +3,12 @@ SECTIONS >> > > { >> > > /* . = 0 + SIZEOF_HEADERS; */ >> > > . = 0x280; >> > > - .text: ALIGN(0x1000) >> > > + .text : ALIGN(0x1000) >> > > { >> > > *(.text .stub .text.* .gnu.linkonce.t.*) >> > > . = ALIGN(0x20); >> > > } >> > > - .data: ALIGN(0x1000) >> > > + .data : ALIGN(0x1000) >> > > { >> > > *( >> > > .rodata .rodata.* .gnu.linkonce.r.* @@ -18,16 +18,16 @@ SECTIONS >> > > ) >> > > . = ALIGN(0x20); >> > > } >> > > - .eh_frame: ALIGN(0x1000) >> > > + .eh_frame : ALIGN(0x1000) >> > > { >> > > KEEP (*(.eh_frame)) >> > > } >> > > - .got: ALIGN(0x1000) >> > > + .got : ALIGN(0x1000) >> > > { >> > > *(.got .got.*) >> > > . = ALIGN(0x20); >> > > } >> > > - .rela: ALIGN(0x1000) >> > > + .rela : ALIGN(0x1000) >> > > { >> > > *(.rela .rela.*) >> > > } >> > > -- >> > > 1.9.1 >> > > ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index e5fc90d2e610..7f06b51f65cf 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -48,6 +48,9 @@ [BuildOptions] INTEL:*_*_X64_GENFW_FLAGS = --keepexceptiontable !endif +[BuildOptions.X64.EDKII.DXE_RUNTIME_DRIVER] + GCC:*_*_*_DLINK_FLAGS = --script=$(EDK_TOOLS_PATH)/Scripts/gcc-4K-align-ld-script + ################################################################################ # # SKU Identification section - list of all SKU IDs supported by this Platform.