[edk2] [PATCH] UefiCpuPkg/MpInitLib: Fix a bug that AP enters timer INT handler

Ruiyu Ni posted 1 patch 6 years, 11 months ago
Failed in applying to current master (apply log)
UefiCpuPkg/Library/MpInitLib/MpLib.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
[edk2] [PATCH] UefiCpuPkg/MpInitLib: Fix a bug that AP enters timer INT handler
Posted by Ruiyu Ni 6 years, 11 months ago
When SourceLevelDebug is enabled, AP randomly executes the DXECORE
timer handler logic. The root cause is the interrupts are not
masked in AP wake up procedure.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jeff Fan <vanjeff_919@hotmail.com>
---
 UefiCpuPkg/Library/MpInitLib/MpLib.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c
index 0c2058a7b0..1a6cdb678e 100644
--- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
+++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
@@ -1,7 +1,7 @@
 /** @file
   CPU MP Initialize Library common functions.
 
-  Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
   which accompanies this distribution.  The full text of the license may be found at
@@ -582,6 +582,10 @@ ApWakeupFunction (
   // We need to re-initialize them at here
   //
   ProgramVirtualWireMode ();
+  //
+  // Mask the LINT0 and LINT1 so that AP doesn't enter the system timer interrupt handler.
+  //
+  DisableLvtInterrupts ();
   SyncLocalApicTimerSetting (CpuMpData);
 
   CurrentApicMode = GetApicMode ();
-- 
2.15.1.windows.2

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH] UefiCpuPkg/MpInitLib: Fix a bug that AP enters timer INT handler
Posted by Fan Jeff 6 years, 11 months ago
Reviewed-by: Jeff Fan <vanjeff_919@hotmail.com>

Ray,thank you find/fix this issue!


发自我的 iPhone

> 在 2018年1月5日,下午5:08,Ruiyu Ni <ruiyu.ni@intel.com> 写道:
> 
> When SourceLevelDebug is enabled, AP randomly executes the DXECORE
> timer handler logic. The root cause is the interrupts are not
> masked in AP wake up procedure.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
> Cc: Jeff Fan <vanjeff_919@hotmail.com>
> ---
> UefiCpuPkg/Library/MpInitLib/MpLib.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c
> index 0c2058a7b0..1a6cdb678e 100644
> --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
> +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
> @@ -1,7 +1,7 @@
> /** @file
>   CPU MP Initialize Library common functions.
> 
> -  Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>
>   This program and the accompanying materials
>   are licensed and made available under the terms and conditions of the BSD License
>   which accompanies this distribution.  The full text of the license may be found at
> @@ -582,6 +582,10 @@ ApWakeupFunction (
>   // We need to re-initialize them at here
>   //
>   ProgramVirtualWireMode ();
> +  //
> +  // Mask the LINT0 and LINT1 so that AP doesn't enter the system timer interrupt handler.
> +  //
> +  DisableLvtInterrupts ();
>   SyncLocalApicTimerSetting (CpuMpData);
> 
>   CurrentApicMode = GetApicMode ();
> -- 
> 2.15.1.windows.2
> 
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel