public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "duntan" <dun.tan@intel.com>
To: Sean Brogan <spbrogan@outlook.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Subject: Re: [edk2-devel] [PATCH 0/2] Remove mInternalCr3 in PiSmmCpuDxeSmm
Date: Wed, 10 Aug 2022 04:03:43 +0000	[thread overview]
Message-ID: <BN9PR11MB5483AE82F853784C1972D30AE5659@BN9PR11MB5483.namprd11.prod.outlook.com> (raw)
In-Reply-To: <BY3PR19MB490067B1568564BBB0EC1280C8659@BY3PR19MB4900.namprd19.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 2317 bytes --]

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






[-- Attachment #2: Type: text/html, Size: 5816 bytes --]

      reply	other threads:[~2022-08-10  4:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-10  1:45 [PATCH 0/2] Remove mInternalCr3 in PiSmmCpuDxeSmm duntan
2022-08-10  1:45 ` [PATCH 1/2] UefiCpuPkg/PiSmmCpuDxeSmm: Add a new IsShadowStack flag duntan
2022-08-10  3:51   ` [edk2-devel] " Ni, Ray
2022-08-10  4:02     ` duntan
2022-08-10  1:45 ` [PATCH 2/2] UefiCpuPkg/PiSmmCpuDxeSmm: Remove mInternalCr3 in PiSmmCpuDxeSmm duntan
2022-08-10  5:20   ` Ni, Ray
2022-08-10  3:20 ` [edk2-devel] [PATCH 0/2] " Sean
2022-08-10  4:03   ` duntan [this message]

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=BN9PR11MB5483AE82F853784C1972D30AE5659@BN9PR11MB5483.namprd11.prod.outlook.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