From nobody Mon Feb 9 09:32:37 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+48723+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+48723+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1570707000; cv=none; d=zoho.com; s=zohoarc; b=dLPT4OTe3pBsC3sPSNbcIdCvCfSXTGm3Ca4H5wbLZuOr8tE42eKlarOOaqPa2+w6MFtLUTXum+lU41YisChC6FTz+rLex/bwfmgyAPXgdxbRLS9AcHG5lkIUJioXnaSjmipXKqfMxVO18otli1evYjh5hUkeIpc2E3+9yiuHf8s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570707000; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=Fk4SALRYeW7aBsxhhGE8gf8GyqsEu9FxTuVP8XNXwEI=; b=OMoZVv9Qee6C/x40jY7TLqc3XPtY1QLrmWTNWoOCNwy0MGOTX3GM0RXpW7Kd0DdCBZQeHX/5QKJjCtcXESpQ/zqeroJWNErMXGUXCYUzg+hkEkPjh5ovlN/tHkOl0INnBSVzyEBaUwpD8BJe9FYGCYY+LdoC11fEL4vtwIUQ9gs= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+48723+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 157070700004581.22667155101362; Thu, 10 Oct 2019 04:30:00 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id aaaaYY1788612xaaaaaaaaaa; Thu, 10 Oct 2019 04:29:58 -0700 X-Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.groups.io with SMTP id smtpd.web11.4713.1570706998062363550 for ; Thu, 10 Oct 2019 04:29:58 -0700 X-Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BDF3F18CB8E5; Thu, 10 Oct 2019 11:29:57 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-48.rdu2.redhat.com [10.10.120.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id BA0115D6B2; Thu, 10 Oct 2019 11:29:56 +0000 (UTC) From: "Laszlo Ersek" To: edk2-devel-groups-io Cc: Eric Dong , Ray Ni Subject: [edk2-devel] [PATCH v2 1/2] UefiCpuPkg/MpInitLib: expand comment on initial AP enumeration Date: Thu, 10 Oct 2019 13:29:51 +0200 Message-Id: <20191010112952.7187-2-lersek@redhat.com> In-Reply-To: <20191010112952.7187-1-lersek@redhat.com> References: <20191010112952.7187-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.63]); Thu, 10 Oct 2019 11:29:57 +0000 (UTC) Precedence: Bulk List-Unsubscribe: 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,lersek@redhat.com X-Gm-Message-State: aaaaaaaaaaaaaaaaaaaaaaaax1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1570706998; bh=UaOAAmq4f8V5IdJ8N1s9vS7Wucrk5DwJjOaSESnJ1pg=; h=Cc:Date:From:Reply-To:Subject:To; b=TYzwVhWb1nAZgrajYVmlWCxDYkU+IWhsEUtYteOZ1T2rrE5ZvM8wN5pVXv6gRkN20+s c4BNDbCVZMBK0X2kjTRm4D6d+YULKV/rmDxGSJaCdMWr+bLLagLtUInddVdwUkFWpz4wz md5LkeR1lYbWxYGOb04a2clo+cwguA4AKPY= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Before adding another AP enumeration mode, clarify the documentation on the current logic. No functional changes. Cc: Eric Dong Cc: Ray Ni Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1515 Signed-off-by: Laszlo Ersek Reviewed-by: Ray Ni --- Notes: v2: - new patch UefiCpuPkg/Library/MpInitLib/MpLib.c | 38 +++++++++++++++----- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpIn= itLib/MpLib.c index d6f84c6f45c0..594a035d8b92 100644 --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c @@ -1045,14 +1045,36 @@ WakeUpAP ( } if (CpuMpData->InitFlag =3D=3D ApInitConfig) { // - // Here support two methods to collect AP count through adjust - // PcdCpuApInitTimeOutInMicroSeconds values. - // - // one way is set a value to just let the first AP to start the - // initialization, then through the later while loop to wait all Aps - // finsh the initialization. - // The other way is set a value to let all APs finished the initialz= ation. - // In this case, the later while loop is useless. + // The AP enumeration algorithm below is suitable for two use cases. + // + // (1) The check-in time for an individual AP is bounded, and APs run + // through their initialization routines strongly concurrently. = In + // particular, the number of concurrently running APs + // ("NumApsExecuting") is never expected to fall to zero + // *temporarily* -- it is expected to fall to zero only when all + // APs have checked-in. + // + // In this case, the platform is supposed to set + // PcdCpuApInitTimeOutInMicroSeconds to a low-ish value (just lo= ng + // enough for one AP to start initialization). The timeout will = be + // reached soon, and remaining APs are collected by watching + // NumApsExecuting fall to zero. If NumApsExecuting falls to zero + // mid-process, while some APs have not completed initialization, + // the behavior is undefined. + // + // (2) The check-in time for an individual AP is unbounded, and/or A= Ps + // may complete their initializations widely spread out. In + // particular, some APs may finish initialization before some APs + // even start. + // + // In this case, the platform is supposed to set + // PcdCpuApInitTimeOutInMicroSeconds to a high-ish value. The AP + // enumeration will always take that long (except when the boot = CPU + // count happens to be maximal, that is, + // PcdCpuMaxLogicalProcessorNumber). All APs are expected to + // check-in before the timeout, and NumApsExecuting is assumed z= ero + // at timeout. APs that miss the time-out may cause undefined + // behavior. // TimedWaitForApFinish ( CpuMpData, --=20 2.19.1.3.g30247aa5d201 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#48723): https://edk2.groups.io/g/devel/message/48723 Mute This Topic: https://groups.io/mt/34473662/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-