From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web10.2232.1587542419875204007 for ; Wed, 22 Apr 2020 01:00:20 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: ray.ni@intel.com) IronPort-SDR: W69sDiAn/o0RSDDPkajGVHSBG5Diu5MuAzwjDxTxPJVH4byYk98j+zSMk5iJ0/bpPfK18ozBRo BNozjcstuzxQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Apr 2020 01:00:19 -0700 IronPort-SDR: 3ktCssRkL/f/Nc/ojdyOtRHpBF0xGPlR7SiBeixkzaLLirfEKTkmMA5Aubo56uCiJ/3qaoZVQu KOesctej/fMA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,412,1580803200"; d="scan'208";a="457058201" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga006.fm.intel.com with ESMTP; 22 Apr 2020 01:00:19 -0700 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 22 Apr 2020 01:00:18 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 22 Apr 2020 01:00:18 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.225]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.129]) with mapi id 14.03.0439.000; Wed, 22 Apr 2020 16:00:16 +0800 From: "Ni, Ray" To: "devel@edk2.groups.io" , "Dong, Eric" CC: Laszlo Ersek , "Kumar, Chandana C" Subject: Re: [edk2-devel] [PATCH 2/2] UefiCpuPkg/MpInitLib: Avoid ApInitReconfig in PEI. Thread-Topic: [edk2-devel] [PATCH 2/2] UefiCpuPkg/MpInitLib: Avoid ApInitReconfig in PEI. Thread-Index: AQHWGEZF1jJ3oF3cKUKrRJ1oVVrUiqiExshw Date: Wed, 22 Apr 2020 08:00:15 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C508172@SHSMSX104.ccr.corp.intel.com> References: <20200422013456.1053-1-eric.dong@intel.com> <20200422013456.1053-3-eric.dong@intel.com> In-Reply-To: <20200422013456.1053-3-eric.dong@intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: ray.ni@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ray Ni with a bit comments update: "Current been used wake up buffer is allocated in PEI phase and no long val= id at this time." -> "Wakeup buffer allocated in PEI phase is no longer valid in DXE." > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Dong, > Eric > Sent: Wednesday, April 22, 2020 9:35 AM > To: devel@edk2.groups.io > Cc: Ni, Ray ; Laszlo Ersek ; Kumar, > Chandana C > Subject: [edk2-devel] [PATCH 2/2] UefiCpuPkg/MpInitLib: Avoid > ApInitReconfig in PEI. >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2683 >=20 >=20 > In PEI phase, AP already been waked up through ApInitConfig, > so it can directly wake up it through change wakup buffer > instead of use ApInitReconfig flag. It can save some time. >=20 > Change code to only use ApInitReconfig flag in DXE phase > which must need to update the wake up buffer. >=20 > Cc: Ray Ni > Cc: Laszlo Ersek > Cc: Chandana Kumar > Signed-off-by: Eric Dong > --- > UefiCpuPkg/Library/MpInitLib/MpLib.c | 13 +++++++++++-- > 1 file changed, 11 insertions(+), 2 deletions(-) >=20 > diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c > b/UefiCpuPkg/Library/MpInitLib/MpLib.c > index ac7f92fd48..644971b68f 100644 > --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c > +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c > @@ -1819,7 +1819,14 @@ MpInitLibInitialize ( > // Wakeup APs to do some AP initialize sync (Microcode & MTRR) >=20 > // >=20 > if (CpuMpData->CpuCount > 1) { >=20 > - CpuMpData->InitFlag =3D ApInitReconfig; >=20 > + if (OldCpuMpData !=3D NULL) { >=20 > + // >=20 > + // Only needs to use this flag for DXE phase to update the wake up >=20 > + // buffer. Current been used wake up buffer is allocated in PEI ph= ase >=20 > + // and no long valid at this time. >=20 > + // >=20 > + CpuMpData->InitFlag =3D ApInitReconfig; >=20 > + } >=20 > WakeUpAP (CpuMpData, TRUE, 0, ApInitializeSync, CpuMpData, TRUE); >=20 > // >=20 > // Wait for all APs finished initialization >=20 > @@ -1827,7 +1834,9 @@ MpInitLibInitialize ( > while (CpuMpData->FinishedCount < (CpuMpData->CpuCount - 1)) { >=20 > CpuPause (); >=20 > } >=20 > - CpuMpData->InitFlag =3D ApInitDone; >=20 > + if (OldCpuMpData !=3D NULL) { >=20 > + CpuMpData->InitFlag =3D ApInitDone; >=20 > + } >=20 > for (Index =3D 0; Index < CpuMpData->CpuCount; Index++) { >=20 > SetApState (&CpuMpData->CpuData[Index], CpuStateIdle); >=20 > } >=20 > -- > 2.23.0.windows.1 >=20 >=20 > -=3D-=3D-=3D-=3D-=3D-=3D > Groups.io Links: You receive all messages sent to this group. >=20 > View/Reply Online (#57774): https://edk2.groups.io/g/devel/message/57774 > Mute This Topic: https://groups.io/mt/73187417/1712937 > Group Owner: devel+owner@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub [ray.ni@intel.com] > -=3D-=3D-=3D-=3D-=3D-=3D