From nobody Sun Feb 8 19:38:05 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+39567+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+39567+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1556214821; cv=none; d=zoho.com; s=zohoarc; b=cqTKIWcw4Udu8SXijeqmko+FgMzaLbckB901xgAMQd6axDvBTYSbn8bBBGTbARtghhXFlNVs3exkNVH2E7ezAtZDB/ZR+C6RHnlIJlk+viraTRx/jTnPRCnh6+GG4zFUevmmjbrCEvXvo/D4zZzQYEHLeN0LERZu3nIY/RBNepM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556214821; 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=aj68Bcm6qJVMmUeRy7iEfzwI9MItFVrUk/1X00cWTAc=; b=LsdBm8rBniYaa/zMYRVW//oA9xQmaSzxuf1fy9hilg/jYLx+6R5CKm5SQQvHohV5WF8JNMka1G81WTO87MEtJVAuVPPqNurr7/ZW5yKIpbw5qAPOu1JNbLkZ1MWPsqF+bzihisZHlcxVwJZHRUPMXT5c93zlqnl/EMJXFgTSUA4= 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+39567+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 15562148212641020.5536480900123; Thu, 25 Apr 2019 10:53:41 -0700 (PDT) Return-Path: X-Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by groups.io with SMTP; Thu, 25 Apr 2019 10:53:40 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Apr 2019 10:53:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,394,1549958400"; d="scan'208";a="134369333" X-Received: from unknown (HELO mdkinney-MOBL2.amr.corp.intel.com) ([10.241.111.154]) by orsmga007.jf.intel.com with ESMTP; 25 Apr 2019 10:53:38 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Laszlo Ersek Subject: [edk2-devel] [Patch 2/4] UefiCpuPkg/MpInitLib: Avoid MSR_IA32_APIC_BASE for single core Date: Thu, 25 Apr 2019 10:53:32 -0700 Message-Id: <20190425175334.5944-3-michael.d.kinney@intel.com> In-Reply-To: <20190425175334.5944-1-michael.d.kinney@intel.com> References: <20190425175334.5944-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=1556214820; bh=Zi93hhHTnX0rtVY3I8O0MMWktpBNsTaqpIAy7oaNJ+4=; h=Cc:Date:From:Reply-To:Subject:To; b=aWu7JWguTr14t9CUlDbEnEpm/4rwpFDMJZh/8hTtNjm9sU0+PN6m4Pgeafi5DnPoQp1 pq0KE8YrgDN1+SpRRxl74PduGJ8LBYbIPsofzYlzIXxJDIgogq2mMzeunspeQ3E5BOUYd +jbF+7IH3+ApksK/a9I/sTDZJaVyBozDrX0= 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 Reviewed-by: Eric Dong Reviewed-by: Ray Ni --- 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 (#39567): https://edk2.groups.io/g/devel/message/39567 Mute This Topic: https://groups.io/mt/31345224/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-