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 590777803CE for ; Wed, 10 Jan 2024 02:47:41 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=UPHx25pOhvuk+cWlzXBeuevWrcTPxQRUVr/nxoLb0FQ=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type; s=20140610; t=1704854860; v=1; b=ie/PpdYz8dqJpb61VSvM6likBD+7Ah8g4uqZane45ZHDeEEDxYNwEjDQAoghWa3xBJ+hnXma vN6oWDSSidtgu4JEDR24kgxOALQr8FglnZMh+D+NGPJx9iLDVihGZc1hdLwkh4MmAgE6UnfjsTd UHridKkG+1qmEDJy/NzVN9NQ= X-Received: by 127.0.0.2 with SMTP id PubJYY7687511xHj3WiJ3oo7; Tue, 09 Jan 2024 18:47:40 -0800 X-Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by mx.groups.io with SMTP id smtpd.web11.3670.1704854858392354268 for ; Tue, 09 Jan 2024 18:47:39 -0800 X-Received: from loongson.cn (unknown [10.40.24.149]) by gateway (Coremail) with SMTP id _____8BxWeo6BZ5lErUDAA--.3267S3; Wed, 10 Jan 2024 10:47:22 +0800 (CST) X-Received: from [10.40.24.149] (unknown [10.40.24.149]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cxid02BZ5lTQ4KAA--.26797S3; Wed, 10 Jan 2024 10:47:18 +0800 (CST) Message-ID: <6728db33-f653-4f2f-bf60-f2416842cac2@loongson.cn> Date: Wed, 10 Jan 2024 10:47:18 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [PATCH v6 26/36] OvmfPkg/LoongArchVirt: Add a NULL library named CollectApResouceLibNull To: devel@edk2.groups.io, maobibo@loongson.cn Cc: Ard Biesheuvel , Jiewen Yao , Jordan Justen , Gerd Hoffmann , Dongyan Qian References: <20240105094118.2279380-1-lichao@loongson.cn> <20240105094549.2281628-1-lichao@loongson.cn> <07c50d79-ddd1-7679-1046-e0f50bb293c7@loongson.cn> From: "Chao Li" In-Reply-To: <07c50d79-ddd1-7679-1046-e0f50bb293c7@loongson.cn> X-CM-TRANSID: AQAAf8Cxid02BZ5lTQ4KAA--.26797S3 X-CM-SenderInfo: xolfxt3r6o00pqjv00gofq/1tbiAQAMCGWd7KkDIQABsb X-Coremail-Antispam: 1Uk129KBj93XoW3Gr13tr1kGFW8JryUWrW5CFX_yoW7Zw1Dpr 1fua13GryfW34xJw4fG3yUWFyfurs3Cw45Gr1SgFy8tF1kJryY9r15XrZ0gryUuws5Cr18 Xryjva1UuF1kJrcCm3ZEXasCq-sJn29KB7ZKAUJUUUU8529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnRJUUUyCb4IE77IF4wAF F20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r 106r15M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAF wI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1l84ACjcxK6I8E87Iv67 AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AKxVW8Jr0_Cr1UM2AIxVAIcxkEcVAq 07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx1lYx0E2Ix0cI8IcVAFwI0_Jr0_Jr 4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvEwIxGrwCj r7xvwVCIw2I0I7xG6c02F41l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr 1lx2IqxVAqx4xG67AKxVWUGVWUWwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE 14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7 IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E 87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r1j6r4UYxBIdaVFxhVjvjDU0x ZFpf9x07UEFAJUUUUU= 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,lichao@loongson.cn List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: JjAb3By2OYsP6MVUSy8IBzPFx7686176AA= Content-Type: multipart/alternative; boundary="------------dFjD5djG1Hq82Eu8Z03OI0LX" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b="ie/PpdYz"; dmarc=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 --------------dFjD5djG1Hq82Eu8Z03OI0LX Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi Bibo, Thanks, Chao On 2024/1/10 09:24, maobibo wrote: > > > On 2024/1/5 下午5:45, Chao Li wrote: >> This Library is used to collect APs resources, but is currently NULL >> for OvmfPkg, because it is not used by the LoongArch virtual machine. >> >> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4584 >> >> Cc: Ard Biesheuvel >> Cc: Jiewen Yao >> Cc: Jordan Justen >> Cc: Gerd Hoffmann >> Cc: Bibo Mao >> Cc: Dongyan Qian >> Signed-off-by: Chao Li >> --- >>   .../CollectApResourceLibNull.c                | 38 +++++++++++++++++++ >>   .../CollectApResourceLibNull.inf              | 31 +++++++++++++++ >>   .../CollectApResourceLibNull.uni              |  9 +++++ >>   3 files changed, 78 insertions(+) >>   create mode 100644 >> OvmfPkg/LoongArchVirt/Library/CollectApResouceLibNull/CollectApResourceLibNull.c >>   create mode 100644 >> OvmfPkg/LoongArchVirt/Library/CollectApResouceLibNull/CollectApResourceLibNull.inf >>   create mode 100644 >> OvmfPkg/LoongArchVirt/Library/CollectApResouceLibNull/CollectApResourceLibNull.uni >> >> diff --git >> a/OvmfPkg/LoongArchVirt/Library/CollectApResouceLibNull/CollectApResourceLibNull.c >> b/OvmfPkg/LoongArchVirt/Library/CollectApResouceLibNull/CollectApResourceLibNull.c >> >> new file mode 100644 >> index 0000000000..19995c1193 >> --- /dev/null >> +++ >> b/OvmfPkg/LoongArchVirt/Library/CollectApResouceLibNull/CollectApResourceLibNull.c >> @@ -0,0 +1,38 @@ >> +/** @file >> +  LoongArch64 CPU Collect AP resource NULL Library functions. >> + >> +  Copyright (c) 2024, Loongson Technology Corporation Limited. All >> rights reserved.
>> + >> +  SPDX-License-Identifier: BSD-2-Clause-Patent >> + >> +**/ >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include "../../../UefiCpuPkg/Library/LoongArch64MpInitLib/MpLib.h" > The included path is a little strange, should we put > CollectApResouceLibNull library in ovmf package or > UefiCpuPkg/Library/LoongArch64MpInitLib package? This library is a private because virtual-matchines collect AP resouces differently from physical machines, so I thought would be fine if it was located in OvmfPkg/LoongArchVirt/Library. > > Regards > Bibo Mao > >> + >> +VOID >> +SaveProcessorResourceData ( >> +  IN PROCESSOR_RESOURCE_DATA * >> +  ); >> + >> +VOID >> +EFIAPI >> +SaveProcessorResource ( >> +  PROCESSOR_RESOURCE_DATA  *mProcessorResource >> +  ) >> +{ >> +  SaveProcessorResourceData (mProcessorResource); >> +} >> + >> +VOID >> +EFIAPI >> +CollectAllProcessorResource ( >> +  VOID >> +  ) >> +{ >> +  return; >> +} >> diff --git >> a/OvmfPkg/LoongArchVirt/Library/CollectApResouceLibNull/CollectApResourceLibNull.inf >> b/OvmfPkg/LoongArchVirt/Library/CollectApResouceLibNull/CollectApResourceLibNull.inf >> >> new file mode 100644 >> index 0000000000..c166df6bbd >> --- /dev/null >> +++ >> b/OvmfPkg/LoongArchVirt/Library/CollectApResouceLibNull/CollectApResourceLibNull.inf >> @@ -0,0 +1,31 @@ >> +## @file >> +#  LoongArch64 CPU Collect AP resource NULL Library. >> +# >> +#  Copyright (c) 2024, Loongson Technology Corporation Limited. All >> rights reserved.
>> +#  SPDX-License-Identifier: BSD-2-Clause-Patent >> +# >> +## >> + >> +[Defines] >> +  INF_VERSION                    = 1.29 >> +  BASE_NAME                      = CollectApResourceLibNull >> +  MODULE_UNI_FILE                = CollectApResourceLibNull.uni >> +  FILE_GUID                      = 8C3B54BF-6A9F-E8B4-4D57-67B3AB578DD6 >> +  MODULE_TYPE                    = PEIM >> +  VERSION_STRING                 = 1.1 >> +  LIBRARY_CLASS                  = PEIM >> + >> +[Sources.common] >> +  CollectApResourceLibNull.c >> + >> +[Packages] >> +  MdePkg/MdePkg.dec >> +  UefiCpuPkg/UefiCpuPkg.dec >> + >> +[LibraryClasses] >> +  BaseLib >> +  HobLib >> +  MemoryAllocationLib >> + >> +[Pcd] >> +  gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber >> diff --git >> a/OvmfPkg/LoongArchVirt/Library/CollectApResouceLibNull/CollectApResourceLibNull.uni >> b/OvmfPkg/LoongArchVirt/Library/CollectApResouceLibNull/CollectApResourceLibNull.uni >> >> new file mode 100644 >> index 0000000000..d1638ab11e >> --- /dev/null >> +++ >> b/OvmfPkg/LoongArchVirt/Library/CollectApResouceLibNull/CollectApResourceLibNull.uni >> @@ -0,0 +1,9 @@ >> +// @file >> +//  LoongArch64 CPU Collect AP resource NULL Library. >> +// >> +//  Copyright (c) 2024, Loongson Technology Corporation Limited. All >> rights reserved.
>> +//  SPDX-License-Identifier: BSD-2-Clause-Patent >> + >> +#string STR_MODULE_ABSTRACT             #language en-US "CPU Collect >> AP resource NULL Library." >> + >> +#string STR_MODULE_DESCRIPTION          #language en-US "CPU Collect >> AP resource NULL Library." >> > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113510): https://edk2.groups.io/g/devel/message/113510 Mute This Topic: https://groups.io/mt/103540125/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=- --------------dFjD5djG1Hq82Eu8Z03OI0LX Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Hi Bibo,


Thanks,
Chao
On 2024/1/10 09:24, maobibo wrote:


On 2024/1/5 下午5:45, Chao Li wrote:
This Library is used to collect APs resources, but is currently NULL
for OvmfPkg, because it is not used by the LoongArch virtual machine.

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4584

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Bibo Mao <maobibo@loongson.cn>
Cc: Dongyan Qian <qiandongyan@loongson.cn>
Signed-off-by: Chao Li <lichao@loongson.cn>
---
  .../CollectApResourceLibNull.c                | 38 +++++++++++++++++++
  .../CollectApResourceLibNull.inf              | 31 +++++++++++++++
  .../CollectApResourceLibNull.uni              |  9 +++++
  3 files changed, 78 insertions(+)
  create mode 100644 OvmfPkg/LoongArchVirt/Library/CollectApResouceLibNull/CollectApResourceLibNull.c
  create mode 100644 OvmfPkg/LoongArchVirt/Library/CollectApResouceLibNull/CollectApResourceLibNull.inf
  create mode 100644 OvmfPkg/LoongArchVirt/Library/CollectApResouceLibNull/CollectApResourceLibNull.uni

diff --git a/OvmfPkg/LoongArchVirt/Library/CollectApResouceLibNull/CollectApResourceLibNull.c b/OvmfPkg/LoongArchVirt/Library/CollectApResouceLibNull/CollectApResourceLibNull.c
new file mode 100644
index 0000000000..19995c1193
--- /dev/null
+++ b/OvmfPkg/LoongArchVirt/Library/CollectApResouceLibNull/CollectApResourceLibNull.c
@@ -0,0 +1,38 @@
+/** @file
+  LoongArch64 CPU Collect AP resource NULL Library functions.
+
+  Copyright (c) 2024, Loongson Technology Corporation Limited. All rights reserved.<BR>
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <PiPei.h>
+#include <Library/BaseLib.h>
+#include <Library/HobLib.h>
+#include <Library/MemoryAllocationLib.h>
+#include <Register/LoongArch64/Csr.h>
+#include "../../../UefiCpuPkg/Library/LoongArch64MpInitLib/MpLib.h"
The included path is a little strange, should we put CollectApResouceLibNull library in ovmf package or UefiCpuPkg/Library/LoongArch64MpInitLib package?
This library is a private because virtual-matchines collect AP resouces differently from physical machines, so I thought would be fine if it was located in OvmfPkg/LoongArchVirt/Library.

Regards
Bibo Mao

+
+VOID
+SaveProcessorResourceData (
+  IN PROCESSOR_RESOURCE_DATA *
+  );
+
+VOID
+EFIAPI
+SaveProcessorResource (
+  PROCESSOR_RESOURCE_DATA  *mProcessorResource
+  )
+{
+  SaveProcessorResourceData (mProcessorResource);
+}
+
+VOID
+EFIAPI
+CollectAllProcessorResource (
+  VOID
+  )
+{
+  return;
+}
diff --git a/OvmfPkg/LoongArchVirt/Library/CollectApResouceLibNull/CollectApResourceLibNull.inf b/OvmfPkg/LoongArchVirt/Library/CollectApResouceLibNull/CollectApResourceLibNull.inf
new file mode 100644
index 0000000000..c166df6bbd
--- /dev/null
+++ b/OvmfPkg/LoongArchVirt/Library/CollectApResouceLibNull/CollectApResourceLibNull.inf
@@ -0,0 +1,31 @@
+## @file
+#  LoongArch64 CPU Collect AP resource NULL Library.
+#
+#  Copyright (c) 2024, Loongson Technology Corporation Limited. All rights reserved.<BR>
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION                    = 1.29
+  BASE_NAME                      = CollectApResourceLibNull
+  MODULE_UNI_FILE                = CollectApResourceLibNull.uni
+  FILE_GUID                      = 8C3B54BF-6A9F-E8B4-4D57-67B3AB578DD6
+  MODULE_TYPE                    = PEIM
+  VERSION_STRING                 = 1.1
+  LIBRARY_CLASS                  = PEIM
+
+[Sources.common]
+  CollectApResourceLibNull.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  UefiCpuPkg/UefiCpuPkg.dec
+
+[LibraryClasses]
+  BaseLib
+  HobLib
+  MemoryAllocationLib
+
+[Pcd]
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber
diff --git a/OvmfPkg/LoongArchVirt/Library/CollectApResouceLibNull/CollectApResourceLibNull.uni b/OvmfPkg/LoongArchVirt/Library/CollectApResouceLibNull/CollectApResourceLibNull.uni
new file mode 100644
index 0000000000..d1638ab11e
--- /dev/null
+++ b/OvmfPkg/LoongArchVirt/Library/CollectApResouceLibNull/CollectApResourceLibNull.uni
@@ -0,0 +1,9 @@
+// @file
+//  LoongArch64 CPU Collect AP resource NULL Library.
+//
+//  Copyright (c) 2024, Loongson Technology Corporation Limited. All rights reserved.<BR>
+//  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+#string STR_MODULE_ABSTRACT             #language en-US "CPU Collect AP resource NULL Library."
+
+#string STR_MODULE_DESCRIPTION          #language en-US "CPU Collect AP resource NULL Library."






_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#113510) | | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--------------dFjD5djG1Hq82Eu8Z03OI0LX--