public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "duntan" <dun.tan@intel.com>
To: devel@edk2.groups.io
Cc: Eric Dong <eric.dong@intel.com>, Ray Ni <ray.ni@intel.com>,
	Rahul Kumar <rahul1.kumar@intel.com>,
	Gerd Hoffmann <kraxel@redhat.com>
Subject: [edk2-devel] [PATCH 1/3] UefiCpuPkg: Create MpInformation.h in UefiCpuPkg
Date: Thu,  9 Nov 2023 10:51:05 +0800	[thread overview]
Message-ID: <20231109025107.1787-2-dun.tan@intel.com> (raw)
In-Reply-To: <20231109025107.1787-1-dun.tan@intel.com>

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 <dun.tan@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
---
 UefiCpuPkg/Include/Guid/MpInformation.h | 35 +++++++++++++++++++++++++++++++++++
 UefiCpuPkg/UefiCpuPkg.dec               |  3 +++
 2 files changed, 38 insertions(+)

diff --git a/UefiCpuPkg/Include/Guid/MpInformation.h b/UefiCpuPkg/Include/Guid/MpInformation.h
new file mode 100644
index 0000000000..f0a6fdb24e
--- /dev/null
+++ b/UefiCpuPkg/Include/Guid/MpInformation.h
@@ -0,0 +1,35 @@
+/** @file
+  EFI MP information protocol provides a lightweight MP_SERVICES_PROTOCOL.
+
+  MP information protocol only provides static information of MP processor.
+
+  Copyright (c) 2009 - 2023, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.<BR>
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef _MP_INFORMATION_H_
+#define _MP_INFORMATION_H_
+
+#include <Protocol/MpService.h>
+#include <PiPei.h>
+#include <Ppi/SecPlatformInformation.h>
+
+#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 (#110942): https://edk2.groups.io/g/devel/message/110942
Mute This Topic: https://groups.io/mt/102479009/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2023-11-09  2:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-09  2:51 [edk2-devel] [PATCH 0/3] Move gMpInformationHobGuid from StandaloneMmPkg to UefiCpuPkg duntan
2023-11-09  2:51 ` duntan [this message]
2023-11-09  2:51 ` [edk2-devel] [PATCH 2/3] StandaloneMmPkg:Add UefiCpuPkg.dec in DependencyCheck duntan
2023-11-09  2:51 ` [edk2-devel] [PATCH 3/3] StandaloneMmPkg:Remove MpInformation.h duntan
2024-01-03 15:11   ` Ard Biesheuvel
2024-01-03 17:42     ` Oliver Smith-Denny
2024-01-04  2:21     ` duntan
2024-01-04  8:32       ` Ard Biesheuvel
2023-11-13  1:47 ` [edk2-devel] [PATCH 0/3] Move gMpInformationHobGuid from StandaloneMmPkg to UefiCpuPkg Ni, Ray
2023-11-13 14:33 ` Laszlo Ersek
2023-11-14 10:11   ` duntan
2023-11-15  0:30   ` duntan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231109025107.1787-2-dun.tan@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox