public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Jeff Fan <jeff.fan@intel.com>
To: edk2-devel@lists.01.org
Cc: Feng Tian <feng.tian@intel.com>,
	Michael Kinney <michael.d.kinney@intel.com>
Subject: [PATCH 1/2] UefiCpuPkg/MpInitLib: save/restore original contents
Date: Fri, 21 Apr 2017 14:04:17 +0800	[thread overview]
Message-ID: <20170421060418.12732-2-jeff.fan@intel.com> (raw)
In-Reply-To: <20170421060418.12732-1-jeff.fan@intel.com>

If APs is in HLT-LOOP mode, we need AP reset vector for waking up APs. This
updating is to save/restore original contents of AP reset vector around waking
up APs always.

https://bugzilla.tianocore.org/show_bug.cgi?id=500

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
---
 UefiCpuPkg/Library/MpInitLib/PeiMpLib.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c b/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c
index fb1d48f..5ce5788 100644
--- a/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c
+++ b/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c
@@ -1,7 +1,7 @@
 /** @file
   MP initialize support functions for PEI phase.
 
-  Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2016 - 2017, 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
@@ -129,10 +129,8 @@ CpuMpEndOfPeiCallback (
       }
       Hob.Raw = GET_NEXT_HOB (Hob);
     }
-  } else {
-    CpuMpData->SaveRestoreFlag = TRUE;
-    RestoreWakeupBuffer (CpuMpData);
   }
+
   return EFI_SUCCESS;
 }
 
@@ -286,12 +284,8 @@ AllocateResetVector (
     CpuMpData->WakeupBuffer      = GetWakeupBuffer (ApResetVectorSize);
     CpuMpData->MpCpuExchangeInfo = (MP_CPU_EXCHANGE_INFO *) (UINTN)
                     (CpuMpData->WakeupBuffer + CpuMpData->AddressMap.RendezvousFunnelSize);
-    BackupAndPrepareWakeupBuffer (CpuMpData);
-  }
-
-  if (CpuMpData->SaveRestoreFlag) {
-    BackupAndPrepareWakeupBuffer (CpuMpData);
   }
+  BackupAndPrepareWakeupBuffer (CpuMpData);
 }
 
 /**
@@ -304,9 +298,7 @@ FreeResetVector (
   IN CPU_MP_DATA              *CpuMpData
   )
 {
-  if (CpuMpData->SaveRestoreFlag) {
-    RestoreWakeupBuffer (CpuMpData);
-  }
+  RestoreWakeupBuffer (CpuMpData);
 }
 
 /**
-- 
2.9.3.windows.2



  reply	other threads:[~2017-04-21  6:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-21  6:04 [PATCH 0/2] Borrow the space below 1MB for AP reset vector Jeff Fan
2017-04-21  6:04 ` Jeff Fan [this message]
2017-04-21  6:04 ` [PATCH 2/2] UefiCpuPkg/MpInitLib: needn't to allocate " Jeff Fan
2017-04-25  2:36 ` [PATCH 0/2] Borrow the space below 1MB for " Tian, Feng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170421060418.12732-2-jeff.fan@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox