From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web12.1977.1649389952259457979 for ; Thu, 07 Apr 2022 20:52:32 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=hhUm0UPO; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: gang.c.chen@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649389952; x=1680925952; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=si/OxgNcMSn9ylui/AzwvZ/PN5zDu73NndkMPHfRstU=; b=hhUm0UPO31vEvoQ3VJmvW7fc/ivolKi1qJaJLR9y/5pzOcVhbfzo2DpN CS1g0a00onV4Tgc6FKGG3g5htNh4t6YIvqBi5jVAAOPqhWusKf9Wmw5Hm hrJKnJMt4DL23OFRBXTTVVvYE+URDCuyEZaxXUXcqD3WWJegbP4+9U16o Y1+PYnciU0sP1Zm7/dV6KCxANQIteQQl35RygljlCWec3NkQrRAD+Tfws AMIqmylhGffUsqr/cCqSYRnnj5UqKm4RncH7iNjGqDzja7VPdqpIymbRg PCOs/2NHUnEXOAB1FVAufThtcwVyAOZQpbyBLLoRGghFoVvwl7XANR2Rd A==; X-IronPort-AV: E=McAfee;i="6400,9594,10310"; a="241435045" X-IronPort-AV: E=Sophos;i="5.90,243,1643702400"; d="scan'208";a="241435045" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2022 20:52:31 -0700 X-IronPort-AV: E=Sophos;i="5.90,243,1643702400"; d="scan'208";a="571336792" Received: from gchen29.sh.intel.com ([10.239.154.135]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2022 20:52:29 -0700 From: "Chen, Gang C" To: devel@edk2.groups.io Cc: guomin.jiang@intel.com, dandan.bi@intel.com, di.zhang@intel.com, Jian J Wang , Liming Gao , Eric Dong , Ray Ni Subject: [PATCH] MdeModulePkg/dec: update the PcdCpuStackGuard property Date: Fri, 8 Apr 2022 11:52:11 +0800 Message-Id: <20220408035211.637342-1-gang.c.chen@intel.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Update the PcdCpuStackGuard from PcdsFixedAtBuild to PcdsDynamicEx. Meanwhile, remove the duplicate check for PcdCpuStackGuard for some limitation, which has been checked at the entry of InitializeMpExceptionStackSwitchHandlers. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3897 Cc: Jian J Wang Cc: Liming Gao Cc: devel@edk2.groups.io Cc: Eric Dong Cc: Ray Ni Signed-off-by: Gang Chen --- MdeModulePkg/MdeModulePkg.dec | 14 +++++++------- .../CpuExceptionHandlerLib/PeiCpuException.c | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index 463e889e9a..72e7e2eced 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -1070,13 +1070,6 @@ # @Prompt The Heap Guard feature mask gEfiMdeModulePkgTokenSpaceGuid.PcdHeapGuardPropertyMask|0x0|UINT8|0x30001054 - ## Indicates if UEFI Stack Guard will be enabled. - # If enabled, stack overflow in UEFI can be caught, preventing chaotic consequences.

- # TRUE - UEFI Stack Guard will be enabled.
- # FALSE - UEFI Stack Guard will be disabled.
- # @Prompt Enable UEFI Stack Guard. - gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard|FALSE|BOOLEAN|0x30001055 - [PcdsFixedAtBuild, PcdsPatchableInModule] ## Dynamic type PCD can be registered callback function for Pcd setting action. # PcdMaxPeiPcdCallBackNumberPerPcdEntry indicates the maximum number of callback function @@ -2079,6 +2072,13 @@ # @Prompt Enable PCIe Resizable BAR Capability support. gEfiMdeModulePkgTokenSpaceGuid.PcdPcieResizableBarSupport|FALSE|BOOLEAN|0x10000024 + ## Indicates if UEFI Stack Guard will be enabled. + # If enabled, stack overflow in UEFI can be caught, preventing chaotic consequences.

+ # TRUE - UEFI Stack Guard will be enabled.
+ # FALSE - UEFI Stack Guard will be disabled.
+ # @Prompt Enable UEFI Stack Guard. + gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard|FALSE|BOOLEAN|0x00010025 + [PcdsPatchableInModule] ## Specify memory size with page number for PEI code when # Loading Module at Fixed Address feature is enabled. diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuException.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuException.c index 687fc4177f..bcd4175ffa 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuException.c +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuException.c @@ -254,7 +254,7 @@ InitializeCpuExceptionHandlersEx ( // // Initializing stack switch is only necessary for Stack Guard functionality. // - if (PcdGetBool (PcdCpuStackGuard) && (InitData != NULL)) { + if (InitData != NULL) { Status = ArchSetupExceptionStack (InitData); } } -- 2.35.1