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 27745941053 for ; Mon, 20 Nov 2023 03:10:15 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=DTjVSXzmVbiuMYF8U4gdEQ/khDCQ2ZCwxKHR2cBX/bs=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1700449813; v=1; b=XmsGZ+MMa5ueUV4dlmn+fQHJwl7b66pDfypOzt7nI5TLLMzQ5bqf0Z6l+xg4fVejSORjnKqf Xgc8seg0FuRweMTHJ+TYxj+Z3nmt8vycB1Z7rufi26l8E8GA6GMAvT5C1C5a+ky2pbFJm3Fzrpf 8fcDd98dnYy1pLN5T7+mL0LU= X-Received: by 127.0.0.2 with SMTP id djC3YY7687511xuKGgCBkR74; Sun, 19 Nov 2023 19:10:13 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web10.43091.1700449812939290744 for ; Sun, 19 Nov 2023 19:10:13 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10899"; a="458041203" X-IronPort-AV: E=Sophos;i="6.04,212,1695711600"; d="scan'208";a="458041203" X-Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Nov 2023 19:10:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10899"; a="856865726" X-IronPort-AV: E=Sophos;i="6.04,212,1695711600"; d="scan'208";a="856865726" X-Received: from shwdesfp01.ccr.corp.intel.com ([10.239.158.151]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Nov 2023 19:10:10 -0800 From: "Zhiguang Liu" To: devel@edk2.groups.io Cc: Zhiguang Liu , Ray Ni , Rahul Kumar , Gerd Hoffmann , Laszlo Ersek Subject: [edk2-devel] [PATCH v2] UefiCpuPkg/PiSmmCpuDxeSmm: Use NonSmm BSP as default SMM BSP. Date: Mon, 20 Nov 2023 11:10:04 +0800 Message-Id: <20231120031004.1525-1-zhiguang.liu@intel.com> MIME-Version: 1.0 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,zhiguang.liu@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: zeOhipxpJw6GonILWS6jpUYdx7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=XmsGZ+MM; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=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 Currently, if BSP election is not enabled, will use Core0 as SMM BSP. However, Core0 does not always have the highest performance. So, we can used NonSmm BSP as default BSP. This will take effect in normal SMM init flow and S3 boot flow Cc: Ray Ni Cc: Rahul Kumar Cc: Gerd Hoffmann Cc: Laszlo Ersek Signed-off-by: Zhiguang Liu --- UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c index 25d058c5b9..b279f5dfcc 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c @@ -1953,6 +1953,16 @@ InitializeMpSyncData ( // Enable BSP election by setting BspIndex to -1 // mSmmMpSyncData->BspIndex = (UINT32)-1; + } else { + // + // Use NonSMM BSP as SMM BSP + // + for (CpuIndex = 0; CpuIndex < gSmmCpuPrivate->SmmCoreEntryContext.NumberOfCpus; CpuIndex++) { + if (GetApicId () == gSmmCpuPrivate->ProcessorInfo[CpuIndex].ProcessorId) { + mSmmMpSyncData->BspIndex = (UINT32)CpuIndex; + break; + } + } } mSmmMpSyncData->EffectiveSyncMode = mCpuSmmSyncMode; -- 2.31.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111439): https://edk2.groups.io/g/devel/message/111439 Mute This Topic: https://groups.io/mt/102701170/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-