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.web11.8810.1585751866157191120 for ; Wed, 01 Apr 2020 07:37:46 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CrTRSbCI; 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=1585751865; h=from:from:reply-to: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=1IcFdfTFOmAQPhHrkcHt8G39qBMGu6DBmhuhRsSHShs=; b=CrTRSbCIRgz1dofwVom1taXVfWlGTwb91jol2EqAEj6wNj/fizIhJ5zprd/5NgCEBT8YWc h0Lh7gnNbGfv0y2QRwA9jfglGholIexAYyScewTL7PP2gV33jCr0sfjSbHblmniq5er/+R FUUiL/viQZRp2HLzmbkpATMu1xKw8NA= 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-388-qA4JMFoCMluCxNROn7L1Cg-1; Wed, 01 Apr 2020 10:37:35 -0400 X-MC-Unique: qA4JMFoCMluCxNROn7L1Cg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B78051005509; Wed, 1 Apr 2020 14:37:33 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-94.ams2.redhat.com [10.36.114.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id CA82D5C1B0; Wed, 1 Apr 2020 14:37:31 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH 1/1] OvmfPkg: Fix SMM/RT driver section alignment for XCODE5/CLANGPDB From: "Laszlo Ersek" To: Vitaly Cheptsov , devel@edk2.groups.io Cc: Andrew Fish , =?UTF-8?Q?Marvin_H=c3=a4user?= , Liming Gao , Michael Kinney Reply-To: devel@edk2.groups.io, lersek@redhat.com References: <20200329132158.35259-1-cheptsov@ispras.ru> <20200329132158.35259-2-cheptsov@ispras.ru> <72e723b3-dadd-ad9d-67b8-6e9dcf1aa3e8@redhat.com> Message-ID: Date: Wed, 1 Apr 2020 16:37:30 +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: <72e723b3-dadd-ad9d-67b8-6e9dcf1aa3e8@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03/30/20 13:37, Laszlo Ersek wrote: > On 03/29/20 15:21, Vitaly Cheptsov wrote: >> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2642 >> >> This patch resolves the problem of using memory protection >> attributes when OVMF firmware is compiled with XCODE5 and CLANGPDB. >> >> CC: Andrew Fish >> CC: Laszlo Ersek >> CC: Marvin H=C3=A4user >> Signed-off-by: Vitaly Cheptsov >> --- >> OvmfPkg/OvmfPkgIa32.dsc | 6 ++++-- >> OvmfPkg/OvmfPkgIa32X64.dsc | 6 ++++-- >> OvmfPkg/OvmfPkgX64.dsc | 6 ++++-- >> OvmfPkg/OvmfXen.dsc | 8 ++++++-- >> 4 files changed, 18 insertions(+), 8 deletions(-) >=20 > This patch is an update on TianoCore#559 / commit 01e9597540fa > ("OvmfPkg: Add XCODE5 statements to fix build break", 2017-05-19). >=20 > I'd like Mike and/or Liming to ACK this patch (I don't use either XCODE > or CLANGPDB, and the patches related to those toolchains seem to have > come from Liming and Mike mainly). >=20 > Afterwards, I'm happy to push this patch: >=20 > Acked-by: Laszlo Ersek Pushed as commit 4fb393aaa8bb029dc98a1330f40303bf16e2b092, via . (I didn't want to delay this patch -- it's potential to cause a regression is limited, and if it happens, we still have plenty of time to fix it for the stable tag.) Thanks Laszlo >> diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc >> index 19728f20b3..0aba200c2d 100644 >> --- a/OvmfPkg/OvmfPkgIa32.dsc >> +++ b/OvmfPkg/OvmfPkgIa32.dsc >> @@ -80,14 +80,16 @@ [BuildOptions] >> >> [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER] >> GCC:*_*_*_DLINK_FLAGS =3D -z common-page-size=3D0x1000 >> - XCODE:*_*_*_DLINK_FLAGS =3D >> + XCODE:*_*_*_DLINK_FLAGS =3D -seg1addr 0x1000 -segalign 0x1000 >> + XCODE:*_*_*_MTOC_FLAGS =3D -align 0x1000 >> CLANGPDB:*_*_*_DLINK_FLAGS =3D /ALIGN:4096 >> >> # Force PE/COFF sections to be aligned at 4KB boundaries to support pa= ge level >> # protection of DXE_SMM_DRIVER/SMM_CORE modules >> [BuildOptions.common.EDKII.DXE_SMM_DRIVER, BuildOptions.common.EDKII.S= MM_CORE] >> GCC:*_*_*_DLINK_FLAGS =3D -z common-page-size=3D0x1000 >> - XCODE:*_*_*_DLINK_FLAGS =3D >> + XCODE:*_*_*_DLINK_FLAGS =3D -seg1addr 0x1000 -segalign 0x1000 >> + XCODE:*_*_*_MTOC_FLAGS =3D -align 0x1000 >> CLANGPDB:*_*_*_DLINK_FLAGS =3D /ALIGN:4096 >> >> ######################################################################= ########## >> diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc >> index 3c0c229e3a..eca70d64c3 100644 >> --- a/OvmfPkg/OvmfPkgIa32X64.dsc >> +++ b/OvmfPkg/OvmfPkgIa32X64.dsc >> @@ -85,14 +85,16 @@ [BuildOptions] >> >> [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER] >> GCC:*_*_*_DLINK_FLAGS =3D -z common-page-size=3D0x1000 >> - XCODE:*_*_*_DLINK_FLAGS =3D >> + XCODE:*_*_*_DLINK_FLAGS =3D -seg1addr 0x1000 -segalign 0x1000 >> + XCODE:*_*_*_MTOC_FLAGS =3D -align 0x1000 >> CLANGPDB:*_*_*_DLINK_FLAGS =3D /ALIGN:4096 >> >> # Force PE/COFF sections to be aligned at 4KB boundaries to support pa= ge level >> # protection of DXE_SMM_DRIVER/SMM_CORE modules >> [BuildOptions.common.EDKII.DXE_SMM_DRIVER, BuildOptions.common.EDKII.S= MM_CORE] >> GCC:*_*_*_DLINK_FLAGS =3D -z common-page-size=3D0x1000 >> - XCODE:*_*_*_DLINK_FLAGS =3D >> + XCODE:*_*_*_DLINK_FLAGS =3D -seg1addr 0x1000 -segalign 0x1000 >> + XCODE:*_*_*_MTOC_FLAGS =3D -align 0x1000 >> CLANGPDB:*_*_*_DLINK_FLAGS =3D /ALIGN:4096 >> >> ######################################################################= ########## >> diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc >> index f6c1d8d228..676d0ed9a6 100644 >> --- a/OvmfPkg/OvmfPkgX64.dsc >> +++ b/OvmfPkg/OvmfPkgX64.dsc >> @@ -85,14 +85,16 @@ [BuildOptions] >> >> [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER] >> GCC:*_*_*_DLINK_FLAGS =3D -z common-page-size=3D0x1000 >> - XCODE:*_*_*_DLINK_FLAGS =3D >> + XCODE:*_*_*_DLINK_FLAGS =3D -seg1addr 0x1000 -segalign 0x1000 >> + XCODE:*_*_*_MTOC_FLAGS =3D -align 0x1000 >> CLANGPDB:*_*_*_DLINK_FLAGS =3D /ALIGN:4096 >> >> # Force PE/COFF sections to be aligned at 4KB boundaries to support pa= ge level >> # protection of DXE_SMM_DRIVER/SMM_CORE modules >> [BuildOptions.common.EDKII.DXE_SMM_DRIVER, BuildOptions.common.EDKII.S= MM_CORE] >> GCC:*_*_*_DLINK_FLAGS =3D -z common-page-size=3D0x1000 >> - XCODE:*_*_*_DLINK_FLAGS =3D >> + XCODE:*_*_*_DLINK_FLAGS =3D -seg1addr 0x1000 -segalign 0x1000 >> + XCODE:*_*_*_MTOC_FLAGS =3D -align 0x1000 >> CLANGPDB:*_*_*_DLINK_FLAGS =3D /ALIGN:4096 >> >> ######################################################################= ########## >> diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc >> index 5751ff1f03..783bac3e8b 100644 >> --- a/OvmfPkg/OvmfXen.dsc >> +++ b/OvmfPkg/OvmfXen.dsc >> @@ -82,13 +82,17 @@ [BuildOptions] >> >> [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER] >> GCC:*_*_*_DLINK_FLAGS =3D -z common-page-size=3D0x1000 >> - XCODE:*_*_*_DLINK_FLAGS =3D >> + XCODE:*_*_*_DLINK_FLAGS =3D -seg1addr 0x1000 -segalign 0x1000 >> + XCODE:*_*_*_MTOC_FLAGS =3D -align 0x1000 >> + CLANGPDB:*_*_*_DLINK_FLAGS =3D /ALIGN:4096 >> >> # Force PE/COFF sections to be aligned at 4KB boundaries to support pa= ge level >> # protection of DXE_SMM_DRIVER/SMM_CORE modules >> [BuildOptions.common.EDKII.DXE_SMM_DRIVER, BuildOptions.common.EDKII.S= MM_CORE] >> GCC:*_*_*_DLINK_FLAGS =3D -z common-page-size=3D0x1000 >> - XCODE:*_*_*_DLINK_FLAGS =3D >> + XCODE:*_*_*_DLINK_FLAGS =3D -seg1addr 0x1000 -segalign 0x1000 >> + XCODE:*_*_*_MTOC_FLAGS =3D -align 0x1000 >> + CLANGPDB:*_*_*_DLINK_FLAGS =3D /ALIGN:4096 >> >> ######################################################################= ########## >> # >> >=20 >=20 >=20 >=20