[edk2-devel] [PATCH 0/2] Remove mInternalCr3 in PiSmmCpuDxeSmm

duntan posted 2 patches 1 year, 8 months ago
Failed in applying to current master (apply log)
UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c           |  30 +++++-------------------------
UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h         |  26 +++++++++-----------------
UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c | 113 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------
UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c            |  73 +++++++++++++++++++++++--------------------------------------------------
4 files changed, 98 insertions(+), 144 deletions(-)
[edk2-devel] [PATCH 0/2] Remove mInternalCr3 in PiSmmCpuDxeSmm
Posted by duntan 1 year, 8 months ago
Add a new IsShadowStack flag in PiSmmCpuDxeSmm.
Remove mInternalCr3 in PiSmmCpuDxeSmm.

Dun Tan (2):
  UefiCpuPkg/PiSmmCpuDxeSmm: Add a new IsShadowStack flag
  UefiCpuPkg/PiSmmCpuDxeSmm: Remove mInternalCr3 in PiSmmCpuDxeSmm

 UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c           |  30 +++++-------------------------
 UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h         |  26 +++++++++-----------------
 UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c | 113 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------
 UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c            |  73 +++++++++++++++++++++++--------------------------------------------------
 4 files changed, 98 insertions(+), 144 deletions(-)

-- 
2.31.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92267): https://edk2.groups.io/g/devel/message/92267
Mute This Topic: https://groups.io/mt/92928944/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 0/2] Remove mInternalCr3 in PiSmmCpuDxeSmm
Posted by Sean 1 year, 8 months ago
Is there any documentation to why this change is important and what exactly was broken?

Thanks
Sean
________________________________
From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of duntan <dun.tan@intel.com>
Sent: Tuesday, August 9, 2022 6:45:30 PM
To: devel@edk2.groups.io <devel@edk2.groups.io>
Subject: [edk2-devel] [PATCH 0/2] Remove mInternalCr3 in PiSmmCpuDxeSmm

Add a new IsShadowStack flag in PiSmmCpuDxeSmm.
Remove mInternalCr3 in PiSmmCpuDxeSmm.

Dun Tan (2):
  UefiCpuPkg/PiSmmCpuDxeSmm: Add a new IsShadowStack flag
  UefiCpuPkg/PiSmmCpuDxeSmm: Remove mInternalCr3 in PiSmmCpuDxeSmm

 UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c           |  30 +++++-------------------------
 UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h         |  26 +++++++++-----------------
 UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c | 113 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------
 UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c            |  73 +++++++++++++++++++++++--------------------------------------------------
 4 files changed, 98 insertions(+), 144 deletions(-)

--
2.31.1.windows.1








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92270): https://edk2.groups.io/g/devel/message/92270
Mute This Topic: https://groups.io/mt/92928944/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH 0/2] Remove mInternalCr3 in PiSmmCpuDxeSmm
Posted by duntan 1 year, 8 months ago
Hi Sean,

The patch set is a code refactoring and doesn't change any functionality.  The reason for this code refactoring is because:
1. In PiSmmCpuDxe driver entrypoint, this driver initializes smm page table which is different from Cr3 register. Currently, mInternalCr3 is used to pass address of page table which is different from Cr3 register.
     Now remove it and pass the page table base address from the root function to simplify the code logic.
2. Besides, current code logic will regard a RO range as shadow stack and set the dirty bit in corresponding page table entry if mInternalCr3 is not 0. This assumption may be confusing.
    A new mIsShadowStack flag will be created to identify if it is a shadow stack  or not.

Thanks,
Dun
From: Sean Brogan <spbrogan@outlook.com>
Sent: Wednesday, August 10, 2022 11:21 AM
To: devel@edk2.groups.io; Tan, Dun <dun.tan@intel.com>
Subject: Re: [edk2-devel] [PATCH 0/2] Remove mInternalCr3 in PiSmmCpuDxeSmm

Is there any documentation to why this change is important and what exactly was broken?

Thanks
Sean
________________________________
From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>> on behalf of duntan <dun.tan@intel.com<mailto:dun.tan@intel.com>>
Sent: Tuesday, August 9, 2022 6:45:30 PM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>
Subject: [edk2-devel] [PATCH 0/2] Remove mInternalCr3 in PiSmmCpuDxeSmm

Add a new IsShadowStack flag in PiSmmCpuDxeSmm.
Remove mInternalCr3 in PiSmmCpuDxeSmm.

Dun Tan (2):
  UefiCpuPkg/PiSmmCpuDxeSmm: Add a new IsShadowStack flag
  UefiCpuPkg/PiSmmCpuDxeSmm: Remove mInternalCr3 in PiSmmCpuDxeSmm

 UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c           |  30 +++++-------------------------
 UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h         |  26 +++++++++-----------------
 UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c | 113 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------
 UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c            |  73 +++++++++++++++++++++++--------------------------------------------------
 4 files changed, 98 insertions(+), 144 deletions(-)

--
2.31.1.windows.1







-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92276): https://edk2.groups.io/g/devel/message/92276
Mute This Topic: https://groups.io/mt/92928944/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-