* [PATCH 0/6] Fix issues in CpuPageTableLib @ 2023-03-03 9:54 duntan 2023-03-03 9:54 ` [PATCH 1/6] UefiCpuPkg/CpuPageTableLib: Remove unneeded 'if' condition duntan [not found] ` <1748E02B5D10D9DA.21180@groups.io> 0 siblings, 2 replies; 3+ messages in thread From: duntan @ 2023-03-03 9:54 UTC (permalink / raw) To: devel 1.UefiCpuPkg/CpuPageTableLib: Remove unneeded 'if' condition 2.UefiCpuPkg/CpuPageTableLib: Fix the non-1:1 mapping issue 3.UefiCpuPkg/CpuPageTebleLib: Check input Mask in PageTableMap 4.UefiCpuPkg/CpuPageTableLib: Add manual TestCase to check input Mask 5.UefiCpuPkg/CpuPageTableLib: Modify RandomTest to check Mask 6.UefiCpuPkg/CpuPageTableLib: Enable non-1:1 mapping in random test Dun Tan (6): UefiCpuPkg/CpuPageTableLib: Remove unneeded 'if' condition UefiCpuPkg/CpuPageTableLib: Fix the non-1:1 mapping issue UefiCpuPkg/CpuPageTebleLib: Check input Mask in PageTableMap UefiCpuPkg/CpuPageTableLib: Add manual TestCase to check input Mask UefiCpuPkg/CpuPageTableLib: Modify RandomTest to check Mask UefiCpuPkg/CpuPageTableLib: Enable non-1:1 mapping in random test UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------- UefiCpuPkg/Library/CpuPageTableLib/UnitTest/CpuPageTableLibUnitTestHost.c | 130 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----- UefiCpuPkg/Library/CpuPageTableLib/UnitTest/RandomTest.c | 164 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------- 3 files changed, 311 insertions(+), 69 deletions(-) -- 2.31.1.windows.1 ^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/6] UefiCpuPkg/CpuPageTableLib: Remove unneeded 'if' condition 2023-03-03 9:54 [PATCH 0/6] Fix issues in CpuPageTableLib duntan @ 2023-03-03 9:54 ` duntan [not found] ` <1748E02B5D10D9DA.21180@groups.io> 1 sibling, 0 replies; 3+ messages in thread From: duntan @ 2023-03-03 9:54 UTC (permalink / raw) To: devel; +Cc: Dandan Bi, Liming Gao, Ray Ni Remove unneeded 'if' condition in CpuPageTableLib code. The deleted code is in the code branch for present non-leaf parent entry. So the check for (ParentPagingEntry->Pnle.Bits.Present == 0) won't is always FALSE. Signed-off-by: Dun Tan <dun.tan@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Ray Ni <ray.ni@intel.com> --- UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c b/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c index 37713ec659..47027917d9 100644 --- a/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c +++ b/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c @@ -375,15 +375,6 @@ PageTableLibMapInLevel ( // we need to change PDPTE[0].ReadWrite = 1 and let all PDE[0-255].ReadWrite = 0 in this step. // when PDPTE[0].Nx = 1 but caller wants to map [0-2MB] as Nx = 0 (PDT[0].Nx = 0) // we need to change PDPTE[0].Nx = 0 and let all PDE[0-255].Nx = 1 in this step. - if ((ParentPagingEntry->Pnle.Bits.Present == 0) && (Mask->Bits.Present == 1) && (Attribute->Bits.Present == 1)) { - if (Modify) { - ParentPagingEntry->Pnle.Bits.Present = 1; - } - - ChildAttribute.Bits.Present = 0; - ChildMask.Bits.Present = 1; - } - if ((ParentPagingEntry->Pnle.Bits.ReadWrite == 0) && (Mask->Bits.ReadWrite == 1) && (Attribute->Bits.ReadWrite == 1)) { if (Modify) { ParentPagingEntry->Pnle.Bits.ReadWrite = 1; -- 2.31.1.windows.1 ^ permalink raw reply related [flat|nested] 3+ messages in thread
[parent not found: <1748E02B5D10D9DA.21180@groups.io>]
* Re: [edk2-devel] [PATCH 1/6] UefiCpuPkg/CpuPageTableLib: Remove unneeded 'if' condition [not found] ` <1748E02B5D10D9DA.21180@groups.io> @ 2023-03-03 10:01 ` duntan 0 siblings, 0 replies; 3+ messages in thread From: duntan @ 2023-03-03 10:01 UTC (permalink / raw) To: devel@edk2.groups.io, Tan, Dun; +Cc: Bi, Dandan, Gao, Liming, Ni, Ray Sorry for adding wrong reviewers. Will resend the patch set. Thanks, Dun -----Original Message----- From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of duntan Sent: Friday, March 3, 2023 5:55 PM To: devel@edk2.groups.io Cc: Bi, Dandan <dandan.bi@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Ni, Ray <ray.ni@intel.com> Subject: [edk2-devel] [PATCH 1/6] UefiCpuPkg/CpuPageTableLib: Remove unneeded 'if' condition Remove unneeded 'if' condition in CpuPageTableLib code. The deleted code is in the code branch for present non-leaf parent entry. So the check for (ParentPagingEntry->Pnle.Bits.Present == 0) won't is always FALSE. Signed-off-by: Dun Tan <dun.tan@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Ray Ni <ray.ni@intel.com> --- UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c b/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c index 37713ec659..47027917d9 100644 --- a/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c +++ b/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c @@ -375,15 +375,6 @@ PageTableLibMapInLevel ( // we need to change PDPTE[0].ReadWrite = 1 and let all PDE[0-255].ReadWrite = 0 in this step. // when PDPTE[0].Nx = 1 but caller wants to map [0-2MB] as Nx = 0 (PDT[0].Nx = 0) // we need to change PDPTE[0].Nx = 0 and let all PDE[0-255].Nx = 1 in this step. - if ((ParentPagingEntry->Pnle.Bits.Present == 0) && (Mask->Bits.Present == 1) && (Attribute->Bits.Present == 1)) { - if (Modify) { - ParentPagingEntry->Pnle.Bits.Present = 1; - } - - ChildAttribute.Bits.Present = 0; - ChildMask.Bits.Present = 1; - } - if ((ParentPagingEntry->Pnle.Bits.ReadWrite == 0) && (Mask->Bits.ReadWrite == 1) && (Attribute->Bits.ReadWrite == 1)) { if (Modify) { ParentPagingEntry->Pnle.Bits.ReadWrite = 1; -- 2.31.1.windows.1 ^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-03-03 10:02 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-03-03 9:54 [PATCH 0/6] Fix issues in CpuPageTableLib duntan 2023-03-03 9:54 ` [PATCH 1/6] UefiCpuPkg/CpuPageTableLib: Remove unneeded 'if' condition duntan [not found] ` <1748E02B5D10D9DA.21180@groups.io> 2023-03-03 10:01 ` [edk2-devel] " duntan
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox