Re: [edk2-devel] [PATCH v3 10/13] UefiCpuPkg: Add a new GUID to store the processors resource

2024-04-15 Thread Chao Li

Hi Ray,


Thanks,
Chao
On 2024/4/15 10:10, Ni, Ray wrote:


+
+typedef struct {
+  UINT32    NumberOfProcessor;
+  UINTN *ApicId;

[Ray] How about "UINTN  ApicId[]"? The difference between the two is 
your version contains an 8-byte pointer pointing to somewhere else. My 
version implies the APIC ID array is just after "NumberOfProcessor".
Of curse, using the flexible arrays is better than my version and I will 
adjust this in V3.





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117816): https://edk2.groups.io/g/devel/message/117816
Mute This Topic: https://groups.io/mt/105478501/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v3 10/13] UefiCpuPkg: Add a new GUID to store the processors resource

2024-04-14 Thread Ni, Ray

+
+typedef struct {
+  UINT32NumberOfProcessor;
+  UINTN *ApicId;

[Ray] How about "UINTN  ApicId[]"? The difference between the two is your 
version contains an 8-byte pointer pointing to somewhere else. My version 
implies the APIC ID array is just after "NumberOfProcessor".


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117738): https://edk2.groups.io/g/devel/message/117738
Mute This Topic: https://groups.io/mt/105478501/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v3 10/13] UefiCpuPkg: Add a new GUID to store the processors resource

2024-04-12 Thread Chao Li
On a multi-processor system, if the BSP dose not know how many APs are
online or cannot wake up the AP via broadcast, it can collect AP
resouces before wakeing up the AP and add a new HOB to save the
processor resouces.

Cc: Ray Ni 
Cc: Rahul Kumar 
Cc: Gerd Hoffmann 
Signed-off-by: Chao Li 
---
 .../Include/Guid/ProcessorResourceHob.h   | 29 +++
 UefiCpuPkg/UefiCpuPkg.dec |  3 ++
 2 files changed, 32 insertions(+)
 create mode 100644 UefiCpuPkg/Include/Guid/ProcessorResourceHob.h

diff --git a/UefiCpuPkg/Include/Guid/ProcessorResourceHob.h 
b/UefiCpuPkg/Include/Guid/ProcessorResourceHob.h
new file mode 100644
index 00..da7f381d3b
--- /dev/null
+++ b/UefiCpuPkg/Include/Guid/ProcessorResourceHob.h
@@ -0,0 +1,29 @@
+/** @file
+  Processor resource HOB
+
+  If BSP does not known how many cores are online or the platform cannot
+  wake up AP via broadcast, this HOB can be used to store the processor
+  resource data that may come from ACPI or FDT, etc.
+
+  Copyright (c) 2024, Loongson Technology Corporation Limited. All rights 
reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef PROCESSOR_RESOURCE_HOB_H_
+#define PROCESSOR_RESOURCE_HOB_H_
+
+#define PROCESSOR_RESOURCE_HOB_GUID \
+  { \
+0xb855c7fe, 0xa758, 0x701f, { 0xa7, 0x30, 0x87, 0xf3, 0x9c, 0x03, 0x46, 
0x7e } \
+  }
+
+typedef struct {
+  UINT32NumberOfProcessor;
+  UINTN *ApicId;
+} PROCESSOR_RESOURCE_DATA;
+
+extern EFI_GUID  gProcessorResourceHobGuid;
+
+#endif
diff --git a/UefiCpuPkg/UefiCpuPkg.dec b/UefiCpuPkg/UefiCpuPkg.dec
index 1b890e975c..8ca3b7a5a6 100644
--- a/UefiCpuPkg/UefiCpuPkg.dec
+++ b/UefiCpuPkg/UefiCpuPkg.dec
@@ -96,6 +96,9 @@ [Guids]
   ## Include/Guid/MpInformation2.h
   gMpInformation2HobGuid = { 0x417a7f64, 0xf4e9, 0x4b32, {0x84, 0x6a, 
0x5c, 0xc4, 0xd8, 0x62, 0x18, 0x79 }}
 
+  ## Include/Guid/ProcessorResourceHob.h
+  gProcessorResourceHobGuid  = { 0xb855c7fe, 0xa758, 0x701f, { 0xa7, 0x30, 
0x87, 0xf3, 0x9c, 0x03, 0x46, 0x7e }}
+
 [Protocols]
   ## Include/Protocol/SmmCpuService.h
   gEfiSmmCpuServiceProtocolGuid   = { 0x1d202cab, 0xc8ab, 0x4d5c, { 0x94, 
0xf7, 0x3c, 0xfc, 0xc0, 0xd3, 0xd3, 0x35 }}
-- 
2.27.0



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117657): https://edk2.groups.io/g/devel/message/117657
Mute This Topic: https://groups.io/mt/105478501/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-