From nobody Sun Feb 8 22:21:47 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+88232+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+88232+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1648597692; cv=none; d=zohomail.com; s=zohoarc; b=KTt6eQT8MRwKKoAljLnVd5A92IXn/YdIW3ZYY1DquijWgtNqrwH0+22bveRWiVsmZlAVjfs0slKyRSlpPV64/+XFJO0C44XeEKmnXuKl1pkAYtt20+x617/yDkv3BHUAe8NSYVW23jwu0sy+PTPirqJSoSBwU5XJTWCoOhFf+Vg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1648597692; 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=iALYzaDhVWZke4jNaNX8MvoFpUASjSW3zS2CLVjAM+0=; b=SXnS929Q8pjKYfY4UJqzYwdFBe/qmyCXQP/lI4H1F1VpdnI1iPG71vxhV8Wv4a20+lddt4P/7m1DhWznjsYgADHFpLzna1Qzp4pKr3YauCo3S5g4ZEB4i00m//V71EZ2eU2RUNL+nwzofqcl4axfhmi8fJLHa7rXtuCgxLE0W+w= 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+88232+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 1648597692702357.4347677458942; Tue, 29 Mar 2022 16:48:12 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id gjhYYY1788612xjiccprb5kc; Tue, 29 Mar 2022 16:48:12 -0700 X-Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web12.1145.1648597670632172204 for ; Tue, 29 Mar 2022 16:48:11 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10301"; a="259375365" X-IronPort-AV: E=Sophos;i="5.90,220,1643702400"; d="scan'208";a="259375365" X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2022 16:48:11 -0700 X-IronPort-AV: E=Sophos;i="5.90,220,1643702400"; d="scan'208";a="521658897" X-Received: from zhangpen-mobl.ccr.corp.intel.com (HELO mxu9-mobl1.ccr.corp.intel.com) ([10.255.29.230]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2022 16:48:08 -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 V12 23/47] OvmfPkg/PlatformPei: Refactor MaxCpuCountInitialization Date: Wed, 30 Mar 2022 07:46:16 +0800 Message-Id: <7830bbdbc153447aa6cd8317925795fa72dd25d8.1648555175.git.min.m.xu@intel.com> 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: oclM6WiyuJVQjBP4ZptDZbLHx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1648597692; bh=RXUE1qfjUB1ZJvTUTeDjpTK/BFsVX3DIHMO6fasQuYw=; h=Cc:Date:From:Reply-To:Subject:To; b=oYGHxRB5GT+PypqJrENDkkffYxqMpvYQkUcsd31565fKcMrk+e7LLHbC7Laty7HH9AJ y6jN4iVxzsleF65pJyfT6+HsRlJfcBjiHEFY2YVuK79/Et0BVoMAKP9IaJ7mV+0AUSQPO ew57jGxgN0+mXsoNn9JqYYgg+Vbe10VAtGA= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1648597694668100013 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 Acked-by: Gerd Hoffmann Signed-off-by: Min Xu --- 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 (#88232): https://edk2.groups.io/g/devel/message/88232 Mute This Topic: https://groups.io/mt/90121221/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-