[edk2-devel] [Patch V2 02/14] UefiCpuPkg/CpuPageTableLib: Add check for input Length

duntan dun.tan at intel.com
Wed Mar 15 01:46:57 UTC 2023


Thanks Ray. Will update the corresponding function header comments in next version.

Thanks,
Dun

-----Original Message-----
From: Ni, Ray <ray.ni at intel.com> 
Sent: Wednesday, March 15, 2023 9:25 AM
To: Tan, Dun <dun.tan at intel.com>; devel at edk2.groups.io
Cc: Dong, Eric <eric.dong at intel.com>; Kumar, Rahul R <rahul.r.kumar at intel.com>; Gerd Hoffmann <kraxel at redhat.com>
Subject: RE: [Patch V2 02/14] UefiCpuPkg/CpuPageTableLib: Add check for input Length

The function header comments in lib header and C file should be updated as well to document a new condition when success is returned.

> -----Original Message-----
> From: Tan, Dun <dun.tan at intel.com>
> Sent: Wednesday, March 8, 2023 6:08 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>
> Subject: [Patch V2 02/14] UefiCpuPkg/CpuPageTableLib: Add check for 
> input Length
> 
> Add check for input Length in PageTableMap (). Return RETURN_SUCCESS 
> when input Length is 0.
> 
> Signed-off-by: Dun Tan <dun.tan at intel.com>
> Cc: Eric Dong <eric.dong at intel.com>
> Cc: Ray Ni <ray.ni at intel.com>
> Cc: Rahul Kumar <rahul1.kumar at intel.com>
> Cc: Gerd Hoffmann <kraxel at redhat.com>
> ---
>  UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c
> b/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c
> index 47027917d9..4c9d70fa0a 100644
> --- a/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c
> +++ b/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c
> @@ -567,6 +567,10 @@ PageTableMap (
>    IA32_PAGE_LEVEL     MaxLeafLevel;
>    IA32_MAP_ATTRIBUTE  ParentAttribute;
> 
> +  if (Length == 0) {
> +    return RETURN_SUCCESS;
> +  }
> +
>    if ((PagingMode == Paging32bit) || (PagingMode == PagingPae) || 
> (PagingMode >= PagingModeMax)) {
>      //
>      // 32bit paging is never supported.
> --
> 2.31.1.windows.1



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




More information about the edk2-devel-archive mailing list