From nobody Mon Feb 9 08:56:14 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+39808+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+39808+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1556587817; cv=none; d=zoho.com; s=zohoarc; b=mJEaMPzN0nErwCuM1KCxVHsPh0UpUqGJME0RL96B7Dp7jxCi4nVzb+z1Ynfk7kCZFITeEYiZkJcKTyrR3ng1QHFAvKFLIWyYFtbOZUSgDcUiXq8WhnbCXCbtIMSv559Ma0Ot9SiHW2fCudP9MY71riSOobCmitC2bRIGP9ZHSoY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556587817; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=/0QRNz6FsnXeuiAmzT24HHq2FVVKngRNevoSmQfSgHA=; b=gqyncrsge8r4UsKxkuWtN11HCwK42YLl3gK1+v6YYjACDf5TE9nevLHkDQ/MJzcwdsGSa6vwFj1ydEmUaRmJUyilIUY2ntsM2SzCi1yQFBSszJWb+lbUnn1dJ1/N8t8US3bSf/IPNsqRHUYl5rTJuW9etRI5Ag5yL3j+ORKRq8Q= 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+39808+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 1556587817068728.2372883614379; Mon, 29 Apr 2019 18:30:17 -0700 (PDT) Return-Path: X-Received: from mga04.intel.com (mga04.intel.com []) by groups.io with SMTP; Mon, 29 Apr 2019 18:30:16 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Apr 2019 18:30:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,411,1549958400"; d="scan'208";a="139954338" X-Received: from unknown (HELO mdkinney-MOBL2.amr.corp.intel.com) ([10.241.111.157]) by orsmga006.jf.intel.com with ESMTP; 29 Apr 2019 18:30:15 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Laszlo Ersek Subject: [edk2-devel] [Patch V2 4/6] UefiCpuPkg/MpInitLib: Avoid MSR_IA32_APIC_BASE for single core Date: Mon, 29 Apr 2019 18:30:10 -0700 Message-Id: <20190430013012.24008-5-michael.d.kinney@intel.com> In-Reply-To: <20190430013012.24008-1-michael.d.kinney@intel.com> References: <20190430013012.24008-1-michael.d.kinney@intel.com> MIME-Version: 1.0 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,michael.d.kinney@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1556587816; bh=AGqbS+Ct/C/Pnb/cLze6YvVS8P3PHa9Ld+7KoM5gL2M=; h=Cc:Date:From:Reply-To:Subject:To; b=lT6O6yAzuAPWxRO5SLy8lqxNVCktD+HBo56HTq7JO/aVfmbGZRzleqvSbO249/awawJ OoFR1drc/84/Jh6SAm3nlHIcpYyplua79F38+BH7Qfp6jn9T8s+S++Gpx5hIz4wQjcFTT 2p97qWkQ2PVceEQg3PwU4ojj90OoE55qXI0= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Avoid access to MSR_IA32_APIC_BASE that may not be supported on single core CPUs. If PcdCpuMaxLogicalProcessorNumber is 1, then there is only one CPU that must be the BSP. Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Signed-off-by: Michael D Kinney --- UefiCpuPkg/Library/MpInitLib/PeiMpLib.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c b/UefiCpuPkg/Library/M= pInitLib/PeiMpLib.c index 35dff91fd2..5488049c08 100644 --- a/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c +++ b/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c @@ -1,7 +1,7 @@ /** @file MP initialize support functions for PEI phase. =20 - Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
+ Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -101,6 +101,19 @@ GetCpuMpData ( MSR_IA32_APIC_BASE_REGISTER ApicBaseMsr; IA32_DESCRIPTOR Idtr; =20 + // + // If there is only 1 CPU, then it must be the BSP. This avoids an acce= ss to + // MSR_IA32_APIC_BASE that may not be supported on single core CPUs. + // + if (PcdGet32 (PcdCpuMaxLogicalProcessorNumber) =3D=3D 1) { + CpuMpData =3D GetCpuMpDataFromGuidedHob (); + ASSERT (CpuMpData !=3D NULL); + return CpuMpData; + } + + // + // Otherwise use MSR_IA32_APIC_BASE to determine if the CPU is BSP or AP. + // ApicBaseMsr.Uint64 =3D AsmReadMsr64 (MSR_IA32_APIC_BASE); if (ApicBaseMsr.Bits.BSP =3D=3D 1) { CpuMpData =3D GetCpuMpDataFromGuidedHob (); --=20 2.21.0.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 (#39808): https://edk2.groups.io/g/devel/message/39808 Mute This Topic: https://groups.io/mt/31415903/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-