Re: [edk2-devel] [PATCH v2 1/2] OvmfPkg: Introduce alternate UefiDriverEntrypoint to inhibit driver load

2022-08-17 Thread Laszlo Ersek
On 08/17/22 17:11, Ard Biesheuvel wrote:
> Add a new library that can be incorporated into any driver built from
> source, and which permits loading of the driver to be inhibited based on
> the value of a QEMU fw_cfg boolean variable. This will be used in a
> subsequent patch to allow dispatch of the IPv6 and IPv6 network protocol

(1) Still a typo? Did you mean "IPv4 and IPv6"?

> driver to be controlled from the QEMU command line.
> 
> This approach is based on the notion that all UEFI and DXE drivers share
> a single UefiDriverEntryPoint implementation, which we can easily swap
> out at build time with one that will abort execution based on the value
> of some QEMU fw_cfg variable.
> 
> Signed-off-by: Ard Biesheuvel 
> ---
>  
> OvmfPkg/Library/UefiDriverEntryPointFwCfgOverrideLib/UefiDriverEntryPointFwCfgOverrideLib.c
>| 147 
>  
> OvmfPkg/Library/UefiDriverEntryPointFwCfgOverrideLib/UefiDriverEntryPointFwCfgOverrideLib.inf
>  |  57 
>  OvmfPkg/OvmfPkg.dec  
>  |   4 +
>  3 files changed, 208 insertions(+)
> 
> diff --git 
> a/OvmfPkg/Library/UefiDriverEntryPointFwCfgOverrideLib/UefiDriverEntryPointFwCfgOverrideLib.c
>  
> b/OvmfPkg/Library/UefiDriverEntryPointFwCfgOverrideLib/UefiDriverEntryPointFwCfgOverrideLib.c
> new file mode 100644
> index ..6eaf0cfd16ad
> --- /dev/null
> +++ 
> b/OvmfPkg/Library/UefiDriverEntryPointFwCfgOverrideLib/UefiDriverEntryPointFwCfgOverrideLib.c
> @@ -0,0 +1,147 @@
> +/** @file
> +  Entry point to a EFI/DXE driver. This version is specific to QEMU, and ties
> +  dispatch of the driver in question on the value of a QEMU fw_cfg boolean
> +  variable which is referenced by name via a fixed pointer PCD.
> +
> +Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
> +Copyright (c) 2022, Google LLC. All rights reserved.
> +SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include 
> +
> +#include 
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +/**
> +  Unloads an image from memory.
> +
> +  This function is a callback that a driver registers to do cleanup
> +  when the UnloadImage boot service function is called.
> +
> +  @param  ImageHandle The handle to the image to unload.
> +
> +  @return Status returned by all unload().
> +
> +**/
> +STATIC
> +EFI_STATUS
> +EFIAPI
> +_DriverUnloadHandler (
> +  EFI_HANDLE  ImageHandle
> +  )
> +{
> +  EFI_STATUS  Status;
> +
> +  //
> +  // If an UnloadImage() handler is specified, then call it
> +  //
> +  Status = ProcessModuleUnloadList (ImageHandle);
> +
> +  //
> +  // If the driver specific unload handler does not return an error, then 
> call
> +  // all of the library destructors.  If the unload handler returned an 
> error,
> +  // then the driver can not be unloaded, and the library destructors should
> +  // not be called
> +  //
> +  if (!EFI_ERROR (Status)) {
> +ProcessLibraryDestructorList (ImageHandle, gST);
> +  }
> +
> +  //
> +  // Return the status from the driver specific unload handler
> +  //
> +  return Status;
> +}
> +
> +/**
> +  The entry point of PE/COFF Image for a DXE Driver, DXE Runtime Driver, or
> +  UEFI Driver.
> +
> +  @param  ImageHandleThe image handle of the DXE Driver, DXE
> + Runtime Driver, or UEFI Driver.
> +  @param  SystemTableA pointer to the EFI System Table.
> +
> +  @retval  EFI_SUCCESS   The DXE Driver, DXE Runtime Driver, or
> + UEFI Driver exited normally.
> +  @retval  EFI_INCOMPATIBLE_VERSION  _gUefiDriverRevision is greater than
> + SystemTable->Hdr.Revision.
> +  @retval  Other Return value from
> + ProcessModuleEntryPointList().
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +_ModuleEntryPoint (
> +  IN EFI_HANDLEImageHandle,
> +  IN EFI_SYSTEM_TABLE  *SystemTable
> +  )
> +{
> +  EFI_STATUS Status;
> +  EFI_LOADED_IMAGE_PROTOCOL  *LoadedImage;
> +  RETURN_STATUS  RetStatus;
> +  BOOLEANEnabled;
> +
> +  if (_gUefiDriverRevision != 0) {
> +//
> +// Make sure that the EFI/UEFI spec revision of the platform is >= 
> EFI/UEFI
> +// spec revision of the driver
> +//
> +if (SystemTable->Hdr.Revision < _gUefiDriverRevision) {
> +  return EFI_INCOMPATIBLE_VERSION;
> +}
> +  }
> +
> +  //
> +  // Call constructor for all libraries
> +  //
> +  ProcessLibraryConstructorList (ImageHandle, SystemTable);
> +
> +  //
> +  //  Install unload handler...
> +  //
> +  if (_gDriverUnloadImageCount != 0) {
> +Status = gBS->HandleProtocol (
> +ImageHandle,
> +,
> +(VOID **)
> +);
> +ASSERT_EFI_ERROR (Status);
> +LoadedImage->Unload = _DriverUnloadHandler;
> +  }

Re: [edk2-devel] [PATCH 1/2] CloudHv/arm: add PeiMemInfoLib

2022-08-17 Thread Jianyong Wu
Hi Sami,

Thanks for review. All the comments are Ok for me. Just one inline reply:


+

+struct CloudHvMemNodeInfo CloudHvMemNode[CLOUDHV_MAX_MEM_NODE_NUM];

+

+RETURN_STATUS

+EFIAPI

+CloudHvVirtMemInfoPeiLibConstructor (

+  VOID

+  )

+{

+  VOID   *DeviceTreeBase;

+  EFI_RESOURCE_ATTRIBUTE_TYPE  ResourceAttributes;

+  INT32  Node, Prev;

+  UINT64 CurBase, MemBase;

+  UINT64 CurSize;

+  CONST CHAR8*Type;

+  INT32  Len;

+  CONST UINT64   *RegProp;

+  RETURN_STATUS  PcdStatus;

+  UINT8  Index;

+

+  ZeroMem (CloudHvMemNode, sizeof(CloudHvMemNode[0]) * 
CLOUDHV_MAX_MEM_NODE_NUM);
[SAMI] Will sizeof (CloudHvMemNode) should be sufficient above? Also, can you 
run uncrustify on your patches, please?

[Jong] The local uncrustify test environment is not ready. But I think “sizeof” 
here is OK, as this struct contains only two u64 variables, thus no padding 
here. If sizeof is not preference here, is there any suggestion from you?

Thanks
Jianyong




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




Re: [edk2-devel] [PATCH] IntelSiliconPkg/VTd: Add DMAR SIDP Table dumpping

2022-08-17 Thread Robert Kowalewski
Reviewed-by: Robert Kowalewski 

-Original Message-
From: Sheng, W  
Sent: Wednesday, August 17, 2022 8:20 AM
To: devel@edk2.groups.io
Cc: Ni, Ray ; Chaganty, Rangasai V 
; Huang, Jenny ; 
Kowalewski, Robert 
Subject: [PATCH] IntelSiliconPkg/VTd: Add DMAR SIDP Table dumpping

VT-d spec 4.0 has added a new structure called SIDP which is more generic to 
describe special properties of integrated devices.

Cc: Ray Ni 
Cc: Rangasai V Chaganty 
Cc: Jenny Huang 
Cc: Robert Kowalewski 
Signed-off-by: Sheng Wei 
---
 .../Feature/VTd/IntelVTdDxe/DmarAcpiTable.c   | 72 +++
 1 file changed, 72 insertions(+)

diff --git 
a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTable.c 
b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTable.c
index 75fbd53ed..42e1b1449 100644
--- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTable.c
+++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTabl
+++ e.c
@@ -93,6 +93,10 @@ DumpDmarDeviceScopeEntry (
 "  Length . 0x%02x\n", 
DmarDeviceScopeEntry->Length ));+  DEBUG ((DEBUG_INFO,+"  Flags 
.. 0x%02x\n",+
DmarDeviceScopeEntry->Flags+));   DEBUG ((DEBUG_INFO, "  
Enumeration ID . 0x%02x\n", 
DmarDeviceScopeEntry->EnumerationId@@ -122,6 +126,66 @@ 
DumpDmarDeviceScopeEntry (
   return; } +/**+  Dump DMAR SIDP table.++  @param[in]  Sidp  DMAR SIDP 
table+**/+VOID+DumpDmarSidp (+  IN EFI_ACPI_DMAR_SIDP_HEADER *Sidp+  )+{+  
EFI_ACPI_DMAR_DEVICE_SCOPE_STRUCTURE_HEADER   *DmarDeviceScopeEntry;+  INTN 
 SidpLen;++  if (Sidp == NULL) {+
return;+  }++  DEBUG ((DEBUG_INFO,+"  
***\n"+ 
   ));+  DEBUG ((DEBUG_INFO,+"  *   SoC Integrated Device Property 
Reporting Structure*\n"+));+  DEBUG ((DEBUG_INFO,+"  
***\n"+ 
   ));+  DEBUG ((DEBUG_INFO,+(sizeof(UINTN) == sizeof(UINT64)) ?+"  
SIDP address ... 0x%016lx\n" :+"  
SIDP address ... 0x%08x\n",+Sidp+   
 ));+  DEBUG ((DEBUG_INFO,+"Type 
. 0x%04x\n",+
Sidp->Header.Type+));+  DEBUG ((DEBUG_INFO,+"Length 
... 0x%04x\n",+
Sidp->Header.Length+));+  DEBUG ((DEBUG_INFO,+"Segment Number 
... 0x%04x\n",+Sidp->SegmentNumber+
));++  SidpLen  = Sidp->Header.Length - sizeof(EFI_ACPI_DMAR_SIDP_HEADER);+  
DmarDeviceScopeEntry = (EFI_ACPI_DMAR_DEVICE_SCOPE_STRUCTURE_HEADER *)(Sidp + 
1);+  while (SidpLen > 0) {+DumpDmarDeviceScopeEntry 
(DmarDeviceScopeEntry);+SidpLen -= DmarDeviceScopeEntry->Length;+
DmarDeviceScopeEntry = (EFI_ACPI_DMAR_DEVICE_SCOPE_STRUCTURE_HEADER 
*)((UINTN)DmarDeviceScopeEntry + DmarDeviceScopeEntry->Length);+  }++  DEBUG 
((DEBUG_INFO,+"  
***\n\n"+
));++  return;+}+ /**   Dump DMAR SATC table. @@ -472,6 +536,10 @@ 
DumpDmarDrhd (
 "Flags  0x%02x\n", 
Drhd->Flags ));+  DEBUG ((DEBUG_INFO,+"Size 
. 0x%02x\n",+Drhd->Size+
));   DEBUG ((DEBUG_INFO, "  INCLUDE_PCI_ALL 
 0x%02x\n", Drhd->Flags & 
EFI_ACPI_DMAR_DRHD_FLAGS_INCLUDE_PCI_ALL@@ -583,7 +651,11 @@ DumpAcpiDMAR (
 case EFI_ACPI_DMAR_TYPE_SATC:   DumpDmarSatc 
((EFI_ACPI_DMAR_SATC_HEADER *)DmarHeader);   break;+case 
EFI_ACPI_DMAR_TYPE_SIDP:+  DumpDmarSidp ((EFI_ACPI_DMAR_SIDP_HEADER 
*)DmarHeader);+  break; default:+  DEBUG ((DEBUG_INFO, "Unknown 
DMAR Table Type : %d\n", DmarHeader->Type));   break; } DmarLen -= 
DmarHeader->Length;-- 
2.26.2.windows.1

-
Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial 
Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | 
Kapital zakladowy 200.000 PLN.
Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i 
moze zawierac informacje poufne. W razie przypadkowego otrzymania tej 
wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; 
jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole 
use of the intended recipient(s). If you are not the intended recipient, please 
contact the sender and delete all copies; any review or 

Re: [edk2-devel] CcProbeLib not working for runtime calls

2022-08-17 Thread Gerd Hoffmann
On Thu, Aug 18, 2022 at 01:47:37AM +, Xu, Min M wrote:
> On August 17, 2022 7:05 PM, Gerd Hoffmann wrote:
> > https://bugzilla.redhat.com/show_bug.cgi?id=2114858
> > 
> > I think the call chain is:
> > 
> > -> linux does efi runtime call
> >   -> some debug message printed
> > -> OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c
> >   -> MdePkg/Library/BaseIoLibIntrinsic (IoWriteFifo8)
> > -> OvmfPkg/Library/CcProbeLib (CcProbe)
> >   -> page fault when trying to access WorkArea
> > 
> 
> I think this bug shares the same root cause. 
> https://bugzilla.tianocore.org/show_bug.cgi?id=3974

Yes, highly likely this is the same.

> And there is a fix awaiting for review. 
> https://edk2.groups.io/g/devel/message/91132

Hmm.  When the tdx/sev code actually works properly in runtime mode we
should be able to reserve the workarea, mark it as runtime memory
(SetMemorySpaceAttributes) and access it from runtime code, so we don't
need two different ways to figure what CC mode we are running in.

take care,
  Gerd



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




Re: [edk2-devel] [PATCH EDK2 v2 1/1] MdeModulePkg/BaseBmpSupportLib: Fix ColorMap issue

2022-08-17 Thread Sean
These seem like perfect examples to write host based unit tests for the 
bmpsupportlib. Then you could run all sorts of different bmp contents thru the 
lib routines.

Have you thought about adding that

Thanks
Sean

From: devel@edk2.groups.io  on behalf of wenyi,xie via 
groups.io 
Sent: Wednesday, August 17, 2022 7:26:07 PM
To: devel@edk2.groups.io ; jian.j.w...@intel.com 
; gaolim...@byosoft.com.cn ; 
zhichao@intel.com ; ray...@intel.com 

Cc: songdongku...@huawei.com ; xiewen...@huawei.com 

Subject: [edk2-devel] [PATCH EDK2 v2 1/1] MdeModulePkg/BaseBmpSupportLib: Fix 
ColorMap issue

When BitPerPixel is 1,4,8, there should be a color map in bmp file. But if
the format of bmp file is error, it maybe has no color map when BitPerPixel
is 1,4,8. The condition checking now can not catch this issue.

Cc: Jian J Wang 
Cc: Liming Gao 
Cc: Zhichao Gao 
Cc: Ray Ni 
Signed-off-by: Wenyi Xie 
Reviewed-by: Liming Gao 
---
 MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c 
b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
index c5e885d7a6d5..1cdd857f48f8 100644
--- a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
+++ b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
@@ -236,6 +236,12 @@ TranslateBmpToGopBlt (
 return RETURN_UNSUPPORTED;
   }

+  if ((BmpHeader->ImageOffset == sizeof (BMP_IMAGE_HEADER)) &&
+  ((BmpHeader->BitPerPixel & 0x0D) != 0))
+  {
+return RETURN_UNSUPPORTED;
+  }
+
   if (BmpHeader->ImageOffset > sizeof (BMP_IMAGE_HEADER)) {
 switch (BmpHeader->BitPerPixel) {
   case 1:
--
2.20.1.windows.1








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




[edk2-devel] [PATCH EDK2 v2 1/1] MdeModulePkg/BaseBmpSupportLib: Fix ColorMap issue

2022-08-17 Thread wenyi,xie via groups.io
When BitPerPixel is 1,4,8, there should be a color map in bmp file. But if
the format of bmp file is error, it maybe has no color map when BitPerPixel
is 1,4,8. The condition checking now can not catch this issue.

Cc: Jian J Wang 
Cc: Liming Gao 
Cc: Zhichao Gao 
Cc: Ray Ni 
Signed-off-by: Wenyi Xie 
Reviewed-by: Liming Gao 
---
 MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c 
b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
index c5e885d7a6d5..1cdd857f48f8 100644
--- a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
+++ b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
@@ -236,6 +236,12 @@ TranslateBmpToGopBlt (
 return RETURN_UNSUPPORTED;
   }
 
+  if ((BmpHeader->ImageOffset == sizeof (BMP_IMAGE_HEADER)) &&
+  ((BmpHeader->BitPerPixel & 0x0D) != 0))
+  {
+return RETURN_UNSUPPORTED;
+  }
+
   if (BmpHeader->ImageOffset > sizeof (BMP_IMAGE_HEADER)) {
 switch (BmpHeader->BitPerPixel) {
   case 1:
-- 
2.20.1.windows.1



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




[edk2-devel] [PATCH EDK2 v2 0/1] MdeModulePkg/BaseBmpSupportLib: Fix ColorMap issue

2022-08-17 Thread wenyi,xie via groups.io
Main Changes since v1 :
1.fix format issue found by Uncrustify 

Wenyi Xie (1):
  MdeModulePkg/BaseBmpSupportLib: Fix ColorMap issue

 MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c | 6 ++
 1 file changed, 6 insertions(+)

-- 
2.20.1.windows.1



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




Re: [edk2-devel] CcProbeLib not working for runtime calls

2022-08-17 Thread Min Xu
On August 17, 2022 7:05 PM, Gerd Hoffmann wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=2114858
> 
> I think the call chain is:
> 
> -> linux does efi runtime call
>   -> some debug message printed
> -> OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c
>   -> MdePkg/Library/BaseIoLibIntrinsic (IoWriteFifo8)
> -> OvmfPkg/Library/CcProbeLib (CcProbe)
>   -> page fault when trying to access WorkArea
> 

I think this bug shares the same root cause. 
https://bugzilla.tianocore.org/show_bug.cgi?id=3974
And there is a fix awaiting for review. 
https://edk2.groups.io/g/devel/message/91132

Gerd, what's your thought?

Thanks
Min



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




Re: [edk2-devel] [PATCH v1 1/1] OvmfPkg/VirtioNetDxe: Check ChildHandle argument in GetControllerName

2022-08-17 Thread Samer El-Haj-Mahmoud
Reviewed-By: Samer El-Haj-Mahmoud 

> -Original Message-
> From: Dimitrije Pavlov 
> Sent: Wednesday, August 17, 2022 10:35 AM
> To: devel@edk2.groups.io
> Cc: Ard Biesheuvel ; Jiewen Yao
> ; Liming Gao ; Sunny
> Wang ; Jeff Booher-Kaeding  kaed...@arm.com>; Samer El-Haj-Mahmoud  mahm...@arm.com>
> Subject: [PATCH v1 1/1] OvmfPkg/VirtioNetDxe: Check ChildHandle argument in
> GetControllerName
>
> Per the UEFI specification, a device driver implementation should return
> EFI_UNSUPPORTED if the ChildHandle argument in
> EFI_COMPONENT_NAME2_PROTOCOL.GetControllerName() is not NULL.
>
> Cc: Ard Biesheuvel 
> Cc: Jiewen Yao 
> Cc: Liming Gao 
> Cc: Sunny Wang 
> Cc: Jeff Booher-Kaeding 
> Cc: Samer El-Haj-Mahmoud 
>
> Signed-off-by: Dimitrije Pavlov 
> ---
>  OvmfPkg/VirtioNetDxe/ComponentName.c | 7 +++
>  1 file changed, 7 insertions(+)
>
> diff --git a/OvmfPkg/VirtioNetDxe/ComponentName.c
> b/OvmfPkg/VirtioNetDxe/ComponentName.c
> index e340ca2f8fe4..718096630f6f 100644
> --- a/OvmfPkg/VirtioNetDxe/ComponentName.c
> +++ b/OvmfPkg/VirtioNetDxe/ComponentName.c
> @@ -129,6 +129,13 @@ VirtioNetGetControllerName (
>  return EFI_INVALID_PARAMETER;
>}
>
> +  //
> +  // This is a device driver, so ChildHandle must be NULL.
> +  //
> +  if (ChildHandle != NULL) {
> +return EFI_UNSUPPORTED;
> +  }
> +
>//
>// confirm that the device is managed by this driver, using the VirtIo
>// Protocol
> --
> 2.37.2

IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.


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




[edk2-devel] Event: TianoCore Community Meeting EMEA/NAMO #cal-invite

2022-08-17 Thread Group Notification
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Groups.io Inc//Groups.io Calendar//EN
METHOD:PUBLISH
REFRESH-INTERVAL;VALUE=DURATION:PT1H
X-PUBLISHED-TTL:PT1H
CALSCALE:GREGORIAN
BEGIN:VTIMEZONE
TZID:America/Los_Angeles
LAST-MODIFIED:20220317T223602Z
TZURL:http://tzurl.org/zoneinfo-outlook/America/Los_Angeles
X-LIC-LOCATION:America/Los_Angeles
BEGIN:DAYLIGHT
TZNAME:PDT
TZOFFSETFROM:-0800
TZOFFSETTO:-0700
DTSTART:19700308T02
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:PST
TZOFFSETFROM:-0700
TZOFFSETTO:-0800
DTSTART:19701101T02
RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
X-GIOIDS:Repeat:45816
UID:u7v8.1660766102568797982.u...@groups.io
DTSTAMP:20220817T195502Z
ORGANIZER;CN=Miki Demeter:mailto:devel@edk2.groups.io
DTSTART;TZID=America/Los_Angeles:20221006T08
DTEND;TZID=America/Los_Angeles:20221006T09
RRULE:FREQ=MONTHLY;INTERVAL=1;BYDAY=1TH
SUMMARY:TianoCore Community Meeting EMEA/NAMO
DESCRIPTION:_
 ___\n\nMicrosoft Teams meeting\n\n*Join on your computer 
 or mobile app*\n\nClick here to join the meeting ( https://teams.microsof
 t.com/l/meetup-join/19%3ameeting_MTAyZGJhNjMtYzQ4Mi00MTUxLWFlMWMtOGU0MWNl
 ZDk4NjY5%40thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-
 4ed7712e255d%22%2c%22Oid%22%3a%226e4ce4c4-1242-431b-9a51-92cd01a5df3c%22%
 7d )\n\nMeeting ID: 226 323 011 029\nPasscode: hMRCj6\n\nDownload Teams (
  https://www.microsoft.com/en-us/microsoft-teams/download-app ) | Join on
  the web ( https://www.microsoft.com/microsoft-teams/join-a-meeting )\n\n
 *Join with a video conferencing device*\n\nte...@conf.intel.com\n\nVideo 
 Conference ID: 112 716 814 3\n\nAlternate VTC instructions ( https://conf
 .intel.com/teams/?conf=1127168143=teams=conf.intel.com=test_ca
 ll )\n\nLearn More ( https://aka.ms/JoinTeamsMeeting ) | Meeting options 
 ( https://teams.microsoft.com/meetingOptions/?organizerId=6e4ce4c4-1242-4
 31b-9a51-92cd01a5df3c=46c98d88-e344-4ed4-8496-4ed7712e255d
 dId=19_meeting_MTAyZGJhNjMtYzQ4Mi00MTUxLWFlMWMtOGU0MWNlZDk4NjY5@thread.v2
 =0=en-US )\n\n
 
LOCATION:Microsoft Teams meeting  Join on your computer or mobile app  Cl
 ick here to join the meeting  Meeting ID: 226 323 011 029  Passcode: hMRC
 j6  Download Teams | Join on the web Join with a video conferencing devic
 e  te...@conf.intel.com  Video Conference ID: 112 716 814 3  Alternate VT
 C instructions  Learn More | Meeting options
SEQUENCE:1
END:VEVENT
END:VCALENDAR


invite.ics
Description: application/ics


[edk2-devel] Updated Event: TianoCore Community Meeting - EMEA / NAMO - Thursday, September 15, 2022 #cal-invite

2022-08-17 Thread Group Notification
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Groups.io Inc//Groups.io Calendar//EN
METHOD:PUBLISH
REFRESH-INTERVAL;VALUE=DURATION:PT1H
X-PUBLISHED-TTL:PT1H
CALSCALE:GREGORIAN
BEGIN:VTIMEZONE
TZID:America/Los_Angeles
LAST-MODIFIED:20220317T223602Z
TZURL:http://tzurl.org/zoneinfo-outlook/America/Los_Angeles
X-LIC-LOCATION:America/Los_Angeles
BEGIN:DAYLIGHT
TZNAME:PDT
TZOFFSETFROM:-0800
TZOFFSETTO:-0700
DTSTART:19700308T02
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:PST
TZOFFSETFROM:-0700
TZOFFSETTO:-0800
DTSTART:19701101T02
RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
X-GIOIDS:Event:1599044 
UID:udv2.1625609743287285458.4...@groups.io
DTSTAMP:20220817T194810Z
ORGANIZER;CN=Miki Demeter:mailto:devel@edk2.groups.io
DTSTART:20220915T15Z
DTEND:20220915T16Z
SUMMARY:TianoCore Community Meeting - EMEA / NAMO
DESCRIPTION:Microsoft Teams meeting\n\n*Join on your computer or mobile a
 pp*\n\nClick here to join the meeting ( https://teams.microsoft.com/l/mee
 tup-join/19%3ameeting_N2UyMTVhZjUtOTk3Ni00MmI0LTg0NmItNzIwYTkyMGJhYzNh%40
 thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255
 d%22%2c%22Oid%22%3a%22b286b53a-1218-4db3-bfc9-3d4c5aa7669e%22%7d )\n\n*Jo
 in with a video conferencing device*\n\nte...@conf.intel.com\n\nVideo Con
 ference ID: 111 422 379 4\n\nAlternate VTC dialing instructions ( https:/
 /conf.intel.com/teams/?conf=1114223794=teams=conf.intel.com=te
 st_call )\n\n*Or call in (audio only)*\n\n+1 916-245-6934\,\,482062805# (
  tel:+19162456934\,\,482062805# ) United States\, Sacramento\n\nPhone Con
 ference ID: 482 062 805#\n\nFind a local number ( https://dialin.teams.mi
 crosoft.com/d195d438-2daa-420e-b9ea-da26f9d1d6d5?id=482062805 ) | Reset P
 IN ( https://mysettings.lync.com/pstnconferencing )\n\nLearn More ( https
 ://aka.ms/JoinTeamsMeeting ) | Meeting options ( https://teams.microsoft.
 com/meetingOptions/?organizerId=b286b53a-1218-4db3-bfc9-3d4c5aa7669e
 ntId=46c98d88-e344-4ed4-8496-4ed7712e255d=19_meeting_N2UyMTVhZjU
 tOTk3Ni00MmI0LTg0NmItNzIwYTkyMGJhYzNh@thread.v2=0=en-U
 S )
LOCATION:https://teams.microsoft.com/l/meetup-join/19%3ameeting_N2UyMTVhZ
 jUtOTk3Ni00MmI0LTg0NmItNzIwYTkyMGJhYzNh%40thread.v2/0?context=%7b%22Tid%2
 2%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%22b286b53a-
 1218-4db3-bfc9-3d4c5aa7669e%22%7d
RECURRENCE-ID:20220901T16Z
SEQUENCE:3
END:VEVENT
END:VCALENDAR


invite.ics
Description: application/ics


[edk2-devel] [Patch V2 edk2-stable202208 1/1] BaseTools/Source/C/GenSec: Fix EFI_SECTION_FREEFORM_SUBTYPE_GUID header

2022-08-17 Thread Michael D Kinney
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4021

When the size of a EFI_SECTION_FREEFORM_SUBTYPE_GUID section required
the use of EFI_FREEFORM_SUBTYPE_GUID_SECTION2 header, set the section
type to EFI_SECTION_FREEFORM_SUBTYPE_GUID.

Cc: Leif Lindholm 
Cc: Andrew Fish 
Cc: Konstantin Aladyshev 
Cc: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
Signed-off-by: Michael D Kinney 
Acked-by: Konstantin Aladyshev 
Reviewed-by: Bob Feng 
---
 BaseTools/Source/C/GenSec/GenSec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/C/GenSec/GenSec.c 
b/BaseTools/Source/C/GenSec/GenSec.c
index d86cc197cc26..a4c2d19aa6f4 100644
--- a/BaseTools/Source/C/GenSec/GenSec.c
+++ b/BaseTools/Source/C/GenSec/GenSec.c
@@ -1112,7 +1112,7 @@ Routine Description:
   //
   if (TotalLength >= MAX_SECTION_SIZE) {
 SubtypeGuidSect2 = (EFI_FREEFORM_SUBTYPE_GUID_SECTION2 *) FileBuffer;
-SubtypeGuidSect2->CommonHeader.Type = EFI_SECTION_GUID_DEFINED;
+SubtypeGuidSect2->CommonHeader.Type = 
EFI_SECTION_FREEFORM_SUBTYPE_GUID;
 SubtypeGuidSect2->CommonHeader.Size[0]  = (UINT8) 0xff;
 SubtypeGuidSect2->CommonHeader.Size[1]  = (UINT8) 0xff;
 SubtypeGuidSect2->CommonHeader.Size[2]  = (UINT8) 0xff;
-- 
2.37.1.windows.1



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




Re: [edk2-devel] [PATCH v4 6/6] DynamicTablesPkg: AcpiSsdtPcieLibArm: Added case handling for PCI config

2022-08-17 Thread Kun Qin

Hi Sami,

Thank you for the help! I agree that we can drop this patch and merge 
the rest when the window is open.


Pierre,

Thanks for your input on the usage as well!

Regards,
Kun

On 8/17/2022 5:06 AM, Sami Mujawar wrote:

Hi Kun,

I plan to get this series merged when the merge window opens.

If you agree, I will drop this patch before merging. Please let me 
know if that is ok.


Regards,

Sami Mujawar

On 17/08/2022 09:53 am, Pierre Gondois wrote:



On 8/17/22 02:17, Kun Qin wrote:

Hi Pierre,

You are correct that if CM_ARM_PCI_ADDRESS_MAP_INFO.PCI_SS_CONFIG
is no longer being used, this patch is not needed. Thanks for 
catching this.


On the other hand, just for my learning purpose, could you please 
let me know
what the use case for "PCI_SS_CONFIG" is? It does not seem to be 
used at all.


I haven't seen any usecase neither so far, but it is to be used to 
reference a

PCI bus/device/function/register location to identify/configure a device
from what I understood.



Thanks again for testing these patches!

Regards,
Kun

On 8/16/2022 8:33 AM, Pierre Gondois wrote:

Hello Kun,

Is this patch still required ?
Cf: https://edk2.groups.io/g/devel/message/92204

The CM_ARM_PCI_CONFIG_SPACE_INFO struct should be enough to describe
the PCI ECAM, so CM_ARM_PCI_ADDRESS_MAP_INFO.SpaceCode being set to
PCI_SS_CONFIG should be an invalid case.
If not I don't think a v5 should be necessary.

Also I ran the patchset on KvmTool and everything was working.

Regards,
Pierre

On 8/11/22 00:28, Kun Qin wrote:

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3998

This change added a switch case handling for PCI_SS_CONFIG during 
SSDT
generation. This will allow PCI config case return EFI_SUCCESS 
instead of

EFI_INVALID_PARAMETER.

Cc: Sami Mujawar 
Cc: Alexei Fedorov 

Co-authored-by: Joe Lopez 
Signed-off-by: Kun Qin 
Reviewed-by: Pierre Gondois 
Reviewed-by: Sami Mujawar 
---

Notes:
 v2:
 - Added Reviewed-by tag [Pierre]
  v3:
 - No change
  v4:
 - Added Reviewed-by tag [Sami]

DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c 
| 5 +

  1 file changed, 5 insertions(+)

diff --git 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c 


index dd75fc27e60e..c6fbd09c43f8 100644
--- 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
+++ 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c

@@ -606,6 +606,11 @@ GeneratePciCrs (
 );
  break;
  +  case PCI_SS_CONFIG:
+    // Do nothing
+    Status = EFI_SUCCESS;
+    break;
+
    default:
  Status = EFI_INVALID_PARAMETER;
  } // switch









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




[edk2-devel] [PATCH v3] DynamicTablesPkg: Add support to build _DSD

2022-08-17 Thread Jeff Brasen via groups.io
Add APIs needed to build _DSD with different UUIDs.

This is per ACPI specification 6.4 s6.2.5.



Adds support for building data packages with format

Package {"Name", Integer}



Signed-off-by: Jeff Brasen 

---

 .../Include/Library/AmlLib/AmlLib.h   |  60 +

 .../Common/AmlLib/CodeGen/AmlCodeGen.c| 254 ++

 2 files changed, 314 insertions(+)



diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h 
b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h

index 6f214c0dfa..18013f3c0c 100644

--- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h

+++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h

@@ -1280,6 +1280,66 @@ AmlAddLpiState (

   IN  AML_OBJECT_NODE_HANDLE  LpiNode

   );

 

+/** AML code generation for a _DSD device data object.

+

+  AmlAddDeviceDataDescriptorPackage (Uuid, DsdNode, PackageNode) is

+  equivalent of the following ASL code:

+ToUUID(Uuid),

+Package () {}

+

+  Cf ACPI 6.4 specification, s6.2.5 "_DSD (Device Specific Data)".

+

+  _DSD (Device Specific Data) Implementation Guide

+  https://github.com/UEFI/DSD-Guide

+  Per s3. "'Well-Known _DSD UUIDs and Data Structure Formats'"

+  If creating a Device Properties data then UUID 
daffd814-6eba-4d8c-8a91-bc9bbf4aa301 should be used.

+

+  @ingroup CodeGenApis

+

+  @param [in]  Uuid   The Uuid of the descriptor to be created

+  @param [in]  DsdNodeNode of the DSD Package.

+  @param [out] PackageNodeIf success, contains the created package node.

+

+  @retval EFI_SUCCESS Success.

+  @retval EFI_INVALID_PARAMETER   Invalid parameter.

+  @retval EFI_OUT_OF_RESOURCESFailed to allocate memory.

+**/

+EFI_STATUS

+EFIAPI

+AmlAddDeviceDataDescriptorPackage (

+  IN  CONST EFI_GUID*Uuid,

+  INAML_OBJECT_NODE_HANDLE  DsdNode,

+  OUT   AML_OBJECT_NODE_HANDLE  *PackageNode

+  );

+

+/** AML code generation to add a package with a name and value,

+to a parent package.

+This is useful for build the _DSD package but can be used in other cases.

+

+  AmlAddNameValuePackage ("Name", Value, PackageNode) is

+  equivalent of the following ASL code:

+Package (2) {"Name", Value}

+

+  Cf ACPI 6.4 specification, s6.2.5 "_DSD (Device Specific Data)".

+

+  @ingroup CodeGenApis

+

+  @param [in]  Name   String to place in first entry of package

+  @param [in]  Value  Integer to place in second entry of package

+  @param [in]  PackageNodePackage to add new sub package to.

+

+  @retval EFI_SUCCESS Success.

+  @retval EFI_INVALID_PARAMETER   Invalid parameter.

+  @retval EFI_OUT_OF_RESOURCESFailed to allocate memory.

+**/

+EFI_STATUS

+EFIAPI

+AmlAddNameIntegerPackage (

+  IN CHAR8   *Name,

+  IN UINT64  Value,

+  IN AML_OBJECT_NODE_HANDLE  PackageNode

+  );

+

 // DEPRECATED APIS

 #ifndef DISABLE_NEW_DEPRECATED_INTERFACES

 

diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c 
b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c

index e51d2dd7f0..cf92e7aee7 100644

--- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c

+++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c

@@ -2600,3 +2600,257 @@ error_handler:

 

   return Status;

 }

+

+/** AML code generation for a _DSD device data object.

+

+  AmlAddDeviceDataDescriptorPackage (Uuid, DsdNode, PackageNode) is

+  equivalent of the following ASL code:

+ToUUID(Uuid),

+Package () {}

+

+  Cf ACPI 6.4 specification, s6.2.5 "_DSD (Device Specific Data)".

+

+  _DSD (Device Specific Data) Implementation Guide

+  https://github.com/UEFI/DSD-Guide

+  Per s3. "'Well-Known _DSD UUIDs and Data Structure Formats'"

+  If creating a Device Properties data then UUID 
daffd814-6eba-4d8c-8a91-bc9bbf4aa301 should be used.

+

+  @ingroup CodeGenApis

+

+  @param [in]  Uuid   The Uuid of the descriptor to be created

+  @param [in]  DsdNodeNode of the DSD Package.

+  @param [out] PackageNodeIf success, contains the created package node.

+

+  @retval EFI_SUCCESS Success.

+  @retval EFI_INVALID_PARAMETER   Invalid parameter.

+  @retval EFI_OUT_OF_RESOURCESFailed to allocate memory.

+**/

+EFI_STATUS

+EFIAPI

+AmlAddDeviceDataDescriptorPackage (

+  IN  CONST EFI_GUID*Uuid,

+  INAML_OBJECT_NODE_HANDLE  DsdNode,

+  OUT   AML_OBJECT_NODE_HANDLE  *PackageNode

+  )

+{

+  EFI_STATUS  Status;

+  AML_OBJECT_NODE *UuidNode;

+  AML_DATA_NODE   *UuidDataNode;

+  AML_OBJECT_NODE_HANDLE  DsdEntryList;

+

+  if ((Uuid == NULL) ||

+  (PackageNode == NULL) ||

+  (AmlGetNodeType ((AML_NODE_HANDLE)DsdNode) != EAmlNodeObject) ||

+  (!AmlNodeHasOpCode (DsdNode, AML_NAME_OP, 0)) ||

+  !AmlNameOpCompareName (DsdNode, "_DSD"))

+  {

+ASSERT_EFI_ERROR 

Re: [edk2-devel] [PATCH v1] MinPlatformPkg: Add PcdAcpiGpe1BlockLength for FADT from board package

2022-08-17 Thread Chiu, Chasel


Hello,

Patch has been merged: 
https://github.com/tianocore/edk2-platforms/commit/d56523d0c1fae5311f5bcecd93ccabd8a5c73830

Thanks,
Chasel


> -Original Message-
> From: Chen, Aryeh 
> Sent: Monday, August 15, 2022 1:36 AM
> To: devel@edk2.groups.io
> Cc: Chen, Aryeh ; Chiu, Chasel
> ; Desimone, Nathaniel L
> ; Oram, Isaac W ;
> Gao, Liming ; Dong, Eric 
> Subject: [PATCH v1] MinPlatformPkg: Add PcdAcpiGpe1BlockLength for FADT
> from board package
> 
> From: Aryeh Chen 
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4020
> 
> Add PcdAcpiGpe1BlockLength of FADT Gpe1BlkLen register on MinPlatformPkg
> for PlatformBoardpkg to update platform setting.
> 
> Signed-off-by: Aryeh Chen 
> Cc: Chasel Chiu 
> Cc: Nate DeSimone 
> Cc: Isaac Oram 
> Cc: Liming Gao 
> Cc: Eric Dong 
> ---
>  Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c   | 3 ++-
>  Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.inf | 1 +
>  Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec   | 1 +
>  3 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
> b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
> index f134c8a58f..6e57b638e0 100644
> --- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
> +++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
> @@ -88,7 +88,7 @@ EFI_STATUS
>  AppendCpuMapTableEntry ( IN VOID   *ApicPtr, IN UINT32
> LocalApicCounter,-IN EFI_CPU_ID_ORDER_MAP *CpuApicIdOrderTable +IN
> EFI_CPU_ID_ORDER_MAP *CpuApicIdOrderTable   ) {   EFI_STATUSStatus;@@
> -,6 +,7 @@ PlatformUpdateTables (
>  FadtHeader->Gpe0Blk   = PcdGet16 
> (PcdAcpiGpe0BlockAddress);
> FadtHeader->Gpe0BlkLen= PcdGet8 
> (PcdAcpiGpe0BlockLength);
> FadtHeader->Gpe1Blk   = PcdGet16 
> (PcdAcpiGpe1BlockAddress);+
> FadtHeader->Gpe1BlkLen= PcdGet8 
> (PcdAcpiGpe1BlockLength);
> FadtHeader->Gpe1Base  = PcdGet8 (PcdAcpiGpe1Base);
> FadtHeader->XPm1aEvtBlk.Address   = PcdGet16
> (PcdAcpiPm1AEventBlockAddress);diff --git
> a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.inf
> b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.inf
> index 89350828d6..451034fb8a 100644
> --- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.inf
> +++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.inf
> @@ -84,6 +84,7 @@
>gMinPlatformPkgTokenSpaceGuid.PcdAcpiGpe0BlockAddress
> gMinPlatformPkgTokenSpaceGuid.PcdAcpiGpe0BlockLength
> gMinPlatformPkgTokenSpaceGuid.PcdAcpiGpe1BlockAddress+
> gMinPlatformPkgTokenSpaceGuid.PcdAcpiGpe1BlockLength
> gMinPlatformPkgTokenSpaceGuid.PcdAcpiResetRegisterAccessSize
> gMinPlatformPkgTokenSpaceGuid.PcdAcpiXPm1aEvtBlkAccessSize
> gMinPlatformPkgTokenSpaceGuid.PcdAcpiXPm1bEvtBlkAccessSizediff --git
> a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> index db0a19066f..8e603b7bf9 100644
> --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> @@ -123,6 +123,7 @@
> 
> gMinPlatformPkgTokenSpaceGuid.PcdAcpiGpe0BlockAddress|0x1880|UINT16|0
> x0001003B
> gMinPlatformPkgTokenSpaceGuid.PcdAcpiGpe0BlockLength|0x00|UINT8|0x000
> 1003C
> gMinPlatformPkgTokenSpaceGuid.PcdAcpiGpe1BlockAddress|0x|UINT16|0
> x0001003D+
> gMinPlatformPkgTokenSpaceGuid.PcdAcpiGpe1BlockLength|0x00|UINT8|0x000
> 1003E
> gMinPlatformPkgTokenSpaceGuid.PcdAcpiGpe1Base|0x00|UINT8|0x00010040
> gMinPlatformPkgTokenSpaceGuid.PcdAcpiResetRegisterAccessSize|0x00|UINT8
> |0x00010042 --
> 2.26.2.windows.1



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




Re: [edk2-devel] [PATCH] DynamicTablesPkg: Correct cluster index

2022-08-17 Thread Jeff Brasen via groups.io


> -Original Message-
> From: Ard Biesheuvel 
> Sent: Wednesday, August 17, 2022 1:01 AM
> To: Jeff Brasen 
> Cc: devel@edk2.groups.io; quic_llind...@quicinc.com;
> ardb+tianoc...@kernel.org; sami.muja...@arm.com;
> alexei.fedo...@arm.com
> Subject: Re: [PATCH] DynamicTablesPkg: Correct cluster index
> 
> External email: Use caution opening links or attachments
> 
> 
> On Tue, 16 Aug 2022 at 22:46, Jeff Brasen  wrote:
> >
> > Current code will generate duplicate UID if there are nested clusters
> > in the topology.
> >
> 
> What is a nested cluster?
> 

Better terminology would be nested processor containers, in our case we have 
socket/cluster/cpu. I'll update the commit message. Should I also change 
CreateAmlCluster to CreateAmlProcessorContainer?

> > Signed-off-by: Jeff Brasen 
> > ---
> >  .../SsdtCpuTopologyGenerator.c| 22 ---
> >  1 file changed, 14 insertions(+), 8 deletions(-)
> >
> > diff --git
> >
> a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCp
> uT
> > opologyGenerator.c
> >
> b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCp
> uT
> > opologyGenerator.c
> > index 3266d8dd98..9295117f1f 100644
> > ---
> >
> a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCp
> uT
> > opologyGenerator.c
> > +++
> b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/Ssdt
> > +++ CpuTopologyGenerator.c
> > @@ -706,6 +706,8 @@ CreateAmlCluster (
> >   Cannot be CM_NULL_TOKEN.
> >@param [in] ParentNode Parent node to attach the created
> >   node to.
> > +  @param [in,out] ClusterIndex   Pointer to the current cluster index
> > + to be used as UID.
> >
> >@retval EFI_SUCCESS Success.
> >@retval EFI_INVALID_PARAMETER   Invalid parameter.
> > @@ -718,13 +720,13 @@ CreateAmlCpuTopologyTree (
> >INACPI_CPU_TOPOLOGY_GENERATOR   *Generator,
> >IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST
> CfgMgrProtocol,
> >INCM_OBJECT_TOKEN   NodeToken,
> > -  INAML_NODE_HANDLE   ParentNode
> > +  INAML_NODE_HANDLE   ParentNode,
> > +  IN OUTUINT32*ClusterIndex
> >)
> >  {
> >EFI_STATUS  Status;
> >UINT32  Index;
> >UINT32  CpuIndex;
> > -  UINT32  ClusterIndex;
> >AML_OBJECT_NODE_HANDLE  ClusterNode;
> >
> >ASSERT (Generator != NULL);
> > @@ -733,9 +735,9 @@ CreateAmlCpuTopologyTree (
> >ASSERT (CfgMgrProtocol != NULL);
> >ASSERT (NodeToken != CM_NULL_TOKEN);
> >ASSERT (ParentNode != NULL);
> > +  ASSERT (ClusterIndex != NULL);
> >
> > -  CpuIndex = 0;
> > -  ClusterIndex = 0;
> > +  CpuIndex = 0;
> >
> >for (Index = 0; Index < Generator->ProcNodeCount; Index++) {
> >  // Find the children of the CM_ARM_PROC_HIERARCHY_INFO @@ -
> 790,7
> > +792,7 @@ CreateAmlCpuTopologyTree (
> > CfgMgrProtocol,
> > ParentNode,
> > >ProcNodeList[Index],
> > -   ClusterIndex,
> > +   *ClusterIndex,
> > 
> > );
> >  if (EFI_ERROR (Status)) {
> > @@ -800,7 +802,7 @@ CreateAmlCpuTopologyTree (
> >
> >  // Nodes must have a unique name in the ASL namespace.
> >  // Reset the Cpu index whenever we create a new Cluster.
> > -ClusterIndex++;
> > +(*ClusterIndex)++;
> >  CpuIndex = 0;
> >
> >  // Recursively continue creating an AML tree.
> > @@ -808,7 +810,8 @@ CreateAmlCpuTopologyTree (
> > Generator,
> > CfgMgrProtocol,
> > Generator->ProcNodeList[Index].Token,
> > -   ClusterNode
> > +   ClusterNode,
> > +   ClusterIndex
> > );
> >  if (EFI_ERROR (Status)) {
> >ASSERT (0);
> > @@ -845,6 +848,7 @@ CreateTopologyFromProcHierarchy (
> >EFI_STATUS  Status;
> >UINT32  Index;
> >UINT32  TopLevelProcNodeIndex;
> > +  UINT32  ClusterIndex;
> >
> >ASSERT (Generator != NULL);
> >ASSERT (Generator->ProcNodeCount != 0); @@ -853,6 +857,7 @@
> > CreateTopologyFromProcHierarchy (
> >ASSERT (ScopeNode != NULL);
> >
> >TopLevelProcNodeIndex = MAX_UINT32;
> > +  ClusterIndex  = 0;
> >
> >Status = TokenTableInitialize (Generator, Generator->ProcNodeCount);
> >if (EFI_ERROR (Status)) {
> > @@ -887,7 +892,8 @@ CreateTopologyFromProcHierarchy (
> >   Generator,
> >   CfgMgrProtocol,
> >   Generator->ProcNodeList[TopLevelProcNodeIndex].Token,
> > - ScopeNode
> > + ScopeNode,
> > + 
> >   

Re: [edk2-devel] [PATCH 3/3] RedfishPkg: The functions for Redfish requests do not fully complied with specification

2022-08-17 Thread Chang, Abner via groups.io
Sorry, it's a typo. I mean use RedfishPostToUri() makes more sense to me.

Abner

Get Outlook for Android


From: Chang, Abner 
Sent: Wednesday, August 17, 2022, 11:09 PM
To: Igor Kulchytskyy ; devel@edk2.groups.io 

Cc: nickle.w...@hpe.com 
Subject: RE: [EXTERNAL] RE: [PATCH 3/3] RedfishPkg: The functions for Redfish 
requests do not fully complied with specification

[AMD Official Use Only - General]

Yes, I think we can remove 'Ex' because there is no RedfishPostToUri () in 
RedfishLib.c. Also, RedfishPostToUriEx() has the same parameters as 
postUriFromService() in service.c. Using RedfishPostToUriEx () makes more sense 
to me.
Thanks
Abner

> -Original Message-
> From: Igor Kulchytskyy 
> Sent: Wednesday, August 17, 2022 10:35 PM
> To: Chang, Abner ; devel@edk2.groups.io
> Cc: nickle.w...@hpe.com
> Subject: RE: [EXTERNAL] RE: [PATCH 3/3] RedfishPkg: The functions for
> Redfish requests do not fully complied with specification
>
> [CAUTION: External Email]
>
> Hi Abner,
> I just thought that since I'm adding new functions (extending API) I call 
> those
> functions with Ex suffix.
> But if you think it is better to have the name without Ex, I can change it and
> resubmit.
> Thank you,
> Igor
>
> -Original Message-
> From: Chang, Abner 
> Sent: Wednesday, August 17, 2022 12:00 AM
> To: Igor Kulchytskyy ; devel@edk2.groups.io
> Cc: nickle.w...@hpe.com
> Subject: [EXTERNAL] RE: [PATCH 3/3] RedfishPkg: The functions for Redfish
> requests do not fully complied with specification
>
>
> **CAUTION: The e-mail below is from an external source. Please exercise
> caution before opening attachments, clicking links, or following guidance.**
>
> [AMD Official Use Only - General]
>
> Hi Igor,
> One question in line.
>
> > -Original Message-
> > From: Igor Kulchytskyy 
> > Sent: Tuesday, August 16, 2022 9:25 AM
> > To: devel@edk2.groups.io
> > Cc: Chang, Abner ; nickle.w...@hpe.com; Igor
> > Kulchytskyy ; Chang, Abner 
> > Subject: [PATCH 3/3] RedfishPkg: The functions for Redfish requests do
> > not fully complied with specification
> >
> > [CAUTION: External Email]
> >
> > There is no function to send POST request with the Content type which
> > is different from "application/json".
> > There is no function to send DELETE request with the body.
> >
> > Cc: Abner Chang 
> > Cc: Nickle Wang 
> > Signed-off-by: Igor Kulchytskyy 
> > ---
> >  RedfishPkg/Include/Library/RedfishLib.h|  80 +
> >  RedfishPkg/PrivateLibrary/RedfishLib/RedfishLib.c  | 189
> > +
> >  .../edk2libredfish/include/redfishService.h|   8 +
> >  .../RedfishLib/edk2libredfish/src/service.c|  43 -
> >  4 files changed, 317 insertions(+), 3 deletions(-)
> >
> > diff --git a/RedfishPkg/Include/Library/RedfishLib.h
> > b/RedfishPkg/Include/Library/RedfishLib.h
> > index b2488ab..d4b3246 100644
> > --- a/RedfishPkg/Include/Library/RedfishLib.h
> > +++ b/RedfishPkg/Include/Library/RedfishLib.h
> > @@ -380,6 +380,49 @@ RedfishPatchToPayload (
> >OUTREDFISH_RESPONSE  *RedResponse
> >);
> >
> > +
> > +/**
> > +  Use HTTP POST to create new Redfish resource in the Resource
> Collection.
> > +
> > +  The POST request should be submitted to the Resource Collection in
> > + which the new resource  is to belong. The Resource Collection is
> > + addressed by URI. The Redfish may  ignore any service controlled
> > + properties. The corresponding redfish response will returned,
> > + including HTTP
> > StatusCode, Headers and Payload which record any HTTP response
> messages.
> > +
> > +  Callers are responsible for freeing the HTTP StatusCode, Headers
> > + and Payload returned in  redfish response data.
> > +
> > +  @param[in]RedfishServiceThe Service to access the Redfish
> resources.
> > +  @param[in]Uri   Relative path to address the 
> > resource.
> > +  @param[in]Content   JSON represented properties to be 
> > update.
> > +  @param[in]ContentSize   Size of the Content to be send to 
> > Redfish
> > service
> > +  @param[in]ContentType   Type of the Content to be send to
> Redfish
> > service
> > +  @param[out]   RedResponse   Pointer to the Redfish response data.
> > +
> > +  @retval EFI_SUCCESS The opeartion is successful, indicates 
> > the
> HTTP
> > StatusCode is not
> > +  NULL and the value is 2XX. The
> > + Redfish resource will be
> > returned
> > +  in Payload within RedResponse if
> > + server send it back in the
> > HTTP
> > +  response message body.
> > +  @retval EFI_INVALID_PARAMETER   RedfishService, Uri, Content, or
> > RedResponse is NULL.
> > +  @retval EFI_DEVICE_ERRORAn unexpected system or network error
> > occurred. Callers can get
> > +  more error info from 

[edk2-devel] [PATCH v2 2/2] OvmfPkg/OvmfPkgX64: Allow runtime control of IPv4 and IPv6 support

2022-08-17 Thread Ard Biesheuvel
Wire up the newly added UefiDriverEntrypoint in a way that ties dispatch
of the Ip4Dxe and Ip6Dxe drivers to QEMU fw_cfg variables
'opt/org.tianocore/IPv4Support' and 'opt/org.tianocore/IPv6Support'
respectively.

Setting both variables to 'n' disables IP based networking entirely,
without the need for additional code changes at the NIC driver or
network boot protocol level.

Signed-off-by: Ard Biesheuvel 
---
 OvmfPkg/OvmfPkgX64.dsc | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index 6e68f60dc90f..2cbe35c95824 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -947,6 +947,20 @@ [Components]
   NULL|OvmfPkg/Library/PxeBcPcdProducerLib/PxeBcPcdProducerLib.inf
   }
 
+  NetworkPkg/Ip4Dxe/Ip4Dxe.inf {
+
+  
UefiDriverEntryPoint|OvmfPkg/Library/UefiDriverEntryPointFwCfgOverrideLib/UefiDriverEntryPointFwCfgOverrideLib.inf
+
+  
gUefiOvmfPkgTokenSpaceGuid.PcdEntryPointOverrideFwCfgVarName|"opt/org.tianocore/IPv4Support"
+  }
+
+  NetworkPkg/Ip6Dxe/Ip6Dxe.inf {
+
+  
UefiDriverEntryPoint|OvmfPkg/Library/UefiDriverEntryPointFwCfgOverrideLib/UefiDriverEntryPointFwCfgOverrideLib.inf
+
+  
gUefiOvmfPkgTokenSpaceGuid.PcdEntryPointOverrideFwCfgVarName|"opt/org.tianocore/IPv6Support"
+  }
+
 !if $(NETWORK_TLS_ENABLE) == TRUE
   NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf {
 
-- 
2.35.1



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




[edk2-devel] [PATCH v2 1/2] OvmfPkg: Introduce alternate UefiDriverEntrypoint to inhibit driver load

2022-08-17 Thread Ard Biesheuvel
Add a new library that can be incorporated into any driver built from
source, and which permits loading of the driver to be inhibited based on
the value of a QEMU fw_cfg boolean variable. This will be used in a
subsequent patch to allow dispatch of the IPv6 and IPv6 network protocol
driver to be controlled from the QEMU command line.

This approach is based on the notion that all UEFI and DXE drivers share
a single UefiDriverEntryPoint implementation, which we can easily swap
out at build time with one that will abort execution based on the value
of some QEMU fw_cfg variable.

Signed-off-by: Ard Biesheuvel 
---
 
OvmfPkg/Library/UefiDriverEntryPointFwCfgOverrideLib/UefiDriverEntryPointFwCfgOverrideLib.c
   | 147 
 
OvmfPkg/Library/UefiDriverEntryPointFwCfgOverrideLib/UefiDriverEntryPointFwCfgOverrideLib.inf
 |  57 
 OvmfPkg/OvmfPkg.dec
   |   4 +
 3 files changed, 208 insertions(+)

diff --git 
a/OvmfPkg/Library/UefiDriverEntryPointFwCfgOverrideLib/UefiDriverEntryPointFwCfgOverrideLib.c
 
b/OvmfPkg/Library/UefiDriverEntryPointFwCfgOverrideLib/UefiDriverEntryPointFwCfgOverrideLib.c
new file mode 100644
index ..6eaf0cfd16ad
--- /dev/null
+++ 
b/OvmfPkg/Library/UefiDriverEntryPointFwCfgOverrideLib/UefiDriverEntryPointFwCfgOverrideLib.c
@@ -0,0 +1,147 @@
+/** @file
+  Entry point to a EFI/DXE driver. This version is specific to QEMU, and ties
+  dispatch of the driver in question on the value of a QEMU fw_cfg boolean
+  variable which is referenced by name via a fixed pointer PCD.
+
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2022, Google LLC. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/**
+  Unloads an image from memory.
+
+  This function is a callback that a driver registers to do cleanup
+  when the UnloadImage boot service function is called.
+
+  @param  ImageHandle The handle to the image to unload.
+
+  @return Status returned by all unload().
+
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+_DriverUnloadHandler (
+  EFI_HANDLE  ImageHandle
+  )
+{
+  EFI_STATUS  Status;
+
+  //
+  // If an UnloadImage() handler is specified, then call it
+  //
+  Status = ProcessModuleUnloadList (ImageHandle);
+
+  //
+  // If the driver specific unload handler does not return an error, then call
+  // all of the library destructors.  If the unload handler returned an error,
+  // then the driver can not be unloaded, and the library destructors should
+  // not be called
+  //
+  if (!EFI_ERROR (Status)) {
+ProcessLibraryDestructorList (ImageHandle, gST);
+  }
+
+  //
+  // Return the status from the driver specific unload handler
+  //
+  return Status;
+}
+
+/**
+  The entry point of PE/COFF Image for a DXE Driver, DXE Runtime Driver, or
+  UEFI Driver.
+
+  @param  ImageHandleThe image handle of the DXE Driver, DXE
+ Runtime Driver, or UEFI Driver.
+  @param  SystemTableA pointer to the EFI System Table.
+
+  @retval  EFI_SUCCESS   The DXE Driver, DXE Runtime Driver, or
+ UEFI Driver exited normally.
+  @retval  EFI_INCOMPATIBLE_VERSION  _gUefiDriverRevision is greater than
+ SystemTable->Hdr.Revision.
+  @retval  Other Return value from
+ ProcessModuleEntryPointList().
+
+**/
+EFI_STATUS
+EFIAPI
+_ModuleEntryPoint (
+  IN EFI_HANDLEImageHandle,
+  IN EFI_SYSTEM_TABLE  *SystemTable
+  )
+{
+  EFI_STATUS Status;
+  EFI_LOADED_IMAGE_PROTOCOL  *LoadedImage;
+  RETURN_STATUS  RetStatus;
+  BOOLEANEnabled;
+
+  if (_gUefiDriverRevision != 0) {
+//
+// Make sure that the EFI/UEFI spec revision of the platform is >= EFI/UEFI
+// spec revision of the driver
+//
+if (SystemTable->Hdr.Revision < _gUefiDriverRevision) {
+  return EFI_INCOMPATIBLE_VERSION;
+}
+  }
+
+  //
+  // Call constructor for all libraries
+  //
+  ProcessLibraryConstructorList (ImageHandle, SystemTable);
+
+  //
+  //  Install unload handler...
+  //
+  if (_gDriverUnloadImageCount != 0) {
+Status = gBS->HandleProtocol (
+ImageHandle,
+,
+(VOID **)
+);
+ASSERT_EFI_ERROR (Status);
+LoadedImage->Unload = _DriverUnloadHandler;
+  }
+
+  RetStatus = QemuFwCfgParseBool (
+FixedPcdGetPtr (PcdEntryPointOverrideFwCfgVarName),
+);
+  if (!RETURN_ERROR (RetStatus) && !Enabled) {
+//
+// The QEMU fw_cfg variable tells us not to load this image.  So abort.
+//
+Status = EFI_ABORTED;
+  } else {
+//
+// Call the driver entry point
+//
+Status = ProcessModuleEntryPointList 

[edk2-devel] [PATCH v2 0/2] Ovmf: Allow IPv4 and IPv6 to be disabled at runtime

2022-08-17 Thread Ard Biesheuvel
Add some generic plumbing and wire it up for OvmfPkgX64 so that IPv4
and/or IPv6 networking can be turned off from the QEMU command line.

This is a follow-up to Yuan's patch '[PATCH v1 0/2] Add support to
disable VirtIo net at runtime' which only targeted the virtio network
driver specifically.i

Changes since v1:
- instead of a NULL class library that calls the Exit() boot service
  from its constructor, use a replacement for the UefiDriverEntryPoint
  library

Cc: Yuan Yu 
Cc: Laszlo Ersek 
Cc: Gerd Hoffmann 
Cc: Pawel Polawski 
Cc: Oliver Steffen 
Cc: Jiewen Yao 
Cc: Brian J. Johnson 

Ard Biesheuvel (2):
  OvmfPkg: Introduce alternate UefiDriverEntrypoint to inhibit driver
load
  OvmfPkg/OvmfPkgX64: Allow runtime control of IPv4 and IPv6 support

 
OvmfPkg/Library/UefiDriverEntryPointFwCfgOverrideLib/UefiDriverEntryPointFwCfgOverrideLib.c
   | 147 
 
OvmfPkg/Library/UefiDriverEntryPointFwCfgOverrideLib/UefiDriverEntryPointFwCfgOverrideLib.inf
 |  57 
 OvmfPkg/OvmfPkg.dec
   |   4 +
 OvmfPkg/OvmfPkgX64.dsc 
   |  14 ++
 4 files changed, 222 insertions(+)
 create mode 100644 
OvmfPkg/Library/UefiDriverEntryPointFwCfgOverrideLib/UefiDriverEntryPointFwCfgOverrideLib.c
 create mode 100644 
OvmfPkg/Library/UefiDriverEntryPointFwCfgOverrideLib/UefiDriverEntryPointFwCfgOverrideLib.inf

-- 
2.35.1



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




Re: [edk2-devel] [PATCH 3/3] RedfishPkg: The functions for Redfish requests do not fully complied with specification

2022-08-17 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Yes, I think we can remove 'Ex' because there is no RedfishPostToUri () in 
RedfishLib.c. Also, RedfishPostToUriEx() has the same parameters as 
postUriFromService() in service.c. Using RedfishPostToUriEx () makes more sense 
to me.
Thanks
Abner

> -Original Message-
> From: Igor Kulchytskyy 
> Sent: Wednesday, August 17, 2022 10:35 PM
> To: Chang, Abner ; devel@edk2.groups.io
> Cc: nickle.w...@hpe.com
> Subject: RE: [EXTERNAL] RE: [PATCH 3/3] RedfishPkg: The functions for
> Redfish requests do not fully complied with specification
> 
> [CAUTION: External Email]
> 
> Hi Abner,
> I just thought that since I'm adding new functions (extending API) I call 
> those
> functions with Ex suffix.
> But if you think it is better to have the name without Ex, I can change it and
> resubmit.
> Thank you,
> Igor
> 
> -Original Message-
> From: Chang, Abner 
> Sent: Wednesday, August 17, 2022 12:00 AM
> To: Igor Kulchytskyy ; devel@edk2.groups.io
> Cc: nickle.w...@hpe.com
> Subject: [EXTERNAL] RE: [PATCH 3/3] RedfishPkg: The functions for Redfish
> requests do not fully complied with specification
> 
> 
> **CAUTION: The e-mail below is from an external source. Please exercise
> caution before opening attachments, clicking links, or following guidance.**
> 
> [AMD Official Use Only - General]
> 
> Hi Igor,
> One question in line.
> 
> > -Original Message-
> > From: Igor Kulchytskyy 
> > Sent: Tuesday, August 16, 2022 9:25 AM
> > To: devel@edk2.groups.io
> > Cc: Chang, Abner ; nickle.w...@hpe.com; Igor
> > Kulchytskyy ; Chang, Abner 
> > Subject: [PATCH 3/3] RedfishPkg: The functions for Redfish requests do
> > not fully complied with specification
> >
> > [CAUTION: External Email]
> >
> > There is no function to send POST request with the Content type which
> > is different from "application/json".
> > There is no function to send DELETE request with the body.
> >
> > Cc: Abner Chang 
> > Cc: Nickle Wang 
> > Signed-off-by: Igor Kulchytskyy 
> > ---
> >  RedfishPkg/Include/Library/RedfishLib.h|  80 +
> >  RedfishPkg/PrivateLibrary/RedfishLib/RedfishLib.c  | 189
> > +
> >  .../edk2libredfish/include/redfishService.h|   8 +
> >  .../RedfishLib/edk2libredfish/src/service.c|  43 -
> >  4 files changed, 317 insertions(+), 3 deletions(-)
> >
> > diff --git a/RedfishPkg/Include/Library/RedfishLib.h
> > b/RedfishPkg/Include/Library/RedfishLib.h
> > index b2488ab..d4b3246 100644
> > --- a/RedfishPkg/Include/Library/RedfishLib.h
> > +++ b/RedfishPkg/Include/Library/RedfishLib.h
> > @@ -380,6 +380,49 @@ RedfishPatchToPayload (
> >OUTREDFISH_RESPONSE  *RedResponse
> >);
> >
> > +
> > +/**
> > +  Use HTTP POST to create new Redfish resource in the Resource
> Collection.
> > +
> > +  The POST request should be submitted to the Resource Collection in
> > + which the new resource  is to belong. The Resource Collection is
> > + addressed by URI. The Redfish may  ignore any service controlled
> > + properties. The corresponding redfish response will returned,
> > + including HTTP
> > StatusCode, Headers and Payload which record any HTTP response
> messages.
> > +
> > +  Callers are responsible for freeing the HTTP StatusCode, Headers
> > + and Payload returned in  redfish response data.
> > +
> > +  @param[in]RedfishServiceThe Service to access the Redfish
> resources.
> > +  @param[in]Uri   Relative path to address the 
> > resource.
> > +  @param[in]Content   JSON represented properties to be 
> > update.
> > +  @param[in]ContentSize   Size of the Content to be send to 
> > Redfish
> > service
> > +  @param[in]ContentType   Type of the Content to be send to
> Redfish
> > service
> > +  @param[out]   RedResponse   Pointer to the Redfish response data.
> > +
> > +  @retval EFI_SUCCESS The opeartion is successful, indicates 
> > the
> HTTP
> > StatusCode is not
> > +  NULL and the value is 2XX. The
> > + Redfish resource will be
> > returned
> > +  in Payload within RedResponse if
> > + server send it back in the
> > HTTP
> > +  response message body.
> > +  @retval EFI_INVALID_PARAMETER   RedfishService, Uri, Content, or
> > RedResponse is NULL.
> > +  @retval EFI_DEVICE_ERRORAn unexpected system or network error
> > occurred. Callers can get
> > +  more error info from returned HTTP
> > + StatusCode, Headers
> > and Payload
> > +  within RedResponse:
> > +  1. If the returned StatusCode is
> > + NULL, indicates any error
> > happen.
> > +  2. If the returned StatusCode is
> > + not NULL and the value is
> > not 2XX,
> > + indicates any error happen.
> > 

Re: [edk2-devel] [PATCH 1/2] OvmfPkg: Introduce NULL class library to inhibit driver load

2022-08-17 Thread Ard Biesheuvel
On Wed, 17 Aug 2022 at 11:22, Laszlo Ersek  wrote:
>
> On 08/17/22 10:39, Ard Biesheuvel wrote:
>
> > Agree with all of the above. At this point, I think the only way to do
> > this properly is to create an alternative UefiDriverEntrypoint library
> > with the fw_cfg check folded into it. This is easy to do and addresses
> > all the concerns raised here (as it can force the driver entry point
> > function to return any value at any point) but the code duplication is
> > unfortunate.
>
> Ah, that's very creative. I didn't think of duplicating and customizing
> the entry point library!
>

Yeah, I'll spin a v2 based on this idea.

> > On Tue, 16 Aug 2022 at 23:10, Brian J. Johnson 
> > wrote:
> >> I don't know how any physical machine handles that particular option.
> >> But one approach would be to add a GUID to the depex of the module
> >> you want to control, and install it only when you want the module to
> >> be dispatched.  That's pretty straightforward, although it does
> >> result in "Driver %g was discovered but not loaded!!" messages from
> >> CoreDisplayDiscoveredNotDispatched() if sufficient debugging is
> >> enabled.
> >>
> >
> > I think the diagnostic is fine. But I don't think adding DEPEXes to
> > UEFI drivers (as opposed to DXE drivers) is proper, or even supported.
> > It would also require the drivers in other packages to be updated.
>
> Sigh, I'm totally getting rusty on all this (which is quite expected).
> You are right about the difference between DXE and UEFI drivers wrt.
> depexes. :/
>
> > What i i like about the current approach is that the library can tie
> > any driver or app dispatch to any fw_cfg variable in QEMU (provided
> > that its build is directed by the .dsc in question). Switching to an
> > alternate UefiDriverEntrypoint implementation would limit this to
> > drivers, but this is fine for the purpose at hand.
>
> Just don't forget that the number of fw_cfg slots in QEMU is limited. It
> is exposed as an experimental property (x-file-slots) of the fw_cfg_io
> and fw_cfg_mem on-board devices. It matters for migration, and so it is
> versioned. It used to be 0x10,  for the 2.8 and earlier machine types,
> and has been 0x20 for later machine types. See QEMU commit a5b3ebfd23bc.
>
> IOW, while the mechanism in edk2 could scale "indefinitely", QEMU will
> in effect limit the number of fw_cfg files that can be used for this
> purpose too.
>

Right, that is good to know. But I don't think the point here is to
make each individual driver controllable from the command line. The
goal here is really to make this work in a way that is generic (i.e.,
not specific to networking) that doesn't require changes to the other
packages.


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




Re: [edk2-devel] [PATCH 3/3] RedfishPkg: The functions for Redfish requests do not fully complied with specification

2022-08-17 Thread Igor Kulchytskyy via groups.io
Hi Abner,
I just thought that since I'm adding new functions (extending API) I call those 
functions with Ex suffix.
But if you think it is better to have the name without Ex, I can change it and 
resubmit.
Thank you,
Igor

-Original Message-
From: Chang, Abner 
Sent: Wednesday, August 17, 2022 12:00 AM
To: Igor Kulchytskyy ; devel@edk2.groups.io
Cc: nickle.w...@hpe.com
Subject: [EXTERNAL] RE: [PATCH 3/3] RedfishPkg: The functions for Redfish 
requests do not fully complied with specification


**CAUTION: The e-mail below is from an external source. Please exercise caution 
before opening attachments, clicking links, or following guidance.**

[AMD Official Use Only - General]

Hi Igor,
One question in line.

> -Original Message-
> From: Igor Kulchytskyy 
> Sent: Tuesday, August 16, 2022 9:25 AM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; nickle.w...@hpe.com; Igor
> Kulchytskyy ; Chang, Abner 
> Subject: [PATCH 3/3] RedfishPkg: The functions for Redfish requests do
> not fully complied with specification
>
> [CAUTION: External Email]
>
> There is no function to send POST request with the Content type which
> is different from "application/json".
> There is no function to send DELETE request with the body.
>
> Cc: Abner Chang 
> Cc: Nickle Wang 
> Signed-off-by: Igor Kulchytskyy 
> ---
>  RedfishPkg/Include/Library/RedfishLib.h|  80 +
>  RedfishPkg/PrivateLibrary/RedfishLib/RedfishLib.c  | 189
> +
>  .../edk2libredfish/include/redfishService.h|   8 +
>  .../RedfishLib/edk2libredfish/src/service.c|  43 -
>  4 files changed, 317 insertions(+), 3 deletions(-)
>
> diff --git a/RedfishPkg/Include/Library/RedfishLib.h
> b/RedfishPkg/Include/Library/RedfishLib.h
> index b2488ab..d4b3246 100644
> --- a/RedfishPkg/Include/Library/RedfishLib.h
> +++ b/RedfishPkg/Include/Library/RedfishLib.h
> @@ -380,6 +380,49 @@ RedfishPatchToPayload (
>OUTREDFISH_RESPONSE  *RedResponse
>);
>
> +
> +/**
> +  Use HTTP POST to create new Redfish resource in the Resource Collection.
> +
> +  The POST request should be submitted to the Resource Collection in
> + which the new resource  is to belong. The Resource Collection is
> + addressed by URI. The Redfish may  ignore any service controlled
> + properties. The corresponding redfish response will returned,
> + including HTTP
> StatusCode, Headers and Payload which record any HTTP response messages.
> +
> +  Callers are responsible for freeing the HTTP StatusCode, Headers
> + and Payload returned in  redfish response data.
> +
> +  @param[in]RedfishServiceThe Service to access the Redfish 
> resources.
> +  @param[in]Uri   Relative path to address the resource.
> +  @param[in]Content   JSON represented properties to be 
> update.
> +  @param[in]ContentSize   Size of the Content to be send to 
> Redfish
> service
> +  @param[in]ContentType   Type of the Content to be send to 
> Redfish
> service
> +  @param[out]   RedResponse   Pointer to the Redfish response data.
> +
> +  @retval EFI_SUCCESS The opeartion is successful, indicates the 
> HTTP
> StatusCode is not
> +  NULL and the value is 2XX. The
> + Redfish resource will be
> returned
> +  in Payload within RedResponse if
> + server send it back in the
> HTTP
> +  response message body.
> +  @retval EFI_INVALID_PARAMETER   RedfishService, Uri, Content, or
> RedResponse is NULL.
> +  @retval EFI_DEVICE_ERRORAn unexpected system or network error
> occurred. Callers can get
> +  more error info from returned HTTP
> + StatusCode, Headers
> and Payload
> +  within RedResponse:
> +  1. If the returned StatusCode is
> + NULL, indicates any error
> happen.
> +  2. If the returned StatusCode is
> + not NULL and the value is
> not 2XX,
> + indicates any error happen.
> +**/
> +EFI_STATUS
> +EFIAPI
> +RedfishPostToUriEx (
Why not just name this function RedfishPostToUri without "Ex". There is no 
PostToUri function currently provided by RedfishLib.c yet.
I also see some trailing spaces in this source file by the way.
Abner

> +  IN REDFISH_SERVICE   RedfishService,
> +  IN CONST CHAR8   *Uri,
> +  IN CONST CHAR8   *Content,
> +  IN UINTN ContentSize,
> +  IN CONST CHAR8   *ContentType,
> +  OUTREDFISH_RESPONSE  *RedResponse
> +  );
> +
> +
>  /**
>Use HTTP POST to create a new resource in target payload.
>
> @@ -451,6 +494,43 @@ RedfishDeleteByUri (
>);
>
>  /**
> +  Use HTTP DELETE to remove a resource.
> +
> +  This function uses the RedfishService to remove a Redfish resource
> + which is addressed  by input Uri (only the relative path is 

[edk2-devel] [PATCH v1 1/1] OvmfPkg/VirtioNetDxe: Check ChildHandle argument in GetControllerName

2022-08-17 Thread Dimitrije Pavlov
Per the UEFI specification, a device driver implementation should return
EFI_UNSUPPORTED if the ChildHandle argument in
EFI_COMPONENT_NAME2_PROTOCOL.GetControllerName() is not NULL.

Cc: Ard Biesheuvel 
Cc: Jiewen Yao 
Cc: Liming Gao 
Cc: Sunny Wang 
Cc: Jeff Booher-Kaeding 
Cc: Samer El-Haj-Mahmoud 

Signed-off-by: Dimitrije Pavlov 
---
 OvmfPkg/VirtioNetDxe/ComponentName.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/OvmfPkg/VirtioNetDxe/ComponentName.c 
b/OvmfPkg/VirtioNetDxe/ComponentName.c
index e340ca2f8fe4..718096630f6f 100644
--- a/OvmfPkg/VirtioNetDxe/ComponentName.c
+++ b/OvmfPkg/VirtioNetDxe/ComponentName.c
@@ -129,6 +129,13 @@ VirtioNetGetControllerName (
 return EFI_INVALID_PARAMETER;
   }
 
+  //
+  // This is a device driver, so ChildHandle must be NULL.
+  //
+  if (ChildHandle != NULL) {
+return EFI_UNSUPPORTED;
+  }
+
   //
   // confirm that the device is managed by this driver, using the VirtIo
   // Protocol
-- 
2.37.2



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




Re: [edk2-devel] [PATCH v4 6/6] DynamicTablesPkg: AcpiSsdtPcieLibArm: Added case handling for PCI config

2022-08-17 Thread Sami Mujawar

Hi Kun,

I plan to get this series merged when the merge window opens.

If you agree, I will drop this patch before merging. Please let me know 
if that is ok.


Regards,

Sami Mujawar

On 17/08/2022 09:53 am, Pierre Gondois wrote:



On 8/17/22 02:17, Kun Qin wrote:

Hi Pierre,

You are correct that if CM_ARM_PCI_ADDRESS_MAP_INFO.PCI_SS_CONFIG
is no longer being used, this patch is not needed. Thanks for 
catching this.


On the other hand, just for my learning purpose, could you please let 
me know
what the use case for "PCI_SS_CONFIG" is? It does not seem to be used 
at all.


I haven't seen any usecase neither so far, but it is to be used to 
reference a

PCI bus/device/function/register location to identify/configure a device
from what I understood.



Thanks again for testing these patches!

Regards,
Kun

On 8/16/2022 8:33 AM, Pierre Gondois wrote:

Hello Kun,

Is this patch still required ?
Cf: https://edk2.groups.io/g/devel/message/92204

The CM_ARM_PCI_CONFIG_SPACE_INFO struct should be enough to describe
the PCI ECAM, so CM_ARM_PCI_ADDRESS_MAP_INFO.SpaceCode being set to
PCI_SS_CONFIG should be an invalid case.
If not I don't think a v5 should be necessary.

Also I ran the patchset on KvmTool and everything was working.

Regards,
Pierre

On 8/11/22 00:28, Kun Qin wrote:

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3998

This change added a switch case handling for PCI_SS_CONFIG during SSDT
generation. This will allow PCI config case return EFI_SUCCESS 
instead of

EFI_INVALID_PARAMETER.

Cc: Sami Mujawar 
Cc: Alexei Fedorov 

Co-authored-by: Joe Lopez 
Signed-off-by: Kun Qin 
Reviewed-by: Pierre Gondois 
Reviewed-by: Sami Mujawar 
---

Notes:
 v2:
 - Added Reviewed-by tag [Pierre]
  v3:
 - No change
  v4:
 - Added Reviewed-by tag [Sami]

DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c 
| 5 +

  1 file changed, 5 insertions(+)

diff --git 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c 


index dd75fc27e60e..c6fbd09c43f8 100644
--- 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
+++ 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c

@@ -606,6 +606,11 @@ GeneratePciCrs (
 );
  break;
  +  case PCI_SS_CONFIG:
+    // Do nothing
+    Status = EFI_SUCCESS;
+    break;
+
    default:
  Status = EFI_INVALID_PARAMETER;
  } // switch



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




Re: [edk2-devel] [PATCH v4 5/6] DynamicTablesPkg: AcpiSsdtPcieLibArm: Added function to reserve ECAM space

2022-08-17 Thread Sami Mujawar

Hi Kun,

Thank you for the updated patch.

These changes look good to me.

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar

On 10/08/2022 11:28 pm, Kun Qin via groups.io wrote:

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3998

Certain OSes will complain if the ECAM config space is not reserved in
the ACPI namespace.

This change adds a function to reserve PNP motherboard resources for a
given PCI node.

Co-authored-by: Joe Lopez 
Signed-off-by: Kun Qin 
---

Notes:
 v2:
 - Only create RES0 after config space checking [Pierre]
 
 v3:

 - Updated function names and descriptions [Pierre]
 - Moved translation calculation to CONFIG case [Pierre]
 
 v4:

 - Used CM_ARM_PCI_CONFIG_SPACE_INFO for ECAM region calculation [Sami, 
Pierre]

  DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c | 
135 
  1 file changed, 135 insertions(+)

diff --git 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
index ceffe2838c03..dd75fc27e60e 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
@@ -34,6 +34,9 @@
  


  #include "SsdtPcieGenerator.h"

  


+#define PCI_MAX_DEVICE_COUNT_PER_BUS   32

+#define PCI_MAX_FUNCTION_COUNT_PER_DEVICE  8

+

  /** ARM standard SSDT Pcie Table Generator.

  


  Requirements:

@@ -616,6 +619,130 @@ GeneratePciCrs (
return Status;

  }

  


+/** Generate a RES0 device node to reserve PNP motherboard resources

+  for a given PCI node.

+

+  @param [in]   PciNode   Parent PCI node handle of the generated

+  resource object.

+  @param [out]  CrsNode   CRS node of the AML tree to populate.

+

+  @retval EFI_SUCCESS The function completed successfully.

+  @retval EFI_INVALID_PARAMETER   Invalid input parameter.

+  @retval EFI_OUT_OF_RESOURCESCould not allocate memory.

+**/

+STATIC

+EFI_STATUS

+EFIAPI

+GenerateMotherboardDevice (

+  IN  AML_OBJECT_NODE_HANDLE  PciNode,

+  OUT AML_OBJECT_NODE_HANDLE  *CrsNode

+  )

+{

+  EFI_STATUS  Status;

+  UINT32  EisaId;

+  AML_OBJECT_NODE_HANDLE  ResNode;

+

+  if (CrsNode == NULL) {

+ASSERT (0);

+return EFI_INVALID_PARAMETER;

+  }

+

+  // ASL: Device (RES0) {}

+  Status = AmlCodeGenDevice ("RES0", PciNode, );

+  if (EFI_ERROR (Status)) {

+ASSERT (0);

+return Status;

+  }

+

+  // ASL: Name (_HID, EISAID ("PNP0C02"))

+  Status = AmlGetEisaIdFromString ("PNP0C02", ); /* PNP Motherboard 
Resources */

+  if (EFI_ERROR (Status)) {

+ASSERT (0);

+return Status;

+  }

+

+  Status = AmlCodeGenNameInteger ("_HID", EisaId, ResNode, NULL);

+  if (EFI_ERROR (Status)) {

+ASSERT (0);

+return Status;

+  }

+

+  // ASL: Name (_CRS, ResourceTemplate () {})

+  Status = AmlCodeGenNameResourceTemplate ("_CRS", ResNode, CrsNode);

+  if (EFI_ERROR (Status)) {

+ASSERT (0);

+return Status;

+  }

+

+  return Status;

+}

+

+/** Reserves ECAM space for PCI config space

+

+  @param [in]   Generator   The SSDT Pci generator.

+  @param [in]   CfgMgrProtocol  Pointer to the Configuration Manager

+Protocol interface.

+  @param [in]   PciInfo Pci device information.

+  @param [in, out]  PciNode RootNode of the AML tree to populate.

+

+  @retval EFI_SUCCESS The function completed successfully.

+  @retval EFI_INVALID_PARAMETER   Invalid parameter.

+  @retval EFI_OUT_OF_RESOURCESCould not allocate memory.

+**/

+STATIC

+EFI_STATUS

+EFIAPI

+ReserveEcamSpace (

+  INACPI_PCI_GENERATOR*Generator,

+  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,

+  IN  CONST CM_ARM_PCI_CONFIG_SPACE_INFO  *PciInfo,

+  IN  OUT   AML_OBJECT_NODE_HANDLEPciNode

+  )

+{

+  EFI_STATUS  Status;

+  AML_OBJECT_NODE_HANDLE  CrsNode;

+  UINT64  AddressMinimum;

+  UINT64  AddressMaximum;

+

+  Status = GenerateMotherboardDevice (PciNode, );

+  if (EFI_ERROR (Status)) {

+ASSERT (0);

+return Status;

+  }

+

+  AddressMinimum = PciInfo->BaseAddress + (PciInfo->StartBusNumber *

+   PCI_MAX_DEVICE_COUNT_PER_BUS * 
PCI_MAX_FUNCTION_COUNT_PER_DEVICE * SIZE_4KB);

+  AddressMaximum = PciInfo->BaseAddress + ((PciInfo->EndBusNumber + 1) *

+   PCI_MAX_DEVICE_COUNT_PER_BUS * 
PCI_MAX_FUNCTION_COUNT_PER_DEVICE * SIZE_4KB) - 1;

+

+  Status = AmlCodeGenRdQWordMemory (

+ FALSE,

+ TRUE,

+ TRUE,

+ TRUE,

+ FALSE,  // non-cacheable

+ TRUE,

[edk2-devel] CcProbeLib not working for runtime calls

2022-08-17 Thread Gerd Hoffmann
  Hi,

https://bugzilla.redhat.com/show_bug.cgi?id=2114858

I think the call chain is:

-> linux does efi runtime call
  -> some debug message printed
-> OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c
  -> MdePkg/Library/BaseIoLibIntrinsic (IoWriteFifo8)
-> OvmfPkg/Library/CcProbeLib (CcProbe)
  -> page fault when trying to access WorkArea

Hmm.

We could probably reserve the workarea page and register it for a
runtime mapping etc.  I suspect that'll only crash the in simliar ways a
little later because the tdx/sev code is not prepared to work on runtime
calls.  I'm also not sure this is possible to make work at all given
that #vc/#ve faults are handled by the linux kernel not ovmf at this
point.

So have CcProbe just return CcGuestTypeNonEncrypted when called at
runtime, hoping that the linux kernel handles #vc / #ve faults properly
should they occur?

take care,
  Gerd



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




Re: [edk2-devel] [PATCH 2/2] Platform/Sgi: Add serial debug controller to SSDT

2022-08-17 Thread Rohit Mathew
Thanks Sami.

Regards,
Rohit

From: Sami Mujawar 
Sent: 17 August 2022 10:46
To: Rohit Mathew ; devel@edk2.groups.io
Subject: Re: [edk2-devel] [PATCH 2/2] Platform/Sgi: Add serial debug controller 
to SSDT

Hi Rohit,

Apologies for the delay. I will pick this up once the merge window opens.

Reviewed-by: Sami Mujawar mailto:sami.muja...@arm.com>>

Regards,

Sami Mujawar


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




Re: [edk2-devel] [PATCH v2] DynamicTablesPkg: Add support to build _DSD

2022-08-17 Thread PierreGondois

Hello Jeff,
Thanks for the v2. I only have small NITs.
With the above:
Reviewed-by: Pierre Gondois 

On 8/16/22 20:37, Jeff Brasen wrote:

Add APIs needed to build _DSD with different UUIDs.
This is per ACPI specification 6.4 s6.2.5.

Adds support for building data packages with format
Package {"Name", Integer}

Signed-off-by: Jeff Brasen 
---
  .../Include/Library/AmlLib/AmlLib.h   |  55 
  .../Common/AmlLib/CodeGen/AmlCodeGen.c| 249 ++
  2 files changed, 304 insertions(+)

diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h 
b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
index 6f214c0dfa..86a0e802f4 100644
--- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
+++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
@@ -1280,6 +1280,61 @@ AmlAddLpiState (
IN  AML_OBJECT_NODE_HANDLE  LpiNode
);
  
+/** AML code generation for a _DSD device data object.

+
+  AmlAddDeviceDataDescriptorPackage (Uuid, DsdNode, PackageNode) is
+  equivalent of the following ASL code:
+ToUUID(Uuid),
+Package () {}
+
+  Cf ACPI 6.4 specification, s6.2.5 "_DSD (Device Specific Data)".


Would it be possible to add a reference to:
  _DSD (Device Specific Data) Implementation Guide


+
+  @ingroup CodeGenApis
+
+  @param [in]  Uuid   The Uuid of the descriptor to be created
+  @param [in]  DsdNodeNode of the DSD Package.
+  @param [out] PackageNodeIf success, contains the created package node.
+
+  @retval EFI_SUCCESS Success.
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.
+  @retval EFI_OUT_OF_RESOURCESFailed to allocate memory.
+**/
+EFI_STATUS
+EFIAPI
+AmlAddDeviceDataDescriptorPackage (
+  IN  CONST EFI_GUID*Uuid,
+  INAML_OBJECT_NODE_HANDLE  DsdNode,
+  OUT   AML_OBJECT_NODE_HANDLE  *PackageNode
+  );
+
+/** AML code generation to add a package with a name and value,
+to a parent package.
+This is useful for build the _DSD package but can be used in other cases.
+
+  AmlAddNameValuePackage ("Name", Value, ParentNode) is


Just a typo:
s/ParentNode/PackageNode
(same for the function definition)

Also, would it be possible to add a reference to:
  _DSD (Device Specific Data) Implementation Guide
  s3. 'Well-Known _DSD UUIDs and Data Structure Formats'
and explicitly state that, if uesed to generate a _DSD object,
this function should be used with the following UUID:
  daffd814-6eba-4d8c-8a91-bc9bbf4aa301
to avoid people using a wrong uuid when advertising integer values ?


+  equivalent of the following ASL code:
+Package (2) {"Name", Value}
+
+  Cf ACPI 6.4 specification, s6.2.5 "_DSD (Device Specific Data)".
+
+  @ingroup CodeGenApis
+
+  @param [in]  Name   String to place in first entry of package
+  @param [in]  Value  Integer to place in second entry of package
+  @param [in]  PackageNodePackage to add new sub package to.
+
+  @retval EFI_SUCCESS Success.
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.
+  @retval EFI_OUT_OF_RESOURCESFailed to allocate memory.
+**/
+EFI_STATUS
+EFIAPI
+AmlAddNameIntegerPackage (
+  IN CHAR8   *Name,
+  IN UINT64  Value,
+  IN AML_OBJECT_NODE_HANDLE  PackageNode
+  );
+
  // DEPRECATED APIS
  #ifndef DISABLE_NEW_DEPRECATED_INTERFACES
  



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




Re: [edk2-devel] [PATCH 2/2] Platform/Sgi: Add serial debug controller to SSDT

2022-08-17 Thread Sami Mujawar
Hi Rohit,

Apologies for the delay. I will pick this up once the merge window opens.

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar


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




Re: [edk2-devel] [PATCH 1/2] OvmfPkg: Introduce NULL class library to inhibit driver load

2022-08-17 Thread Laszlo Ersek
On 08/17/22 10:39, Ard Biesheuvel wrote:

> Agree with all of the above. At this point, I think the only way to do
> this properly is to create an alternative UefiDriverEntrypoint library
> with the fw_cfg check folded into it. This is easy to do and addresses
> all the concerns raised here (as it can force the driver entry point
> function to return any value at any point) but the code duplication is
> unfortunate.

Ah, that's very creative. I didn't think of duplicating and customizing
the entry point library!

> On Tue, 16 Aug 2022 at 23:10, Brian J. Johnson 
> wrote:
>> I don't know how any physical machine handles that particular option.
>> But one approach would be to add a GUID to the depex of the module
>> you want to control, and install it only when you want the module to
>> be dispatched.  That's pretty straightforward, although it does
>> result in "Driver %g was discovered but not loaded!!" messages from
>> CoreDisplayDiscoveredNotDispatched() if sufficient debugging is
>> enabled.
>>
> 
> I think the diagnostic is fine. But I don't think adding DEPEXes to
> UEFI drivers (as opposed to DXE drivers) is proper, or even supported.
> It would also require the drivers in other packages to be updated.

Sigh, I'm totally getting rusty on all this (which is quite expected).
You are right about the difference between DXE and UEFI drivers wrt.
depexes. :/

> What i i like about the current approach is that the library can tie
> any driver or app dispatch to any fw_cfg variable in QEMU (provided
> that its build is directed by the .dsc in question). Switching to an
> alternate UefiDriverEntrypoint implementation would limit this to
> drivers, but this is fine for the purpose at hand.

Just don't forget that the number of fw_cfg slots in QEMU is limited. It
is exposed as an experimental property (x-file-slots) of the fw_cfg_io
and fw_cfg_mem on-board devices. It matters for migration, and so it is
versioned. It used to be 0x10,  for the 2.8 and earlier machine types,
and has been 0x20 for later machine types. See QEMU commit a5b3ebfd23bc.

IOW, while the mechanism in edk2 could scale "indefinitely", QEMU will
in effect limit the number of fw_cfg files that can be used for this
purpose too.



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




Re: [edk2-devel] [PATCH 2/2] Platform/Sgi: Add serial debug controller to SSDT

2022-08-17 Thread Rohit Mathew
Gentle reminder for this patch series.

Regards,
Rohit

From: Rohit Mathew
Sent: 02 August 2022 14:51
To: devel@edk2.groups.io; Sami Mujawar 
Cc: Thanu Rangarajan ; Thomas Abraham 
; nd 
Subject: RE: [edk2-devel] [PATCH 2/2] Platform/Sgi: Add serial debug controller 
to SSDT

Hi Sami,

Gentle reminder for this patch series.

Regards,
Rohit.

From: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>> On Behalf Of Rohit Mathew 
via groups.io
Sent: 25 July 2022 15:56
To: Thanu Rangarajan 
mailto:thanu.rangara...@arm.com>>; 
devel@edk2.groups.io
Subject: Re: [edk2-devel] [PATCH 2/2] Platform/Sgi: Add serial debug controller 
to SSDT


Hi Sami/Thanu,

Please find my response inline -

On Mon, Jul 25, 2022 at 02:54 PM, Thanu Rangarajan 
mailto:thanu.rangara...@arm.com>> wrote:

Hi Rohit,

The decision to use the SBSA defined HID for the Generic UART was taken after 
extensive discussions within the Arm ecosystem. And as Sami points out, now 
that formal Linux driver support for this HID is available, it would be good if 
it is used by other components in the stack as well.



+ Samer for any additional comments/clarifications.



Regards,

Thanu

From: Sami Mujawar mailto:sami.muja...@arm.com>>
Date: Monday, 25 July 2022 at 16:12
To: Rohit Mathew mailto:rohit.mat...@arm.com>>, 
"devel@edk2.groups.io" 
mailto:devel@edk2.groups.io>>
Cc: Thanu Rangarajan 
mailto:thanu.rangara...@arm.com>>, nd 
mailto:n...@arm.com>>
Subject: Re: [edk2-devel] [PATCH 2/2] Platform/Sgi: Add serial debug controller 
to SSDT



Hi Rohit,

Please find my response inline marked [SAMI].

Regards,

Sami Mujawar

On 22/07/2022 01:46 pm, Rohit Mathew wrote:

Hi Sami,

Thank you for the review.
Regarding the use of Dynamic Tables Framework, there are no short term plans to 
migrate to it. Please find my response for your comment inline -

On Thu, Jul 21, 2022 at 01:42 PM, Sami Mujawar wrote:

Hi Rohit,

Have you considered moving to use Dynamic Tables Framework? There is
just too much repetition in this series which can be easily avoided. It
will also make the code more maintainable.

Apart from this I have a comment marked inline as [SAMI].

Regards,

Sami Mujawar

On 04/07/2022 05:59 pm, Rohit Mathew wrote:

Add a new device entry in the SSDT ACPI table to describe the serial
port used as the debug port. On the Neoverse reference design platforms,
the UART0 port of the SoC is used as the debug port.

Signed-off-by: Rohit Mathew 
---
Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf | 1 +
Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf | 1 +
Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf | 1 +
Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf | 1 +
Platform/ARM/SgiPkg/AcpiTables/RdN2Cfg1AcpiTables.inf | 1 +
Platform/ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf | 1 +
Platform/ARM/SgiPkg/AcpiTables/RdV1McAcpiTables.inf | 1 +
Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf | 1 +
Platform/ARM/SgiPkg/AcpiTables/SsdtRos.asl | 15 +++
9 files changed, 23 insertions(+)

diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf 
b/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf
index d2935f1e73e1..d46ae0274d90 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf
@@ -39,6 +39,7 @@ [Packages]
[FixedPcd]
gArmPlatformTokenSpaceGuid.PcdCoreCount
gArmPlatformTokenSpaceGuid.PcdClusterCount
+ gArmPlatformTokenSpaceGuid.PcdSerialDbgInterrupt
gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
gArmPlatformTokenSpaceGuid.PL011UartInterrupt

diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf 
b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf
index 73f47ece7718..4bf681d3bc2e 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf
@@ -39,6 +39,7 @@ [Packages]
[FixedPcd]
gArmPlatformTokenSpaceGuid.PcdCoreCount
gArmPlatformTokenSpaceGuid.PcdClusterCount
+ gArmPlatformTokenSpaceGuid.PcdSerialDbgInterrupt
gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
gArmPlatformTokenSpaceGuid.PL011UartInterrupt

diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf 
b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
index da14120bde69..89f532217ceb 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
@@ -41,6 +41,7 @@ [Packages]
[FixedPcd]
gArmPlatformTokenSpaceGuid.PcdCoreCount
gArmPlatformTokenSpaceGuid.PcdClusterCount
+ gArmPlatformTokenSpaceGuid.PcdSerialDbgInterrupt
gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
gArmPlatformTokenSpaceGuid.PL011UartInterrupt

diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf 
b/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf
index 90976250445e..66d5422df36b 100644
--- 

Re: [edk2-devel] 回复: [edk2-devel] [PATCH] MdePkg:Improved Smbios Type9 table and Smbios 3.5.0 spec changes

2022-08-17 Thread Sainadh Nagolu via groups.io
Also attaching the patch files here for reference.


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




Edk2PatchFiles.rar
Description: Binary data


Re: [edk2-devel] 回复: [edk2-devel] [PATCH] MdePkg:Improved Smbios Type9 table and Smbios 3.5.0 spec changes

2022-08-17 Thread Sainadh Nagolu via groups.io
Hi Liming,

Created edk2 Pull Request with Patches, Please help to check.
https://github.com/tianocore/edk2/pull/3214

Thanks,
Sainadh.


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




Re: [edk2-devel] [PATCH 1/2] OvmfPkg: Introduce NULL class library to inhibit driver load

2022-08-17 Thread Laszlo Ersek
On 08/16/22 23:08, Brian J. Johnson wrote:
> On 8/16/22 07:30, Laszlo Ersek wrote:

>> On physical machines, I've seen firmware options for disabling the IP
>> stack entirely; I wonder how those firmwares do it...
> 
> I don't know how any physical machine handles that particular option.
> But one approach would be to add a GUID to the depex of the module you
> want to control, and install it only when you want the module to be
> dispatched.  That's pretty straightforward, although it does result in
> "Driver %g was discovered but not loaded!!" messages from
> CoreDisplayDiscoveredNotDispatched() if sufficient debugging is enabled.

Indeed, thanks for the reminder! ArmVirtPkg and OvmfPkg uses this
pattern with several core drivers:

PlatformHasIoMmuLib:
- depex:   gEdkiiIoMmuProtocolGuid OR gIoMmuAbsentProtocolGuid
- hooked into: PciHostBridgeDxe

PlatformHasAcpiLib:
- depex:   gEdkiiPlatformHasAcpiGuid
- hooked into: AcpiTableDxe

NvVarStoreFormattedLib:
- depex:   gEdkiiNvVarStoreFormattedGuid
- hooked into: VariableRuntimeDxe

>From these, the first and third examples are not full matches, as the
depexes injected via PlatformHasIoMmuLib and NvVarStoreFormattedLib are
always supposed to be satisfied *eventually* -- the drivers that the
dependencies are injected into are always required; the dependencies
ensure some platform specific ordering requirements.

But PlatformHasAcpiLib seems like a 100% match; it *is* meant to block
AcpiTableDxe indefinitely, if the platform chooses so (dynamically).

Thanks!
Laszlo



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




Re: [edk2-devel] [PATCH v4 6/6] DynamicTablesPkg: AcpiSsdtPcieLibArm: Added case handling for PCI config

2022-08-17 Thread PierreGondois




On 8/17/22 02:17, Kun Qin wrote:

Hi Pierre,

You are correct that if CM_ARM_PCI_ADDRESS_MAP_INFO.PCI_SS_CONFIG
is no longer being used, this patch is not needed. Thanks for catching this.

On the other hand, just for my learning purpose, could you please let me know
what the use case for "PCI_SS_CONFIG" is? It does not seem to be used at all.


I haven't seen any usecase neither so far, but it is to be used to reference a
PCI bus/device/function/register location to identify/configure a device
from what I understood.



Thanks again for testing these patches!

Regards,
Kun

On 8/16/2022 8:33 AM, Pierre Gondois wrote:

Hello Kun,

Is this patch still required ?
Cf: https://edk2.groups.io/g/devel/message/92204

The CM_ARM_PCI_CONFIG_SPACE_INFO struct should be enough to describe
the PCI ECAM, so CM_ARM_PCI_ADDRESS_MAP_INFO.SpaceCode being set to
PCI_SS_CONFIG should be an invalid case.
If not I don't think a v5 should be necessary.

Also I ran the patchset on KvmTool and everything was working.

Regards,
Pierre

On 8/11/22 00:28, Kun Qin wrote:

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3998

This change added a switch case handling for PCI_SS_CONFIG during SSDT
generation. This will allow PCI config case return EFI_SUCCESS instead of
EFI_INVALID_PARAMETER.

Cc: Sami Mujawar 
Cc: Alexei Fedorov 

Co-authored-by: Joe Lopez 
Signed-off-by: Kun Qin 
Reviewed-by: Pierre Gondois 
Reviewed-by: Sami Mujawar 
---

Notes:
 v2:
 - Added Reviewed-by tag [Pierre]
  v3:
 - No change
  v4:
 - Added Reviewed-by tag [Sami]

DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c | 5 
+
  1 file changed, 5 insertions(+)

diff --git 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
index dd75fc27e60e..c6fbd09c43f8 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
@@ -606,6 +606,11 @@ GeneratePciCrs (
 );
  break;
  +  case PCI_SS_CONFIG:
+    // Do nothing
+    Status = EFI_SUCCESS;
+    break;
+
    default:
  Status = EFI_INVALID_PARAMETER;
  } // switch



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




Re: [edk2-devel] [PATCH 1/2] OvmfPkg: Introduce NULL class library to inhibit driver load

2022-08-17 Thread Ard Biesheuvel
On Tue, 16 Aug 2022 at 23:10, Brian J. Johnson  wrote:
>
> On 8/16/22 07:30, Laszlo Ersek wrote:
> > On 08/15/22 11:40, Ard Biesheuvel wrote:
> >> Add a new library that can be incorporated into any driver built from
> >> source, and which permits loading of the driver to be inhibited based on
> >> the value of a QEMU fw_cfg boolean variable. This will be used in a
> >> subsequent patch to allow dispatch of the IPv6 and IPv6 network protocol
> >
> > (1) typo? (should be "IPv4 and IPv6" I think)
> >
> >> driver to be controlled from the QEMU command line.
> >>
> >> Signed-off-by: Ard Biesheuvel 
> >> ---
> >>   OvmfPkg/Library/DriverLoadInhibitorLib/DriverLoadInhibitorLib.c   | 30 
> >> 
> >>   OvmfPkg/Library/DriverLoadInhibitorLib/DriverLoadInhibitorLib.inf | 28 
> >> ++
> >>   OvmfPkg/OvmfPkg.dec   |  4 
> >> +++
> >>   3 files changed, 62 insertions(+)
> >>
> >> diff --git 
> >> a/OvmfPkg/Library/DriverLoadInhibitorLib/DriverLoadInhibitorLib.c 
> >> b/OvmfPkg/Library/DriverLoadInhibitorLib/DriverLoadInhibitorLib.c
> >> new file mode 100644
> >> index ..dc8544bc38be
> >> --- /dev/null
> >> +++ b/OvmfPkg/Library/DriverLoadInhibitorLib/DriverLoadInhibitorLib.c
> >> @@ -0,0 +1,30 @@
> >> +// @file
> >> +// Copyright (c) 2022, Google LLC. All rights reserved.
> >> +// SPDX-License-Identifier: BSD-2-Clause-Patent
> >> +//
> >> +
> >> +#include 
> >> +
> >> +#include 
> >> +#include 
> >> +
> >> +STATIC CHAR16 mExitData[] = L"Driver dispatch inhibited by QEMU fw_cfg 
> >> variable.";
> >> +
> >> +EFI_STATUS
> >> +EFIAPI
> >> +DriverLoadInhibitorLibConstructor (
> >> +  IN  EFI_HANDLEHandle,
> >> +  IN  EFI_SYSTEM_TABLE  *SystemTable
> >> +  )
> >> +{
> >> +  RETURN_STATUS Status;
> >> +  BOOLEAN   Enabled;
> >> +
> >> +  Status = QemuFwCfgParseBool (FixedPcdGetPtr 
> >> (PcdDriverInhibitorFwCfgVarName),
> >> + );
> >> +  if (!RETURN_ERROR (Status) && !Enabled) {
> >> +return gBS->Exit (Handle, EFI_REQUEST_UNLOAD_IMAGE, sizeof mExitData,
> >> +  mExitData);
> >
> > (2) Per UEFI spec, ExitData should be allocated with
> > gBS->AllocatePool().
> >
> > (3) EFI_REQUEST_UNLOAD_IMAGE is from the PI spec; while not wrong, I
> > think it's strange to use here. EFI_ABORTED or something similar from
> > the UEFI spec would be a better fit IMO.
> >
> > (4) And then, the big problem:
> >
> > I agree that returning an error from the constructor would not be
> > beneficial, as it would cause an assertion to fail in the
> > ProcessLibraryConstructorList() function, in the generated "AutoGen.c"
> > file.
> >
> > However, calling gBS->Exit() from a constructor seems unsafe to me, with
> > regard to library destructors.
> >
> > Now, in the current case (considering patch#2), this unsafety is not
> > visible. That's because:
> >
> > (quoting ProcessLibraryConstructorList() and
> > ProcessLibraryDestructorList() from
> > "Build/OvmfX64/NOOPT_GCC5/X64/NetworkPkg/Ip4Dxe/Ip4Dxe/DEBUG/AutoGen.c",
> > from an earlier build on my machine anyway):
> >
> >> VOID
> >> EFIAPI
> >> ProcessLibraryConstructorList (
> >>IN EFI_HANDLEImageHandle,
> >>IN EFI_SYSTEM_TABLE  *SystemTable
> >>)
> >> {
> >>EFI_STATUS  Status;
> >>
> >>Status = PlatformDebugLibIoPortConstructor ();
> >>ASSERT_RETURN_ERROR (Status);
> >>
> >>Status = UefiBootServicesTableLibConstructor (ImageHandle, SystemTable);
> >>ASSERT_EFI_ERROR (Status);
> >>
> >>Status = DevicePathLibConstructor (ImageHandle, SystemTable);
> >>ASSERT_EFI_ERROR (Status);
> >>
> >>Status = UefiRuntimeServicesTableLibConstructor (ImageHandle, 
> >> SystemTable);
> >>ASSERT_EFI_ERROR (Status);
> >>
> >>Status = UefiLibConstructor (ImageHandle, SystemTable);
> >>ASSERT_EFI_ERROR (Status);
> >>
> >>Status = UefiHiiServicesLibConstructor (ImageHandle, SystemTable);
> >>ASSERT_EFI_ERROR (Status);
> >>
> >>Status = DpcLibConstructor (ImageHandle, SystemTable);
> >>ASSERT_EFI_ERROR (Status);
> >>
> >> }
> >>
> >>
> >>
> >> VOID
> >> EFIAPI
> >> ProcessLibraryDestructorList (
> >>IN EFI_HANDLEImageHandle,
> >>IN EFI_SYSTEM_TABLE  *SystemTable
> >>)
> >> {
> >>
> >> }
> >
> > there is no library destruction to speak of -- none of the used library
> > instances have resources they need to release at destruction time.
> >
> > However, the general case looks problematic. The new library constructor
> > call would be inserted *somewhere* in ProcessLibraryConstructorList() --
> > the insertion point is likely "mostly unspecified", as no library
> > instance depends on DriverLoadInhibitorLib, and DriverLoadInhibitorLib
> > seems to depend on relatively few lib classes too. Therefore, in theory
> > anyway, the new lib constructor could call gBS->Exit() somewhere in the
> > middle of ProcessLibraryConstructorList(), with only some of the library
> > constructors having been 

Re: [edk2-devel] [PATCH EDK2 v2 1/1] MdeModulePkg/PiSmmCore:Avoid overflow risk

2022-08-17 Thread wenyi,xie via groups.io



On 2022/8/16 9:49, Ni, Ray wrote:
>> --- a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c
>> +++ b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c
>> @@ -621,6 +621,9 @@ InternalIsBufferOverlapped (
>>IN UINTN  Size2
>>)
>>  {
>> +  if (((UINTN)Buff1 > MAX_UINTN - Size1) || ((UINTN)Buff2 > MAX_UINTN -
>> Size2)) {
>> +return TRUE;
>> +  }
> 1. The change looks good because it avoids integer overflow in below code 
> that adds Size1 to Buff1 and
> adds Size2 to Buff2.
> Can you please add comments to explain the logic?
> 
OK, I will add comments.
> 
>>
>> +  if (CommunicateHeader->MessageLength > MAX_UINTN - OFFSET_OF
>> (EFI_SMM_COMMUNICATE_HEADER, Data)) {
>> +return EFI_INVALID_PARAMETER;
>> +  }
> 2. Above check avoids integer overflow in below code that adds 
> CommunicateHeader->MessageLength
> to OFFSET_OF(EFI_SMM_COMMUNICATE_HEADER, Data).
> Can it be moved to inside the below if-clause?
> 
> 
>> +
>>if (CommSize == NULL) {
>>  TempCommSize = OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data)
>> + CommunicateHeader->MessageLength;
>>} else {
> 3.  I further reviewed the else-clause logic. When CommSize is not NULL, is 
> that needed to make sure
> that *CommSize >= OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data) + 
> CommunicateHeader->MessageLength?
> Or is the check already in the code somewhere?
> If we think the check is needed, I agree with the change #2 to have a common 
> logic to check integer overflow.
> .When CommSize is not NULL, it seems only CommSize is been used, 
> CommunicateHeader->MessageLength is been ignored, and value of CommSize will 
> been verified before used by SmiHandler.
So I think it's no need  make sure that *CommSize >= OFFSET_OF 
(EFI_SMM_COMMUNICATE_HEADER, Data) + CommunicateHeader->MessageLength.
I will move it to inside if-clause.

Thanks
Wenyi
> 


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




回复: [edk2-devel] 回复: [PATCH EDK2 v1 1/1] MdeModulePkg/BaseBmpSupportLib: Fix ColorMap issue

2022-08-17 Thread gaoliming via groups.io
Weiyi:
  This patch doesn't pass CI. Please check
https://github.com/tianocore/edk2/pull/3208

> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 gaoliming via
> groups.io
> 发送时间: 2022年8月12日 12:53
> 收件人: 'Wenyi Xie' ; devel@edk2.groups.io;
> jian.j.w...@intel.com; zhichao@intel.com; ray...@intel.com
> 抄送: songdongku...@huawei.com
> 主题: [edk2-devel] 回复: [PATCH EDK2 v1 1/1]
> MdeModulePkg/BaseBmpSupportLib: Fix ColorMap issue
> 
> Agree this fix to add the check for this case. Reviewed-by: Liming Gao
> 
> 
> Thanks
> Liming
> > -邮件原件-
> > 发件人: Wenyi Xie 
> > 发送时间: 2022年8月11日 16:32
> > 收件人: devel@edk2.groups.io; jian.j.w...@intel.com;
> > gaolim...@byosoft.com.cn; zhichao@intel.com; ray...@intel.com
> > 抄送: songdongku...@huawei.com; xiewen...@huawei.com
> > 主题: [PATCH EDK2 v1 1/1] MdeModulePkg/BaseBmpSupportLib: Fix
> > ColorMap issue
> >
> > When BitPerPixel is 1,4,8, there should be a color map in bmp file. But
if
> > the format of bmp file is error, it maybe has no color map when
> BitPerPixel
> > is 1,4,8. The condition checking now can not catch this issue.
> >
> > Cc: Jian J Wang 
> > Cc: Liming Gao 
> > Cc: Zhichao Gao 
> > Cc: Ray Ni 
> > Signed-off-by: Wenyi Xie 
> > ---
> >  MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c | 5 +
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
> > b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
> > index c5e885d7a6d5..bea89d530de6 100644
> > --- a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
> > +++ b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
> > @@ -236,6 +236,11 @@ TranslateBmpToGopBlt (
> >  return RETURN_UNSUPPORTED;
> >}
> >
> > +  if ((BmpHeader->ImageOffset == sizeof (BMP_IMAGE_HEADER)) &&
> > +  ((BmpHeader->BitPerPixel & 0x0D) != 0)) {
> > +return RETURN_UNSUPPORTED;
> > +  }
> > +
> >if (BmpHeader->ImageOffset > sizeof (BMP_IMAGE_HEADER)) {
> >  switch (BmpHeader->BitPerPixel) {
> >case 1:
> > --
> > 2.20.1.windows.1
> 
> 
> 
> 
> 
> 
> 





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




Re: [edk2-devel] [PATCH] DynamicTablesPkg: Correct cluster index

2022-08-17 Thread Ard Biesheuvel
On Tue, 16 Aug 2022 at 22:46, Jeff Brasen  wrote:
>
> Current code will generate duplicate UID if there are nested clusters
> in the topology.
>

What is a nested cluster?

> Signed-off-by: Jeff Brasen 
> ---
>  .../SsdtCpuTopologyGenerator.c| 22 ---
>  1 file changed, 14 insertions(+), 8 deletions(-)
>
> diff --git 
> a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
>  
> b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
> index 3266d8dd98..9295117f1f 100644
> --- 
> a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
> +++ 
> b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
> @@ -706,6 +706,8 @@ CreateAmlCluster (
>   Cannot be CM_NULL_TOKEN.
>@param [in] ParentNode Parent node to attach the created
>   node to.
> +  @param [in,out] ClusterIndex   Pointer to the current cluster index
> + to be used as UID.
>
>@retval EFI_SUCCESS Success.
>@retval EFI_INVALID_PARAMETER   Invalid parameter.
> @@ -718,13 +720,13 @@ CreateAmlCpuTopologyTree (
>INACPI_CPU_TOPOLOGY_GENERATOR   *Generator,
>IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,
>INCM_OBJECT_TOKEN   NodeToken,
> -  INAML_NODE_HANDLE   ParentNode
> +  INAML_NODE_HANDLE   ParentNode,
> +  IN OUTUINT32*ClusterIndex
>)
>  {
>EFI_STATUS  Status;
>UINT32  Index;
>UINT32  CpuIndex;
> -  UINT32  ClusterIndex;
>AML_OBJECT_NODE_HANDLE  ClusterNode;
>
>ASSERT (Generator != NULL);
> @@ -733,9 +735,9 @@ CreateAmlCpuTopologyTree (
>ASSERT (CfgMgrProtocol != NULL);
>ASSERT (NodeToken != CM_NULL_TOKEN);
>ASSERT (ParentNode != NULL);
> +  ASSERT (ClusterIndex != NULL);
>
> -  CpuIndex = 0;
> -  ClusterIndex = 0;
> +  CpuIndex = 0;
>
>for (Index = 0; Index < Generator->ProcNodeCount; Index++) {
>  // Find the children of the CM_ARM_PROC_HIERARCHY_INFO
> @@ -790,7 +792,7 @@ CreateAmlCpuTopologyTree (
> CfgMgrProtocol,
> ParentNode,
> >ProcNodeList[Index],
> -   ClusterIndex,
> +   *ClusterIndex,
> 
> );
>  if (EFI_ERROR (Status)) {
> @@ -800,7 +802,7 @@ CreateAmlCpuTopologyTree (
>
>  // Nodes must have a unique name in the ASL namespace.
>  // Reset the Cpu index whenever we create a new Cluster.
> -ClusterIndex++;
> +(*ClusterIndex)++;
>  CpuIndex = 0;
>
>  // Recursively continue creating an AML tree.
> @@ -808,7 +810,8 @@ CreateAmlCpuTopologyTree (
> Generator,
> CfgMgrProtocol,
> Generator->ProcNodeList[Index].Token,
> -   ClusterNode
> +   ClusterNode,
> +   ClusterIndex
> );
>  if (EFI_ERROR (Status)) {
>ASSERT (0);
> @@ -845,6 +848,7 @@ CreateTopologyFromProcHierarchy (
>EFI_STATUS  Status;
>UINT32  Index;
>UINT32  TopLevelProcNodeIndex;
> +  UINT32  ClusterIndex;
>
>ASSERT (Generator != NULL);
>ASSERT (Generator->ProcNodeCount != 0);
> @@ -853,6 +857,7 @@ CreateTopologyFromProcHierarchy (
>ASSERT (ScopeNode != NULL);
>
>TopLevelProcNodeIndex = MAX_UINT32;
> +  ClusterIndex  = 0;
>
>Status = TokenTableInitialize (Generator, Generator->ProcNodeCount);
>if (EFI_ERROR (Status)) {
> @@ -887,7 +892,8 @@ CreateTopologyFromProcHierarchy (
>   Generator,
>   CfgMgrProtocol,
>   Generator->ProcNodeList[TopLevelProcNodeIndex].Token,
> - ScopeNode
> + ScopeNode,
> + 
>   );
>if (EFI_ERROR (Status)) {
>  ASSERT (0);
> --
> 2.25.1
>


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




[edk2-devel] [PATCH] IntelSiliconPkg/VTd: Add DMAR SIDP Table dumpping

2022-08-17 Thread Sheng Wei
VT-d spec 4.0 has added a new structure called SIDP which is more
generic to describe special properties of integrated devices.

Cc: Ray Ni 
Cc: Rangasai V Chaganty 
Cc: Jenny Huang 
Cc: Robert Kowalewski 
Signed-off-by: Sheng Wei 
---
 .../Feature/VTd/IntelVTdDxe/DmarAcpiTable.c   | 72 +++
 1 file changed, 72 insertions(+)

diff --git 
a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTable.c 
b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTable.c
index 75fbd53ed..42e1b1449 100644
--- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTable.c
+++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTable.c
@@ -93,6 +93,10 @@ DumpDmarDeviceScopeEntry (
 "  Length . 0x%02x\n",
 DmarDeviceScopeEntry->Length
 ));
+  DEBUG ((DEBUG_INFO,
+"  Flags .. 0x%02x\n",
+DmarDeviceScopeEntry->Flags
+));
   DEBUG ((DEBUG_INFO,
 "  Enumeration ID . 0x%02x\n",
 DmarDeviceScopeEntry->EnumerationId
@@ -122,6 +126,66 @@ DumpDmarDeviceScopeEntry (
   return;
 }
 
+/**
+  Dump DMAR SIDP table.
+
+  @param[in]  Sidp  DMAR SIDP table
+**/
+VOID
+DumpDmarSidp (
+  IN EFI_ACPI_DMAR_SIDP_HEADER *Sidp
+  )
+{
+  EFI_ACPI_DMAR_DEVICE_SCOPE_STRUCTURE_HEADER   *DmarDeviceScopeEntry;
+  INTN  SidpLen;
+
+  if (Sidp == NULL) {
+return;
+  }
+
+  DEBUG ((DEBUG_INFO,
+"  
***\n"
+));
+  DEBUG ((DEBUG_INFO,
+"  *   SoC Integrated Device Property Reporting Structure  
  *\n"
+));
+  DEBUG ((DEBUG_INFO,
+"  
***\n"
+));
+  DEBUG ((DEBUG_INFO,
+(sizeof(UINTN) == sizeof(UINT64)) ?
+"  SIDP address ... 0x%016lx\n" :
+"  SIDP address ... 0x%08x\n",
+Sidp
+));
+  DEBUG ((DEBUG_INFO,
+"Type . 0x%04x\n",
+Sidp->Header.Type
+));
+  DEBUG ((DEBUG_INFO,
+"Length ... 0x%04x\n",
+Sidp->Header.Length
+));
+  DEBUG ((DEBUG_INFO,
+"Segment Number ... 0x%04x\n",
+Sidp->SegmentNumber
+));
+
+  SidpLen  = Sidp->Header.Length - sizeof(EFI_ACPI_DMAR_SIDP_HEADER);
+  DmarDeviceScopeEntry = (EFI_ACPI_DMAR_DEVICE_SCOPE_STRUCTURE_HEADER *)(Sidp 
+ 1);
+  while (SidpLen > 0) {
+DumpDmarDeviceScopeEntry (DmarDeviceScopeEntry);
+SidpLen -= DmarDeviceScopeEntry->Length;
+DmarDeviceScopeEntry = (EFI_ACPI_DMAR_DEVICE_SCOPE_STRUCTURE_HEADER 
*)((UINTN)DmarDeviceScopeEntry + DmarDeviceScopeEntry->Length);
+  }
+
+  DEBUG ((DEBUG_INFO,
+"  
***\n\n"
+));
+
+  return;
+}
+
 /**
   Dump DMAR SATC table.
 
@@ -472,6 +536,10 @@ DumpDmarDrhd (
 "Flags  0x%02x\n",
 Drhd->Flags
 ));
+  DEBUG ((DEBUG_INFO,
+"Size . 0x%02x\n",
+Drhd->Size
+));
   DEBUG ((DEBUG_INFO,
 "  INCLUDE_PCI_ALL  0x%02x\n",
 Drhd->Flags & EFI_ACPI_DMAR_DRHD_FLAGS_INCLUDE_PCI_ALL
@@ -583,7 +651,11 @@ DumpAcpiDMAR (
 case EFI_ACPI_DMAR_TYPE_SATC:
   DumpDmarSatc ((EFI_ACPI_DMAR_SATC_HEADER *)DmarHeader);
   break;
+case EFI_ACPI_DMAR_TYPE_SIDP:
+  DumpDmarSidp ((EFI_ACPI_DMAR_SIDP_HEADER *)DmarHeader);
+  break;
 default:
+  DEBUG ((DEBUG_INFO, "Unknown DMAR Table Type : %d\n", DmarHeader->Type));
   break;
 }
 DmarLen -= DmarHeader->Length;
-- 
2.26.2.windows.1



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