From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id C711F9416A0 for ; Fri, 17 Nov 2023 09:40:35 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=YXDXHotnNtC9GS1MkWOjj36LrHBvgTaw+srPdSD6xxQ=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1700214034; v=1; b=muC2PjSqgBxCVBtyXUSap7z+SLjxFb8MIzcjzMRsVFHHvwPpCIMGJzJ5Kq1IwJ7FR2lKyaov 1ODKNvnur9GvD3Zp0G2Mrwf+dq2228OCTbJikCoKsvxMoppyhH/lO/0f0Lk3eafl3YY9fHk7b5X KSKLKYouBSAof4gLNl0JhAPg= X-Received: by 127.0.0.2 with SMTP id CktGYY7687511xoqceUFJrIx; Fri, 17 Nov 2023 01:40:34 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web11.8460.1700214033363346575 for ; Fri, 17 Nov 2023 01:40:34 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10896"; a="376319671" X-IronPort-AV: E=Sophos;i="6.04,206,1695711600"; d="scan'208";a="376319671" X-Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2023 01:40:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10896"; a="800447590" X-IronPort-AV: E=Sophos;i="6.04,206,1695711600"; d="scan'208";a="800447590" X-Received: from shwdeopenlab702.ccr.corp.intel.com ([10.239.55.43]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2023 01:40:16 -0800 From: "duntan" To: devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Rahul Kumar , Gerd Hoffmann , Laszlo Ersek Subject: [edk2-devel] [Patch V2 1/3] UefiCpuPkg: Create MpInformation.h in UefiCpuPkg Date: Fri, 17 Nov 2023 17:39:55 +0800 Message-Id: <20231117093957.621-2-dun.tan@intel.com> In-Reply-To: <20231117093957.621-1-dun.tan@intel.com> References: <20231117093957.621-1-dun.tan@intel.com> MIME-Version: 1.0 Precedence: Bulk 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,dun.tan@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: nM1ypjGFX5uwNKRBy9xjai4Px7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=muC2PjSq; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Copy MpInformation.h and gMpInformationHobGuid to UefiCpuPkg. Previously, the HOB is defined, created and consumed only in StandaloneMmPkg. The HOB contains the number of processors and EFI_PROCESSOR_INFORMATION structure. This is the same as the information that PiSmmCpuDxeSmm uses EfiMpServiceProtocolGuid to get. The incoming plan is to create gMpInformationHobGuid for both StandaloneMm and legacy DXE_SMM in early phase. Then PiSmmCpuDxeSmm can consume the hob, which can simplified code logic about consuming MpService Protocol. So move this HOB definition to UefiCpuPkg. Signed-off-by: Dun Tan Cc: Eric Dong Cc: Ray Ni Cc: Rahul Kumar Cc: Gerd Hoffmann Cc: Laszlo Ersek --- UefiCpuPkg/Include/Guid/MpInformation.h | 39 +++++++++++++++++++++++++++++++++++++++ UefiCpuPkg/UefiCpuPkg.dec | 3 +++ 2 files changed, 42 insertions(+) diff --git a/UefiCpuPkg/Include/Guid/MpInformation.h b/UefiCpuPkg/Include/Guid/MpInformation.h new file mode 100644 index 0000000000..29da80d4df --- /dev/null +++ b/UefiCpuPkg/Include/Guid/MpInformation.h @@ -0,0 +1,39 @@ +/** @file + EFI MP information protocol provides a lightweight MP_SERVICES_PROTOCOL. + + MP information protocol only provides static information of MP processor. + + If SwitchBSP or Enable/DisableAP in MP service is called between the HOB + production and HOB consumption, EFI_PROCESSOR_INFORMATION.StatusFlag and + NumberOfEnabledProcessors fields in this HOB may be invalidated. + + Copyright (c) 2009 - 2023, Intel Corporation. All rights reserved.
+ Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef _MP_INFORMATION_H_ +#define _MP_INFORMATION_H_ + +#include +#include +#include + +#define MP_INFORMATION_GUID \ + { \ + 0xba33f15d, 0x4000, 0x45c1, {0x8e, 0x88, 0xf9, 0x16, 0x92, 0xd4, 0x57, 0xe3} \ + } + +#pragma pack(1) +typedef struct { + UINT64 NumberOfProcessors; + UINT64 NumberOfEnabledProcessors; + EFI_PROCESSOR_INFORMATION ProcessorInfoBuffer[]; +} MP_INFORMATION_HOB_DATA; +#pragma pack() + +extern EFI_GUID gMpInformationHobGuid; + +#endif diff --git a/UefiCpuPkg/UefiCpuPkg.dec b/UefiCpuPkg/UefiCpuPkg.dec index 0b5431dbf7..92860b4c6e 100644 --- a/UefiCpuPkg/UefiCpuPkg.dec +++ b/UefiCpuPkg/UefiCpuPkg.dec @@ -85,6 +85,9 @@ ## Include/Guid/SmmBaseHob.h gSmmBaseHobGuid = { 0xc2217ba7, 0x03bb, 0x4f63, {0xa6, 0x47, 0x7c, 0x25, 0xc5, 0xfc, 0x9d, 0x73 }} + ## Include/Guid/MpInformation.h + gMpInformationHobGuid = { 0xba33f15d, 0x4000, 0x45c1, { 0x8e, 0x88, 0xf9, 0x16, 0x92, 0xd4, 0x57, 0xe3 }} + [Protocols] ## Include/Protocol/SmmCpuService.h gEfiSmmCpuServiceProtocolGuid = { 0x1d202cab, 0xc8ab, 0x4d5c, { 0x94, 0xf7, 0x3c, 0xfc, 0xc0, 0xd3, 0xd3, 0x35 }} -- 2.31.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111348): https://edk2.groups.io/g/devel/message/111348 Mute This Topic: https://groups.io/mt/102644630/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-