public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [PATCH v2 1/2] UefiCpuPkg/CpuPageTableLib: Enhance function header for PageTableMap()
@ 2024-01-17  6:21 Zhiguang Liu
  2024-01-17 10:23 ` Laszlo Ersek
  0 siblings, 1 reply; 3+ messages in thread
From: Zhiguang Liu @ 2024-01-17  6:21 UTC (permalink / raw)
  To: devel; +Cc: Zhiguang Liu, Ray Ni, Laszlo Ersek, Rahul Kumar, Gerd Hoffmann

PageTableMap() only modifies the PageTable root pointer when creating from zero.
Explicitly explain it in function header.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
---
 UefiCpuPkg/Include/Library/CpuPageTableLib.h         | 1 +
 UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/UefiCpuPkg/Include/Library/CpuPageTableLib.h b/UefiCpuPkg/Include/Library/CpuPageTableLib.h
index 78aa83b8de..755c8ab084 100644
--- a/UefiCpuPkg/Include/Library/CpuPageTableLib.h
+++ b/UefiCpuPkg/Include/Library/CpuPageTableLib.h
@@ -61,6 +61,7 @@ typedef enum {
   Create or update page table to map [LinearAddress, LinearAddress + Length) with specified attribute.
 
   @param[in, out] PageTable      The pointer to the page table to update, or pointer to NULL if a new page table is to be created.
+                                 If not pointer to NULL, the value it points to won't be changed in this function.
   @param[in]      PagingMode     The paging mode.
   @param[in]      Buffer         The free buffer to be used for page table creation/updating.
   @param[in, out] BufferSize     The buffer size.
diff --git a/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c b/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c
index 36b2c4e6a3..25bd9fc8d8 100644
--- a/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c
+++ b/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c
@@ -620,6 +620,7 @@ PageTableLibMapInLevel (
   Create or update page table to map [LinearAddress, LinearAddress + Length) with specified attribute.
 
   @param[in, out] PageTable      The pointer to the page table to update, or pointer to NULL if a new page table is to be created.
+                                 If not pointer to NULL, the value it points to won't be changed in this function.
   @param[in]      PagingMode     The paging mode.
   @param[in]      Buffer         The free buffer to be used for page table creation/updating.
   @param[in, out] BufferSize     The buffer size.
-- 
2.31.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113928): https://edk2.groups.io/g/devel/message/113928
Mute This Topic: https://groups.io/mt/103781121/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [edk2-devel] [PATCH v2 1/2] UefiCpuPkg/CpuPageTableLib: Enhance function header for PageTableMap()
  2024-01-17  6:21 [edk2-devel] [PATCH v2 1/2] UefiCpuPkg/CpuPageTableLib: Enhance function header for PageTableMap() Zhiguang Liu
@ 2024-01-17 10:23 ` Laszlo Ersek
  2024-01-18  5:11   ` Ni, Ray
  0 siblings, 1 reply; 3+ messages in thread
From: Laszlo Ersek @ 2024-01-17 10:23 UTC (permalink / raw)
  To: devel, zhiguang.liu; +Cc: Ray Ni, Rahul Kumar, Gerd Hoffmann

On 1/17/24 07:21, Zhiguang Liu wrote:
> PageTableMap() only modifies the PageTable root pointer when creating from zero.
> Explicitly explain it in function header.
> 
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Rahul Kumar <rahul1.kumar@intel.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
> ---
>  UefiCpuPkg/Include/Library/CpuPageTableLib.h         | 1 +
>  UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/UefiCpuPkg/Include/Library/CpuPageTableLib.h b/UefiCpuPkg/Include/Library/CpuPageTableLib.h
> index 78aa83b8de..755c8ab084 100644
> --- a/UefiCpuPkg/Include/Library/CpuPageTableLib.h
> +++ b/UefiCpuPkg/Include/Library/CpuPageTableLib.h
> @@ -61,6 +61,7 @@ typedef enum {
>    Create or update page table to map [LinearAddress, LinearAddress + Length) with specified attribute.
>  
>    @param[in, out] PageTable      The pointer to the page table to update, or pointer to NULL if a new page table is to be created.
> +                                 If not pointer to NULL, the value it points to won't be changed in this function.
>    @param[in]      PagingMode     The paging mode.
>    @param[in]      Buffer         The free buffer to be used for page table creation/updating.
>    @param[in, out] BufferSize     The buffer size.
> diff --git a/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c b/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c
> index 36b2c4e6a3..25bd9fc8d8 100644
> --- a/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c
> +++ b/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c
> @@ -620,6 +620,7 @@ PageTableLibMapInLevel (
>    Create or update page table to map [LinearAddress, LinearAddress + Length) with specified attribute.
>  
>    @param[in, out] PageTable      The pointer to the page table to update, or pointer to NULL if a new page table is to be created.
> +                                 If not pointer to NULL, the value it points to won't be changed in this function.
>    @param[in]      PagingMode     The paging mode.
>    @param[in]      Buffer         The free buffer to be used for page table creation/updating.
>    @param[in, out] BufferSize     The buffer size.

Reviewed-by: Laszlo Ersek <lersek@redhat.com>

(applying this is going to be difficult, because the patch emails were
not sent in response to a common cover letter, or in response to each other)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113945): https://edk2.groups.io/g/devel/message/113945
Mute This Topic: https://groups.io/mt/103781121/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [edk2-devel] [PATCH v2 1/2] UefiCpuPkg/CpuPageTableLib: Enhance function header for PageTableMap()
  2024-01-17 10:23 ` Laszlo Ersek
@ 2024-01-18  5:11   ` Ni, Ray
  0 siblings, 0 replies; 3+ messages in thread
From: Ni, Ray @ 2024-01-18  5:11 UTC (permalink / raw)
  To: Laszlo Ersek, devel@edk2.groups.io, Liu, Zhiguang
  Cc: Kumar, Rahul R, Gerd Hoffmann

Reviewed-by: Ray Ni <Ray.ni@intel.com>

Thanks,
Ray
> -----Original Message-----
> From: Laszlo Ersek <lersek@redhat.com>
> Sent: Wednesday, January 17, 2024 6:23 PM
> To: devel@edk2.groups.io; Liu, Zhiguang <zhiguang.liu@intel.com>
> Cc: Ni, Ray <ray.ni@intel.com>; Kumar, Rahul R <rahul.r.kumar@intel.com>;
> Gerd Hoffmann <kraxel@redhat.com>
> Subject: Re: [edk2-devel] [PATCH v2 1/2] UefiCpuPkg/CpuPageTableLib:
> Enhance function header for PageTableMap()
> 
> On 1/17/24 07:21, Zhiguang Liu wrote:
> > PageTableMap() only modifies the PageTable root pointer when creating
> from zero.
> > Explicitly explain it in function header.
> >
> > Cc: Ray Ni <ray.ni@intel.com>
> > Cc: Laszlo Ersek <lersek@redhat.com>
> > Cc: Rahul Kumar <rahul1.kumar@intel.com>
> > Cc: Gerd Hoffmann <kraxel@redhat.com>
> > Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
> > ---
> >  UefiCpuPkg/Include/Library/CpuPageTableLib.h         | 1 +
> >  UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c | 1 +
> >  2 files changed, 2 insertions(+)
> >
> > diff --git a/UefiCpuPkg/Include/Library/CpuPageTableLib.h
> b/UefiCpuPkg/Include/Library/CpuPageTableLib.h
> > index 78aa83b8de..755c8ab084 100644
> > --- a/UefiCpuPkg/Include/Library/CpuPageTableLib.h
> > +++ b/UefiCpuPkg/Include/Library/CpuPageTableLib.h
> > @@ -61,6 +61,7 @@ typedef enum {
> >    Create or update page table to map [LinearAddress, LinearAddress +
> Length) with specified attribute.
> >
> >    @param[in, out] PageTable      The pointer to the page table to
> update, or pointer to NULL if a new page table is to be created.
> > +                                 If not pointer to NULL, the value
> it points to won't be changed in this function.
> >    @param[in]      PagingMode     The paging mode.
> >    @param[in]      Buffer         The free buffer to be used for page
> table creation/updating.
> >    @param[in, out] BufferSize     The buffer size.
> > diff --git a/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c
> b/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c
> > index 36b2c4e6a3..25bd9fc8d8 100644
> > --- a/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c
> > +++ b/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c
> > @@ -620,6 +620,7 @@ PageTableLibMapInLevel (
> >    Create or update page table to map [LinearAddress, LinearAddress +
> Length) with specified attribute.
> >
> >    @param[in, out] PageTable      The pointer to the page table to
> update, or pointer to NULL if a new page table is to be created.
> > +                                 If not pointer to NULL, the value
> it points to won't be changed in this function.
> >    @param[in]      PagingMode     The paging mode.
> >    @param[in]      Buffer         The free buffer to be used for page
> table creation/updating.
> >    @param[in, out] BufferSize     The buffer size.
> 
> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
> 
> (applying this is going to be difficult, because the patch emails were
> not sent in response to a common cover letter, or in response to each other)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113984): https://edk2.groups.io/g/devel/message/113984
Mute This Topic: https://groups.io/mt/103781121/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-01-18  5:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-17  6:21 [edk2-devel] [PATCH v2 1/2] UefiCpuPkg/CpuPageTableLib: Enhance function header for PageTableMap() Zhiguang Liu
2024-01-17 10:23 ` Laszlo Ersek
2024-01-18  5:11   ` Ni, Ray

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox