From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 27F7294109F for ; Fri, 28 Jul 2023 06:50:00 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=tBZ51AHFcroWBdya44Y5jtR+RDAErCd2eXn6qXNv4mo=; c=relaxed/simple; d=groups.io; h=X-Received:X-Received:X-Received:X-Received:X-Received:X-Received:X-WM-Sender:X-Originating-IP:X-WM-AuthFlag:X-WM-AuthUser:Date:From:To:Cc:Subject:References:X-Priority:X-Has-Attach:Mime-Version:Message-ID:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:X-Gm-Message-State:Content-Type; s=20140610; t=1690526998; v=1; b=FVQyExfIXqwW+FakZEJguZufZMKMMZ1etqPu5lK4n/z9qdfPQD9WWQ3CNJVDgVKzIv8oOJxx pPwyPRPOcaU9qxGCE825JNta4f/pY9F1uUv8CX0R5Sz5XU3j3A4p1Z/fjQwciQ1k9Rh/kbjVz7L Z0QC2z/cGYdKbm6/tTclSsH8= X-Received: by 127.0.0.2 with SMTP id 9JXRYY7687511xjjottaAyTh; Thu, 27 Jul 2023 23:49:58 -0700 X-Received: from cxsh.intel-email.com (cxsh.intel-email.com [121.46.250.151]) by mx.groups.io with SMTP id smtpd.web10.27198.1690526996059344960 for ; Thu, 27 Jul 2023 23:49:57 -0700 X-Received: from cxsh.intel-email.com (localhost [127.0.0.1]) by cxsh.intel-email.com (Postfix) with ESMTP id 1A2B6DDA7C5 for ; Fri, 28 Jul 2023 14:49:52 +0800 (CST) X-Received: from localhost (localhost [127.0.0.1]) by cxsh.intel-email.com (Postfix) with ESMTP id 15854DDA7AB for ; Fri, 28 Jul 2023 14:49:52 +0800 (CST) X-Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by cxsh.intel-email.com (Postfix) with SMTP id A5083DDA7BF for ; Fri, 28 Jul 2023 14:49:49 +0800 (CST) X-Received: from DESKTOP-M5NI163 ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Fri, 28 Jul 2023 14:49:44 +0800 X-WM-Sender: fanjianfeng@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: fanjianfeng@byosoft.com.cn Date: Fri, 28 Jul 2023 14:49:48 +0800 From: "Jeff Fan via groups.io" To: "devel@edk2.groups.io" , yuanhao.xie Cc: =?GB2312?B?RG9uZywgRXJpYw==?= , =?GB2312?B?TmksIFJheQ==?= , "Rahul Kumar" , "Gerd Hoffmann" , "Yuanhao Xie" Subject: Re: [edk2-devel] [Patch V6 4/4] UefiCpuPkg:Wake up APs after power-up or RESET through SIPI. References: <20230728062529.6312-1-yuanhao.xie@intel.com>, <20230728062529.6312-5-yuanhao.xie@intel.com> X-Priority: 3 X-Has-Attach: no Mime-Version: 1.0 Message-ID: <202307281449476781951@byosoft.com.cn> Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,fanjianfeng@byosoft.com.cn List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: qZ73dy8j9eRruN0fJ4kwmb5cx7686176AA= Content-Type: multipart/alternative; boundary="----=_001_NextPart320440026156_=----" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=FVQyExfI; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io ------=_001_NextPart320440026156_=---- Content-Type: text/plain; charset="GB2312" Content-Transfer-Encoding: base64 WXVhbmhhb6OsDQoNCkhhdmUgeW91IHZlcmlyZmVkIHdoZXRoZXIgQVBzIGNvdWxkIGJlIHdha2Vu LXVwIG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JTlQzMilFeGNoYW5nZUluZm8tPkJ1ZmZlclN0YXJ0KTsNCisgICAg ICAgIH0NCiAgICAgICB9DQogICAgIH0NCi0tIA0KMi4zNi4xLndpbmRvd3MuMQ0KIA0KIA0KIA0K DQogDQogDQogDQoNCgotPS09LT0tPS09LT0tPS09LT0tPS09LQpHcm91cHMuaW8gTGlua3M6IFlv dSByZWNlaXZlIGFsbCBtZXNzYWdlcyBzZW50IHRvIHRoaXMgZ3JvdXAuClZpZXcvUmVwbHkgT25s aW5lICgjMTA3MzY5KTogaHR0cHM6Ly9lZGsyLmdyb3Vwcy5pby9nL2RldmVsL21lc3NhZ2UvMTA3 MzY5Ck11dGUgVGhpcyBUb3BpYzogaHR0cHM6Ly9ncm91cHMuaW8vbXQvMTAwNDA1OTIyLzc2ODYx NzYKR3JvdXAgT3duZXI6IGRldmVsK293bmVyQGVkazIuZ3JvdXBzLmlvClVuc3Vic2NyaWJlOiBo dHRwczovL2VkazIuZ3JvdXBzLmlvL2cvZGV2ZWwvdW5zdWIgW3JlYmVjY2FAb3BlbmZ3LmlvXQot PS09LT0tPS09LT0tPS09LT0tPS09LQoKDQo= ------=_001_NextPart320440026156_=---- Content-Type: text/html; charset="GB2312" Content-Transfer-Encoding: quoted-printable
Yuanhao=A3=AC

Have you verirfed = whether APs could be waken-up from ApInHltLoop state or not?

Thank= s!
Jeff

fanjianfeng@byosoft.com.cn
 
Fr= om: Yuanhao Xie
=
Date: 2023-07-28 14:25
To: devel
Subject:&nbs= p;[edk2-devel] [Patch V6 4/4] UefiCpuPkg:Wake up APs after power-up or RESE= T through SIPI.
The implementation of this new b= ehavior aligns with the guidelines
outlined in the Intel SDM.
 
Following a power-up or RESET of an MP system, system hardware
dynamically selects one of the processors on the system bus as the BSP= .
The remaining processors are designated as APs. The APs complete a
minimal self-configuration, then wait for a startup signal (a SIPI
message) from the BSP processor.
 
Additionally, the MP protocol is executed only after
a power-up or RESET. If the MP protocol has completed and a
BSP is chosen, subsequent INITs (either to a specific processor or
system wide) do not cause the MP protocol to be repeated. Instead, eac= h
logical processor examines its BSP flag (in the IA32_APIC_BASE MSR) to=
determine whether it should execute the BIOS boot-strap code (if it is=
the BSP) or enter a wait-for-SIPI state (if it is an AP).
 
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Ray Ni <ray.ni@intel.com>
Signed-off-by: Yuanhao Xie <yuanhao.xie@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
---
UefiCpuPkg/Library/MpInitLib/MpLib.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
 
diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library= /MpInitLib/MpLib.c
index e7054adbcc..6f1456cfe1 100644
--- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
+++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
@@ -1294,7 +1294,14 @@ WakeUpAP (
       if (CpuMpData->SevSnpIsEnabled= && (CpuMpData->InitFlag !=3D ApInitConfig)) {
         SevSnpCreateAP (CpuMp= Data, -1);
       } else {
-        SendInitSipiSipiAllExcludi= ngSelf ((UINT32)ExchangeInfo->BufferStart);
+        if ((CpuMpData->InitFla= g =3D=3D ApInitConfig) && FixedPcdGetBool (PcdFirstTimeWakeUpAPsByS= ipi)) {
+          //
+          // SIPI can be= used for the first time wake up after reset to reduce boot time.
+          //
+          SendStartupIpi= AllExcludingSelf ((UINT32)ExchangeInfo->BufferStart);
+        } else {
+          SendInitSipiSi= piAllExcludingSelf ((UINT32)ExchangeInfo->BufferStart);
+        }
       }
     }
--
2.36.1.windows.1
 
 
 
 
 
 
_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#107369) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
------=_001_NextPart320440026156_=------