From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [63.128.21.74]) by mx.groups.io with SMTP id smtpd.web11.47690.1585568255176145198 for ; Mon, 30 Mar 2020 04:37:35 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=P4jYzbF8; spf=pass (domain: redhat.com, ip: 63.128.21.74, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585568254; 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=c1s/FaJ2oBmdLIwGj1gWeSok28kKh8IVY/Yn4c93I6c=; b=P4jYzbF85UTkSjcmvBj8Kte6C+zBrVCrWOdyPMyu0WYt1CE8kiXtqCFC/RIAVnkvvhqz6G jaWrD8WhYGxz//MQvFD4NzvIxI1gey3jB11NqzbuNNGrkvkHdz+bFd6/JWzd+84qxvo2cl QAwR3ZM4oV8WZEzrRDLWf68zROTHY1U= 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-276-SQhGlepTPha61WcHPNWZPA-1; Mon, 30 Mar 2020 07:37:26 -0400 X-MC-Unique: SQhGlepTPha61WcHPNWZPA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 039598010F8; Mon, 30 Mar 2020 11:37:25 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-112-191.ams2.redhat.com [10.36.112.191]) by smtp.corp.redhat.com (Postfix) with ESMTP id 15CFAD7669; Mon, 30 Mar 2020 11:37:22 +0000 (UTC) Subject: Re: [PATCH 1/1] OvmfPkg: Fix SMM/RT driver section alignment for XCODE5/CLANGPDB To: Vitaly Cheptsov , devel@edk2.groups.io Cc: Andrew Fish , =?UTF-8?Q?Marvin_H=c3=a4user?= , Liming Gao , Michael Kinney References: <20200329132158.35259-1-cheptsov@ispras.ru> <20200329132158.35259-2-cheptsov@ispras.ru> From: "Laszlo Ersek" Message-ID: <72e723b3-dadd-ad9d-67b8-6e9dcf1aa3e8@redhat.com> Date: Mon, 30 Mar 2020 13:37:22 +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: <20200329132158.35259-2-cheptsov@ispras.ru> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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/29/20 15:21, Vitaly Cheptsov wrote: > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2642 >=20 > This patch resolves the problem of using memory protection > attributes when OVMF firmware is compiled with XCODE5 and CLANGPDB. >=20 > 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(-) This patch is an update on TianoCore#559 / commit 01e9597540fa ("OvmfPkg: Add XCODE5 statements to fix build break", 2017-05-19). 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). Afterwards, I'm happy to push this patch: Acked-by: Laszlo Ersek 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] > =20 > [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 > =20 > # Force PE/COFF sections to be aligned at 4KB boundaries to support page= level > # protection of DXE_SMM_DRIVER/SMM_CORE modules > [BuildOptions.common.EDKII.DXE_SMM_DRIVER, BuildOptions.common.EDKII.SMM= _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 > ########################################################################= ######## > 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] > =20 > [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 > =20 > # Force PE/COFF sections to be aligned at 4KB boundaries to support page= level > # protection of DXE_SMM_DRIVER/SMM_CORE modules > [BuildOptions.common.EDKII.DXE_SMM_DRIVER, BuildOptions.common.EDKII.SMM= _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 > ########################################################################= ######## > 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] > =20 > [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 > =20 > # Force PE/COFF sections to be aligned at 4KB boundaries to support page= level > # protection of DXE_SMM_DRIVER/SMM_CORE modules > [BuildOptions.common.EDKII.DXE_SMM_DRIVER, BuildOptions.common.EDKII.SMM= _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 > ########################################################################= ######## > 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] > =20 > [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 > =20 > # Force PE/COFF sections to be aligned at 4KB boundaries to support page= level > # protection of DXE_SMM_DRIVER/SMM_CORE modules > [BuildOptions.common.EDKII.DXE_SMM_DRIVER, BuildOptions.common.EDKII.SMM= _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