public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 0/4] Support non-stop mode in heap guard and null detection
@ 2018-08-20  6:41 Jian J Wang
  2018-08-20  6:41 ` [PATCH 1/4] MdeModulePkg/MdeModulePkg.dec: add new settings for PCDs Jian J Wang
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Jian J Wang @ 2018-08-20  6:41 UTC (permalink / raw)
  To: edk2-devel

Background:
Heap Guard and NULL Pointer Detection are very useful features to detect
code flaw in EDK II. If an issue is detected, #PF exception will be
triggered and the BIOS will enter into dead loop, which is the default
behavior of exception handling. From QA perspective, this default behavior
will block them to collect all tests result in reasonable time.

Solution:
This patch series update CpuDxe, PiSmmCpuDxeSmm and CpuExceptionHandlerLib
to allow the code to continue execution after #PF. The mechanism behind it
is the same as SMM Profile feature, in which a special #PF handler is
registered to set the page causing #PF to be 'present' and setup single
steop trap, then return the control back to the instruction accessing that
page. Once the instruction is re-executed, a #DB is triggered and a special
handler for it will be called to reset the page back to 'not-present'.

Usage:
The non-stop mode is enabled/disabled by BIT6 of following PCDs

  gEfiMdeModulePkgTokenSpaceGuid.PcdHeapGuardPropertyMask
  gEfiMdeModulePkgTokenSpaceGuid.PcdNullPointerDetectionPropertyMask

The default setting is 'disable'.

BZ Tracker:
https://bugzilla.tianocore.org/show_bug.cgi?id=1095

Jian J Wang (4):
  MdeModulePkg/MdeModulePkg.dec: add new settings for PCDs
  UefiCpuPkg/CpuExceptionHandlerLib: Setup single step in #PF handler
  UefiCpuPkg/CpuDxe: implement non-stop mode for uefi
  UefiCpuPkg/PiSmmCpuDxeSmm: implement non-stop mode for SMM

 MdeModulePkg/MdeModulePkg.dec                      |   4 +-
 UefiCpuPkg/CpuDxe/CpuDxe.h                         |  39 +++
 UefiCpuPkg/CpuDxe/CpuDxe.inf                       |   3 +
 UefiCpuPkg/CpuDxe/CpuMp.c                          |  34 ++-
 UefiCpuPkg/CpuDxe/CpuPageTable.c                   | 271 +++++++++++++++++++++
 .../Ia32/ExceptionHandlerAsm.nasm                  |   7 +
 .../Ia32/ExceptionTssEntryAsm.nasm                 |   4 +-
 .../X64/ExceptionHandlerAsm.nasm                   |   4 +
 UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c           |  43 ++--
 UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmiException.nasm   |   3 +-
 UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c             |  60 ++++-
 UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.h             |  15 ++
 UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfileInternal.h     |   6 +
 UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c            |  43 ++--
 14 files changed, 495 insertions(+), 41 deletions(-)

-- 
2.16.2.windows.1



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

end of thread, other threads:[~2018-08-20  8:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-20  6:41 [PATCH 0/4] Support non-stop mode in heap guard and null detection Jian J Wang
2018-08-20  6:41 ` [PATCH 1/4] MdeModulePkg/MdeModulePkg.dec: add new settings for PCDs Jian J Wang
2018-08-20  6:41 ` [PATCH 2/4] UefiCpuPkg/CpuExceptionHandlerLib: Setup single step in #PF handler Jian J Wang
2018-08-20  6:42 ` [PATCH 3/4] UefiCpuPkg/CpuDxe: implement non-stop mode for uefi Jian J Wang
2018-08-20  6:42 ` [PATCH 4/4] UefiCpuPkg/PiSmmCpuDxeSmm: implement non-stop mode for SMM Jian J Wang
2018-08-20  8:28 ` [PATCH 0/4] Support non-stop mode in heap guard and null detection Wang, Jian J

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