From nobody Mon Feb 9 06:07:49 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+87699+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+87699+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1647564454; cv=none; d=zohomail.com; s=zohoarc; b=mKzDU60zaCqgPCrjOwQJxKL68aB0BJt34lAAeVpJgHWCjoBgYFzxGAuYei40uKaCKD/43+IgRzvlZEdxshIeOlCI8UwEb5S3cQc66pV9eLo1HwjfVrCTbBez9K21mVuOUPqbHp1mkAvS+7x7t8rDMv7Jq7IIIA17zvnkB2Fs2pI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1647564454; 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=jX31uasl/RBT/uLsH3mpW9/H6Rl0q/UgsSM8lyFiVIY=; b=oEdSGhqCBVyew24Jo0YSsBIzodCUxT2UI8zH8G+PQRMQ/a6u9v5jw1xiooD6Uaw3JIdkjpqiA97DFY21419kv6J83Bq5mO9e96Oj2NtJfJyWgeefKe/rzmzwyUahVc8Go0PqIJvskk8HYMwtQH6vpyUd+lRANOi0ZTGr4L2k8IY= 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+87699+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 1647564454679981.6576792473784; Thu, 17 Mar 2022 17:47:34 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id HITiYY1788612xKuV8y6lgE4; Thu, 17 Mar 2022 17:47:34 -0700 X-Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web09.4305.1647564386903029587 for ; Thu, 17 Mar 2022 17:47:33 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10289"; a="281818195" X-IronPort-AV: E=Sophos;i="5.90,190,1643702400"; d="scan'208";a="281818195" X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2022 17:47:33 -0700 X-IronPort-AV: E=Sophos;i="5.90,190,1643702400"; d="scan'208";a="541602918" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.249.172.84]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2022 17:47:30 -0700 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 V9 23/47] OvmfPkg/PlatformPei: Refactor MaxCpuCountInitialization Date: Fri, 18 Mar 2022 08:45:41 +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: GdKIXR07G0lksjVb3jEQapNyx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1647564454; bh=ZS+nTmH82Pi5SQ+1PSS2PU5BHDvViH0ulJW48fBKMIk=; h=Cc:Date:From:Reply-To:Subject:To; b=ppdZ3QV1cnWl8+YwEzre7dn3eK+Au0tnvpZAz2UnTJPD15FzvZt1LKj4qU1lwBjztH3 ToirNQbs4CsgAuCD0Xr0K0BIxHLiQPmgOUXMxMigOevV7rtyf6QPz4Fak0XIORyeMaQ6P aIpfPiYlbNla6dKHubh2IauwH0E36hqQjeQ= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1647564455830100003 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 Acked-by: Gerd Hoffmann --- OvmfPkg/PlatformPei/Platform.c | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index 7d370c9b8fa8..20e38a098d52 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -539,16 +539,15 @@ Q35BoardVerification ( =20 /** Fetch the boot CPU count and the possible CPU count from QEMU, and expose - them to UefiCpuPkg modules. Set the mMaxCpuCount variable. + them to UefiCpuPkg modules. Set the MaxCpuCount field in PlatformInfoHob. **/ 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 MaxCpuCount field in PlatformInfoHob. +**/ +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 (#87699): https://edk2.groups.io/g/devel/message/87699 Mute This Topic: https://groups.io/mt/89859032/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-