Re: [edk2] [Patch] UefiCpuPkg/S3Resume2Pei: disable paging before creating new page table.

2018-10-10 Thread Laszlo Ersek
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of >> Laszlo Ersek >> Sent: Wednesday, October 10, 2018 9:19 PM >> To: Yao, Jiewen ; Dong, Eric ; >> edk2-devel@lists.01.org >> Cc: Ni, Ruiyu >> Subject: Re: [edk2] [Patch] UefiCpuPkg/S3Resum

Re: [edk2] [Patch] UefiCpuPkg/S3Resume2Pei: disable paging before creating new page table.

2018-10-10 Thread Yao, Jiewen
en ; Dong, Eric ; > edk2-devel@lists.01.org > Cc: Ni, Ruiyu > Subject: Re: [edk2] [Patch] UefiCpuPkg/S3Resume2Pei: disable paging > before creating new page table. > > On 10/10/18 15:14, Yao, Jiewen wrote: > > Good idea, Laszlo. > > > > If we know something will fail

Re: [edk2] [Patch] UefiCpuPkg/S3Resume2Pei: disable paging before creating new page table.

2018-10-10 Thread Laszlo Ersek
Eric ; >> edk2-devel@lists.01.org >> Cc: Ni, Ruiyu >> Subject: Re: [edk2] [Patch] UefiCpuPkg/S3Resume2Pei: disable paging >> before creating new page table. >> >> On 10/10/18 09:58, Yao, Jiewen wrote: >>> Hey >>> I do not think we need add if (size

Re: [edk2] [Patch] UefiCpuPkg/S3Resume2Pei: disable paging before creating new page table.

2018-10-10 Thread Yao, Jiewen
well). > > Thanks! > Laszlo > > > > > Thank you > > Yao Jiewen > > > >> -Original Message- > >> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of > >> Eric Dong > >> Sent: Wednesday, Oc

Re: [edk2] [Patch] UefiCpuPkg/S3Resume2Pei: disable paging before creating new page table.

2018-10-10 Thread Laszlo Ersek
, 2018 3:44 PM >> To: edk2-devel@lists.01.org >> Cc: Ni, Ruiyu ; Laszlo Ersek >> Subject: [edk2] [Patch] UefiCpuPkg/S3Resume2Pei: disable paging before >> creating new page table. >> >> V4: >> Only disable paging when it is enabled. >> >> V3 c

Re: [edk2] [Patch] UefiCpuPkg/S3Resume2Pei: disable paging before creating new page table.

2018-10-10 Thread Yao, Jiewen
Behalf Of > Eric Dong > Sent: Wednesday, October 10, 2018 3:44 PM > To: edk2-devel@lists.01.org > Cc: Ni, Ruiyu ; Laszlo Ersek > Subject: [edk2] [Patch] UefiCpuPkg/S3Resume2Pei: disable paging before > creating new page table. > > V4: > Only disable paging when it is en

[edk2] [Patch] UefiCpuPkg/S3Resume2Pei: disable paging before creating new page table.

2018-10-10 Thread Eric Dong
V4: Only disable paging when it is enabled. V3 changes: No need to change inf file. V2 changes: Only disable paging in 32 bit mode, no matter it is enable or not. V1 changes: PEI Stack Guard needs to enable paging. This might cause #GP if code trying to write CR3 register with PML4 page table

Re: [edk2] [Patch] UefiCpuPkg/S3Resume2Pei: disable paging before creating new page table.

2018-10-09 Thread Laszlo Ersek
On 10/09/18 10:26, Ni, Ruiyu wrote: > On 10/9/2018 4:09 PM, Laszlo Ersek wrote: >>> >>> Two comments: >>> 1. We'd better not map the PcdCpuStackGuard to paging-enable. Maybe some >>> other feature also enables the paging in PEI phase but the >>> PcdCpuStackGuard is FALSE. >> >> I think I agree. >>

Re: [edk2] [Patch] UefiCpuPkg/S3Resume2Pei: disable paging before creating new page table.

2018-10-09 Thread Ni, Ruiyu
On 10/9/2018 4:09 PM, Laszlo Ersek wrote: Two comments: 1. We'd better not map the PcdCpuStackGuard to paging-enable. Maybe some other feature also enables the paging in PEI phase but the PcdCpuStackGuard is FALSE. I think I agree. 2. When PEI is in 64bit mode, disabling paging may not work

Re: [edk2] [Patch] UefiCpuPkg/S3Resume2Pei: disable paging before creating new page table.

2018-10-09 Thread Laszlo Ersek
-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of >>> Eric Dong >>> Sent: Tuesday, October 9, 2018 9:51 AM >>> To: edk2-devel@lists.01.org >>> Cc: Ni, Ruiyu ; Laszlo Ersek >>> Subject: [edk2] [Patch] UefiCpuPkg/S3Resume2Pei: disable paging be

Re: [edk2] [Patch] UefiCpuPkg/S3Resume2Pei: disable paging before creating new page table.

2018-10-08 Thread Dong, Eric
ferences in message. > > Regards, > Jian > > > > -Original Message- > > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] > > Sent: Tuesday, October 09, 2018 9:59 AM > > To: Dong, Eric ; edk2-devel@lists.01.org > > Cc: Ni, Ruiyu ; Laszlo

Re: [edk2] [Patch] UefiCpuPkg/S3Resume2Pei: disable paging before creating new page table.

2018-10-08 Thread Ni, Ruiyu
-devel@lists.01.org Cc: Ni, Ruiyu ; Laszlo Ersek Subject: [edk2] [Patch] UefiCpuPkg/S3Resume2Pei: disable paging before creating new page table. PEI Stack Guard needs to enable paging. This might cause #GP in the transition from 32-bit PEI to 64-bit SMM due to the code trying to write CR3 register

Re: [edk2] [Patch] UefiCpuPkg/S3Resume2Pei: disable paging before creating new page table.

2018-10-08 Thread Dong, Eric
> Cc: Ni, Ruiyu ; Laszlo Ersek > Subject: [edk2] [Patch] UefiCpuPkg/S3Resume2Pei: disable paging before > creating new page table. > > PEI Stack Guard needs to enable paging. This might cause #GP in the > transition from 32-bit PEI to 64-bit SMM due to the code trying to write CR

Re: [edk2] [Patch] UefiCpuPkg/S3Resume2Pei: disable paging before creating new page table.

2018-10-08 Thread Wang, Jian J
8 9:59 AM > To: Dong, Eric ; edk2-devel@lists.01.org > Cc: Ni, Ruiyu ; Laszlo Ersek > Subject: Re: [edk2] [Patch] UefiCpuPkg/S3Resume2Pei: disable paging before > creating new page table. > > Thanks for fixing this issue. > > Reviewed-by: Jian J Wang > > > -

Re: [edk2] [Patch] UefiCpuPkg/S3Resume2Pei: disable paging before creating new page table.

2018-10-08 Thread Wang, Jian J
Thanks for fixing this issue. Reviewed-by: Jian J Wang > -Original Message- > From: Dong, Eric > Sent: Tuesday, October 09, 2018 9:51 AM > To: edk2-devel@lists.01.org > Cc: Ni, Ruiyu ; Laszlo Ersek ; Wang, > Jian J > Subject: [Patch] UefiCpuPkg/S3Resume2Pei: disable paging before

[edk2] [Patch] UefiCpuPkg/S3Resume2Pei: disable paging before creating new page table.

2018-10-08 Thread Eric Dong
PEI Stack Guard needs to enable paging. This might cause #GP in the transition from 32-bit PEI to 64-bit SMM due to the code trying to write CR3 register with PML4 page table while the processor is enabled with PAE paging. Simply disabling paging before updating CR3 can solve this conflict.