[edk2-devel] [Patch V4 07/21] UefiCpuPkg/MpInitLib: Add code to initialize MapMask

duntan posted 21 patches 1 year, 6 months ago
There is a newer version of this series
[edk2-devel] [Patch V4 07/21] UefiCpuPkg/MpInitLib: Add code to initialize MapMask
Posted by duntan 1 year, 6 months ago
In function CreatePageTable(), add code to initialize MapMask to
MAX_UINT64. When creating new page table or map non-present range
to present, all attributes should be provided.

Signed-off-by: Dun Tan <dun.tan@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
---
 UefiCpuPkg/Library/MpInitLib/X64/CreatePageTable.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/UefiCpuPkg/Library/MpInitLib/X64/CreatePageTable.c b/UefiCpuPkg/Library/MpInitLib/X64/CreatePageTable.c
index 7cf91ed9c4..f20068152b 100644
--- a/UefiCpuPkg/Library/MpInitLib/X64/CreatePageTable.c
+++ b/UefiCpuPkg/Library/MpInitLib/X64/CreatePageTable.c
@@ -36,10 +36,7 @@ CreatePageTable (
   MapAttribute.Uint64         = Address;
   MapAttribute.Bits.Present   = 1;
   MapAttribute.Bits.ReadWrite = 1;
-
-  MapMask.Bits.PageTableBaseAddress = 1;
-  MapMask.Bits.Present              = 1;
-  MapMask.Bits.ReadWrite            = 1;
+  MapMask.Uint64              = MAX_UINT64;
 
   PageTable           = 0;
   PageTableBufferSize = 0;
-- 
2.31.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101635): https://edk2.groups.io/g/devel/message/101635
Mute This Topic: https://groups.io/mt/97796381/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [Patch V4 07/21] UefiCpuPkg/MpInitLib: Add code to initialize MapMask
Posted by Ni, Ray 1 year, 6 months ago
Reviewed-by: Ray Ni <ray.ni@intel.com>

> -----Original Message-----
> From: Tan, Dun <dun.tan@intel.com>
> Sent: Thursday, March 23, 2023 3:41 PM
> To: devel@edk2.groups.io
> Cc: Dong, Eric <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Kumar,
> Rahul R <rahul.r.kumar@intel.com>; Gerd Hoffmann <kraxel@redhat.com>
> Subject: [Patch V4 07/21] UefiCpuPkg/MpInitLib: Add code to initialize
> MapMask
> 
> In function CreatePageTable(), add code to initialize MapMask to
> MAX_UINT64. When creating new page table or map non-present range
> to present, all attributes should be provided.
> 
> Signed-off-by: Dun Tan <dun.tan@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Rahul Kumar <rahul1.kumar@intel.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  UefiCpuPkg/Library/MpInitLib/X64/CreatePageTable.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/UefiCpuPkg/Library/MpInitLib/X64/CreatePageTable.c
> b/UefiCpuPkg/Library/MpInitLib/X64/CreatePageTable.c
> index 7cf91ed9c4..f20068152b 100644
> --- a/UefiCpuPkg/Library/MpInitLib/X64/CreatePageTable.c
> +++ b/UefiCpuPkg/Library/MpInitLib/X64/CreatePageTable.c
> @@ -36,10 +36,7 @@ CreatePageTable (
>    MapAttribute.Uint64         = Address;
>    MapAttribute.Bits.Present   = 1;
>    MapAttribute.Bits.ReadWrite = 1;
> -
> -  MapMask.Bits.PageTableBaseAddress = 1;
> -  MapMask.Bits.Present              = 1;
> -  MapMask.Bits.ReadWrite            = 1;
> +  MapMask.Uint64              = MAX_UINT64;
> 
>    PageTable           = 0;
>    PageTableBufferSize = 0;
> --
> 2.31.1.windows.1



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