From nobody Mon Feb 9 16:47:09 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+87490+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+87490+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1647050136; cv=none; d=zohomail.com; s=zohoarc; b=HdCDHDDKd/TKoX8GFB8sAhZ/re7ensVrMr+vXY3BMIOjetPOtaVOISA2hzj+PlPp8ixAJJh27cCrR7zXDhMrs+n4W34pVLeDR2bV3PZj+c4jFPCWYbsHx0hzbFQxyibbL1OHgBA9U1CkZA9KdXO0Ta+PcmzgAVgQU55Av6K7CGM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1647050136; 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=RBgOzZ57zmh8rLgOaTp0i8qlPlezz+wPHSV7P2HGXaU=; b=nPL/R4BzXYHkWVzg69sWgSve37OtNKaOx8W5sN3WLwSmgkn6mB7sJiUTeqIlkKzknOhDHoJoztHwEkstI9RXBbWlNSW9FPPbMAstDD7H8XdzBrpnANTNQfzV4riO6K1p6djJY5Fj0AHZgQAtCHzCXAi45y7qGPa94HNTR15zxZQ= 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+87490+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 1647050136003911.8859370046038; Fri, 11 Mar 2022 17:55:36 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 4v2QYY1788612xO0vUvWuEVs; Fri, 11 Mar 2022 17:55:36 -0800 X-Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web08.919.1647050070631942533 for ; Fri, 11 Mar 2022 17:55:36 -0800 X-IronPort-AV: E=McAfee;i="6200,9189,10283"; a="255894576" X-IronPort-AV: E=Sophos;i="5.90,175,1643702400"; d="scan'208";a="255894576" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Mar 2022 17:55:35 -0800 X-IronPort-AV: E=Sophos;i="5.90,175,1643702400"; d="scan'208";a="555564759" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.255.29.254]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Mar 2022 17:55:32 -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 V8 22/47] OvmfPkg/PlatformPei: Refactor MaxCpuCountInitialization Date: Sat, 12 Mar 2022 09:53:47 +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: 99toEFAThdsmXhYkURCK0jFvx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1647050136; bh=+mDLf/PMIrgIStCZoQuxNLJElJiajZizeS3o5Au3uy8=; h=Cc:Date:From:Reply-To:Subject:To; b=xIkd2Fq8F2D6aMzAzpBrMqmHxKXWMp1uE2lvzqJkLdxJJWsmoZiDcriOfeFv+NQQevk UrJqsceLGhacJF07wdzDA+w0+H0BTD/5tvH+8unszwtsAvzhcjCFuXdI6a2Ogmb2GcK91 gssJDZtdrBHVUUKKcnLeLV0LbzV5X//ZkOk= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1647050138149100001 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 (#87490): https://edk2.groups.io/g/devel/message/87490 Mute This Topic: https://groups.io/mt/89725417/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-