public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix bad performance in changing page attributes
@ 2018-01-26  9:03 Jian J Wang
  2018-01-26  9:03 ` [PATCH 1/2] UefiCpuPkg/MpInitLib: force flushing TLB for AP in mwait loop mode Jian J Wang
  2018-01-26  9:03 ` [PATCH 2/2] UefiCpuPkg/CpuDxe: remove all code to flush TLB for APs Jian J Wang
  0 siblings, 2 replies; 6+ messages in thread
From: Jian J Wang @ 2018-01-26  9:03 UTC (permalink / raw)
  To: edk2-devel

There's a great performance down if we enable heap guard features.
This feature will frequently update page attribute to set/unset guard
pages, which is done by CpuArchProtocol.SetMemoryAttributes. In the
implementation of this method (in CpuDxe), it will call
MpProtocol.StartupAllAps() to flush TLB for all APs after updating
page attributes. We found that StartupAllAps() will spend a lot of
time to complete the flush operation. For example, listing a folder
content in shell will take 55s to complete. Normally it should take
less than 5s.

The solution is removing the flush operation for AP in CpuDxe driver
but let AP do it in its own wakeup code. There's no need to flush TLB
for AP who has no chance to run code.

Jian J Wang (2):
  UefiCpuPkg/MpInitLib: force flushing TLB for AP in mwait loop mode
  UefiCpuPkg/CpuDxe: remove all code to flush TLB for APs

 UefiCpuPkg/CpuDxe/CpuPageTable.c     | 85 +++---------------------------------
 UefiCpuPkg/Library/MpInitLib/MpLib.c |  6 +++
 2 files changed, 11 insertions(+), 80 deletions(-)

-- 
2.15.1.windows.2



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

* [PATCH 1/2] UefiCpuPkg/MpInitLib: force flushing TLB for AP in mwait loop mode
  2018-01-26  9:03 [PATCH 0/2] Fix bad performance in changing page attributes Jian J Wang
@ 2018-01-26  9:03 ` Jian J Wang
  2018-01-26  9:14   ` Ni, Ruiyu
  2018-01-26  9:03 ` [PATCH 2/2] UefiCpuPkg/CpuDxe: remove all code to flush TLB for APs Jian J Wang
  1 sibling, 1 reply; 6+ messages in thread
From: Jian J Wang @ 2018-01-26  9:03 UTC (permalink / raw)
  To: edk2-devel; +Cc: Ruiyu Ni, Jiewen Yao, Eric Dong, Laszlo Ersek

The reason doing this is that we found that calling StartupAllAps() to
flush TLB for all APs in CpuDxe driver after changing page attributes
will spend a lot of time to complete. If there are many page attributes
update requests, the whole system performance will be slowed down
explicitly, including any shell command and UI operation.

The solution is removing the flush operation for AP in CpuDxe driver.
Since TLB is always flushed in HLT loop mode, we just need to enforce
a TLB flush for mwait loop mode.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
---
 UefiCpuPkg/Library/MpInitLib/MpLib.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c
index 6231968c74..175a4b49e5 100644
--- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
+++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
@@ -630,6 +630,12 @@ ApWakeupFunction (
         // Restore AP's volatile registers saved
         //
         RestoreVolatileRegisters (&CpuMpData->CpuData[ProcessorNumber].VolatileRegisters, TRUE);
+      } else {
+        //
+        // Due to performance concern, the CPU driver might not flush TLB for
+        // APs on spot. AP itself needs to take care of it when woken up.
+        //
+        CpuFlushTlb ();
       }
 
       if (GetApState (&CpuMpData->CpuData[ProcessorNumber]) == CpuStateReady) {
-- 
2.15.1.windows.2



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

* [PATCH 2/2] UefiCpuPkg/CpuDxe: remove all code to flush TLB for APs
  2018-01-26  9:03 [PATCH 0/2] Fix bad performance in changing page attributes Jian J Wang
  2018-01-26  9:03 ` [PATCH 1/2] UefiCpuPkg/MpInitLib: force flushing TLB for AP in mwait loop mode Jian J Wang
@ 2018-01-26  9:03 ` Jian J Wang
  2018-01-26  9:13   ` Ni, Ruiyu
  1 sibling, 1 reply; 6+ messages in thread
From: Jian J Wang @ 2018-01-26  9:03 UTC (permalink / raw)
  To: edk2-devel; +Cc: Ruiyu Ni, Jiewen Yao, Eric Dong, Laszlo Ersek

The reason doing this is that we found that calling StartupAllAps() to
flush TLB for all APs in CpuDxe driver after changing page attributes
will spend a lot of time to complete. If there are many page attributes
update requests, the whole system performance will be slowed down
explicitly, including any shell command and UI operation.

The solution is removing the flush operation for AP in CpuDxe driver
and let AP flush TLB after woken up.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
---
 UefiCpuPkg/CpuDxe/CpuPageTable.c | 85 +++-------------------------------------
 1 file changed, 5 insertions(+), 80 deletions(-)

diff --git a/UefiCpuPkg/CpuDxe/CpuPageTable.c b/UefiCpuPkg/CpuDxe/CpuPageTable.c
index a33ac5519e..a5bf0dfe28 100644
--- a/UefiCpuPkg/CpuDxe/CpuPageTable.c
+++ b/UefiCpuPkg/CpuDxe/CpuPageTable.c
@@ -89,70 +89,6 @@ PAGE_ATTRIBUTE_TABLE mPageAttributeTable[] = {
 
 PAGE_TABLE_POOL   *mPageTablePool = NULL;
 
-/**
-  Enable write protection function for AP.
-
-  @param[in,out] Buffer  The pointer to private data buffer.
-**/
-VOID
-EFIAPI
-SyncCpuEnableWriteProtection (
-  IN OUT VOID *Buffer
-  )
-{
-  AsmWriteCr0 (AsmReadCr0 () | BIT16);
-}
-
-/**
-  CpuFlushTlb function for AP.
-
-  @param[in,out] Buffer  The pointer to private data buffer.
-**/
-VOID
-EFIAPI
-SyncCpuFlushTlb (
-  IN OUT VOID *Buffer
-  )
-{
-  CpuFlushTlb();
-}
-
-/**
-  Sync memory page attributes for AP.
-
-  @param[in] Procedure            A pointer to the function to be run on enabled APs of
-                                  the system.
-**/
-VOID
-SyncMemoryPageAttributesAp (
-  IN EFI_AP_PROCEDURE            Procedure
-  )
-{
-  EFI_STATUS                Status;
-  EFI_MP_SERVICES_PROTOCOL  *MpService;
-
-  Status = gBS->LocateProtocol (
-                  &gEfiMpServiceProtocolGuid,
-                  NULL,
-                  (VOID **)&MpService
-                  );
-  //
-  // Synchronize the update with all APs
-  //
-  if (!EFI_ERROR (Status)) {
-    Status = MpService->StartupAllAPs (
-                          MpService,          // This
-                          Procedure,          // Procedure
-                          FALSE,              // SingleThread
-                          NULL,               // WaitEvent
-                          0,                  // TimeoutInMicrosecsond
-                          NULL,               // ProcedureArgument
-                          NULL                // FailedCpuList
-                          );
-    ASSERT (Status == EFI_SUCCESS || Status == EFI_NOT_STARTED || Status == EFI_NOT_READY);
-  }
-}
-
 /**
   Return current paging context.
 
@@ -574,20 +510,6 @@ IsReadOnlyPageWriteProtected (
   return ((AsmReadCr0 () & BIT16) != 0);
 }
 
-/**
-  Disable write protection function for AP.
-
-  @param[in,out] Buffer  The pointer to private data buffer.
-**/
-VOID
-EFIAPI
-SyncCpuDisableWriteProtection (
-  IN OUT VOID *Buffer
-  )
-{
-  AsmWriteCr0 (AsmReadCr0() & ~BIT16);
-}
-
 /**
  Disable Write Protect on pages marked as read-only.
 **/
@@ -835,10 +757,13 @@ AssignMemoryPageAttributes (
   if (!EFI_ERROR(Status)) {
     if ((PagingContext == NULL) && IsModified) {
       //
-      // Flush TLB as last step
+      // Flush TLB as last step.
+      //
+      // Note: Don't flush TLB for APs here. It will take a lot of time to
+      // complete, and then slow down boot performance of the whole system
+      // if page attributes are requested frequently to update.
       //
       CpuFlushTlb();
-      SyncMemoryPageAttributesAp (SyncCpuFlushTlb);
     }
   }
 
-- 
2.15.1.windows.2



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

* Re: [PATCH 2/2] UefiCpuPkg/CpuDxe: remove all code to flush TLB for APs
  2018-01-26  9:03 ` [PATCH 2/2] UefiCpuPkg/CpuDxe: remove all code to flush TLB for APs Jian J Wang
@ 2018-01-26  9:13   ` Ni, Ruiyu
  2018-01-26  9:18     ` Wang, Jian J
  0 siblings, 1 reply; 6+ messages in thread
From: Ni, Ruiyu @ 2018-01-26  9:13 UTC (permalink / raw)
  To: Jian J Wang, edk2-devel; +Cc: Laszlo Ersek, Jiewen Yao, Eric Dong

On 1/26/2018 5:03 PM, Jian J Wang wrote:
> The reason doing this is that we found that calling StartupAllAps() to
> flush TLB for all APs in CpuDxe driver after changing page attributes
> will spend a lot of time to complete. If there are many page attributes
> update requests, the whole system performance will be slowed down
> explicitly, including any shell command and UI operation.
> 
> The solution is removing the flush operation for AP in CpuDxe driver
> and let AP flush TLB after woken up.
> 
> Cc: Ruiyu Ni <ruiyu.ni@intel.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
> ---
>   UefiCpuPkg/CpuDxe/CpuPageTable.c | 85 +++-------------------------------------
>   1 file changed, 5 insertions(+), 80 deletions(-)
> 
> diff --git a/UefiCpuPkg/CpuDxe/CpuPageTable.c b/UefiCpuPkg/CpuDxe/CpuPageTable.c
> index a33ac5519e..a5bf0dfe28 100644
> --- a/UefiCpuPkg/CpuDxe/CpuPageTable.c
> +++ b/UefiCpuPkg/CpuDxe/CpuPageTable.c
> @@ -89,70 +89,6 @@ PAGE_ATTRIBUTE_TABLE mPageAttributeTable[] = {
>   
>   PAGE_TABLE_POOL   *mPageTablePool = NULL;
>   
> -/**
> -  Enable write protection function for AP.
> -
> -  @param[in,out] Buffer  The pointer to private data buffer.
> -**/
> -VOID
> -EFIAPI
> -SyncCpuEnableWriteProtection (
> -  IN OUT VOID *Buffer
> -  )
> -{
> -  AsmWriteCr0 (AsmReadCr0 () | BIT16);
> -}
> -
> -/**
> -  CpuFlushTlb function for AP.
> -
> -  @param[in,out] Buffer  The pointer to private data buffer.
> -**/
> -VOID
> -EFIAPI
> -SyncCpuFlushTlb (
> -  IN OUT VOID *Buffer
> -  )
> -{
> -  CpuFlushTlb();
> -}
> -
> -/**
> -  Sync memory page attributes for AP.
> -
> -  @param[in] Procedure            A pointer to the function to be run on enabled APs of
> -                                  the system.
> -**/
> -VOID
> -SyncMemoryPageAttributesAp (
> -  IN EFI_AP_PROCEDURE            Procedure
> -  )
> -{
> -  EFI_STATUS                Status;
> -  EFI_MP_SERVICES_PROTOCOL  *MpService;
> -
> -  Status = gBS->LocateProtocol (
> -                  &gEfiMpServiceProtocolGuid,
> -                  NULL,
> -                  (VOID **)&MpService
> -                  );
> -  //
> -  // Synchronize the update with all APs
> -  //
> -  if (!EFI_ERROR (Status)) {
> -    Status = MpService->StartupAllAPs (
> -                          MpService,          // This
> -                          Procedure,          // Procedure
> -                          FALSE,              // SingleThread
> -                          NULL,               // WaitEvent
> -                          0,                  // TimeoutInMicrosecsond
> -                          NULL,               // ProcedureArgument
> -                          NULL                // FailedCpuList
> -                          );
> -    ASSERT (Status == EFI_SUCCESS || Status == EFI_NOT_STARTED || Status == EFI_NOT_READY);
> -  }
> -}
> -
>   /**
>     Return current paging context.
>   
> @@ -574,20 +510,6 @@ IsReadOnlyPageWriteProtected (
>     return ((AsmReadCr0 () & BIT16) != 0);
>   }
>   
> -/**
> -  Disable write protection function for AP.
> -
> -  @param[in,out] Buffer  The pointer to private data buffer.
> -**/
> -VOID
> -EFIAPI
> -SyncCpuDisableWriteProtection (
> -  IN OUT VOID *Buffer
> -  )
> -{
> -  AsmWriteCr0 (AsmReadCr0() & ~BIT16);
> -}
> -
>   /**
>    Disable Write Protect on pages marked as read-only.
>   **/
> @@ -835,10 +757,13 @@ AssignMemoryPageAttributes (
>     if (!EFI_ERROR(Status)) {
>       if ((PagingContext == NULL) && IsModified) {
>         //
> -      // Flush TLB as last step
> +      // Flush TLB as last step.
> +      //
> +      // Note: Don't flush TLB for APs here. It will take a lot of time to
> +      // complete, and then slow down boot performance of the whole system
> +      // if page attributes are requested frequently to update.
>         //

Code change looks good. But comments look like we skip the sync due to
performance. In fact, sync is unnecessary.
How about comments like below (refine as you need):
No need to flush TLB for APs here because:
1. when APs wake up from hlt, AP initialization code always sets CR3
2. when APs wake up from mwait/run loop, patch
    *UefiCpuPkg/MpInitLib: force flushing TLB for AP in mwait loop mode*
    sets CR3.

With the comments refine, Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>


>         CpuFlushTlb();
> -      SyncMemoryPageAttributesAp (SyncCpuFlushTlb);
>       }
>     }
>   
> 


-- 
Thanks,
Ray


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

* Re: [PATCH 1/2] UefiCpuPkg/MpInitLib: force flushing TLB for AP in mwait loop mode
  2018-01-26  9:03 ` [PATCH 1/2] UefiCpuPkg/MpInitLib: force flushing TLB for AP in mwait loop mode Jian J Wang
@ 2018-01-26  9:14   ` Ni, Ruiyu
  0 siblings, 0 replies; 6+ messages in thread
From: Ni, Ruiyu @ 2018-01-26  9:14 UTC (permalink / raw)
  To: Jian J Wang, edk2-devel; +Cc: Jiewen Yao, Eric Dong, Laszlo Ersek

On 1/26/2018 5:03 PM, Jian J Wang wrote:
> The reason doing this is that we found that calling StartupAllAps() to
> flush TLB for all APs in CpuDxe driver after changing page attributes
> will spend a lot of time to complete. If there are many page attributes
> update requests, the whole system performance will be slowed down
> explicitly, including any shell command and UI operation.
> 
> The solution is removing the flush operation for AP in CpuDxe driver.
> Since TLB is always flushed in HLT loop mode, we just need to enforce
> a TLB flush for mwait loop mode.
> 
> Cc: Ruiyu Ni <ruiyu.ni@intel.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
> ---
>   UefiCpuPkg/Library/MpInitLib/MpLib.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c
> index 6231968c74..175a4b49e5 100644
> --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
> +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
> @@ -630,6 +630,12 @@ ApWakeupFunction (
>           // Restore AP's volatile registers saved
>           //
>           RestoreVolatileRegisters (&CpuMpData->CpuData[ProcessorNumber].VolatileRegisters, TRUE);
> +      } else {
> +        //
> +        // Due to performance concern, the CPU driver might not flush TLB for
> +        // APs on spot. AP itself needs to take care of it when woken up.
> +        //
> +        CpuFlushTlb ();
>         }
>   
>         if (GetApState (&CpuMpData->CpuData[ProcessorNumber]) == CpuStateReady) {
> 
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>

-- 
Thanks,
Ray


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

* Re: [PATCH 2/2] UefiCpuPkg/CpuDxe: remove all code to flush TLB for APs
  2018-01-26  9:13   ` Ni, Ruiyu
@ 2018-01-26  9:18     ` Wang, Jian J
  0 siblings, 0 replies; 6+ messages in thread
From: Wang, Jian J @ 2018-01-26  9:18 UTC (permalink / raw)
  To: Ni, Ruiyu, edk2-devel@lists.01.org; +Cc: Laszlo Ersek, Yao, Jiewen, Dong, Eric

Right. I'll update the comments.

Regards,
Jian


> -----Original Message-----
> From: Ni, Ruiyu
> Sent: Friday, January 26, 2018 5:14 PM
> To: Wang, Jian J <jian.j.wang@intel.com>; edk2-devel@lists.01.org
> Cc: Laszlo Ersek <lersek@redhat.com>; Yao, Jiewen <jiewen.yao@intel.com>;
> Dong, Eric <eric.dong@intel.com>
> Subject: Re: [edk2] [PATCH 2/2] UefiCpuPkg/CpuDxe: remove all code to flush
> TLB for APs
> 
> On 1/26/2018 5:03 PM, Jian J Wang wrote:
> > The reason doing this is that we found that calling StartupAllAps() to
> > flush TLB for all APs in CpuDxe driver after changing page attributes
> > will spend a lot of time to complete. If there are many page attributes
> > update requests, the whole system performance will be slowed down
> > explicitly, including any shell command and UI operation.
> >
> > The solution is removing the flush operation for AP in CpuDxe driver
> > and let AP flush TLB after woken up.
> >
> > Cc: Ruiyu Ni <ruiyu.ni@intel.com>
> > Cc: Jiewen Yao <jiewen.yao@intel.com>
> > Cc: Eric Dong <eric.dong@intel.com>
> > Cc: Laszlo Ersek <lersek@redhat.com>
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
> > ---
> >   UefiCpuPkg/CpuDxe/CpuPageTable.c | 85 +++-------------------------------------
> >   1 file changed, 5 insertions(+), 80 deletions(-)
> >
> > diff --git a/UefiCpuPkg/CpuDxe/CpuPageTable.c
> b/UefiCpuPkg/CpuDxe/CpuPageTable.c
> > index a33ac5519e..a5bf0dfe28 100644
> > --- a/UefiCpuPkg/CpuDxe/CpuPageTable.c
> > +++ b/UefiCpuPkg/CpuDxe/CpuPageTable.c
> > @@ -89,70 +89,6 @@ PAGE_ATTRIBUTE_TABLE mPageAttributeTable[] = {
> >
> >   PAGE_TABLE_POOL   *mPageTablePool = NULL;
> >
> > -/**
> > -  Enable write protection function for AP.
> > -
> > -  @param[in,out] Buffer  The pointer to private data buffer.
> > -**/
> > -VOID
> > -EFIAPI
> > -SyncCpuEnableWriteProtection (
> > -  IN OUT VOID *Buffer
> > -  )
> > -{
> > -  AsmWriteCr0 (AsmReadCr0 () | BIT16);
> > -}
> > -
> > -/**
> > -  CpuFlushTlb function for AP.
> > -
> > -  @param[in,out] Buffer  The pointer to private data buffer.
> > -**/
> > -VOID
> > -EFIAPI
> > -SyncCpuFlushTlb (
> > -  IN OUT VOID *Buffer
> > -  )
> > -{
> > -  CpuFlushTlb();
> > -}
> > -
> > -/**
> > -  Sync memory page attributes for AP.
> > -
> > -  @param[in] Procedure            A pointer to the function to be run on enabled
> APs of
> > -                                  the system.
> > -**/
> > -VOID
> > -SyncMemoryPageAttributesAp (
> > -  IN EFI_AP_PROCEDURE            Procedure
> > -  )
> > -{
> > -  EFI_STATUS                Status;
> > -  EFI_MP_SERVICES_PROTOCOL  *MpService;
> > -
> > -  Status = gBS->LocateProtocol (
> > -                  &gEfiMpServiceProtocolGuid,
> > -                  NULL,
> > -                  (VOID **)&MpService
> > -                  );
> > -  //
> > -  // Synchronize the update with all APs
> > -  //
> > -  if (!EFI_ERROR (Status)) {
> > -    Status = MpService->StartupAllAPs (
> > -                          MpService,          // This
> > -                          Procedure,          // Procedure
> > -                          FALSE,              // SingleThread
> > -                          NULL,               // WaitEvent
> > -                          0,                  // TimeoutInMicrosecsond
> > -                          NULL,               // ProcedureArgument
> > -                          NULL                // FailedCpuList
> > -                          );
> > -    ASSERT (Status == EFI_SUCCESS || Status == EFI_NOT_STARTED || Status
> == EFI_NOT_READY);
> > -  }
> > -}
> > -
> >   /**
> >     Return current paging context.
> >
> > @@ -574,20 +510,6 @@ IsReadOnlyPageWriteProtected (
> >     return ((AsmReadCr0 () & BIT16) != 0);
> >   }
> >
> > -/**
> > -  Disable write protection function for AP.
> > -
> > -  @param[in,out] Buffer  The pointer to private data buffer.
> > -**/
> > -VOID
> > -EFIAPI
> > -SyncCpuDisableWriteProtection (
> > -  IN OUT VOID *Buffer
> > -  )
> > -{
> > -  AsmWriteCr0 (AsmReadCr0() & ~BIT16);
> > -}
> > -
> >   /**
> >    Disable Write Protect on pages marked as read-only.
> >   **/
> > @@ -835,10 +757,13 @@ AssignMemoryPageAttributes (
> >     if (!EFI_ERROR(Status)) {
> >       if ((PagingContext == NULL) && IsModified) {
> >         //
> > -      // Flush TLB as last step
> > +      // Flush TLB as last step.
> > +      //
> > +      // Note: Don't flush TLB for APs here. It will take a lot of time to
> > +      // complete, and then slow down boot performance of the whole system
> > +      // if page attributes are requested frequently to update.
> >         //
> 
> Code change looks good. But comments look like we skip the sync due to
> performance. In fact, sync is unnecessary.
> How about comments like below (refine as you need):
> No need to flush TLB for APs here because:
> 1. when APs wake up from hlt, AP initialization code always sets CR3
> 2. when APs wake up from mwait/run loop, patch
>     *UefiCpuPkg/MpInitLib: force flushing TLB for AP in mwait loop mode*
>     sets CR3.
> 
> With the comments refine, Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
> 
> 
> >         CpuFlushTlb();
> > -      SyncMemoryPageAttributesAp (SyncCpuFlushTlb);
> >       }
> >     }
> >
> >
> 
> 
> --
> Thanks,
> Ray

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

end of thread, other threads:[~2018-01-26  9:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-26  9:03 [PATCH 0/2] Fix bad performance in changing page attributes Jian J Wang
2018-01-26  9:03 ` [PATCH 1/2] UefiCpuPkg/MpInitLib: force flushing TLB for AP in mwait loop mode Jian J Wang
2018-01-26  9:14   ` Ni, Ruiyu
2018-01-26  9:03 ` [PATCH 2/2] UefiCpuPkg/CpuDxe: remove all code to flush TLB for APs Jian J Wang
2018-01-26  9:13   ` Ni, Ruiyu
2018-01-26  9:18     ` Wang, Jian J

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