From nobody Mon Feb 9 12:27:29 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+87334+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+87334+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1646707015986523.356375330539; Mon, 7 Mar 2022 18:36:55 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id xYuzYY1788612xNCOM3CDoSx; Mon, 07 Mar 2022 18:36:56 -0800 X-Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web11.4209.1646706992182166839 for ; Mon, 07 Mar 2022 18:36:56 -0800 X-IronPort-AV: E=McAfee;i="6200,9189,10279"; a="317801138" X-IronPort-AV: E=Sophos;i="5.90,163,1643702400"; d="scan'208";a="317801138" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2022 18:36:55 -0800 X-IronPort-AV: E=Sophos;i="5.90,163,1643702400"; d="scan'208";a="553432791" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.238.2.184]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2022 18:36:51 -0800 From: "Min Xu" To: devel@edk2.groups.io Cc: Min Xu , Ard Biesheuvel , Jordan Justen , Brijesh Singh , Erdem Aktas , James Bottomley , Jiewen Yao , Tom Lendacky , Gerd Hoffmann , Sebastien Boeuf Subject: [edk2-devel] [PATCH 07/14] OvmfPkg/PlatformPei: Refactor MaxCpuCountInitialization Date: Tue, 8 Mar 2022 10:36:08 +0800 Message-Id: In-Reply-To: References: 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,min.m.xu@intel.com X-Gm-Message-State: WQrtY6zmsGWB3wmOo7F7ZO7hx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1646707016; bh=9BHv3A9kTvQds/F0fh6ANPjXk9lOhxIiPhjgGu/5log=; h=Cc:Date:From:Reply-To:Subject:To; b=HjWjDeTeYs163AG46bZUqMr6afyx+aIHqB18667Vta1dJ7GPMtNYHWO4i8sFYojj8LG iodNV/w/XJ5DL/zZ8LQ3ph47iS4aUJRoCRe9sgHX5lKXOY5oVSPDmKmPBOmT8ItMnDHMO s74O+rl9Ys08PQWWZpx4oeq8RZKtn8ZI6Vc= X-ZohoMail-DKIM: fail (Signature date is -1 seconds in the future.) X-ZM-MESSAGEID: 1646707018181100001 Content-Type: text/plain; charset="utf-8" BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3863 MaxCpuCountInitialization is splitted into two: - PlatformMaxCpuCountInitialization is for PlatformInitLib - MaxCpuCountInitialization is for PlatformPei. It calls PlatformMaxCpuCountInitialization then sets PCDs. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Brijesh Singh Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Gerd Hoffmann Cc: Sebastien Boeuf Signed-off-by: Min Xu --- OvmfPkg/PlatformPei/Platform.c | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index 7d370c9b8fa8..c184fdb57ee0 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -542,13 +542,12 @@ Q35BoardVerification ( them to UefiCpuPkg modules. Set the mMaxCpuCount variable. **/ VOID -MaxCpuCountInitialization ( +PlatformMaxCpuCountInitialization ( IN OUT EFI_HOB_PLATFORM_INFO *PlatformInfoHob ) { - UINT16 BootCpuCount; - UINT32 MaxCpuCount; - RETURN_STATUS PcdStatus; + UINT16 BootCpuCount; + UINT32 MaxCpuCount; =20 // // Try to fetch the boot CPU count. @@ -705,15 +704,29 @@ MaxCpuCountInitialization ( )); ASSERT (BootCpuCount <=3D MaxCpuCount); =20 - PcdStatus =3D PcdSet32S (PcdCpuBootLogicalProcessorNumber, BootCpuCount); - ASSERT_RETURN_ERROR (PcdStatus); - PcdStatus =3D PcdSet32S (PcdCpuMaxLogicalProcessorNumber, MaxCpuCount); - ASSERT_RETURN_ERROR (PcdStatus); - PlatformInfoHob->PcdCpuMaxLogicalProcessorNumber =3D MaxCpuCount; PlatformInfoHob->PcdCpuBootLogicalProcessorNumber =3D BootCpuCount; } =20 +/** + Fetch the boot CPU count and the possible CPU count from QEMU, and expose + them to UefiCpuPkg modules. Set the mMaxCpuCount variable. +**/ +VOID +MaxCpuCountInitialization ( + IN OUT EFI_HOB_PLATFORM_INFO *PlatformInfoHob + ) +{ + RETURN_STATUS PcdStatus; + + PlatformMaxCpuCountInitialization (PlatformInfoHob); + + PcdStatus =3D PcdSet32S (PcdCpuBootLogicalProcessorNumber, PlatformInfoH= ob->PcdCpuBootLogicalProcessorNumber); + ASSERT_RETURN_ERROR (PcdStatus); + PcdStatus =3D PcdSet32S (PcdCpuMaxLogicalProcessorNumber, PlatformInfoHo= b->PcdCpuMaxLogicalProcessorNumber); + ASSERT_RETURN_ERROR (PcdStatus); +} + /** Perform Platform PEI initialization. =20 --=20 2.29.2.windows.2 -=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 (#87334): https://edk2.groups.io/g/devel/message/87334 Mute This Topic: https://groups.io/mt/89629681/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-