[edk2] [PATCH v4 3/3] EmulatorPkg/Mpservice: add enabled processor check for startupThisAP

Subject: [edk2] [PATCH v4 3/3] EmulatorPkg/Mpservice: add enabled processor check for startupThisAP

From: Chen Fan <chen.fan.fnst@cn.fujitsu.com>

To: <edk2-devel@lists.sourceforge.net>

Date: 2014-11-17 21:19:44

  • 2014-11-17 21:19:44  Chen Fan   [edk2] [PATCH v4 3/3] EmulatorPkg/Mpservice: add enabled processor check for startupThisAP
if processor number is the one of disabled processor, startupThisAP
should return invalid prameter.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan 
Reviewed-by: Jordan Justen 
---
 EmulatorPkg/CpuRuntimeDxe/MpService.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/EmulatorPkg/CpuRuntimeDxe/MpService.c b/EmulatorPkg/CpuRuntimeDxe/MpService.c
index 372b9a4..dcc79d3 100644
--- a/EmulatorPkg/CpuRuntimeDxe/MpService.c
+++ b/EmulatorPkg/CpuRuntimeDxe/MpService.c
@@ -693,6 +693,10 @@ CpuMpServicesStartupThisAP (
     return EFI_INVALID_PARAMETER;
   }
 
+  if ((gMPSystem.ProcessorData[ProcessorNumber].Info.StatusFlag & PROCESSOR_ENABLED_BIT) == 0) {
+    return EFI_INVALID_PARAMETER;
+  }
+
   gThread->MutexLock(gMPSystem.ProcessorData[ProcessorNumber].StateLock);
   if (gMPSystem.ProcessorData[ProcessorNumber].State != CPU_STATE_IDLE) {
     gThread->MutexUnlock(gMPSystem.ProcessorData[ProcessorNumber].StateLock);
-- 
1.9.3


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel