public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: Vitaly Cheptsov <cheptsov@ispras.ru>, devel@edk2.groups.io
Cc: "Andrew Fish" <afish@apple.com>,
	"Marvin Häuser" <mhaeuser@outlook.de>,
	"Liming Gao" <liming.gao@intel.com>,
	"Michael Kinney" <michael.d.kinney@intel.com>
Subject: Re: [PATCH 1/1] OvmfPkg: Fix SMM/RT driver section alignment for XCODE5/CLANGPDB
Date: Mon, 30 Mar 2020 13:37:22 +0200	[thread overview]
Message-ID: <72e723b3-dadd-ad9d-67b8-6e9dcf1aa3e8@redhat.com> (raw)
In-Reply-To: <20200329132158.35259-2-cheptsov@ispras.ru>

On 03/29/20 15:21, Vitaly Cheptsov wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2642
> 
> This patch resolves the problem of using memory protection
> attributes when OVMF firmware is compiled with XCODE5 and CLANGPDB.
> 
> CC: Andrew Fish <afish@apple.com>
> CC: Laszlo Ersek <lersek@redhat.com>
> CC: Marvin Häuser <mhaeuser@outlook.de>
> Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
> ---
>  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 <lersek@redhat.com>

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 = -z common-page-size=0x1000
> -  XCODE:*_*_*_DLINK_FLAGS =
> +  XCODE:*_*_*_DLINK_FLAGS = -seg1addr 0x1000 -segalign 0x1000
> +  XCODE:*_*_*_MTOC_FLAGS = -align 0x1000
>    CLANGPDB:*_*_*_DLINK_FLAGS = /ALIGN:4096
>  
>  # 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 = -z common-page-size=0x1000
> -  XCODE:*_*_*_DLINK_FLAGS =
> +  XCODE:*_*_*_DLINK_FLAGS = -seg1addr 0x1000 -segalign 0x1000
> +  XCODE:*_*_*_MTOC_FLAGS = -align 0x1000
>    CLANGPDB:*_*_*_DLINK_FLAGS = /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 = -z common-page-size=0x1000
> -  XCODE:*_*_*_DLINK_FLAGS =
> +  XCODE:*_*_*_DLINK_FLAGS = -seg1addr 0x1000 -segalign 0x1000
> +  XCODE:*_*_*_MTOC_FLAGS = -align 0x1000
>    CLANGPDB:*_*_*_DLINK_FLAGS = /ALIGN:4096
>  
>  # 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 = -z common-page-size=0x1000
> -  XCODE:*_*_*_DLINK_FLAGS =
> +  XCODE:*_*_*_DLINK_FLAGS = -seg1addr 0x1000 -segalign 0x1000
> +  XCODE:*_*_*_MTOC_FLAGS = -align 0x1000
>    CLANGPDB:*_*_*_DLINK_FLAGS = /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 = -z common-page-size=0x1000
> -  XCODE:*_*_*_DLINK_FLAGS =
> +  XCODE:*_*_*_DLINK_FLAGS = -seg1addr 0x1000 -segalign 0x1000
> +  XCODE:*_*_*_MTOC_FLAGS = -align 0x1000
>    CLANGPDB:*_*_*_DLINK_FLAGS = /ALIGN:4096
>  
>  # 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 = -z common-page-size=0x1000
> -  XCODE:*_*_*_DLINK_FLAGS =
> +  XCODE:*_*_*_DLINK_FLAGS = -seg1addr 0x1000 -segalign 0x1000
> +  XCODE:*_*_*_MTOC_FLAGS = -align 0x1000
>    CLANGPDB:*_*_*_DLINK_FLAGS = /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 = -z common-page-size=0x1000
> -  XCODE:*_*_*_DLINK_FLAGS =
> +  XCODE:*_*_*_DLINK_FLAGS = -seg1addr 0x1000 -segalign 0x1000
> +  XCODE:*_*_*_MTOC_FLAGS = -align 0x1000
> +  CLANGPDB:*_*_*_DLINK_FLAGS = /ALIGN:4096
>  
>  # 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 = -z common-page-size=0x1000
> -  XCODE:*_*_*_DLINK_FLAGS =
> +  XCODE:*_*_*_DLINK_FLAGS = -seg1addr 0x1000 -segalign 0x1000
> +  XCODE:*_*_*_MTOC_FLAGS = -align 0x1000
> +  CLANGPDB:*_*_*_DLINK_FLAGS = /ALIGN:4096
>  
>  ################################################################################
>  #
> 


  reply	other threads:[~2020-03-30 11:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-29 13:21 [PATCH 0/1] OvmfPkg: Fix SMM/RT driver section alignment for XCODE5/CLANGPDB Vitaly Cheptsov
2020-03-29 13:21 ` [PATCH 1/1] " Vitaly Cheptsov
2020-03-30 11:37   ` Laszlo Ersek [this message]
2020-04-01 14:37     ` [edk2-devel] " Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=72e723b3-dadd-ad9d-67b8-6e9dcf1aa3e8@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox