From: Jian J Wang <jian.j.wang@intel.com>
To: edk2-devel@lists.01.org
Cc: Star Zeng <star.zeng@intel.com>, Eric Dong <eric.dong@intel.com>,
Laszlo Ersek <lersek@redhat.com>,
Jiewen Yao <jiewen.yao@intel.com>,
Michael Kinney <michael.d.kinney@intel.com>,
Jordan Justen <jordan.l.justen@intel.com>,
Ayellet Wolman <ayellet.wolman@intel.com>
Subject: [PATCH v2 0/6] Add NULL pointer detection feature
Date: Thu, 21 Sep 2017 13:20:26 +0800 [thread overview]
Message-ID: <20170921052032.13652-1-jian.j.wang@intel.com> (raw)
In-Reply-To: <Add NULL pointer detection feature>
The mechanism behind is to trigger a page fault exception at address 0.
This can be made by disabling page 0 (0-4095) during page table setup.
So this feature can only be available on platform with paging enabled.
Once this feature is enabled, any code, like CSM, which has to access
memory in page 0 needs to enable this page temporarily in advance and
disable it afterwards.
PcdNullPointerDetectionPropertyMask is used to control and elaborate
the use cases. For example, BIT7 of this PCD must be set for Windows 7
boot on Qemu if BIT0 set; or boot will fail.
Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Jordan Justen <jordan.l.justen@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>
Jian J Wang (5):
MdeModulePkg/DxeIpl: Implement NULL pointer detection
UefiCpuPkg/PiSmmCpuDxeSmm: Implement NULL pointer detection for SMM
code
MdeModulePkg/Core/Dxe: Add EndOfDxe workaround for NULL pointer
detection
IntelFrameworkModulePkg/Csm: Add code to bypass NULL pointer detection
OvmfPkg/QemuVideoDxe: Bypass NULL pointer detection during VBE SHIM
installing
Wang, Jian J (1):
MdeModulePkg/MdeModulePkg.dec: Add NULL pointer detection PCD
.../Csm/BiosThunk/KeyboardDxe/BiosKeyboard.c | 13 ++++
.../Csm/BiosThunk/KeyboardDxe/BiosKeyboard.h | 2 +
.../Csm/BiosThunk/KeyboardDxe/KeyboardDxe.inf | 2 +
.../Csm/LegacyBiosDxe/LegacyBda.c | 4 +
.../Csm/LegacyBiosDxe/LegacyBios.c | 90 ++++++++++++++++++++++
.../Csm/LegacyBiosDxe/LegacyBiosDxe.inf | 2 +
.../Csm/LegacyBiosDxe/LegacyBiosInterface.h | 18 +++++
.../Csm/LegacyBiosDxe/LegacyBootSupport.c | 23 +++++-
.../Csm/LegacyBiosDxe/LegacyPci.c | 17 +++-
IntelFrameworkModulePkg/Csm/LegacyBiosDxe/Thunk.c | 27 +++++--
MdeModulePkg/Core/Dxe/DxeMain.inf | 1 +
MdeModulePkg/Core/Dxe/Mem/Page.c | 4 +-
MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c | 48 ++++++++++++
MdeModulePkg/Core/DxeIplPeim/DxeIpl.h | 25 ++++++
MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf | 1 +
MdeModulePkg/Core/DxeIplPeim/DxeLoad.c | 65 ++++++++++++++++
MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c | 11 ++-
MdeModulePkg/Core/DxeIplPeim/X64/DxeLoadFunc.c | 2 +
MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c | 31 ++++++--
MdeModulePkg/MdeModulePkg.dec | 13 ++++
OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf | 2 +
OvmfPkg/QemuVideoDxe/VbeShim.c | 22 ++++++
UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c | 12 +++
UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 25 +++++-
UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf | 1 +
UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c | 12 +++
26 files changed, 452 insertions(+), 21 deletions(-)
--
2.14.1.windows.1
next parent reply other threads:[~2017-09-21 5:17 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Add NULL pointer detection feature>
2017-09-21 5:20 ` Jian J Wang [this message]
2017-09-21 5:20 ` [PATCH v2 1/6] MdeModulePkg/MdeModulePkg.dec: Add NULL pointer detection PCD Jian J Wang
2017-09-25 8:01 ` Zeng, Star
2017-09-25 8:25 ` Wang, Jian J
2017-09-21 5:20 ` [PATCH v2 2/6] MdeModulePkg/DxeIpl: Implement NULL pointer detection Jian J Wang
2017-09-25 8:50 ` Yao, Jiewen
2017-09-26 0:54 ` Wang, Jian J
2017-09-21 5:20 ` [PATCH v2 3/6] UefiCpuPkg/PiSmmCpuDxeSmm: Implement NULL pointer detection for SMM code Jian J Wang
2017-09-21 5:20 ` [PATCH v2 4/6] MdeModulePkg/Core/Dxe: Add EndOfDxe workaround for NULL pointer detection Jian J Wang
2017-09-21 5:20 ` [PATCH v2 5/6] IntelFrameworkModulePkg/Csm: Add code to bypass " Jian J Wang
2017-09-21 5:20 ` [PATCH v2 6/6] OvmfPkg/QemuVideoDxe: Bypass NULL pointer detection during VBE SHIM installing Jian J Wang
2017-09-22 11:50 ` Laszlo Ersek
2017-09-22 15:29 ` Laszlo Ersek
2017-09-25 1:04 ` Wang, Jian J
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=20170921052032.13652-1-jian.j.wang@intel.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