Re: [edk2-devel] [PATCH] UefiCpuPkg/CpuPageTableLib: qualify page table accesses as volatile

2024-03-01 Thread Laszlo Ersek
On 3/1/24 03:54, Zhou Jianfeng wrote: > Add volatile qualifier to page table related variable to prevent > compiler from optimizing away the variables which may lead to > unexpected result. > > Signed-off-by: Zhou Jianfeng > Cc: Ray Ni > Cc: Laszlo Ersek > Cc: Rahul Kumar > Cc: Gerd Hoffmann

Re: [edk2-devel] [PATCH] UefiCpuPkg/CpuPageTableLib: qualify page table accesses as volatile

2024-03-01 Thread Laszlo Ersek
On 3/1/24 03:54, Zhou Jianfeng wrote: > Add volatile qualifier to page table related variable to prevent > compiler from optimizing away the variables which may lead to > unexpected result. > > Signed-off-by: Zhou Jianfeng > Cc: Ray Ni > Cc: Laszlo Ersek > Cc: Rahul Kumar > Cc: Gerd Hoffmann

Re: [edk2-devel] [PATCH] UefiCpuPkg/CpuPageTableLib: qualify page table accesses as volatile

2024-03-01 Thread Michael Brown
Reviewed-by: Michael Brown Thanks, Michael On 01/03/2024 02:54, Zhou Jianfeng wrote: Add volatile qualifier to page table related variable to prevent compiler from optimizing away the variables which may lead to unexpected result. Signed-off-by: Zhou Jianfeng Cc: Ray Ni Cc: Laszlo Ersek

[edk2-devel] [PATCH] UefiCpuPkg/CpuPageTableLib: qualify page table accesses as volatile

2024-03-01 Thread Zhou Jianfeng
Add volatile qualifier to page table related variable to prevent compiler from optimizing away the variables which may lead to unexpected result. Signed-off-by: Zhou Jianfeng Cc: Ray Ni Cc: Laszlo Ersek Cc: Rahul Kumar Cc: Gerd Hoffmann Cc: Pedro Falcato Cc: Zhang Di Cc: Tan Dun Cc:

Re: [edk2-devel] [PATCH] UefiCpuPkg/CpuPageTableLib: qualify page table accesses as volatile

2024-02-25 Thread Zhou, Jianfeng
Dun Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg/CpuPageTableLib: qualify page table accesses as volatile On 22/02/2024 08:41, Zhou Jianfeng wrote: > --- a/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c > +++ b/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c > @@ -20,13 +20,

Re: [edk2-devel] [PATCH] UefiCpuPkg/CpuPageTableLib: qualify page table accesses as volatile

2024-02-25 Thread Laszlo Ersek
On 2/23/24 16:51, Michael Brown wrote: > On 23/02/2024 15:12, Zhou, Jianfeng wrote: >>> While it may well cause the compiler to generate less optimised code, >>> there is absolutely no way that this volatile declaration on a local >>> stack variable can possibly change the outcome of the code. >>>

Re: [edk2-devel] [PATCH] UefiCpuPkg/CpuPageTableLib: qualify page table accesses as volatile

2024-02-23 Thread Michael Brown
On 23/02/2024 15:12, Zhou, Jianfeng wrote: While it may well cause the compiler to generate less optimised code, there is absolutely no way that this volatile declaration on a local stack variable can possibly change the outcome of the code. There can never be any meaningful side-effects from

Re: [edk2-devel] [PATCH] UefiCpuPkg/CpuPageTableLib: qualify page table accesses as volatile

2024-02-23 Thread Michael Brown
On 22/02/2024 08:41, Zhou Jianfeng wrote: --- a/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c +++ b/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c @@ -20,13 +20,13 @@ **/ VOID PageTableLibSetPte4K ( - IN OUT IA32_PTE_4K *Pte4K, - IN UINT64 Offset, -

[edk2-devel] [PATCH] UefiCpuPkg/CpuPageTableLib: qualify page table accesses as volatile

2024-02-23 Thread Zhou Jianfeng
Add volatile qualifier to page table related variable to prevent compiler from optimizing away the variables which may lead to unexpected result. Signed-off-by: Zhou Jianfeng Cc: Ray Ni Cc: Laszlo Ersek Cc: Rahul Kumar Cc: Gerd Hoffmann Cc: Pedro Falcato Cc: Zhang Di Cc: Tan Dun ---