From nobody Mon Dec 15 23:49:05 2025 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+106717+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+106717+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1688707753; cv=none; d=zohomail.com; s=zohoarc; b=H8YIf5CUrr8mrg5BHLJ6vWo0ln64O+gH3u5BQXt0sDWmiBZ1a0D7WA0SGaT3VVzfNsDITjPJasMNblDVdGO5IRQWYu4pBIG+YJNMnJyAMIS1sGaC59AvCDHGSsBFzzVdMDGZxwg2Me173yBjKMHTznUxrZa66866+vOh7/n6Y+A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688707753; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=gAHZLkS92TKVw4pPeg+ygsC//dGfF/rRc/q6kpAjWHQ=; b=T55+rgN8VOKvkUacffFe/Ng8QEGCCDwDnWIoGMYW/FcEWcohov5qu5MoC4shHZ7az97HHbJvQ468JBkumD3My1gZE6ohuZ2JezBgfAcmpd4eDuuWVE3nwn8HAtCaXJcE2ZsEh01oLlM46U731aGXlYZDzilPdl/rwHK/HN2yHbA= 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+106717+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 1688707753365681.286878466133; Thu, 6 Jul 2023 22:29:13 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id w75kYY1788612xWxVZDfOFY9; Thu, 06 Jul 2023 22:29:13 -0700 X-Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web10.6404.1688707749454802251 for ; Thu, 06 Jul 2023 22:29:12 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10763"; a="353650660" X-IronPort-AV: E=Sophos;i="6.01,187,1684825200"; d="scan'208";a="353650660" X-Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2023 22:29:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10763"; a="833232036" X-IronPort-AV: E=Sophos;i="6.01,187,1684825200"; d="scan'208";a="833232036" X-Received: from shwdeopenlab706.ccr.corp.intel.com ([10.239.55.95]) by fmsmga002.fm.intel.com with ESMTP; 06 Jul 2023 22:29:11 -0700 From: "Ni, Ray" To: devel@edk2.groups.io Cc: Eric Dong , Rahul Kumar , Gerd Hoffmann Subject: [edk2-devel] [PATCH 3/4] UefiCpuPkg/MpInitLib: Skip X2APIC enabling when BSP in X2APIC already Date: Fri, 7 Jul 2023 13:29:00 +0800 Message-Id: <20230707052901.869-4-ray.ni@intel.com> In-Reply-To: <20230707052901.869-1-ray.ni@intel.com> References: <20230707052901.869-1-ray.ni@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,ray.ni@intel.com X-Gm-Message-State: QWhtILDhcqJfbqKB5Eb15mYJx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1688707753; bh=8pRd3cvgUbGPtKA2s5HqaFQTZsKo80o2AfMaXz6pi5k=; h=Cc:Date:From:Reply-To:Subject:To; b=nZBK3bOAeuJxCAmcBgyFS2BZsVL7YV3hhX+eoKdq1NLTX3v8IQWpnwCo7oYY5oh1/T5 1Y3WFzMShWnRAxlzl5IIUMldry99fcD6U1Oxc09IBDso+LdLXGf8Mns9fi0X6WkZ5urTh GP7eSqVdmvXeKG+mWObojQ4EXGWt0XP1VUI= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1688707754065100011 Content-Type: text/plain; charset="utf-8" The BSP's APIC mode is synced to all APs in CollectProcessorCount(). So, it's safe to skip the X2 APIC enabling in AutoEnableX2Apic() which runs later when BSP's APIC mode is X2 APIC already. Signed-off-by: Ray Ni Cc: Eric Dong Cc: Rahul Kumar Cc: Gerd Hoffmann --- UefiCpuPkg/Library/MpInitLib/MpLib.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpIn= itLib/MpLib.c index 2372475a04..5a8ed027be 100644 --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c @@ -1998,7 +1998,9 @@ MpInitLibInitialize ( // // Enable X2APIC if needed. // - AutoEnableX2Apic (CpuMpData); + if (CpuMpData->InitialBspApicMode =3D=3D LOCAL_APIC_MODE_XAPIC) { + AutoEnableX2Apic (CpuMpData); + } =20 // // Sort BSP/Aps by CPU APIC ID in ascending order --=20 2.39.1.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 (#106717): https://edk2.groups.io/g/devel/message/106717 Mute This Topic: https://groups.io/mt/100000877/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076= /xyzzy [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-