public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] Vlv2TbltDevicePkg: Use 4K aligned PE/COFF sections
@ 2016-11-29 19:22 Michael Kinney
  2016-11-30  1:47 ` Yao, Jiewen
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Kinney @ 2016-11-29 19:22 UTC (permalink / raw)
  To: edk2-devel; +Cc: Jiewen Yao, David Wei, Mang Guo

Update [BuildOptions] to use of 4K aligned PE/COFF
image sections to support page level protection of
DXE_RUNTIME_DRIVER, SMM_CORE, and DXE_SMM_DRIVER
modules.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: David Wei <david.wei@intel.com>
Cc: Mang Guo <mang.guo@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
---
 Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc | 16 ++++++++++++++++
 Vlv2TbltDevicePkg/PlatformPkgIA32.dsc   | 16 ++++++++++++++++
 Vlv2TbltDevicePkg/PlatformPkgX64.dsc    | 16 ++++++++++++++++
 3 files changed, 48 insertions(+)

diff --git a/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc b/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
index c3dc25f..6da2a8a 100644
--- a/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
+++ b/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
@@ -1676,6 +1676,22 @@ $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/IA32/fTPMInitPeim.inf
   INTEL:*_*_X64_GENFW_FLAGS = --keepexceptiontable
 !endif
 
+#
+# Force PE/COFF sections to be aligned at 4KB boundaries to support page level
+# protection of DXE_RUNTIME_DRIVER modules
+#
+[BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
+  MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096
+  GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
+
+#
+# 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]
+  MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096
+  GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
+
 [BuildOptions.Common.EDK]
 
 #
diff --git a/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc b/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc
index 3a5776a..5b5523f 100644
--- a/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc
+++ b/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc
@@ -1659,6 +1659,22 @@ $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/IA32/fTPMInitPeim.inf
 
 !endif
 
+#
+# Force PE/COFF sections to be aligned at 4KB boundaries to support page level
+# protection of DXE_RUNTIME_DRIVER modules
+#
+[BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
+  MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096
+  GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
+
+#
+# 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]
+  MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096
+  GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
+
 [BuildOptions.Common.EDK]
 
 #
diff --git a/Vlv2TbltDevicePkg/PlatformPkgX64.dsc b/Vlv2TbltDevicePkg/PlatformPkgX64.dsc
index 83cbb0a..54d2b81 100644
--- a/Vlv2TbltDevicePkg/PlatformPkgX64.dsc
+++ b/Vlv2TbltDevicePkg/PlatformPkgX64.dsc
@@ -1668,6 +1668,22 @@ $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/IA32/fTPMInitPeim.inf
 
 !endif
 
+#
+# Force PE/COFF sections to be aligned at 4KB boundaries to support page level
+# protection of DXE_RUNTIME_DRIVER modules
+#
+[BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
+  MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096
+  GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
+
+#
+# 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]
+  MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096
+  GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
+
 [BuildOptions.Common.EDK]
 
 #
-- 
2.6.3.windows.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Patch] Vlv2TbltDevicePkg: Use 4K aligned PE/COFF sections
  2016-11-29 19:22 [Patch] Vlv2TbltDevicePkg: Use 4K aligned PE/COFF sections Michael Kinney
@ 2016-11-30  1:47 ` Yao, Jiewen
  2016-11-30  2:15   ` Kinney, Michael D
  0 siblings, 1 reply; 3+ messages in thread
From: Yao, Jiewen @ 2016-11-30  1:47 UTC (permalink / raw)
  To: Kinney, Michael D, edk2-devel@lists.01.org; +Cc: Wei, David, Guo, Mang

HI Mike
I agree on this change.
But I would like to mention that the protection does not takes effect, until all VLV2 binary uses this build option, too.

We should feedback to VLV2 binary provider as well.

Reviewed-by: Jiewen.yao@intel.com

Thank you
Yao Jiewen

> -----Original Message-----
> From: Kinney, Michael D
> Sent: Wednesday, November 30, 2016 3:22 AM
> To: edk2-devel@lists.01.org
> Cc: Yao, Jiewen <jiewen.yao@intel.com>; Wei, David
> <david.wei@intel.com>; Guo, Mang <mang.guo@intel.com>
> Subject: [Patch] Vlv2TbltDevicePkg: Use 4K aligned PE/COFF sections
> 
> Update [BuildOptions] to use of 4K aligned PE/COFF
> image sections to support page level protection of
> DXE_RUNTIME_DRIVER, SMM_CORE, and DXE_SMM_DRIVER
> modules.
> 
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: David Wei <david.wei@intel.com>
> Cc: Mang Guo <mang.guo@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
> ---
>  Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc | 16 ++++++++++++++++
>  Vlv2TbltDevicePkg/PlatformPkgIA32.dsc   | 16 ++++++++++++++++
>  Vlv2TbltDevicePkg/PlatformPkgX64.dsc    | 16 ++++++++++++++++
>  3 files changed, 48 insertions(+)
> 
> diff --git a/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
> b/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
> index c3dc25f..6da2a8a 100644
> --- a/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
> +++ b/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
> @@ -1676,6 +1676,22 @@
> $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/IA32/fT
> PMInitPeim.inf
>    INTEL:*_*_X64_GENFW_FLAGS = --keepexceptiontable
>  !endif
> 
> +#
> +# Force PE/COFF sections to be aligned at 4KB boundaries to support page
> level
> +# protection of DXE_RUNTIME_DRIVER modules
> +#
> +[BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
> +  MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096
> +  GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
> +
> +#
> +# 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]
> +  MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096
> +  GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
> +
>  [BuildOptions.Common.EDK]
> 
>  #
> diff --git a/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc
> b/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc
> index 3a5776a..5b5523f 100644
> --- a/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc
> +++ b/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc
> @@ -1659,6 +1659,22 @@
> $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/IA32/fT
> PMInitPeim.inf
> 
>  !endif
> 
> +#
> +# Force PE/COFF sections to be aligned at 4KB boundaries to support page
> level
> +# protection of DXE_RUNTIME_DRIVER modules
> +#
> +[BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
> +  MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096
> +  GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
> +
> +#
> +# 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]
> +  MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096
> +  GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
> +
>  [BuildOptions.Common.EDK]
> 
>  #
> diff --git a/Vlv2TbltDevicePkg/PlatformPkgX64.dsc
> b/Vlv2TbltDevicePkg/PlatformPkgX64.dsc
> index 83cbb0a..54d2b81 100644
> --- a/Vlv2TbltDevicePkg/PlatformPkgX64.dsc
> +++ b/Vlv2TbltDevicePkg/PlatformPkgX64.dsc
> @@ -1668,6 +1668,22 @@
> $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/IA32/fT
> PMInitPeim.inf
> 
>  !endif
> 
> +#
> +# Force PE/COFF sections to be aligned at 4KB boundaries to support page
> level
> +# protection of DXE_RUNTIME_DRIVER modules
> +#
> +[BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
> +  MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096
> +  GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
> +
> +#
> +# 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]
> +  MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096
> +  GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
> +
>  [BuildOptions.Common.EDK]
> 
>  #
> --
> 2.6.3.windows.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Patch] Vlv2TbltDevicePkg: Use 4K aligned PE/COFF sections
  2016-11-30  1:47 ` Yao, Jiewen
@ 2016-11-30  2:15   ` Kinney, Michael D
  0 siblings, 0 replies; 3+ messages in thread
From: Kinney, Michael D @ 2016-11-30  2:15 UTC (permalink / raw)
  To: Yao, Jiewen, edk2-devel@lists.01.org, Kinney, Michael D
  Cc: Wei, David, Guo, Mang

Jiewen,

I agree.  I have entered an additional Bugzilla issue to get the binaries fixed.

	https://bugzilla.tianocore.org/show_bug.cgi?id=268

Best regards,

Mike

> -----Original Message-----
> From: Yao, Jiewen
> Sent: Tuesday, November 29, 2016 5:48 PM
> To: Kinney, Michael D <michael.d.kinney@intel.com>; edk2-devel@lists.01.org
> Cc: Wei, David <david.wei@intel.com>; Guo, Mang <mang.guo@intel.com>
> Subject: RE: [Patch] Vlv2TbltDevicePkg: Use 4K aligned PE/COFF sections
> 
> HI Mike
> I agree on this change.
> But I would like to mention that the protection does not takes effect, until all
> VLV2 binary uses this build option, too.
> 
> We should feedback to VLV2 binary provider as well.
> 
> Reviewed-by: Jiewen.yao@intel.com
> 
> Thank you
> Yao Jiewen
> 
> > -----Original Message-----
> > From: Kinney, Michael D
> > Sent: Wednesday, November 30, 2016 3:22 AM
> > To: edk2-devel@lists.01.org
> > Cc: Yao, Jiewen <jiewen.yao@intel.com>; Wei, David
> > <david.wei@intel.com>; Guo, Mang <mang.guo@intel.com>
> > Subject: [Patch] Vlv2TbltDevicePkg: Use 4K aligned PE/COFF sections
> >
> > Update [BuildOptions] to use of 4K aligned PE/COFF
> > image sections to support page level protection of
> > DXE_RUNTIME_DRIVER, SMM_CORE, and DXE_SMM_DRIVER
> > modules.
> >
> > Cc: Jiewen Yao <jiewen.yao@intel.com>
> > Cc: David Wei <david.wei@intel.com>
> > Cc: Mang Guo <mang.guo@intel.com>
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
> > ---
> >  Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc | 16 ++++++++++++++++
> >  Vlv2TbltDevicePkg/PlatformPkgIA32.dsc   | 16 ++++++++++++++++
> >  Vlv2TbltDevicePkg/PlatformPkgX64.dsc    | 16 ++++++++++++++++
> >  3 files changed, 48 insertions(+)
> >
> > diff --git a/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
> > b/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
> > index c3dc25f..6da2a8a 100644
> > --- a/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
> > +++ b/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
> > @@ -1676,6 +1676,22 @@
> > $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/IA32/fT
> > PMInitPeim.inf
> >    INTEL:*_*_X64_GENFW_FLAGS = --keepexceptiontable
> >  !endif
> >
> > +#
> > +# Force PE/COFF sections to be aligned at 4KB boundaries to support page
> > level
> > +# protection of DXE_RUNTIME_DRIVER modules
> > +#
> > +[BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
> > +  MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096
> > +  GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
> > +
> > +#
> > +# 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]
> > +  MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096
> > +  GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
> > +
> >  [BuildOptions.Common.EDK]
> >
> >  #
> > diff --git a/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc
> > b/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc
> > index 3a5776a..5b5523f 100644
> > --- a/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc
> > +++ b/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc
> > @@ -1659,6 +1659,22 @@
> > $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/IA32/fT
> > PMInitPeim.inf
> >
> >  !endif
> >
> > +#
> > +# Force PE/COFF sections to be aligned at 4KB boundaries to support page
> > level
> > +# protection of DXE_RUNTIME_DRIVER modules
> > +#
> > +[BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
> > +  MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096
> > +  GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
> > +
> > +#
> > +# 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]
> > +  MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096
> > +  GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
> > +
> >  [BuildOptions.Common.EDK]
> >
> >  #
> > diff --git a/Vlv2TbltDevicePkg/PlatformPkgX64.dsc
> > b/Vlv2TbltDevicePkg/PlatformPkgX64.dsc
> > index 83cbb0a..54d2b81 100644
> > --- a/Vlv2TbltDevicePkg/PlatformPkgX64.dsc
> > +++ b/Vlv2TbltDevicePkg/PlatformPkgX64.dsc
> > @@ -1668,6 +1668,22 @@
> > $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/IA32/fT
> > PMInitPeim.inf
> >
> >  !endif
> >
> > +#
> > +# Force PE/COFF sections to be aligned at 4KB boundaries to support page
> > level
> > +# protection of DXE_RUNTIME_DRIVER modules
> > +#
> > +[BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
> > +  MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096
> > +  GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
> > +
> > +#
> > +# 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]
> > +  MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096
> > +  GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
> > +
> >  [BuildOptions.Common.EDK]
> >
> >  #
> > --
> > 2.6.3.windows.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-30  2:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-29 19:22 [Patch] Vlv2TbltDevicePkg: Use 4K aligned PE/COFF sections Michael Kinney
2016-11-30  1:47 ` Yao, Jiewen
2016-11-30  2:15   ` Kinney, Michael D

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox