[edk2-devel] [Patch V4 11/21] UefiCpuPkg/CpuPageTableLib:Modify RandomTest to check Mask/Attr

Ni, Ray ray.ni at intel.com
Thu Mar 23 13:11:54 UTC 2023



> -----Original Message-----
> From: Tan, Dun <dun.tan at intel.com>
> Sent: Thursday, March 23, 2023 3:41 PM
> To: devel at edk2.groups.io
> Cc: Dong, Eric <eric.dong at intel.com>; Ni, Ray <ray.ni at intel.com>; Kumar,
> Rahul R <rahul.r.kumar at intel.com>; Gerd Hoffmann <kraxel at redhat.com>;
> Liu, Zhiguang <zhiguang.liu at intel.com>
> Subject: [Patch V4 11/21] UefiCpuPkg/CpuPageTableLib:Modify RandomTest
> to check Mask/Attr
> 
> Modify RandomTest to check invalid input. When creating new page
> table or updating exsiting page table:
> 1.If set [LinearAddress, LinearAddress+Length] to non-preset, all
1. "non-present"

> +  //
> +  if (MapEntrys->Maps[MapsIndex].Length > 0) {
> +    for (Index = 0; Index < MapCount; Index++) {
> +      if ((PreviousAddress < Map[Index].LinearAddress) &&
> +          (MapEntrys->Maps[MapsIndex].LinearAddress <
> Map[Index].LinearAddress) && (RangeLimit > PreviousAddress))
> +      {
> +        //
> +        // MapEntrys->Maps[MapsIndex] contains not-present range in
> exsiting page table.
> +        //
> +        break;
> +      }
> +
> +      PreviousAddress = Map[Index].LinearAddress + Map[Index].Length;
> +    }
> +
> +    if (PreviousAddress < RangeLimit) {
2. can you use "if (Index < MapCount)"?



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101679): https://edk2.groups.io/g/devel/message/101679
Mute This Topic: https://groups.io/mt/97796388/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/3943202/1813853/130120423/xyzzy [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list