From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.24; helo=mga09.intel.com; envelope-from=jian.j.wang@intel.com; receiver=edk2-devel@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7844E2194D387 for ; Mon, 10 Sep 2018 22:16:48 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Sep 2018 22:16:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,359,1531810800"; d="scan'208";a="72214017" Received: from shwdeopenpsi777.ccr.corp.intel.com ([10.239.158.27]) by orsmga008.jf.intel.com with ESMTP; 10 Sep 2018 22:16:46 -0700 From: Jian J Wang To: edk2-devel@lists.01.org Cc: Star Zeng , Laszlo Ersek , Ard Biesheuvel , Ruiyu Ni , Jiewen Yao Date: Tue, 11 Sep 2018 13:16:36 +0800 Message-Id: <20180911051636.4888-6-jian.j.wang@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: <20180911051636.4888-1-jian.j.wang@intel.com> References: <20180911051636.4888-1-jian.j.wang@intel.com> Subject: [PATCH 5/5] MdeModulePkg: expire PcdSetNxForStack X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Sep 2018 05:16:48 -0000 BZ#: https://bugzilla.tianocore.org/show_bug.cgi?id=1116 Since the stack memory is allocated as EfiBootServicesData, its NX protection can be covered by BIT4 of PcdDxeNxMemoryProtectionPolicy. To avoid confusing in setting related PCDs, PcdSetNxForStack will be expired. Set BIT4 of PcdDxeNxMemoryProtectionPolicy if NX protection is needed for stack. Cc: Star Zeng Cc: Laszlo Ersek Cc: Ard Biesheuvel Cc: Ruiyu Ni Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang --- MdeModulePkg/MdeModulePkg.dec | 10 +--------- MdeModulePkg/MdeModulePkg.uni | 10 +--------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index 74a699cbb7..b1f208909c 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -1320,6 +1320,7 @@ # # NOTE: User must NOT set NX protection for EfiLoaderCode / EfiBootServicesCode / EfiRuntimeServicesCode.
# User MUST set the same NX protection for EfiBootServicesData and EfiConventionalMemory.
+ # Stack is allocated as type of EfiBootServicesData. Enable NX protection for it will also enable NX protection for stack.
# # e.g. 0x7FD5 can be used for all memory except Code.
# e.g. 0x7BD4 can be used for all memory except Code and ACPINVS/Reserved.
@@ -1886,15 +1887,6 @@ # @Prompt Default Creator Revision for ACPI table creation. gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorRevision|0x01000013|UINT32|0x30001038 - ## Indicates if to set NX for stack.

- # For the DxeIpl and the DxeCore are both X64, set NX for stack feature also require PcdDxeIplBuildPageTables be TRUE.
- # For the DxeIpl and the DxeCore are both IA32 (PcdDxeIplSwitchToLongMode is FALSE), set NX for stack feature also require - # IA32 PAE is supported and Execute Disable Bit is available.
- # TRUE - to set NX for stack.
- # FALSE - Not to set NX for stack.
- # @Prompt Set NX for stack. - gEfiMdeModulePkgTokenSpaceGuid.PcdSetNxForStack|FALSE|BOOLEAN|0x0001006f - ## This PCD specifies the PCI-based SD/MMC host controller mmio base address. # Define the mmio base address of the pci-based SD/MMC host controller. If there are multiple SD/MMC # host controllers, their mmio base addresses are calculated one by one from this base address. diff --git a/MdeModulePkg/MdeModulePkg.uni b/MdeModulePkg/MdeModulePkg.uni index 080b8a62c0..6b26b21f00 100644 --- a/MdeModulePkg/MdeModulePkg.uni +++ b/MdeModulePkg/MdeModulePkg.uni @@ -339,15 +339,6 @@ #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSerialRegisterStride_HELP #language en-US "The number of bytes between registers in serial device. The default is 1 byte." -#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSetNxForStack_PROMPT #language en-US "Set NX for stack" - -#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSetNxForStack_HELP #language en-US "Indicates if to set NX for stack.

" - "For the DxeIpl and the DxeCore are both X64, set NX for stack feature also require PcdDxeIplBuildPageTables be TRUE.
" - "For the DxeIpl and the DxeCore are both IA32 (PcdDxeIplSwitchToLongMode is FALSE), set NX for stack feature also require" - "IA32 PAE is supported and Execute Disable Bit is available.
" - "TRUE - to set NX for stack.
" - "FALSE - Not to set NX for stack.
" - #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdAcpiS3Enable_PROMPT #language en-US "ACPI S3 Enable" #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdAcpiS3Enable_HELP #language en-US "Indicates if ACPI S3 will be enabled.

" @@ -1129,6 +1120,7 @@ "\n" "NOTE: User must NOT set NX protection for EfiLoaderCode / EfiBootServicesCode / EfiRuntimeServicesCode.
\n" "User MUST set the same NX protection for EfiBootServicesData and EfiConventionalMemory.
\n" + "Stack is allocated as type of EfiBootServicesData. Enable NX protection for it will also enable NX protection for stack.
\n" "\n" "e.g. 0x7FD5 can be used for all memory except Code.
\n" "e.g. 0x7BD4 can be used for all memory except Code and ACPINVS/Reserved.
\n" -- 2.16.2.windows.1