]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/MdeModulePkg.dec,.uni: Add NULL pointer detection PCD
authorWang, Jian J <jian.j.wang@intel.com>
Sat, 26 Aug 2017 01:08:10 +0000 (09:08 +0800)
committerEric Dong <eric.dong@intel.com>
Wed, 11 Oct 2017 08:39:00 +0000 (16:39 +0800)
PCD PcdNullPointerDetectionPropertyMask is a bitmask used to control the
NULL address detection functionality in code for different phases.

If enabled, accessing NULL address in UEFI or SMM code can be caught
as a page fault exception.

    BIT0    - Enable NULL pointer detection for UEFI.
    BIT1    - Enable NULL pointer detection for SMM.
    BIT2..6 - Reserved for future uses.
    BIT7    - Disable NULL pointer detection just after EndOfDxe. This is a
              workaround for those unsolvable NULL access issues in
              OptionROM, boot loader, etc. It can also help to avoid
              unnecessary exception caused by legacy memory (0-4095) access
              after EndOfDxe, such as Windows 7 boot on Qemu.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Ayellet Wolman <ayellet.wolman@intel.com>
Suggested-by: Ayellet Wolman <ayellet.wolman@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
MdeModulePkg/MdeModulePkg.dec
MdeModulePkg/MdeModulePkg.uni

index a3c0633ee1ec6ab7540a1b7221850e975f95ad80..9248d10da8810923f2c0efba0d6e15f2bb641408 100644 (file)
   # @ValidList  0x80000006 | 0x03058002\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdErrorCodeSetVariable|0x03058002|UINT32|0x30001040\r
 \r
+  ## Mask to control the NULL address detection in code for different phases.\r
+  #  If enabled, accessing NULL address in UEFI or SMM code can be caught.<BR><BR>\r
+  #    BIT0    - Enable NULL pointer detection for UEFI.<BR>\r
+  #    BIT1    - Enable NULL pointer detection for SMM.<BR>\r
+  #    BIT2..6 - Reserved for future uses.<BR>\r
+  #    BIT7    - Disable NULL pointer detection just after EndOfDxe. <BR>\r
+  #              This is a workaround for those unsolvable NULL access issues in\r
+  #              OptionROM, boot loader, etc. It can also help to avoid unnecessary\r
+  #              exception caused by legacy memory (0-4095) access after EndOfDxe,\r
+  #              such as Windows 7 boot on Qemu.<BR>\r
+  # @Prompt Enable NULL address detection.\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdNullPointerDetectionPropertyMask|0x0|UINT8|0x30001050\r
+\r
 [PcdsFixedAtBuild, PcdsPatchableInModule]\r
   ## Dynamic type PCD can be registered callback function for Pcd setting action.\r
   #  PcdMaxPeiPcdCallBackNumberPerPcdEntry indicates the maximum number of callback function\r
index d6015de75fe0c40bdeda8162c6359b86eaf734d3..f8b31694ba81e7048a79cb08f08c6bb087f3738c 100644 (file)
                                                                                                      "enabled on AMD processors supporting the Secure Encrypted Virtualization (SEV) feature.\n"\r
                                                                                                      "This mask should be applied when creating 1:1 virtual to physical mapping tables."\r
 \r
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdNullPointerDetectionPropertyMask_PROMPT  #language en-US "Enable NULL pointer detection"\r
+\r
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdNullPointerDetectionPropertyMask_HELP    #language en-US "Mask to control the NULL address detection in code for different phases.\n"\r
+                                                                                                       " If enabled, accessing NULL address in UEFI or SMM code can be caught.\n\n"\r
+                                                                                                       "   BIT0    - Enable NULL pointer detection for UEFI.\n"\r
+                                                                                                       "   BIT1    - Enable NULL pointer detection for SMM.\n"\r
+                                                                                                       "   BIT2..6 - Reserved for future uses.\n"\r
+                                                                                                       "   BIT7    - Disable NULL pointer detection just after EndOfDxe."\r
+                                                                                                       " This is a workaround for those unsolvable NULL access issues in"\r
+                                                                                                       " OptionROM, boot loader, etc. It can also help to avoid unnecessary"\r
+                                                                                                       " exception caused by legacy memory (0-4095) access after EndOfDxe,"\r
+                                                                                                       " such as Windows 7 boot on Qemu.\n"\r
+\r