From nobody Mon Feb 9 14:50:35 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+112796+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+112796+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1703125297; cv=none; d=zohomail.com; s=zohoarc; b=W1wzDB2fAIE6AjmoeSmkuAeCT1ysadAGyNTZaMgWVU0me6tlVagfaWYpBWvbozFjyEDaKMsNic0PAHN95S/soFe0YAR5ntU4mfLB9O5wtnsw5wUFnx/5qMHcilZIWwh3Hc0+uH+HioeqJ/YHn90NfGqM2ulbvWNyh/gmpfb3RqE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1703125297; h=Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=Layl+inh2pIh0RwRsuYK/xjrhd2y+279ZFH8Yj165WQ=; b=KLOyTGxO1w5lRgUD+Eu6R0n6t46XpmfbNlv3IGignVIi4srE0qAODhJuObtFGNupDDwiF+CqXEEfIJUtHWRrRG3BM83GF0u3GDLpGVtefU1enx2powUKaIhA9ok0acEWH+v5dal/pc68a05FubC6Eah37pLK0it5hFKNLlZNbZw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+112796+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1703125297827483.2537062491067; Wed, 20 Dec 2023 18:21:37 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=qNUuo53jdOqrgYPkDjHlXvt+fMm1Gex+A1GJYzdfi9U=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe; s=20140610; t=1703125297; v=1; b=rOzbTU62oX+CzSmEjs8B2swDHkN/a8UVIM14EppRAoKbFgvL/uMAzNq/O8XYsGaROfrieUQP Adfr2cLMJgFrMplwv8S+PDlcPzYjbBhGlNnpDu+RBRarOKnurWQKLup/NeI3DM/6mScGAckwW4K 7oIt1jDTEtElZjY5GawyWyT8= X-Received: by 127.0.0.2 with SMTP id Blo3YY1788612xe9LCOFAer4; Wed, 20 Dec 2023 18:21:37 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by mx.groups.io with SMTP id smtpd.web10.43419.1703125294908514900 for ; Wed, 20 Dec 2023 18:21:35 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10930"; a="14591375" X-IronPort-AV: E=Sophos;i="6.04,292,1695711600"; d="scan'208";a="14591375" X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Dec 2023 18:21:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10930"; a="920172821" X-IronPort-AV: E=Sophos;i="6.04,292,1695711600"; d="scan'208";a="920172821" X-Received: from sh1gapp1009.ccr.corp.intel.com ([10.239.189.219]) by fmsmga001.fm.intel.com with ESMTP; 20 Dec 2023 18:21:32 -0800 From: "Wu, Jiaxin" To: devel@edk2.groups.io Cc: Laszlo Ersek , Eric Dong , Ray Ni , Zeng Star , Gerd Hoffmann , Rahul Kumar Subject: [edk2-devel] [PATCH v1 5/6] UefiCpuPkg/PiSmmCpuDxeSmm: Invert ReleaseAllAPs & InitializeDebugAgent Date: Thu, 21 Dec 2023 10:21:20 +0800 Message-Id: <20231221022121.12224-6-jiaxin.wu@intel.com> In-Reply-To: <20231221022121.12224-1-jiaxin.wu@intel.com> References: <20231221022121.12224-1-jiaxin.wu@intel.com> 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,jiaxin.wu@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 15S67CO0oBaI2vw2yYfokXGMx1787277AA= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1703125299760100023 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Below BSP & AP sync flow before exit SMI is to: 1. Make sure BSP and all APs finish the MTRR programming and start later executing the same start line. This is the MTRR programming requirement. 2. Make sure all APs finish the pending tasks, then BSP can stop source level debug. BSP: SmmCpuSyncWaitForAPs <-- AP: SmmCpuSyncReleaseBsp BSP: ReleaseAllAPs --> AP: SmmCpuSyncWaitForBsp For SMM source level debug, it doesn't depend on the AP Present flag set. So we can invert ReleaseAllAPs & InitializeDebugAgent. Cc: Laszlo Ersek Cc: Eric Dong Cc: Ray Ni Cc: Zeng Star Cc: Gerd Hoffmann Cc: Rahul Kumar Signed-off-by: Jiaxin Wu --- UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c b/UefiCpuPkg/PiSmmCpuDxe= Smm/MpService.c index 8e525ce3b3..04622c66a2 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c @@ -648,23 +648,23 @@ BSPHandler ( // // Wait for all APs to complete their pending tasks including MTRR progr= amming if needed. // SmmCpuSyncWaitForAPs (mSmmMpSyncData->SyncContext, ApCount, CpuIndex); =20 + // + // Signal APs to Reset states/semaphore for this processor + // + ReleaseAllAPs (); + if (*mSmmDebugAgentSupport) { // // Stop source level debug in BSP handler, the code below will not be // debugged. // InitializeDebugAgent (DEBUG_AGENT_INIT_EXIT_SMI, NULL, NULL); } =20 - // - // Signal APs to Reset states/semaphore for this processor - // - ReleaseAllAPs (); - // // Perform pending operations for hot-plug // SmmCpuUpdate (); =20 --=20 2.16.2.windows.1 -=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 (#112796): https://edk2.groups.io/g/devel/message/112796 Mute This Topic: https://groups.io/mt/103293802/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-