Re: [edk2-devel] [PATCH v1 1/1] DynamicTablesPkg: Add SMBIOS String table helper library

2023-03-09 Thread PierreGondois

Hello Sami,

On 3/9/23 12:11, Sami Mujawar wrote:

Hi Pierre,

On Tue, Oct 4, 2022 at 01:22 AM, PierreGondois wrote:

+EFI_STATUS
+EFIAPI
+StringTablePublishStringSet (
+ IN STRING_TABLE *CONST StrTable,
+ IN CHAR8 *CONST SmbiosStringAreaStart,
+ IN CONST UINTN SmbiosStringAreaSize
+ )
+{
+ UINT8 Index;
+ STRING_ELEMENT *StrElement;
+ CHAR8 *SmbiosString;
+ UINTN BytesRemaining;
+ UINTN BytesCopied;
+
+ if ((StrTable == NULL) || (SmbiosStringAreaStart == NULL)) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ if (SmbiosStringAreaSize < StringTableGetStringSetSize 
(StrTable)) {
+ return EFI_BUFFER_TOO_SMALL;
+ }
+
+ SmbiosString = SmbiosStringAreaStart;
+ BytesRemaining = SmbiosStringAreaSize;
+
+ if (StrTable->StrCount == 0) {
+ // See Section 6.1.3 Text strings, SMBIOS Specification Version 
3.6.0
+ // If the formatted portion of the structure contains 
string-reference
+ // fields and all the string fields are set to 0 (no string 
references),
+ // the formatted section of the structure is followed by two null 
(00h)
+ // BYTES.
+ *SmbiosString++ = '\0';
+ } else {
+ for (Index = 0; Index < StrTable->StrCount; Index++) {
+ StrElement = >Elements[Index];
+ AsciiStrCpyS (SmbiosString, BytesRemaining, StrElement->String);
+
+ // See Section 6.1.3 Text strings, SMBIOS Specification Version 
3.6.0
+ // - Each string is terminated with a null (00h) BYTE
+ // Bytes Copied = String length + 1 for the string NULL 
terminator.
+ BytesCopied = StrElement->StringLen + 1;
+ BytesRemaining -= BytesCopied;
+ SmbiosString += BytesCopied;
+ }
+ }
+
+ // See Section 6.1.3 Text strings, SMBIOS Specification Version 
3.6.0
+ // - the set of strings is terminated with an additional null 
(00h) BYTE.
+ *SmbiosString = '\0';

[GM] Shouldn't you advance the SmbiosString pointer by one more ? After
the loop isn't SmbiosString going to be at the NULL char of the last
string ? And we're trying to add one more NULL character ?
Should it be:
SmbiosString++;
*SmbiosString = '\0';

I didn't try to run the code, but it seems ok to me. Assuming the string 
has 9 chars:
"""
// Copy 9 chars + 1 NULL char
AsciiStrCpyS (SmbiosString, BytesRemaining, StrElement->String);

// We have copied 10 chars
BytesCopied = StrElement->StringLen + 1;
BytesRemaining -= BytesCopied;
// Increment SmbiosString of 10 chars, so SmbiosString is pointing
// to an un-initialized char now and we can continue.
SmbiosString += BytesCopied;
"""

However, maybe we need to add an extra check/ASSERT for BytesRemaining 
before
writing the last NULL char.

The check at the function entry i.e. "if (SmbiosStringAreaSize < 
StringTableGetStringSetSize (StrTable)) {"
should cover this, as BytesRemaining is derived from SmbiosStringAreaSize.
So as long as StringTableGetStringSetSize() returns the correct size, the 
additional check before writing
the last NULL char is not needed.


Ok sure, it was just a suggestion.
Also just in case, there was this remark from you:
https://edk2.groups.io/g/devel/message/93654

Otherwise:
Reviewed-by: Pierre Gondois 

Regards,
Pierre



Please let me know if you think otherwise.

Regards,

Sami Mujawar



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




Re: [edk2-devel] [edk2 2/3] [PATCH v3] MdePkg: add SBI-based SeriaPortLib for RISC-V

2023-03-09 Thread Sunil V L
On Fri, Mar 03, 2023 at 12:04:09PM -0600, Andrei Warkentin wrote:
> These are implementations of SerialPortLib using SBI console services.
> - SecPeiRiscVSerialPortLibSbi is appropriate for SEC/PEI (XIP) environments
> - PrePiDxeRiscVSerialPortLibSbi is appropriate for PrePI/DXE environments
> 
> Tested with:
> - Qemu RiscVVirt (non-DBCN case, backed by UART)
> - TinyEMU + RiscVVirt (non-DBCN case, HTIF)
> - TinyEMU + RiscVVirt (DBCN case, HTIF)
> 
> Cc: Daniel Schaefer 
> Cc: Sunil V L 
> Acked-by: Gerd Hoffmann 
> Signed-off-by: Andrei Warkentin 
> ---
>  
> MdePkg/Library/PrePiDxeRiscVSerialPortLibSbi/PrePiDxeRiscVSerialPortLibSbi.inf
>  |  36 +++
>  MdePkg/Library/SecPeiRiscVSerialPortLibSbi/SecPeiRiscVSerialPortLibSbi.inf   
>   |  39 +++
>  MdePkg/Library/PrePiDxeRiscVSerialPortLibSbi/PrePiDxeRiscVSerialPortLibSbi.c 
>   | 285 
>  MdePkg/Library/SecPeiRiscVSerialPortLibSbi/SecPeiRiscVSerialPortLibSbi.c 
>   | 233 
>  
> MdePkg/Library/PrePiDxeRiscVSerialPortLibSbi/PrePiDxeRiscVSerialPortLibSbi.uni
>  |  16 ++
>  MdePkg/Library/SecPeiRiscVSerialPortLibSbi/SecPeiRiscVSerialPortLibSbi.uni   
>   |  16 ++
>  6 files changed, 625 insertions(+)
> 
> diff --git 
> a/MdePkg/Library/PrePiDxeRiscVSerialPortLibSbi/PrePiDxeRiscVSerialPortLibSbi.inf
>  
> b/MdePkg/Library/PrePiDxeRiscVSerialPortLibSbi/PrePiDxeRiscVSerialPortLibSbi.inf
> new file mode 100644
> index ..1d8544756bb9
> --- /dev/null
> +++ 
> b/MdePkg/Library/PrePiDxeRiscVSerialPortLibSbi/PrePiDxeRiscVSerialPortLibSbi.inf
> @@ -0,0 +1,36 @@
> +## @file
> +#  Serial Port Library backed by SBI console.
> +#
> +#  Meant for PrePi and DXE environments (where globals are allowed). See
> +#  SecPeiSerialPortLibRiscVSbi for a reduced variant appropriate for SEC
> +#  and PEI (XIP) environments.
> +#
> +#  Copyright (c) 2023, Intel Corporation. All rights reserved.
> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +#
> +##
> +
> +[Defines]
> +  INF_VERSION= 0x0001001B
> +  BASE_NAME  = PrePiDxeRiscVSerialPortLibSbi
> +  MODULE_UNI_FILE= PrePiDxeRiscVSerialPortLibSbi.uni
> +  FILE_GUID  = 872af743-ab56-45b4-a065-602567f4820c
> +  MODULE_TYPE= BASE
> +  VERSION_STRING = 1.0
> +  LIBRARY_CLASS  = SerialPortLib | SEC DXE_CORE DXE_DRIVER 
> DXE_RUNTIME_DRIVER UEFI_DRIVER UEFI_APPLICATION
> +
> +
> +#
> +#  VALID_ARCHITECTURES   = RISCV64
> +#
> +
> +[Sources]
> +  PrePiDxeRiscVSerialPortLibSbi.c
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +
> +[LibraryClasses]
> +  RiscVSbiLib
> diff --git 
> a/MdePkg/Library/SecPeiRiscVSerialPortLibSbi/SecPeiRiscVSerialPortLibSbi.inf 
> b/MdePkg/Library/SecPeiRiscVSerialPortLibSbi/SecPeiRiscVSerialPortLibSbi.inf
> new file mode 100644
> index ..7bc7cd47c11c
> --- /dev/null
> +++ 
> b/MdePkg/Library/SecPeiRiscVSerialPortLibSbi/SecPeiRiscVSerialPortLibSbi.inf
> @@ -0,0 +1,39 @@
> +## @file
> +#  Serial Port Library backed by SBI console.
> +#
> +#  Meant for SEC and PEI (XIP) environments.
> +#
> +#  Due to limitations of SBI console interface and XIP environments
> +#  (on use of globals), this library instance does not implement reading
> +#  and polling the serial port. See PrePiDxeSerialPortLibRiscVSbi for
> +#  the full-featured variant meant for PrePi and DXE environments.
> +#
> +#  Copyright (c) 2023, Intel Corporation. All rights reserved.
> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +#
> +##
> +
> +[Defines]
> +  INF_VERSION= 0x0001001B
> +  BASE_NAME  = SecPeiRiscVSerialPortLibSbi
> +  MODULE_UNI_FILE= SecPeiRiscVSerialPortLibSbi.uni
> +  FILE_GUID  = 639fad38-4bfd-4eb9-9f09-e97c7947d480
> +  MODULE_TYPE= BASE
> +  VERSION_STRING = 1.0
> +  LIBRARY_CLASS  = SerialPortLib | SEC PEI_CORE PEIM
> +
> +
> +#
> +#  VALID_ARCHITECTURES   = RISCV64
> +#
> +
> +[Sources]
> +  SecPeiRiscVSerialPortLibSbi.c
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +
> +[LibraryClasses]
> +  RiscVSbiLib
> diff --git 
> a/MdePkg/Library/PrePiDxeRiscVSerialPortLibSbi/PrePiDxeRiscVSerialPortLibSbi.c
>  
> b/MdePkg/Library/PrePiDxeRiscVSerialPortLibSbi/PrePiDxeRiscVSerialPortLibSbi.c
> new file mode 100644
> index ..cedda04ee5aa
> --- /dev/null
> +++ 
> b/MdePkg/Library/PrePiDxeRiscVSerialPortLibSbi/PrePiDxeRiscVSerialPortLibSbi.c
> @@ -0,0 +1,285 @@
> +/** @file
> +  Serial Port Library backed by SBI console.
> +
> +  Meant for PrePi and DXE environments (where globals are allowed). See
> +  SecPeiSerialPortLibRiscVSbi for a reduced variant appropriate for SEC
> +  and PEI (XIP) environments.
> +
> +  Copyright (c) 2023, Intel Corporation. All rights reserved.
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include 
> +#include 
> +#include 
> +
> +STATIC 

Re: [edk2-devel] [PATCH] UefiCpuPkg/MicrocodeMeasurementDxe: Fix exception

2023-03-09 Thread Michael D Kinney
Merged

PR: https://github.com/tianocore/edk2/pull/4129

Commit: 
https://github.com/tianocore/edk2/commit/fd1820b7ea09e53e404d6f56bb8bc4b51a5dd83e

Mike

From: devel@edk2.groups.io  On Behalf Of Darbin Reyes
Sent: Thursday, March 9, 2023 8:31 PM
To: devel@edk2.groups.io; Reyes, Darbin ; Dong, Eric 
; Ni, Ray ; Kumar, Rahul R 
; kra...@redhat.com
Cc: Narey, Jacob 
Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg/MicrocodeMeasurementDxe: Fix 
exception

+ @UefiCpuPkg Maintainers

Requesting an estimated ETA on integration of this 1 character patch.

I understand the patch queue is huge, just looking to provide a realistic 
expectation to those who are blocked by this and waiting for me to provide an 
update.

Warm Regards,
Darbin

From: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>> on behalf of Darbin Reyes 
mailto:darbin.re...@intel.com>>
Sent: Tuesday, March 7, 2023 3:04 PM
To: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>>
Cc: Reyes, Darbin mailto:darbin.re...@intel.com>>; 
Narey, Jacob mailto:jacob.na...@intel.com>>
Subject: [edk2-devel] [PATCH] UefiCpuPkg/MicrocodeMeasurementDxe: Fix exception

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

An incorrect format specifier is being used in a DEBUG print,
specifically, a variable of type EFI_STATUS was being printed with
the %a format specifier (pointer to an ASCII string), thus the value of
the Status variable was being treated as the address of a string,
leading to a CPU exception, when encountered this bug manifests itself
as a hang near "Ready to Boot Event", with the last DEBUG print being
"INFO: Got MicrocodePatchHob with microcode patches starting address"
followed by a CPU Exception dump.

Signed-off-by: Darbin Reyes 
mailto:darbin.re...@intel.com>>
Reviewed-by: Jacob Narey mailto:jacob.na...@intel.com>>
---
 UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c 
b/UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c
index 762ca159ff..5fd3b3365c 100644
--- a/UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c
+++ b/UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c
@@ -238,7 +238,7 @@ MeasureMicrocodePatches (
TotalMicrocodeSize)

   );

   } else {

-DEBUG ((DEBUG_ERROR, "ERROR: TpmMeasureAndLogData failed with status 
%a!\n", Status));

+DEBUG ((DEBUG_ERROR, "ERROR: TpmMeasureAndLogData failed with status 
%r!\n", Status));

   }



   FreePool (Offsets);

--
2.38.1.windows.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100818): https://edk2.groups.io/g/devel/message/100818
Mute This Topic: https://groups.io/mt/97461560/7511391
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [darbin.re...@intel.com]
-=-=-=-=-=-=




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




Re: [edk2-devel] [edk2 3/3] OvmfPkg: RiscVVirt: Add missing SerialPortInitialize to Sec

2023-03-09 Thread Sunil V L
On Fri, Mar 03, 2023 at 12:04:10PM -0600, Andrei Warkentin wrote:
> If the SerialPortLib had any initialization needed, this
> would be skipped in the RiscVVirt Sec. Follow the example
> seen elsewhere (ArmVirtPkg PrePi).
> 
> Seen with BaseSerialPortLibRiscVSbi not using DBCN in Sec, yet
> using DBCN elsewhere.
> 
> Cc: Daniel Schaefer 
> Cc: Sunil V L 
> Signed-off-by: Andrei Warkentin 
> ---
>  OvmfPkg/RiscVVirt/Sec/SecMain.inf | 1 +
>  OvmfPkg/RiscVVirt/Sec/SecMain.h   | 1 +
>  OvmfPkg/RiscVVirt/Sec/SecMain.c   | 4 +++-
>  3 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/OvmfPkg/RiscVVirt/Sec/SecMain.inf 
> b/OvmfPkg/RiscVVirt/Sec/SecMain.inf
> index aed35d3af596..0e2a5785e8a4 100644
> --- a/OvmfPkg/RiscVVirt/Sec/SecMain.inf
> +++ b/OvmfPkg/RiscVVirt/Sec/SecMain.inf
> @@ -48,6 +48,7 @@ [LibraryClasses]
>FdtLib
>MemoryAllocationLib
>HobLib
> +  SerialPortLib
>  
>  [Ppis]
>gEfiTemporaryRamSupportPpiGuid# PPI ALWAYS_PRODUCED
> diff --git a/OvmfPkg/RiscVVirt/Sec/SecMain.h b/OvmfPkg/RiscVVirt/Sec/SecMain.h
> index 83a8058efe40..7c7650f0d298 100644
> --- a/OvmfPkg/RiscVVirt/Sec/SecMain.h
> +++ b/OvmfPkg/RiscVVirt/Sec/SecMain.h
> @@ -29,6 +29,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  
>  /**
> diff --git a/OvmfPkg/RiscVVirt/Sec/SecMain.c b/OvmfPkg/RiscVVirt/Sec/SecMain.c
> index adf73f2eb66c..db309ebdf1a3 100644
> --- a/OvmfPkg/RiscVVirt/Sec/SecMain.c
> +++ b/OvmfPkg/RiscVVirt/Sec/SecMain.c
> @@ -1,7 +1,7 @@
>  /** @file
>RISC-V SEC phase module for Qemu Virt.
>  
> -  Copyright (c) 2008 - 2015, Intel Corporation. All rights reserved.
> +  Copyright (c) 2008 - 2013, Intel Corporation. All rights reserved.
Should be 2008 - 2023

Otherwise, LGTM.

Reviewed-by: Sunil V L 


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




Re: [edk2-devel] [edk2 1/3] MdePkg: BaseRiscVSbiLib: make more useful to consumers

2023-03-09 Thread Sunil V L
On Fri, Mar 03, 2023 at 12:04:08PM -0600, Andrei Warkentin wrote:
> Add a few more definitions and make SbiCall and TranslateError
> usable (not static) by library users.
> 
> Cc: Daniel Schaefer 
> Cc: Sunil V L 
> Acked-by: Gerd Hoffmann 
> Signed-off-by: Andrei Warkentin 
> ---

Reviewed-by: Sunil V L 


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




Re: [edk2-devel] [Patch V3 1/2] MdePkg: modify the wrong 'AcpiId' to 'ApicId' in MpWakeupStructure

2023-03-09 Thread duntan
Hi Liming,

I've checked edk2 and edk2-platforms repo. This code change doesn't impacted 
any code.
The MultiprocessorWakeupMailbox structure has not been used yet. 

Thanks,
Dun

-Original Message-
From: gaoliming  
Sent: Friday, March 10, 2023 10:16 AM
To: Tan, Dun ; devel@edk2.groups.io
Cc: Kinney, Michael D ; Liu, Zhiguang 

Subject: 回复: [Patch V3 1/2] MdePkg: modify the wrong 'AcpiId' to 'ApicId' in 
MpWakeupStructure

Dun:
  Is there any code impact with this change?

Thanks
Liming
> -邮件原件-
> 发件人: Dun Tan 
> 发送时间: 2023年3月9日 11:40
> 收件人: devel@edk2.groups.io
> 抄送: Michael D Kinney ; Liming Gao 
> ; Zhiguang Liu 
> 主题: [Patch V3 1/2] MdePkg: modify the wrong 'AcpiId' to 'ApicId' in 
> MpWakeupStructure
> 
> modify the wrong 'AcpiId' to 'ApicId' of MpWakeupStructure defination 
> in Acpi64.h.
> 
> Signed-off-by: Dun Tan 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Reviewed-by: Zhiguang Liu 
> ---
>  MdePkg/Include/IndustryStandard/Acpi64.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/MdePkg/Include/IndustryStandard/Acpi64.h
> b/MdePkg/Include/IndustryStandard/Acpi64.h
> index fe5ebfac2b..bfd022b6b6 100644
> --- a/MdePkg/Include/IndustryStandard/Acpi64.h
> +++ b/MdePkg/Include/IndustryStandard/Acpi64.h
> @@ -607,7 +607,7 @@ typedef struct {
>  typedef struct {
>UINT16Command;
>UINT16Reserved;
> -  UINT32AcpiId;
> +  UINT32ApicId;
>UINT64WakeupVector;
>UINT8 ReservedForOs[2032];
>UINT8 ReservedForFirmware[2048];
> --
> 2.31.1.windows.1





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




Re: [edk2-devel] [PATCH] MdePkg/BaseCacheMaintenanceLib: RISC-V: Fix instruction cache not been invalidated

2023-03-09 Thread Sunil V L
On Mon, Mar 06, 2023 at 09:10:58AM -0800, Tuan Phan wrote:
> When the range instruction cache invalidating not supported, the whole
> instruction cache should be invalidated instead.
> 
> Signed-off-by: Tuan Phan 
> ---
>  MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c 
> b/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c
> index 67a3387ff3c6..a744b2a6f889 100644
> --- a/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c
> +++ b/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c
> @@ -76,7 +76,10 @@ InvalidateInstructionCacheRange (
>IN UINTN  Length
>)
>  {
> -  DEBUG ((DEBUG_ERROR, "%a:RISC-V unsupported function.\n", __FUNCTION__));
> +  DEBUG ((DEBUG_WARN,
> +  "%a:RISC-V unsupported function.\n"
> +  "Invalidating the whole instruction cache instead.\n", __func__));
Hi Tuan,

Please run uncrustify and fix the error at this line.

Thanks,
Sunil

> +  InvalidateInstructionCache ();
>return Address;
>  }
>  
> -- 
> 2.25.1
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100984): https://edk2.groups.io/g/devel/message/100984
Mute This Topic: https://groups.io/mt/97429987/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] CryptoPkg/OpensslLib: Upgrade OpenSSL to 1.1.1t

2023-03-09 Thread Yao, Jiewen
Merged https://github.com/tianocore/edk2/pull/4128

> -Original Message-
> From: Sheng, W 
> Sent: Tuesday, February 28, 2023 10:44 AM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J ; Yao, Jiewen
> ; Lu, Xiaoyu1 ; Jiang,
> Guomin 
> Subject: [PATCH v2] CryptoPkg/OpensslLib: Upgrade OpenSSL to 1.1.1t
> 
> Upgrade openssl to 1.1.1t
> Pick up bugfixes from the latest openssl release.
> 
> Cc: Jian J Wang 
> Cc: Jiewen Yao 
> Cc: Xiaoyu Lu 
> Cc: Guomin Jiang 
> Signed-off-by: Sheng Wei 
> ---
>  CryptoPkg/Library/OpensslLib/OpensslLib.inf  | 1 +
>  CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf | 1 +
>  CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf| 1 +
>  CryptoPkg/Library/OpensslLib/OpensslLibFull.inf  | 1 +
>  CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf | 1 +
>  CryptoPkg/Library/OpensslLib/openssl | 2 +-
>  6 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
> b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
> index 60c6c24b0a..1474df8125 100644
> --- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
> +++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
> @@ -162,6 +162,7 @@
>$(OPENSSL_PATH)/crypto/bn/bn_srp.c
> 
>$(OPENSSL_PATH)/crypto/bn/bn_word.c
> 
>$(OPENSSL_PATH)/crypto/bn/bn_x931p.c
> 
> +  $(OPENSSL_PATH)/crypto/bn/rsa_sup_mul.c
> 
>$(OPENSSL_PATH)/crypto/buffer/buf_err.c
> 
>$(OPENSSL_PATH)/crypto/buffer/buffer.c
> 
>$(OPENSSL_PATH)/crypto/cmac/cm_ameth.c
> 
> diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf
> b/CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf
> index 103ef7bda2..3c5f6d5d17 100644
> --- a/CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf
> +++ b/CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf
> @@ -163,6 +163,7 @@
>$(OPENSSL_PATH)/crypto/bn/bn_srp.c
> 
>$(OPENSSL_PATH)/crypto/bn/bn_word.c
> 
>$(OPENSSL_PATH)/crypto/bn/bn_x931p.c
> 
> +  $(OPENSSL_PATH)/crypto/bn/rsa_sup_mul.c
> 
>$(OPENSSL_PATH)/crypto/buffer/buf_err.c
> 
>$(OPENSSL_PATH)/crypto/buffer/buffer.c
> 
>$(OPENSSL_PATH)/crypto/cmac/cm_ameth.c
> 
> diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
> b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
> index c4eaea888c..a9adb94720 100644
> --- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
> +++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
> @@ -163,6 +163,7 @@
>$(OPENSSL_PATH)/crypto/bn/bn_srp.c
> 
>$(OPENSSL_PATH)/crypto/bn/bn_word.c
> 
>$(OPENSSL_PATH)/crypto/bn/bn_x931p.c
> 
> +  $(OPENSSL_PATH)/crypto/bn/rsa_sup_mul.c
> 
>$(OPENSSL_PATH)/crypto/buffer/buf_err.c
> 
>$(OPENSSL_PATH)/crypto/buffer/buffer.c
> 
>$(OPENSSL_PATH)/crypto/cmac/cm_ameth.c
> 
> diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibFull.inf
> b/CryptoPkg/Library/OpensslLib/OpensslLibFull.inf
> index 309e43055c..4c2cbe9cf7 100644
> --- a/CryptoPkg/Library/OpensslLib/OpensslLibFull.inf
> +++ b/CryptoPkg/Library/OpensslLib/OpensslLibFull.inf
> @@ -167,6 +167,7 @@
>$(OPENSSL_PATH)/crypto/bn/bn_srp.c
> 
>$(OPENSSL_PATH)/crypto/bn/bn_word.c
> 
>$(OPENSSL_PATH)/crypto/bn/bn_x931p.c
> 
> +  $(OPENSSL_PATH)/crypto/bn/rsa_sup_mul.c
> 
>$(OPENSSL_PATH)/crypto/buffer/buf_err.c
> 
>$(OPENSSL_PATH)/crypto/buffer/buffer.c
> 
>$(OPENSSL_PATH)/crypto/cmac/cm_ameth.c
> 
> diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf
> b/CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf
> index 4b79bd..591c57fdc2 100644
> --- a/CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf
> +++ b/CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf
> @@ -168,6 +168,7 @@
>$(OPENSSL_PATH)/crypto/bn/bn_srp.c
> 
>$(OPENSSL_PATH)/crypto/bn/bn_word.c
> 
>$(OPENSSL_PATH)/crypto/bn/bn_x931p.c
> 
> +  $(OPENSSL_PATH)/crypto/bn/rsa_sup_mul.c
> 
>$(OPENSSL_PATH)/crypto/buffer/buf_err.c
> 
>$(OPENSSL_PATH)/crypto/buffer/buffer.c
> 
>$(OPENSSL_PATH)/crypto/cmac/cm_ameth.c
> 
> diff --git a/CryptoPkg/Library/OpensslLib/openssl
> b/CryptoPkg/Library/OpensslLib/openssl
> index 129058165d..830bf8e1e4 16
> --- a/CryptoPkg/Library/OpensslLib/openssl
> +++ b/CryptoPkg/Library/OpensslLib/openssl
> @@ -1 +1 @@
> -Subproject commit 129058165d195e43a0ad10111b0c2e29bdf65980
> +Subproject commit 830bf8e1e4749ad65c51b6a1d0d769ae689404ba
> --
> 2.26.2.windows.1



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




Re: [edk2-devel] [PATCH] UefiCpuPkg/MicrocodeMeasurementDxe: Fix exception

2023-03-09 Thread Dong, Eric
Reviewed-by: Eric Dong 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Darbin Reyes
Sent: Wednesday, March 8, 2023 7:04 AM
To: devel@edk2.groups.io
Cc: Reyes, Darbin ; Narey, Jacob 
Subject: [edk2-devel] [PATCH] UefiCpuPkg/MicrocodeMeasurementDxe: Fix exception

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

An incorrect format specifier is being used in a DEBUG print, specifically, a 
variable of type EFI_STATUS was being printed with the %a format specifier 
(pointer to an ASCII string), thus the value of the Status variable was being 
treated as the address of a string, leading to a CPU exception, when 
encountered this bug manifests itself as a hang near "Ready to Boot Event", 
with the last DEBUG print being
"INFO: Got MicrocodePatchHob with microcode patches starting address"
followed by a CPU Exception dump.

Signed-off-by: Darbin Reyes 
Reviewed-by: Jacob Narey 
---
 UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c 
b/UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c
index 762ca159ff..5fd3b3365c 100644
--- a/UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c
+++ b/UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c
@@ -238,7 +238,7 @@ MeasureMicrocodePatches (
TotalMicrocodeSize)   );   } else {-DEBUG ((DEBUG_ERROR, 
"ERROR: TpmMeasureAndLogData failed with status %a!\n", Status));+DEBUG 
((DEBUG_ERROR, "ERROR: TpmMeasureAndLogData failed with status %r!\n", 
Status));   }FreePool (Offsets);-- 
2.38.1.windows.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100818): https://edk2.groups.io/g/devel/message/100818
Mute This Topic: https://groups.io/mt/97461560/1768733
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [eric.d...@intel.com] 
-=-=-=-=-=-=




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




Re: [edk2-devel] [PATCH] UefiCpuPkg/MicrocodeMeasurementDxe: Fix exception

2023-03-09 Thread Darbin Reyes
+ @UefiCpuPkg Maintainers

Requesting an estimated ETA on integration of this 1 character patch.

I understand the patch queue is huge, just looking to provide a realistic 
expectation to those who are blocked by this and waiting for me to provide an 
update.

Warm Regards,
Darbin

From: devel@edk2.groups.io  on behalf of Darbin Reyes 

Sent: Tuesday, March 7, 2023 3:04 PM
To: devel@edk2.groups.io 
Cc: Reyes, Darbin ; Narey, Jacob 
Subject: [edk2-devel] [PATCH] UefiCpuPkg/MicrocodeMeasurementDxe: Fix exception

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

An incorrect format specifier is being used in a DEBUG print,
specifically, a variable of type EFI_STATUS was being printed with
the %a format specifier (pointer to an ASCII string), thus the value of
the Status variable was being treated as the address of a string,
leading to a CPU exception, when encountered this bug manifests itself
as a hang near "Ready to Boot Event", with the last DEBUG print being
"INFO: Got MicrocodePatchHob with microcode patches starting address"
followed by a CPU Exception dump.

Signed-off-by: Darbin Reyes 
Reviewed-by: Jacob Narey 
---
 UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c 
b/UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c
index 762ca159ff..5fd3b3365c 100644
--- a/UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c
+++ b/UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c
@@ -238,7 +238,7 @@ MeasureMicrocodePatches (
TotalMicrocodeSize)

   );

   } else {

-DEBUG ((DEBUG_ERROR, "ERROR: TpmMeasureAndLogData failed with status 
%a!\n", Status));

+DEBUG ((DEBUG_ERROR, "ERROR: TpmMeasureAndLogData failed with status 
%r!\n", Status));

   }



   FreePool (Offsets);

--
2.38.1.windows.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100818): https://edk2.groups.io/g/devel/message/100818
Mute This Topic: https://groups.io/mt/97461560/7511391
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [darbin.re...@intel.com]
-=-=-=-=-=-=




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




Re: [edk2-devel] [PATCH] [IntelFsp2Pkg]: Fix GCC Compiler warning

2023-03-09 Thread Chiu, Chasel


Fix patch has been pushed with commit message typo and format correction: 
https://github.com/tianocore/edk2/commit/8820767fb3bad09eeedecc3030d75c9e0cd4cab7

Thanks,
Chasel


> -Original Message-
> From: S, Ashraf Ali 
> Sent: Thursday, March 9, 2023 8:06 AM
> To: devel@edk2.groups.io
> Cc: S, Ashraf Ali ; Chiu, Chasel 
> ;
> Desimone, Nathaniel L ; Chaganty, Rangasai
> V ; Zeng, Star 
> Subject: [PATCH] [IntelFsp2Pkg]: Fix GCC Compiler warning
> 
> Function defination should match with declaration.
> [-Wlto-type-mismatch]
> 
> Cc: Chasel Chiu 
> Cc: Nate DeSimone 
> Cc: Sai Chaganty 
> Cc: Star Zeng 
> 
> Signed-off-by: Ashraf Ali S 
> ---
>  IntelFsp2Pkg/Library/BaseFspPlatformLib/FspPlatformNotify.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/IntelFsp2Pkg/Library/BaseFspPlatformLib/FspPlatformNotify.c
> b/IntelFsp2Pkg/Library/BaseFspPlatformLib/FspPlatformNotify.c
> index 795bb28c0f..a5a51c804c 100644
> --- a/IntelFsp2Pkg/Library/BaseFspPlatformLib/FspPlatformNotify.c
> +++ b/IntelFsp2Pkg/Library/BaseFspPlatformLib/FspPlatformNotify.c
> @@ -296,6 +296,7 @@ FspTempRamExitDone2 (
> 
>  **/
>  VOID
> +EFIAPI
>  FspWaitForNotify (
>VOID
>)
> --
> 2.38.1.windows.1



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




Re: 回复: [edk2-devel] [PATCH] MdePkg/BaseCacheMaintenanceLib: RISC-V: Fix instruction cache not been invalidated

2023-03-09 Thread Sunil V L
On Fri, Mar 10, 2023 at 10:13:42AM +0800, gaoliming via groups.io wrote:
> Tuan:
> 
>  Can __FUNCTION__ be used? If yes, please still keep it. 
> 
Hi Liming,

I had suggested this. There are efforts to move to using __func__. 

https://edk2.groups.io/g/devel/message/99904

I think, we better start the culture of using  __func__ when
we have the opportunity.

Thanks,
Sunil




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




回复: [edk2-devel] [PATCH 1/1] MdePkg: Add DDR5 SPD defs to IndustryStandard per JESD400-5A.01

2023-03-09 Thread gaoliming via groups.io
Rebecca:
  Why new file name is not SdramSpdDdr5.h? 

Thanks
Liming
> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Rebecca Cran
> 发送时间: 2023年2月14日 23:37
> 收件人: Kinney, Michael D ;
> devel@edk2.groups.io; Gao, Liming 
> 抄送: 'Liming Gao' ; Liu, Zhiguang
> 
> 主题: Re: [edk2-devel] [PATCH 1/1] MdePkg: Add DDR5 SPD defs to
> IndustryStandard per JESD400-5A.01
> 
> On 2/10/23 11:01, Kinney, Michael D wrote:
> > We usually do not include basetype includes from .h files in
> Protocol/PPI/GUID/IndustryStandard.
> >
> > This is because we always get base types from AutoGen.h and from C/H files
> in modules/libs
> > That have to include top level include files for their module type. Base.h,
> PiPei.h, PiDxe,h, Uefi.h.
> >
> > Also UINT8 is available from Base.h that does not assume UEFI or PI env.
> 
> Thanks. I've sent out a v2 patch with the include line removed.
> 
> --
> Rebecca Cran
> 
> 
> 
> 
> 





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




[edk2-devel] 回复: [PATCH 0/3] BaseTools: Fix doc block location and formatting; run uncrustify

2023-03-09 Thread gaoliming via groups.io
Rebecca:
  I think these changes are good. Reviewed-by: Liming Gao


  Besides, which tool is used to convert function comments to Doxygen
format?

Thanks
Liming
> -邮件原件-
> 发件人: Rebecca Cran 
> 发送时间: 2023年2月25日 8:54
> 收件人: devel@edk2.groups.io; Bob Feng ; Liming
> Gao ; Yuwei Chen 
> 抄送: Rebecca Cran 
> 主题: [PATCH 0/3] BaseTools: Fix doc block location and formatting; run
> uncrustify
> 
> Fix the formatting and location of documentation blocks in
Source/C/Common,
> and replace the duplicate prototype of __PcdSet with __PcdGet. Those
> patches
> will fail CI because it appears Uncrustify was never run on BaseTools?
> 
> Patch 3/3 reformats the files in Source/C/Common according to
> Uncrustify.
> 
> Rebecca Cran (3):
>   BaseTools: Source/C/Common: Fix doc block locations and convert to
> Doxygen
>   BaseTools: Replace duplicate __PcdSet prototype with __PcdGet
>   BaseTools: Run Uncrustify over files in Source/C/Common
> 
>  BaseTools/Source/C/Common/BinderFuncs.h |   27 +-
>  BaseTools/Source/C/Common/CommonLib.h   |  267 ++--
>  BaseTools/Source/C/Common/Compress.h|   45 +-
>  BaseTools/Source/C/Common/Crc32.h   |   36 +-
>  BaseTools/Source/C/Common/Decompress.h  |  122 +-
>  BaseTools/Source/C/Common/EfiUtilityMsgs.h  |   38 +-
>  BaseTools/Source/C/Common/FirmwareVolumeBufferLib.h |  101 +-
>  BaseTools/Source/C/Common/FvLib.h   |   51 +-
>  BaseTools/Source/C/Common/MemoryFile.h  |   76 +-
>  BaseTools/Source/C/Common/MyAlloc.h |  196 +--
>  BaseTools/Source/C/Common/OsPath.h  |   92 +-
>  BaseTools/Source/C/Common/ParseGuidedSectionTools.h |  101 +-
>  BaseTools/Source/C/Common/ParseInf.h|  228 ++--
>  BaseTools/Source/C/Common/PcdValueCommon.h  |  196 +--
>  BaseTools/Source/C/Common/PeCoffLib.h   |   66 +-
>  BaseTools/Source/C/Common/SimpleFileParsing.h   |   24 +-
>  BaseTools/Source/C/Common/StringFuncs.h |  203 +--
>  BaseTools/Source/C/Common/WinNtInclude.h|   28 +-
>  BaseTools/Source/C/Common/BasePeCoff.c  | 1068
> +++
>  BaseTools/Source/C/Common/BinderFuncs.c |   31 +-
>  BaseTools/Source/C/Common/CommonLib.c   |  914
> ++---
>  BaseTools/Source/C/Common/Crc32.c   |   38 +-
>  BaseTools/Source/C/Common/Decompress.c  |  795
> +--
>  BaseTools/Source/C/Common/EfiCompress.c | 1189
> 
>  BaseTools/Source/C/Common/EfiUtilityMsgs.c  |  663 -
>  BaseTools/Source/C/Common/FirmwareVolumeBuffer.c| 1426
> 
>  BaseTools/Source/C/Common/FvLib.c   |  638
> -
>  BaseTools/Source/C/Common/MemoryFile.c  |  131 +-
>  BaseTools/Source/C/Common/MyAlloc.c |  265 ++--
>  BaseTools/Source/C/Common/OsPath.c  |  180 +--
>  BaseTools/Source/C/Common/ParseGuidedSectionTools.c |  142 +-
>  BaseTools/Source/C/Common/ParseInf.c|  401 +++---
>  BaseTools/Source/C/Common/PcdValueCommon.c  |  618
> -
>  BaseTools/Source/C/Common/PeCoffLoaderEx.c  |  277 ++--
>  BaseTools/Source/C/Common/SimpleFileParsing.c   |  737
> +-
>  BaseTools/Source/C/Common/StringFuncs.c |  310 ++---
>  BaseTools/Source/C/Common/TianoCompress.c   | 1075
> ++-
>  37 files changed, 5544 insertions(+), 7251 deletions(-)
> 
> --
> 2.37.1 (Apple Git-137.1)





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




[edk2-devel] 回复: [PATCH 1/1] MdePkg: Add new JedecJep106Lib to fetch JEDEC JEP106 manufacturer

2023-03-09 Thread gaoliming via groups.io
Rebecca:
  I add my comments below. 

> -邮件原件-
> 发件人: Rebecca Cran 
> 发送时间: 2023年2月15日 3:07
> 收件人: devel@edk2.groups.io; Michael D Kinney
> ; Liming Gao ;
> Zhiguang Liu 
> 抄送: Rebecca Cran 
> 主题: [PATCH 1/1] MdePkg: Add new JedecJep106Lib to fetch JEDEC JEP106
> manufacturer
> 
> Add a new library, JedecJep106Lib which provides a service to return the
> JEDEC JEP106 manufacturer string given the code and continuation bytes
> values.
> 
> Signed-off-by: Rebecca Cran 
> ---
>  MdePkg/MdePkg.dec|3 +
>  MdePkg/MdePkg.dsc|2 +
>  MdePkg/Library/JedecJep106Lib/JedecJep106Lib.inf |   25 +
>  MdePkg/Include/Library/JedecJep106Lib.h  |   39 +
>  MdePkg/Library/JedecJep106Lib/JedecJep106Lib.c   | 1862
> 
>  5 files changed, 1931 insertions(+)
> 
> diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
> index 3d08f20d15b0..af4f013c9b22 100644
> --- a/MdePkg/MdePkg.dec
> +++ b/MdePkg/MdePkg.dec
> @@ -257,6 +257,9 @@ [LibraryClasses]
>#
>UnitTestLib|Include/Library/UnitTestLib.h
> 
> +  ## @libraryclass Provides service to get the manufacturer given JEP106
> bytes.
> +  JedecJep106Lib|Include/Library/JedecJep106Lib.h
> +
>## @libraryclass Extension to BaseLib for host based unit tests that
allows
> a
>#subset of BaseLib services to be hooked for
> emulation.
>#
> diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc
> index 32a852dc466e..e41d4947db9e 100644
> --- a/MdePkg/MdePkg.dsc
> +++ b/MdePkg/MdePkg.dsc
> @@ -136,6 +136,8 @@ [Components]
>MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf
> 
> MdePkg/Library/SmmCpuRendezvousLibNull/SmmCpuRendezvousLibNull.inf
> 
> +  MdePkg/Library/JedecJep106Lib/JedecJep106Lib.inf
> +
>  [Components.IA32, Components.X64, Components.ARM,
> Components.AARCH64]
>#
># Add UEFI Target Based Unit Tests
> diff --git a/MdePkg/Library/JedecJep106Lib/JedecJep106Lib.inf
> b/MdePkg/Library/JedecJep106Lib/JedecJep106Lib.inf
> new file mode 100644
> index ..b49e2ba720fd
> --- /dev/null
> +++ b/MdePkg/Library/JedecJep106Lib/JedecJep106Lib.inf
> @@ -0,0 +1,25 @@
> +## @file
> +#  Instance of JEDEC JEP106 Library
> +#
> +#  JedecJep106Lib fetches the manufacturer string given the JEP106
> +#  Code and Continuation Bytes.
> +#
> +#  Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights
> reserved.
> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +##
> +
> +[Defines]
> +  INF_VERSION= 0x0001001d
> +  BASE_NAME  = JedecJep106Lib
> +  FILE_GUID  =
> d48d43d7-ba31-4463-9433-ccb233cf0df7
> +  MODULE_TYPE= BASE
> +  VERSION_STRING = 1.0
> +  LIBRARY_CLASS  = JedecJep106Lib
> +
> +[Sources]
> +  JedecJep106Lib.c
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> diff --git a/MdePkg/Include/Library/JedecJep106Lib.h
> b/MdePkg/Include/Library/JedecJep106Lib.h
> new file mode 100644
> index ..e40372330693
> --- /dev/null
> +++ b/MdePkg/Include/Library/JedecJep106Lib.h
> @@ -0,0 +1,39 @@
> +/** @file
> +  Provides JEDEC JEP-106 Manufacturer functions.
> +
> +  Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights
> reserved.
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef JEDEC_JEP106_LIB_H_
> +#define JEDEC_JEP106_LIB_H_
> +
> +/**
> +  Looks up the JEP-106 manufacturer.
> +
> +  @param Code  Last non-zero byte of the manufacturer's
> ID code.
> +  @param ContinuationBytes Number of continuation bytes indicated in
> JEP-106.
> +
> +  @return The manufacturer string, or NULL if an error occurred or the
> +  combination of Code and ContinuationBytes are not valid.
> +
> +**/
> +CONST CHAR8 *
> +Jep106GetManufacturerName (
> +  IN UINT8  Code,
> +  IN UINT8  ContinuationBytes
> +  );
> +
Library API needs EFIAPI. 

> +/**
> + Returns the length of the longest manufacturer name.
> +
> +@return The length of the longest manufacturer name.
> +
> +**/
> +UINTN
> +Jep106GetLongestManufacturerName (
> +  VOID
> +  );
> +
What usage is for this new API?

Thanks
Liming
> +#endif /* JEDEC_JEP106_LIB_H_ */
> diff --git a/MdePkg/Library/JedecJep106Lib/JedecJep106Lib.c
> b/MdePkg/Library/JedecJep106Lib/JedecJep106Lib.c
> new file mode 100644
> index ..eb832115d61d
> --- /dev/null
> +++ b/MdePkg/Library/JedecJep106Lib/JedecJep106Lib.c
> @@ -0,0 +1,1862 @@
> +/** @file
> +  Provides JEDEC JEP-106 Manufacturer functions.
> +
> +  Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights
reserved.
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include 
> +#include 
> +
> +typedef struct {
> +  UINT8  Code;
> +  CONST CHAR8*Manufacturer;
> +} JEDEC_MANUFACTURERS;
> +
> +// From JEP106BE, published Jan 2022.
> +STATIC CONST JEDEC_MANUFACTURERS  Jep106ManufacturersBank1[] = {
> +  { 0x01, "AMD" 

回复: [edk2-devel] [PATCH 1/2] MdePkg: Update Base.h to be compliant with C11

2023-03-09 Thread gaoliming via groups.io
Rebecca:
  This patch pass code review. It can be merged now. The second change to using 
__func__ is only for MdePkg. Do you expect the change in MdePkg is first merged?

Thanks
Liming
> -邮件原件-
> 发件人: Rebecca Cran 
> 发送时间: 2023年3月7日 0:39
> 收件人: devel@edk2.groups.io; quic_rc...@quicinc.com; Michael D Kinney
> ; Liming Gao ;
> Zhiguang Liu 
> 主题: Re: [edk2-devel] [PATCH 1/2] MdePkg: Update Base.h to be compliant
> with C11
> 
> Now that edk2-stable202302 has been released, I'd like to get this patch
> series committed.
> 
> 
> --
> Rebecca Cran
> 
> 
> On 2/9/23 8:45 AM, Rebecca Cran wrote:
> > With the introduction of the use of _Static_assert, edk2 requires a C11
> > compatible compiler. Update Include/Base.h to be compliant with C11.
> >
> > As of C11, the maximum type of an enum is type `int`. Since the UEFI
> > Specification 2.3.1 Errata C allows either `int` or `unsigned int`, fix
> > the 32-bit enum check to use a signed int.
> >
> > Since the UEFI 2.3 Specification only allowed signed int, update the
> > comment to reference 2.3.1 Errata C where the change was made to allow
> > unsigned int.
> >
> > Signed-off-by: Rebecca Cran 
> > ---
> >   MdePkg/Include/Base.h | 12 ++--
> >   1 file changed, 6 insertions(+), 6 deletions(-)
> >
> > diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
> > index d209e6de280a..e89c84962ab2 100644
> > --- a/MdePkg/Include/Base.h
> > +++ b/MdePkg/Include/Base.h
> > @@ -796,9 +796,9 @@ STATIC_ASSERT (sizeof (L"A")== 4, "sizeof
> (L\"A\") does not meet UEFI Specif
> >   //
> >   // The following three enum types are used to verify that the compiler
> >   // configuration for enum types is compliant with Section 2.3.1 of the
> > -// UEFI 2.3 Specification. These enum types and enum values are not
> > -// intended to be used. A prefix of '__' is used avoid conflicts with
> > -// other types.
> > +// UEFI 2.3.1 Errata C Specification. These enum types and enum values
> > +// are not intended to be used. A prefix of '__' is used avoid
> > +// conflicts with other types.
> >   //
> >   typedef enum {
> > __VerifyUint8EnumValue = 0xff
> > @@ -809,12 +809,12 @@ typedef enum {
> >   } __VERIFY_UINT16_ENUM_SIZE;
> >
> >   typedef enum {
> > -  __VerifyUint32EnumValue = 0x
> > -} __VERIFY_UINT32_ENUM_SIZE;
> > +  __VerifyInt32EnumValue = 0x7fff
> > +} __VERIFY_INT32_ENUM_SIZE;
> >
> >   STATIC_ASSERT (sizeof (__VERIFY_UINT8_ENUM_SIZE) == 4, "Size of
> enum does not meet UEFI Specification Data Type requirements");
> >   STATIC_ASSERT (sizeof (__VERIFY_UINT16_ENUM_SIZE) == 4, "Size of
> enum does not meet UEFI Specification Data Type requirements");
> > -STATIC_ASSERT (sizeof (__VERIFY_UINT32_ENUM_SIZE) == 4, "Size of
> enum does not meet UEFI Specification Data Type requirements");
> > +STATIC_ASSERT (sizeof (__VERIFY_INT32_ENUM_SIZE) == 4, "Size of enum
> does not meet UEFI Specification Data Type requirements");
> >
> >   /**
> > Macro that returns a pointer to the data structure that contains a
> specified field of




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




回复: [edk2-devel] PATCH v3 0/3 Add xterm resize support to OVMF

2023-03-09 Thread gaoliming via groups.io
Pawel:
  The change in MdeModulePkg looks good to me. Reviewed-by: Liming Gao 


Thanks
Liming
> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Pawe?
> Po?awski
> 发送时间: 2023年2月17日 21:02
> 收件人: devel@edk2.groups.io
> 主题: [edk2-devel] PATCH v3 0/3 Add xterm resize support to OVMF
> 
> This set of patches adds xterm resize sequences support to OvmfPkg
> and ArmVirtPkg. This way firmware will be able to sent resize
> requests to user terminal (gnome-terminal, xterm, xfce4-terminal).
> 
> To test this feature you can use a new configuration option:
> -fw_cfg name=opt/org.tianocore/PcdResizeXterm,string=1
> 
> Laszlo Ersek (3):
>   MdeModulePkg: TerminalDxe: set xterm resolution on mode change
>   ArmVirtPkg: take PcdResizeXterm from the QEMU command line
>   OvmfPkg: take PcdResizeXterm from the QEMU command line
> 
>  MdeModulePkg/MdeModulePkg.dec
> |  4 ++
>  ArmVirtPkg/ArmVirtQemu.dsc
> |  7 +++-
>  OvmfPkg/AmdSev/AmdSevX64.dsc
> |  6 ++-
>  OvmfPkg/CloudHv/CloudHvX64.dsc
> |  6 ++-
>  OvmfPkg/IntelTdx/IntelTdxX64.dsc
> |  6 ++-
>  OvmfPkg/Microvm/MicrovmX64.dsc
> |  6 ++-
>  OvmfPkg/OvmfPkgIa32.dsc
> |  6 ++-
>  OvmfPkg/OvmfPkgIa32X64.dsc
> |  6 ++-
>  OvmfPkg/OvmfPkgX64.dsc
> |  6 ++-
>  MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf|
> 2 +
>  OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf | 33
> 
>  OvmfPkg/PlatformPei/PlatformPei.inf
> |  1 +
>  MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
> | 29 ++
>  OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.c   |
> 41 
>  14 files changed, 151 insertions(+), 8 deletions(-)
>  create mode 100644
> OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf
>  create mode 100644
> OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.c
> 
> --
> 2.39.1
> 
> 
> 
> 
> 





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




回复: [edk2-devel] GetSectionFromAnyFv doesnt find file from FV

2023-03-09 Thread gaoliming via groups.io
FVMAIN_COMPACT is not reported to DXE. So, it can’t be found in DXE phase. 

 

Thanks

Liming

发件人: devel@edk2.groups.io  代表 Alireza Banejad
发送时间: 2023年3月2日 20:16
收件人: devel@edk2.groups.io; alibanejad1...@gmail.com
主题: Re: [edk2-devel] GetSectionFromAnyFv doesnt find file from FV

 

So, I managed to solve this issue by adding my file to the [FV.DXEFV] section. 
I don't know why my files aren't found when I add them in [FV.FVMAIN_COMPACT] 
section.

 

 

On Thu, Mar 2, 2023 at 3:16 PM Alireza Banejad via groups.io  
 mailto:gmail@groups.io> > wrote:

Any thoughts?

 

On Tue, Feb 28, 2023 at 3:32 PM Alireza Banejad via groups.io 
  mailto:gmail@groups.io> > wrote:

Hi everyone,

I have this bmp file which I defined in the FV.FVMAIN_COMPACT section of the 
OvmfPkgX64.fdf file. when I get the a hexdump on the built firmware (OVMF.fd) I 
can see the file inside it. but whenever I call the the GetSectionFromAnyFv() 
function from a Application it fails to find the file.

This is how I defined the file in OvmfX64.fdf:



[FV.FVMAIN_COMPACT]
FvNameGuid = 48DB5E17-707C-472D-91CD-1613E7EF51B0
FvAlignment= 16
ERASE_POLARITY = 1
MEMORY_MAPPED  = TRUE
STICKY_WRITE   = TRUE
LOCK_CAP   = TRUE
LOCK_STATUS= TRUE
WRITE_DISABLED_CAP = TRUE
WRITE_ENABLED_CAP  = TRUE
WRITE_STATUS   = TRUE
WRITE_LOCK_CAP = TRUE
WRITE_LOCK_STATUS  = TRUE
READ_DISABLED_CAP  = TRUE
READ_ENABLED_CAP   = TRUE
READ_STATUS= TRUE
READ_LOCK_CAP  = TRUE
READ_LOCK_STATUS   = TRUE




FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {
   SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = 
TRUE {
 #
 # These firmware volumes will have files placed in them uncompressed,
 # and then both firmware volumes will be compressed in a single
 # compression operation in order to achieve better overall compression.
 #
 SECTION FV_IMAGE = PEIFV
 SECTION FV_IMAGE = DXEFV
   }
 }
  FILE FREEFORM = AFDAEAB5-3F81-4E93-8EE3-228434BA283D {
SECTION RAW = OemPkg/FrontPage/Resources/FrontpageLogo.bmp
  }



!include FvmainCompactScratchEnd.fdf.inc

__

 

and this is how I am using the GetSectionFromAnyFv() function:

  Status = GetSectionFromAnyFv (
 FileGuid,
 EFI_SECTION_RAW,
 0,
 (VOID **),
 
 );

So there's nothing much to it, yet I still don't know why it fails to find the 
file. I also must mention that I checked the GUID being passed to the function 
and the GUID of the file, they are both the same. I still don't know what's 
going on





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




回复: [edk2-devel] [PATCH 1/3] MdeModulePkg/BmBoot: Skip removable media if it is not present

2023-03-09 Thread gaoliming via groups.io
PR https://github.com/tianocore/edk2/pull/4127 is created for this patch. 

 

Thanks

Liming

发件人: devel@edk2.groups.io  代表 gaoliming via groups.io
发送时间: 2023年3月9日 8:55
收件人: devel@edk2.groups.io; ray...@intel.com; 'Tan, Lean Sheng' 

抄送: 'Wang, Jian J' 
主题: 回复: [edk2-devel] [PATCH 1/3] MdeModulePkg/BmBoot: Skip removable media if 
it is not present

 

Ray:

 You also have access to merge the patch. Sure, I can help merge this patch. 

 

Thanks

Liming

发件人: devel@edk2.groups.io   mailto:devel@edk2.groups.io> > 代表 Ni, Ray
发送时间: 2023年3月8日 16:58
收件人: devel@edk2.groups.io  ; Tan, Lean Sheng 
mailto:sheng@9elements.com> >
抄送: Wang, Jian J mailto:jian.j.w...@intel.com> >; Gao, 
Liming mailto:gaolim...@byosoft.com.cn> >
主题: Re: [edk2-devel] [PATCH 1/3] MdeModulePkg/BmBoot: Skip removable media if 
it is not present

 

M: Jian J Wang jian.j.w...@intel.com   [jwang36]

M: Liming Gao gaolim...@byosoft.com.cn   
[lgao4]

 

Jian and Liming are maintainers of MdeModulePkg.

The patch passed my review. Either of them can help to merge the patch.

 

I guess Liming might not see this patch. I am sure he can help on merging it.

 

 

Thanks,

Ray

 

From: devel@edk2.groups.io   mailto:devel@edk2.groups.io> > On Behalf Of Sheng Lean Tan
Sent: Wednesday, March 8, 2023 4:55 PM
To: Tan, Lean Sheng mailto:sheng@9elements.com> 
>; devel@edk2.groups.io  
Subject: Re: [edk2-devel] [PATCH 1/3] MdeModulePkg/BmBoot: Skip removable media 
if it is not present

 

Seriously, what is the hold up here?
did Sean not following the process? Did he miss anything?
it just doesn’t make sense to keep ignoring this patch for half year for no 
reason. Is there a way to voice up a about this? 





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




[edk2-devel] 回复: [Patch V3 1/2] MdePkg: modify the wrong 'AcpiId' to 'ApicId' in MpWakeupStructure

2023-03-09 Thread gaoliming via groups.io
Dun:
  Is there any code impact with this change?

Thanks
Liming
> -邮件原件-
> 发件人: Dun Tan 
> 发送时间: 2023年3月9日 11:40
> 收件人: devel@edk2.groups.io
> 抄送: Michael D Kinney ; Liming Gao
> ; Zhiguang Liu 
> 主题: [Patch V3 1/2] MdePkg: modify the wrong 'AcpiId' to 'ApicId' in
> MpWakeupStructure
> 
> modify the wrong 'AcpiId' to 'ApicId' of MpWakeupStructure defination
> in Acpi64.h.
> 
> Signed-off-by: Dun Tan 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Reviewed-by: Zhiguang Liu 
> ---
>  MdePkg/Include/IndustryStandard/Acpi64.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/MdePkg/Include/IndustryStandard/Acpi64.h
> b/MdePkg/Include/IndustryStandard/Acpi64.h
> index fe5ebfac2b..bfd022b6b6 100644
> --- a/MdePkg/Include/IndustryStandard/Acpi64.h
> +++ b/MdePkg/Include/IndustryStandard/Acpi64.h
> @@ -607,7 +607,7 @@ typedef struct {
>  typedef struct {
>UINT16Command;
>UINT16Reserved;
> -  UINT32AcpiId;
> +  UINT32ApicId;
>UINT64WakeupVector;
>UINT8 ReservedForOs[2032];
>UINT8 ReservedForFirmware[2048];
> --
> 2.31.1.windows.1





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




回复: [edk2-devel] [PATCH] MdePkg/BaseCacheMaintenanceLib: RISC-V: Fix instruction cache not been invalidated

2023-03-09 Thread gaoliming via groups.io
Tuan:

 Can __FUNCTION__ be used? If yes, please still keep it. 

 

Thanks

Liming

发件人: devel@edk2.groups.io  代表 Tuan Phan
发送时间: 2023年3月10日 3:19
收件人: devel@edk2.groups.io
抄送: michael.d.kin...@intel.com; gaolim...@byosoft.com.cn; 
zhiguang@intel.com; suni...@ventanamicro.com; g...@danielschaefer.me
主题: Re: [edk2-devel] [PATCH] MdePkg/BaseCacheMaintenanceLib: RISC-V: Fix 
instruction cache not been invalidated

 

Hi All,

Any updates on this patch?

 

Thanks,

 

From: Tuan Phan via groups.io  
Sent: Monday, March 6, 2023 9:11 AM
To: devel@edk2.groups.io  
Cc: michael.d.kin...@intel.com  ; 
gaolim...@byosoft.com.cn  ; 
zhiguang@intel.com  ; 
suni...@ventanamicro.com  ; 
g...@danielschaefer.me  ; Tuan Phan 
 
Subject: [edk2-devel] [PATCH] MdePkg/BaseCacheMaintenanceLib: RISC-V: Fix 
instruction cache not been invalidated

 

When the range instruction cache invalidating not supported, the whole

instruction cache should be invalidated instead.

 

Signed-off-by: Tuan Phan mailto:tp...@ventanamicro.com> >

---

MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c | 5 -

1 file changed, 4 insertions(+), 1 deletion(-)

 

diff --git a/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c 
b/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c

index 67a3387ff3c6..a744b2a6f889 100644

--- a/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c

+++ b/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c

@@ -76,7 +76,10 @@ InvalidateInstructionCacheRange (

   IN UINTN  Length

 

   )

 

{

 

-  DEBUG ((DEBUG_ERROR, "%a:RISC-V unsupported function.\n", __FUNCTION__));

 

+  DEBUG ((DEBUG_WARN,

 

+  "%a:RISC-V unsupported function.\n"

 

+  "Invalidating the whole instruction cache instead.\n", __func__));

 

+  InvalidateInstructionCache ();

 

   return Address;

 

}

 

 

-- 

2.25.1

 

 

 

-=-=-=-=-=-=

Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#100744): https://edk2.groups.io/g/devel/message/100744

Mute This Topic: https://groups.io/mt/97429987/7027451

Group Owner: devel+ow...@edk2.groups.io  

Unsubscribe: https://edk2.groups.io/g/devel/unsub [tp...@ventanamicro.com]

-=-=-=-=-=-=

 

 

 





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




Re: [edk2-devel] [PATCH] [IntelFsp2Pkg]: Fix GCC Compiler warning

2023-03-09 Thread Zeng, Star
Reviewed-by: Star Zeng  with typo defination -> definition 
fixed in commit message.

-Original Message-
From: Chaganty, Rangasai V  
Sent: Friday, March 10, 2023 8:27 AM
To: S, Ashraf Ali ; devel@edk2.groups.io
Cc: Chiu, Chasel ; Desimone, Nathaniel L 
; Zeng, Star 
Subject: RE: [PATCH] [IntelFsp2Pkg]: Fix GCC Compiler warning

Reviewed-by: Sai Chaganty 

-Original Message-
From: S, Ashraf Ali  
Sent: Thursday, March 09, 2023 8:06 AM
To: devel@edk2.groups.io
Cc: S, Ashraf Ali ; Chiu, Chasel 
; Desimone, Nathaniel L 
; Chaganty, Rangasai V 
; Zeng, Star 
Subject: [PATCH] [IntelFsp2Pkg]: Fix GCC Compiler warning

Function defination should match with declaration.
[-Wlto-type-mismatch]

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Sai Chaganty 
Cc: Star Zeng 

Signed-off-by: Ashraf Ali S 
---
 IntelFsp2Pkg/Library/BaseFspPlatformLib/FspPlatformNotify.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/IntelFsp2Pkg/Library/BaseFspPlatformLib/FspPlatformNotify.c 
b/IntelFsp2Pkg/Library/BaseFspPlatformLib/FspPlatformNotify.c
index 795bb28c0f..a5a51c804c 100644
--- a/IntelFsp2Pkg/Library/BaseFspPlatformLib/FspPlatformNotify.c
+++ b/IntelFsp2Pkg/Library/BaseFspPlatformLib/FspPlatformNotify.c
@@ -296,6 +296,7 @@ FspTempRamExitDone2 (
 
 **/
 VOID
+EFIAPI
 FspWaitForNotify (
   VOID
   )
-- 
2.38.1.windows.1



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




Re: [edk2-devel] [PATCH] [IntelFsp2Pkg]: Fix GCC Compiler warning

2023-03-09 Thread Chaganty, Rangasai V
Reviewed-by: Sai Chaganty 

-Original Message-
From: S, Ashraf Ali  
Sent: Thursday, March 09, 2023 8:06 AM
To: devel@edk2.groups.io
Cc: S, Ashraf Ali ; Chiu, Chasel 
; Desimone, Nathaniel L 
; Chaganty, Rangasai V 
; Zeng, Star 
Subject: [PATCH] [IntelFsp2Pkg]: Fix GCC Compiler warning

Function defination should match with declaration.
[-Wlto-type-mismatch]

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Sai Chaganty 
Cc: Star Zeng 

Signed-off-by: Ashraf Ali S 
---
 IntelFsp2Pkg/Library/BaseFspPlatformLib/FspPlatformNotify.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/IntelFsp2Pkg/Library/BaseFspPlatformLib/FspPlatformNotify.c 
b/IntelFsp2Pkg/Library/BaseFspPlatformLib/FspPlatformNotify.c
index 795bb28c0f..a5a51c804c 100644
--- a/IntelFsp2Pkg/Library/BaseFspPlatformLib/FspPlatformNotify.c
+++ b/IntelFsp2Pkg/Library/BaseFspPlatformLib/FspPlatformNotify.c
@@ -296,6 +296,7 @@ FspTempRamExitDone2 (
 
 **/
 VOID
+EFIAPI
 FspWaitForNotify (
   VOID
   )
-- 
2.38.1.windows.1



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




Re: [edk2-devel] [PATCH] [IntelFsp2Pkg]: Fix GCC Compiler warning

2023-03-09 Thread Nate DeSimone
Reviewed-by: Nate DeSimone 

-Original Message-
From: S, Ashraf Ali  
Sent: Thursday, March 9, 2023 8:06 AM
To: devel@edk2.groups.io
Cc: S, Ashraf Ali ; Chiu, Chasel 
; Desimone, Nathaniel L 
; Chaganty, Rangasai V 
; Zeng, Star 
Subject: [PATCH] [IntelFsp2Pkg]: Fix GCC Compiler warning

Function defination should match with declaration.
[-Wlto-type-mismatch]

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Sai Chaganty 
Cc: Star Zeng 

Signed-off-by: Ashraf Ali S 
---
 IntelFsp2Pkg/Library/BaseFspPlatformLib/FspPlatformNotify.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/IntelFsp2Pkg/Library/BaseFspPlatformLib/FspPlatformNotify.c 
b/IntelFsp2Pkg/Library/BaseFspPlatformLib/FspPlatformNotify.c
index 795bb28c0f..a5a51c804c 100644
--- a/IntelFsp2Pkg/Library/BaseFspPlatformLib/FspPlatformNotify.c
+++ b/IntelFsp2Pkg/Library/BaseFspPlatformLib/FspPlatformNotify.c
@@ -296,6 +296,7 @@ FspTempRamExitDone2 (
 
 **/
 VOID
+EFIAPI
 FspWaitForNotify (
   VOID
   )
-- 
2.38.1.windows.1



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




Re: [edk2-devel] [PATCH 0/7] RISC-V: Add MMU support

2023-03-09 Thread Andrei Warkentin
Hi Tuan,

Could you share a GitHub link to a branch with the patch set? Somehow my email 
client is mangling one of your patches where it’s all one giant line of code.

A

From: Tuan Phan 
Sent: Thursday, March 9, 2023 1:20 PM
To: devel@edk2.groups.io
Cc: Kinney, Michael D ; Gao, Liming 
; Liu, Zhiguang ; 
suni...@ventanamicro.com; g...@danielschaefer.me; Warkentin, Andrei 

Subject: RE: [PATCH 0/7] RISC-V: Add MMU support

Hi All,
Any updates on this series?

Thanks,

From: Tuan Phan
Sent: Monday, March 6, 2023 9:33 AM
To: devel@edk2.groups.io
Cc: michael.d.kin...@intel.com; 
gaolim...@byosoft.com.cn; 
zhiguang@intel.com; 
suni...@ventanamicro.com; 
g...@danielschaefer.me; 
andrei.warken...@intel.com; Tuan 
Phan
Subject: [PATCH 0/7] RISC-V: Add MMU support

This series adds MMU support for RISC-V. Only SV39/48/57 modes
are supported and tested. The MMU is required to support setting
page attribute which is the first basic step to support security
booting on RISC-V.

There are three parts:
1. Add MMU core to UefiCpuPkg. MMU will be enabled during
CpuDxe initialization.
2. Fix OvmfPkg/VirtNorFlashDxe that failed to add flash base
address to GCD if already done.
3. Enable MMU for RiscVVirt platform and populating its device
resources in SEC phase. All resources should be populated in HOB
or added to GCD by driver before accessing them when MMU enabled.

Tuan Phan (7):
  MdePkg/BaseLib: RISC-V: Support getting satp register value
  MdePkg/Register: RISC-V: Add satp mode bits shift definition
  UefiCpuPkg: RISC-V: Support MMU with SV39/48/57 mode
  OvmfPkg/RiscVVirt: VirtNorFlashPlatformLib: Fix wrong flash size
  OvmfPkg/VirtNorFlashDxe: Not add memory space if it exists
  OvmfPkg/RiscVVirt: SEC: Add IO memory resource hob for platform
devices
  OvmfPkg/RiscVVirt: Enable MMU with SV39 mode

MdePkg/Include/Library/BaseLib.h  |   5 +
.../Include/Register/RiscV64/RiscVEncoding.h  |   7 +-
MdePkg/Library/BaseLib/RiscV64/RiscVMmu.S |   8 +
.../VirtNorFlashStaticLib.c   |   3 +-
OvmfPkg/RiscVVirt/RiscVVirt.dsc.inc   |   1 +
OvmfPkg/RiscVVirt/Sec/Memory.c|  17 -
OvmfPkg/RiscVVirt/Sec/Platform.c  |  62 +++
OvmfPkg/RiscVVirt/Sec/SecMain.inf |   1 +
OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.c |  25 +-
UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c |  10 +-
UefiCpuPkg/CpuDxeRiscV64/CpuDxe.h |   1 +
UefiCpuPkg/CpuDxeRiscV64/CpuDxeRiscV64.inf|   5 +
UefiCpuPkg/CpuDxeRiscV64/Mmu.c| 493 ++
UefiCpuPkg/CpuDxeRiscV64/Mmu.h|  33 ++
UefiCpuPkg/CpuDxeRiscV64/MmuCore.S|  29 ++
UefiCpuPkg/UefiCpuPkg.dec |   8 +
16 files changed, 676 insertions(+), 32 deletions(-)
create mode 100644 UefiCpuPkg/CpuDxeRiscV64/Mmu.c
create mode 100644 UefiCpuPkg/CpuDxeRiscV64/Mmu.h
create mode 100644 UefiCpuPkg/CpuDxeRiscV64/MmuCore.S

--
2.25.1




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




[edk2-devel] [PATCH v1 1/1] Define security policy in SECURITY.md file for repository

2023-03-09 Thread Kun Qin
From: Sean Brogan 

Create SECURITY.md security policy for tianocore edk2 leveraging CVD and
the Github Private Vulnerability Reporting process.

Co-authored-by: Sean Brogan 
Signed-off-by: Kun Qin 
---
 SECURITY.md | 33 
 1 file changed, 33 insertions(+)

diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index ..bef046e91aa1
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,33 @@
+# Security Policy
+
+Tianocore Edk2 is an open source firmware project that is leveraged by and 
combined into other projects to build the firmware for a given product.
+We build and maintain edk2 knowing that there are many downstream repositories 
and projects that derive or inherit significant code from this project.
+But, that said, in the firmware ecosystem there is a lot of variation and 
differentiation, and the license in this project allows
+flexibility for use without contribution back to Edk2. Therefore, any issues 
found here may or may not exist in products derived from Edk2.
+
+## Supported Versions
+
+Due to the usage model we generally only supply fixes to the master branch. If 
requested we may generate a release branch from a stable
+tag and apply patches but given our downstream consumption model this is 
generally not necessary.
+
+## Reporting a Vulnerability
+
+Please do not report security vulnerabilities through public GitHub issues or 
bugzilla.
+
+Instead please use Github Private vulnerability reporting, which is enabled 
for the edk2 repository.
+This process is well documented by github in their documentation
+[here](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability).
+
+This process will allow us to privately discuss the issue, collaborate on a 
solution, and then disclose the vulnerability.
+
+## Preferred Languages
+
+We prefer all communications to be in English.
+
+## Policy
+
+Tianocore Edk2 follows the principle of Coordinated Vulnerability Disclosure.
+More information is available here:
+
+* [ISO/IEC 29147:2018 on Vulnerability 
Disclosure](https://www.iso.org/standard/72311.html)
+* [The CERT Guide to Coordinated Vulnerability 
Disclosure](https://resources.sei.cmu.edu/asset_files/SpecialReport/2017_003_001_503340.pdf)
-- 
2.37.1.windows.1



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




[edk2-devel] [PATCH v1 0/1] Define security policy in SECURITY.md file for repository

2023-03-09 Thread Kun Qin
This change added a markdown file as a policy guideline for Tianocore EDK2
community to handle security sensitive reports.

Patch v1 branch: https://github.com/kuqin12/edk2/tree/patch-1

Cc: Andrew Fish 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Miki Demeter 
Cc: Sean Brogan 

Sean Brogan (1):
  Define security policy in SECURITY.md file for repository

 SECURITY.md | 33 
 1 file changed, 33 insertions(+)
 create mode 100644 SECURITY.md

-- 
2.37.1.windows.1



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




Re: [edk2-devel] [PATCH 0/7] RISC-V: Add MMU support

2023-03-09 Thread Tuan Phan
Hi All,Any updates on this series? Thanks, From: Tuan PhanSent: Monday, March 6, 2023 9:33 AMTo: devel@edk2.groups.ioCc: michael.d.kin...@intel.com; gaolim...@byosoft.com.cn; zhiguang@intel.com; suni...@ventanamicro.com; g...@danielschaefer.me; andrei.warken...@intel.com; Tuan PhanSubject: [PATCH 0/7] RISC-V: Add MMU support This series adds MMU support for RISC-V. Only SV39/48/57 modesare supported and tested. The MMU is required to support settingpage attribute which is the first basic step to support securitybooting on RISC-V. There are three parts:1. Add MMU core to UefiCpuPkg. MMU will be enabled duringCpuDxe initialization.2. Fix OvmfPkg/VirtNorFlashDxe that failed to add flash baseaddress to GCD if already done.3. Enable MMU for RiscVVirt platform and populating its deviceresources in SEC phase. All resources should be populated in HOBor added to GCD by driver before accessing them when MMU enabled. Tuan Phan (7):  MdePkg/BaseLib: RISC-V: Support getting satp register value  MdePkg/Register: RISC-V: Add satp mode bits shift definition  UefiCpuPkg: RISC-V: Support MMU with SV39/48/57 mode  OvmfPkg/RiscVVirt: VirtNorFlashPlatformLib: Fix wrong flash size  OvmfPkg/VirtNorFlashDxe: Not add memory space if it exists  OvmfPkg/RiscVVirt: SEC: Add IO memory resource hob for platform    devices  OvmfPkg/RiscVVirt: Enable MMU with SV39 mode  MdePkg/Include/Library/BaseLib.h  |   5 + .../Include/Register/RiscV64/RiscVEncoding.h  |   7 +- MdePkg/Library/BaseLib/RiscV64/RiscVMmu.S |   8 + .../VirtNorFlashStaticLib.c   |   3 +- OvmfPkg/RiscVVirt/RiscVVirt.dsc.inc   |   1 + OvmfPkg/RiscVVirt/Sec/Memory.c    |  17 - OvmfPkg/RiscVVirt/Sec/Platform.c  |  62 +++ OvmfPkg/RiscVVirt/Sec/SecMain.inf |   1 + OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.c |  25 +- UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c |  10 +- UefiCpuPkg/CpuDxeRiscV64/CpuDxe.h |   1 + UefiCpuPkg/CpuDxeRiscV64/CpuDxeRiscV64.inf    |   5 + UefiCpuPkg/CpuDxeRiscV64/Mmu.c    | 493 ++ UefiCpuPkg/CpuDxeRiscV64/Mmu.h    |  33 ++ UefiCpuPkg/CpuDxeRiscV64/MmuCore.S    |  29 ++ UefiCpuPkg/UefiCpuPkg.dec |   8 + 16 files changed, 676 insertions(+), 32 deletions(-) create mode 100644 UefiCpuPkg/CpuDxeRiscV64/Mmu.c create mode 100644 UefiCpuPkg/CpuDxeRiscV64/Mmu.h create mode 100644 UefiCpuPkg/CpuDxeRiscV64/MmuCore.S -- 2.25.1  


_._,_._,_



Groups.io Links:


  
You receive all messages sent to this group.
  
  



View/Reply Online (#100962) |


  

|

  Mute This Topic

| New Topic




Your Subscription |
Contact Group Owner |

Unsubscribe

 [arch...@mail-archive.com]
_._,_._,_



Re: [edk2-devel] [PATCH] MdePkg/BaseCacheMaintenanceLib: RISC-V: Fix instruction cache not been invalidated

2023-03-09 Thread Tuan Phan
Hi All,Any updates on this patch? Thanks, From: Tuan Phan via groups.ioSent: Monday, March 6, 2023 9:11 AMTo: devel@edk2.groups.ioCc: michael.d.kin...@intel.com; gaolim...@byosoft.com.cn; zhiguang@intel.com; suni...@ventanamicro.com; g...@danielschaefer.me; Tuan PhanSubject: [edk2-devel] [PATCH] MdePkg/BaseCacheMaintenanceLib: RISC-V: Fix instruction cache not been invalidated When the range instruction cache invalidating not supported, the wholeinstruction cache should be invalidated instead. Signed-off-by: Tuan Phan --- MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c b/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.cindex 67a3387ff3c6..a744b2a6f889 100644--- a/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c+++ b/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c@@ -76,7 +76,10 @@ InvalidateInstructionCacheRange (   IN UINTN  Length    )  { -  DEBUG ((DEBUG_ERROR, "%a:RISC-V unsupported function.\n", __FUNCTION__)); +  DEBUG ((DEBUG_WARN, +  "%a:RISC-V unsupported function.\n" +  "Invalidating the whole instruction cache instead.\n", __func__)); +  InvalidateInstructionCache ();    return Address;  }   -- 2.25.1   -=-=-=-=-=-=Groups.io Links: You receive all messages sent to this group.View/Reply Online (#100744): https://edk2.groups.io/g/devel/message/100744Mute This Topic: https://groups.io/mt/97429987/7027451Group Owner: devel+ow...@edk2.groups.ioUnsubscribe: https://edk2.groups.io/g/devel/unsub [tp...@ventanamicro.com]-=-=-=-=-=-=   


_._,_._,_



Groups.io Links:


  
You receive all messages sent to this group.
  
  



View/Reply Online (#100961) |


  

|

  Mute This Topic

| New Topic




Your Subscription |
Contact Group Owner |

Unsubscribe

 [arch...@mail-archive.com]
_._,_._,_



Re: [edk2-devel] [PATCH] Maintainers: Add 'Yuwei Chen' as BaseTools maintainer.

2023-03-09 Thread Michael D Kinney
Reviewed-by: Michael D Kinney 

> -Original Message-
> From: Chen, Christine 
> Sent: Wednesday, March 8, 2023 6:55 PM
> To: devel@edk2.groups.io
> Cc: Kinney, Michael D ; Feng, Bob C 
> ; Gao, Liming
> 
> Subject: [PATCH] Maintainers: Add 'Yuwei Chen' as BaseTools maintainer.
> 
> Add myself as maintainer for the BaseTools Pkg.
> 
> Cc: Michael D Kinney 
> Cc: Bob Feng 
> Cc: Liming Gao 
> Signed-off-by: Yuwei Chen 
> ---
>  Maintainers.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt
> index d4607a..463d9567e1 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -179,7 +179,7 @@ F: BaseTools/
>  W: https://github.com/tianocore/tianocore.github.io/wiki/BaseTools
>  M: Bob Feng  [BobCF]
>  M: Liming Gao  [lgao4]
> -R: Yuwei Chen  [YuweiChen1110]
> +M: Yuwei Chen  [YuweiChen1110]
> 
>  CryptoPkg
>  F: CryptoPkg/
> --
> 2.39.1.windows.1



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




Re: [edk2-devel] [PATCH] [IntelFsp2Pkg]: Fix GCC Compiler warning

2023-03-09 Thread Chiu, Chasel


Thanks for fixing this bug! 
Reviewed-by: Chasel Chiu 



> -Original Message-
> From: S, Ashraf Ali 
> Sent: Thursday, March 9, 2023 8:06 AM
> To: devel@edk2.groups.io
> Cc: S, Ashraf Ali ; Chiu, Chasel 
> ;
> Desimone, Nathaniel L ; Chaganty, Rangasai
> V ; Zeng, Star 
> Subject: [PATCH] [IntelFsp2Pkg]: Fix GCC Compiler warning
> 
> Function defination should match with declaration.
> [-Wlto-type-mismatch]
> 
> Cc: Chasel Chiu 
> Cc: Nate DeSimone 
> Cc: Sai Chaganty 
> Cc: Star Zeng 
> 
> Signed-off-by: Ashraf Ali S 
> ---
>  IntelFsp2Pkg/Library/BaseFspPlatformLib/FspPlatformNotify.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/IntelFsp2Pkg/Library/BaseFspPlatformLib/FspPlatformNotify.c
> b/IntelFsp2Pkg/Library/BaseFspPlatformLib/FspPlatformNotify.c
> index 795bb28c0f..a5a51c804c 100644
> --- a/IntelFsp2Pkg/Library/BaseFspPlatformLib/FspPlatformNotify.c
> +++ b/IntelFsp2Pkg/Library/BaseFspPlatformLib/FspPlatformNotify.c
> @@ -296,6 +296,7 @@ FspTempRamExitDone2 (
> 
>  **/
>  VOID
> +EFIAPI
>  FspWaitForNotify (
>VOID
>)
> --
> 2.38.1.windows.1



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




[edk2-devel] [PATCH] [IntelFsp2Pkg]: Fix GCC Compiler warning

2023-03-09 Thread Ashraf Ali S
Function defination should match with declaration.
[-Wlto-type-mismatch]

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Sai Chaganty 
Cc: Star Zeng 

Signed-off-by: Ashraf Ali S 
---
 IntelFsp2Pkg/Library/BaseFspPlatformLib/FspPlatformNotify.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/IntelFsp2Pkg/Library/BaseFspPlatformLib/FspPlatformNotify.c 
b/IntelFsp2Pkg/Library/BaseFspPlatformLib/FspPlatformNotify.c
index 795bb28c0f..a5a51c804c 100644
--- a/IntelFsp2Pkg/Library/BaseFspPlatformLib/FspPlatformNotify.c
+++ b/IntelFsp2Pkg/Library/BaseFspPlatformLib/FspPlatformNotify.c
@@ -296,6 +296,7 @@ FspTempRamExitDone2 (
 
 **/
 VOID
+EFIAPI
 FspWaitForNotify (
   VOID
   )
-- 
2.38.1.windows.1



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




Re: [edk2-devel] [PATCH 0/3] BaseTools: allow users to override CC and CXX on the make command line

2023-03-09 Thread Rebecca Cran

Could I get some reviews on this please?


Thanks.

Rebecca Cran


On 2/16/23 8:50 PM, Rebecca Cran wrote:

Currently, the BaseTools Makefiles use BUILD_CC and BUILD_CXX, which
doesn't allow users to override the compiler to use in the expected way
by running e.g. "make CC=clang-17 CXX=clang++-17". clang/llvm support
was added in https://bugzilla.tianocore.org/show_bug.cgi?id=2842 in a
way that required users to run "make CXX=llvm" and have clang and clang++
executables under $(CLANG_BIN). As far as I know this isn't a standard
way of telling a build system to use clang, and so is likely difficult
to discover by users.

This patch series fixes that, and as a side effect allows the clang
analyzer to run via "scan-build make".

Since clang 17 defaults to C++17 or newer where the 'register' keyword
is deprecated and the warning turned into an error, override the
version used when building C++ code via "-std=c++14".

Rebecca Cran (3):
   BaseTools: Allow users to specify compiler to use with make CC= CXX=
   BaseTools: Improve detection of users wanting to build using clang
   BaseTools: Build against C++14 when building with clang

  BaseTools/Source/C/DevicePath/GNUmakefile  |  7 ++-
  BaseTools/Source/C/LzmaCompress/GNUmakefile|  2 +-
  BaseTools/Source/C/Makefiles/app.makefile  |  2 +-
  BaseTools/Source/C/Makefiles/footer.makefile   |  6 +-
  BaseTools/Source/C/Makefiles/header.makefile   | 59 ++--
  BaseTools/Source/C/VfrCompile/GNUmakefile  | 19 ---
  BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile | 20 +++
  BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile   | 31 +-
  BaseTools/Source/Python/Workspace/DscBuildData.py  |  2 +-
  9 files changed, 76 insertions(+), 72 deletions(-)




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




[edk2-devel] [PATCH 1/3] RedfishPkg/Library: Redfish BMC USBNIC Host Interface

2023-03-09 Thread Chang, Abner via groups.io
From: Abner Chang 

BMC exposed USB NIC platform Redfish Host Interface
library implementation.

Signed-off-by: Abner Chang 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 RedfishPkg/RedfishPkg.dec |   10 +
 .../PlatformHostInterfaceBmcUsbNicLib.inf |   48 +
 RedfishPkg/Include/Library/RedfishDebugLib.h  |3 +-
 .../PlatformHostInterfaceBmcUsbNicLib.h   |   84 ++
 .../PlatformHostInterfaceBmcUsbNicLib.c   | 1280 +
 5 files changed, 1424 insertions(+), 1 deletion(-)
 create mode 100644 
RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.inf
 create mode 100644 
RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.h
 create mode 100644 
RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c

diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec
index 53e52c2b008..251aa5e2b76 100644
--- a/RedfishPkg/RedfishPkg.dec
+++ b/RedfishPkg/RedfishPkg.dec
@@ -113,3 +113,13 @@
   # Default is set to not add.
   #
   
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExAddingExpect|FALSE|BOOLEAN|0x1004
+  #
+  # Use PCD to declare the Redfish host nmae becasue there is no
+  # specification for that.
+  #
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishHostName|""|VOID*|0x1005
+  #
+  # Use PCD to declare the Redfish service UUID becasue there is no
+  # specification for that.
+  #
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishServiceUuid|L""|VOID*|0x1006
diff --git 
a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.inf
 
b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.inf
new file mode 100644
index 000..f2c7d7fec89
--- /dev/null
+++ 
b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.inf
@@ -0,0 +1,48 @@
+## @file
+#  Module to provide the platform Redfish Host Interface information
+#  of USB NIC Device exposed by BMC.
+#
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION= 0x0001000b
+  BASE_NAME  = PlatformHostInterfaceBmcUsbNicLib
+  FILE_GUID  = C4837B58-225E-4352-8FDC-4C52A5D65891
+  MODULE_TYPE= DXE_DRIVER
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = PlatformHostInterfaceBmcUsbNicLib
+
+[Sources]
+  PlatformHostInterfaceBmcUsbNicLib.c
+  PlatformHostInterfaceBmcUsbNicLib.h
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  NetworkPkg/NetworkPkg.dec
+  RedfishPkg/RedfishPkg.dec
+
+[LibraryClasses]
+  BaseMemoryLib
+  DebugLib
+  IpmiLib
+  IpmiCommandLib
+  MemoryAllocationLib
+  UefiLib
+  UefiBootServicesTableLib
+
+[Protocols]
+  gEfiSimpleNetworkProtocolGuid ## CONSUMED
+  gEfiUsbIoProtocolGuid ## CONSUMED
+  gEfiDevicePathProtocolGuid## CONSUMED
+
+[Pcd]
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishHostName ## CONSUMED
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishServiceUuid  ## CONSUMED
+
+[Depex]
+  gIpmiProtocolGuid
diff --git a/RedfishPkg/Include/Library/RedfishDebugLib.h 
b/RedfishPkg/Include/Library/RedfishDebugLib.h
index 21f01353ede..913f2b2f358 100644
--- a/RedfishPkg/Include/Library/RedfishDebugLib.h
+++ b/RedfishPkg/Include/Library/RedfishDebugLib.h
@@ -14,7 +14,8 @@
 #include 
 #include 
 
-#define DEBUG_REDFISH_NETWORK  DEBUG_INFO   ///< Debug error level for Redfish 
networking function
+#define DEBUG_REDFISH_NETWORK DEBUG_INFO   ///< Debug error level for 
Redfish networking function
+#define DEBUG_REDFISH_HOST_INTERFACE  DEBUG_INFO   ///< Debug error level for 
Redfish networking function
 
 /**
 
diff --git 
a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.h
 
b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.h
new file mode 100644
index 000..669c304fc3d
--- /dev/null
+++ 
b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.h
@@ -0,0 +1,84 @@
+/** @file
+  Header file to provide the platform Redfish Host Interface information
+  of USB NIC Device exposed by BMC.
+
+  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef PLATFORM_HOST_INTERFACE_BMC_USB_NIC_LIB_H_
+#define PLATFORM_HOST_INTERFACE_BMC_USB_NIC_LIB_H_
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#define BMC_USB_NIC_HOST_INTERFASCE_READINESS_GUID \
+{  \
+  0xDD96F5D7, 0x4AE1, 0x4E6C, {0xA1, 0x30, 0xA5, 0xAC, 0x77, 0xDD, 0xE4, 
0xA5} \
+}
+
+//
+// This is the 

[edk2-devel] [PATCH 2/3] RedfishPkg: Update Redfish DSC

2023-03-09 Thread Chang, Abner via groups.io
From: Abner Chang 

Update Redfish DSC for
PlatformHostInterfaceBmcUsbNicLib.

Signed-off-by: Abner Chang 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 RedfishPkg/RedfishPkg.dsc | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/RedfishPkg/RedfishPkg.dsc b/RedfishPkg/RedfishPkg.dsc
index cf25b63cc29..223ab72c1db 100644
--- a/RedfishPkg/RedfishPkg.dsc
+++ b/RedfishPkg/RedfishPkg.dsc
@@ -3,6 +3,7 @@
 #
 # Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.
 # (C) Copyright 2021 Hewlett-Packard Enterprise Development LP.
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
 #
 #SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -34,6 +35,7 @@
   
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
   
RedfishPlatformHostInterfaceLib|RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.inf
+  
RedfishPlatformHostInterfaceLib|RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.inf
   HttpLib|NetworkPkg/Library/DxeHttpLib/DxeHttpLib.inf
   HttpIoLib|NetworkPkg/Library/DxeHttpIoLib/DxeHttpIoLib.inf
   NetLib|NetworkPkg/Library/DxeNetLib/DxeNetLib.inf
@@ -41,6 +43,10 @@
   
RedfishPlatformCredentialLib|RedfishPkg/Library/PlatformCredentialLibNull/PlatformCredentialLibNull.inf
   
RedfishContentCodingLib|RedfishPkg/Library/RedfishContentCodingLibNull/RedfishContentCodingLibNull.inf
 
+  # NULL instance of IPMI related library.
+  IpmiLib|MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
+  
IpmiCommandLib|MdeModulePkg/Library/BaseIpmiCommandLibNull/BaseIpmiCommandLibNull.inf
+
 [LibraryClasses.ARM, LibraryClasses.AARCH64]
   #
   # This library provides the instrinsic functions generated by a given 
compiler.
@@ -51,6 +57,7 @@
 
 [Components]
   
RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.inf
+  
RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.inf
   RedfishPkg/Library/PlatformCredentialLibNull/PlatformCredentialLibNull.inf
   
RedfishPkg/Library/RedfishContentCodingLibNull/RedfishContentCodingLibNull.inf
   RedfishPkg/Library/DxeRestExLib/DxeRestExLib.inf
-- 
2.37.1.windows.1



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




[edk2-devel] [PATCH 0/3] BMC USBNIC Platform HI Lib

2023-03-09 Thread Chang, Abner via groups.io
From: Abner Chang 

BZ #: 4282
Implement the platform Redfish host interface library that
uses IPMI commands to get the network information of
BMC-exposed USB NIC for building up the SMBIOS type 42
record.

The prerequisites: BZ #4213, 4214 and 4231

Check "Platform with BMC and the BMC-Exposed USB Network Device"
section in readme.md for the design of implementation.

PR: https://github.com/tianocore/edk2/pull/4101

Signed-off-by: Abner Chang 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 

Abner Chang (3):
  RedfishPkg/Library: Redfish BMC USBNIC Host Interface
  RedfishPkg: Update Redfish DSC
  RedfishPkg: Update Readme.md

 RedfishPkg/RedfishPkg.dec |   10 +
 RedfishPkg/RedfishPkg.dsc |7 +
 .../PlatformHostInterfaceBmcUsbNicLib.inf |   48 +
 RedfishPkg/Include/Library/RedfishDebugLib.h  |3 +-
 .../PlatformHostInterfaceBmcUsbNicLib.h   |   84 ++
 .../PlatformHostInterfaceBmcUsbNicLib.c   | 1280 +
 RedfishPkg/Readme.md  |  112 +-
 .../Documents/Media/BmcExposedUsbNic.svg  |  283 
 .../Media/EmualtorPlatformLibrary.svg |  286 
 .../Media/PlatformWihtBmcLibrary.svg  |  328 +
 10 files changed, 2432 insertions(+), 9 deletions(-)
 create mode 100644 
RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.inf
 create mode 100644 
RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.h
 create mode 100644 
RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c
 create mode 100644 RedfishPkg/Documents/Media/BmcExposedUsbNic.svg
 create mode 100644 RedfishPkg/Documents/Media/EmualtorPlatformLibrary.svg
 create mode 100644 RedfishPkg/Documents/Media/PlatformWihtBmcLibrary.svg

-- 
2.37.1.windows.1



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




[edk2-devel] [PATCH 1/1] DynamicTablesPkg/SsdtCpuTopology: Allow multi-packages topologies

2023-03-09 Thread PierreGondois
From: Pierre Gondois 

The topology of a platform is represented in ACPI using the PPTT
table. It is possible to append information to CPUs/processor
containers using their associated AML nodes in a SSDT
table.
A platform might have multiple 'physical packages' (or top-level
nodes) in their PPTT topology representation. It can be assumed
from [1] that a 'physical packages' is always a 'top-level node',
and conversely.

The SSDT topology generator doesn't support having multiple top-level
nodes. The top-level node is also not generated in the SSDT topology
representation.
Add support to generate multiple top-level nodes in the SSDT topology
generator and generate an AML node for this top-level node. This will
allow to have matching PPTT and SSDT topology representations. Prior
to this patch, this top-level AML node was not generated.

Also factorize the flag checking in CheckProcNode() and add more
checks.

This patch takes inspiration from the discussion at:
- v1: https://edk2.groups.io/g/devel/message/99410
- v2: https://edk2.groups.io/g/devel/message/99615

[1]
ACPI 6.5, 5.2.30.1 Processor hierarchy node structure (Type 0):
- "Multiple trees may be described, covering for example multiple
  packages. For the root of a tree, the parent pointer should be 0.""
- "Each valid processor must belong to exactly one package. That is,
  the leaf must itself be a physical package or have an ancestor
  marked as a physical package."

Change-Id: I48452e623906628f44b7e2c69a34ed7b30276e92
Suggested-by: Jeff Brasen 
Signed-off-by: Pierre Gondois 
---
 .../SsdtCpuTopologyGenerator.c| 131 +++---
 .../SsdtCpuTopologyGenerator.h|   4 +
 2 files changed, 84 insertions(+), 51 deletions(-)

diff --git 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
index c24da8ec71ad..6fb131b66482 100644
--- 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
+++ 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
@@ -805,6 +805,57 @@ CreateAmlProcessorContainer (
   return Status;
 }
 
+/** Check flags and topology of a ProcNode.
+
+  @param [in]  NodeFlagsFlags of the ProcNode to check.
+  @param [in]  IsLeaf   The ProcNode is a leaf.
+  @param [in]  NodeTokenNodeToken of the ProcNode.
+  @param [in]  ParentNodeToken  Parent NodeToken of the ProcNode.
+
+  @retval EFI_SUCCESS Success.
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+CheckProcNode (
+  UINT32   NodeFlags,
+  BOOLEAN  IsLeaf,
+  CM_OBJECT_TOKEN  NodeToken,
+  CM_OBJECT_TOKEN  ParentNodeToken
+  )
+{
+  BOOLEAN  InvalidFlags;
+  BOOLEAN  HasPhysicalPackageBit;
+  BOOLEAN  IsTopLevelNode;
+
+  HasPhysicalPackageBit = (NodeFlags & EFI_ACPI_6_3_PPTT_PACKAGE_PHYSICAL) ==
+  EFI_ACPI_6_3_PPTT_PACKAGE_PHYSICAL;
+  IsTopLevelNode = (ParentNodeToken == CM_NULL_TOKEN);
+
+  // A top-level node is a Physical Package and conversely.
+  InvalidFlags = HasPhysicalPackageBit ^ IsTopLevelNode;
+
+  // Check Leaf specific flags.
+  if (IsLeaf) {
+InvalidFlags |= ((NodeFlags & PPTT_LEAF_MASK) != PPTT_LEAF_MASK);
+  } else {
+InvalidFlags |= ((NodeFlags & PPTT_LEAF_MASK) != 0);
+  }
+
+  if (InvalidFlags) {
+DEBUG ((
+  DEBUG_ERROR,
+  "ERROR: SSDT-CPU-TOPOLOGY: Invalid flags for ProcNode: 0x%p.\n",
+  (VOID *)NodeToken
+  ));
+ASSERT (0);
+return EFI_INVALID_PARAMETER;
+  }
+
+  return EFI_SUCCESS;
+}
+
 /** Create an AML representation of the Cpu topology.
 
   A processor container is by extension any non-leave device in the cpu 
topology.
@@ -814,7 +865,6 @@ CreateAmlProcessorContainer (
   Protocol Interface.
   @param [in] NodeToken   Token of the CM_ARM_PROC_HIERARCHY_INFO
   currently handled.
-  Cannot be CM_NULL_TOKEN.
   @param [in] ParentNode  Parent node to attach the created
   node to.
   @param [in,out] ProcContainerIndex  Pointer to the current processor 
container
@@ -838,6 +888,7 @@ CreateAmlCpuTopologyTree (
   EFI_STATUS  Status;
   UINT32  Index;
   UINT32  CpuIndex;
+  UINT32  ProcContainerName;
   AML_OBJECT_NODE_HANDLE  ProcContainerNode;
   UINT32  Uid;
   UINT16  Name;
@@ -846,11 +897,11 @@ CreateAmlCpuTopologyTree (
   ASSERT (Generator->ProcNodeList != NULL);
   ASSERT (Generator->ProcNodeCount != 0);
   ASSERT (CfgMgrProtocol != NULL);
-  ASSERT (NodeToken != CM_NULL_TOKEN);
   ASSERT (ParentNode != NULL);
   ASSERT (ProcContainerIndex != NULL);
 
-  CpuIndex = 0;
+  CpuIndex  = 0;
+  ProcContainerName = 

Re: [edk2-devel] [edk2-platforms][PATCH V2 0/8] Introduce ManageabilityPkg

2023-03-09 Thread Tinh Nguyen via groups.io

Hi Abner,

I'm not sure if I understand this module completely.

This module is another IPMI solution? we will utilize either 
ManageabilityPkg (using IPMI protocol specified in the EDK2 repo) or 
IpmiFeaturePkg (using IpmiTransportProtocol). How do I use 
IpmiCommandLib 
(IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLib.inf) in combined 
with ManageabilityPkg?


Another question, you don't use "Transport Protocol" and "Protocol 
Driver" in the KCS ManageabilityTransportLib you implement for reference 
because edk2 does not define a protocol for KCS , right?


However, if I want to support other interfaces, I should build 
"ManageabilityTransportLib" using the protocol provided by the PI or 
UEFI specifications.


Thanks,

- Tinh

On 3/8/2023 9:16 PM, Chang, Abner via groups.io wrote:

From: Abner Chang 

edk2 ManageabilityPkg is introduced to provide edk2 drivers
and libraries for industry platform management standards,
such as PLDM (Platform Level Data Model), MCTP (Management
Component Transfer Protocol),
IPMI (Intelligent Platform Management Interface) and others.
The framework of ManageabilityPkg is designed to flexibly
support the transport interfaces for above industry
standards, the transport interfaces such as KCS or I2C for
IPMI, PCI VDM (Vendor Defined Message),
I2C or KCS for MCTP, or the OEM proprietary transports.
Please check the Readme file for the design guidance:
https://github.com/changab/edk2-platforms/blob/Manageability_IPMI_upstream/Features/ManageabilityPkg/Readme.md

In V2: Fix some issues on below files,
   1. Features/ManageabilityPkg/Library/Common/KcsCommon.c
   2. Features/ManageabilityPkg/Library/Dxe/ManageabilityTransportKcs.c
   3. 
Features/ManageabilityPkg/Universal/IpmiProtocol/Common/IpmiprotocolCommon.c

In V1, we had implemented,
- KCS manageability transport library
- Manageability library helper library
- IPMI PEI/DXE/SMM protocol implementations

Next upstream would be edk2 MCTP_PROTOCOL
implementation that also consumes the manageability
transport libraries.

Signed-off-by: Abner Chang 
Cc: Abdul Lateef Attar 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Isaac Oram 
Cc: Nickle Wang 

Abner Chang (8):
   ManageabilityPkg: Add Readme file
   ManageabilityPkg: Initial package
   ManageabilityPkg: Add NULL ManageabilityTransportLib
   ManageabilityPkg: Add ManageabilityTransportHelperLib
   ManageabilityPkg/ManageabilityTransportKcsLib
   ManageabilityPkg: Implement Ipmi Protocol/Ppi
   ManageabilityPkg: Add IpmiProtocol to Manageability Package
   edk2-platforms: Maintainers.txt

  .../ManageabilityPkg/ManageabilityPkg.dec |  48 ++
  .../Include/Dsc/Manageability.dsc |  25 +
  .../ManageabilityPkg/ManageabilityPkg.dsc |  45 ++
  .../BaseManageabilityTransportHelper.inf  |  40 +
  .../BaseManageabilityTransportNull.inf|  28 +
  .../Dxe/DxeManageabilityTransportKcs.inf  |  44 +
  .../IpmiProtocol/Dxe/IpmiProtocolDxe.inf  |  50 ++
  .../Universal/IpmiProtocol/Pei/IpmiPpiPei.inf |  51 ++
  .../IpmiProtocol/Smm/IpmiProtocolSmm.inf  |  52 ++
  .../Library/ManageabilityTransportHelperLib.h |  93 +++
  .../Library/ManageabilityTransportIpmiLib.h   |  24 +
  .../Library/ManageabilityTransportLib.h   | 335 
  .../Common/ManageabilityTransportKcs.h| 106 +++
  .../IpmiProtocol/Common/IpmiProtocolCommon.h  | 108 +++
  .../BaseManageabilityTransportHelper.c| 242 ++
  .../BaseManageabilityTransportNull.c  |  64 ++
  .../Common/KcsCommon.c| 480 +++
  .../Dxe/ManageabilityTransportKcs.c   | 384 +
  .../IpmiProtocol/Common/IpmiProtocolCommon.c  | 247 ++
  .../Universal/IpmiProtocol/Dxe/IpmiProtocol.c | 177 +
  .../Universal/IpmiProtocol/Pei/IpmiPpi.c  | 151 
  .../Universal/IpmiProtocol/Smm/IpmiProtocol.c | 147 
  Features/ManageabilityPkg/Readme.md   | 177 +
  .../Media/ManageabilityDriverStack.svg| 752 ++
  .../BaseManageabilityTransportHelper.uni  |  13 +
  .../BaseManageabilityTransportNull.uni|  13 +
  .../Dxe/ManageabilityTransportKcs.uni |  13 +
  Maintainers.txt   |  11 +-
  28 files changed, 3918 insertions(+), 2 deletions(-)
  create mode 100644 Features/ManageabilityPkg/ManageabilityPkg.dec
  create mode 100644 Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
  create mode 100644 Features/ManageabilityPkg/ManageabilityPkg.dsc
  create mode 100644 
Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
  create mode 100644 
Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.inf
  create mode 100644 
Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/DxeManageabilityTransportKcs.inf
  create mode 100644 
Features/ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocolDxe.inf
  create mode 100644 

Re: [edk2-devel] [PATCH] Maintainers: Add 'Yuwei Chen' as BaseTools maintainer.

2023-03-09 Thread Bob Feng
Thanks Christine.

Reviewed-by: Bob Feng 

-Original Message-
From: Chen, Christine  
Sent: Thursday, March 9, 2023 10:55 AM
To: devel@edk2.groups.io
Cc: Kinney, Michael D ; Feng, Bob C 
; Gao, Liming 
Subject: [PATCH] Maintainers: Add 'Yuwei Chen' as BaseTools maintainer.

Add myself as maintainer for the BaseTools Pkg.

Cc: Michael D Kinney 
Cc: Bob Feng 
Cc: Liming Gao 
Signed-off-by: Yuwei Chen 
---
 Maintainers.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Maintainers.txt b/Maintainers.txt index d4607a..463d9567e1 
100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -179,7 +179,7 @@ F: BaseTools/
 W: https://github.com/tianocore/tianocore.github.io/wiki/BaseTools
 M: Bob Feng  [BobCF]
 M: Liming Gao  [lgao4]
-R: Yuwei Chen  [YuweiChen1110]
+M: Yuwei Chen  [YuweiChen1110]
 
 CryptoPkg
 F: CryptoPkg/
--
2.39.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100948): https://edk2.groups.io/g/devel/message/100948
Mute This Topic: https://groups.io/mt/97489080/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-platforms v2 3/3] IpmiFeaturePkg: refine GetSelfTest function

2023-03-09 Thread Arun K via groups.io
We are not updating the BMC status in the switch()( *default case* ), which may 
lead to installing the IPMI protocol for the failure case too. Could you please 
initialize the BMC status in the default case also?

switch ( SelfTestResult->Result ) {

case IPMI_APP_SELFTEST_NO_ERROR:

case IPMI_APP_SELFTEST_NOT_IMPLEMENTED:

...
.
...

case IPMI_APP_SELFTEST_ERROR:

...
.
...

case IPMI_APP_SELFTEST_FATAL_HW_ERROR:

...
.
...

*default:*

IpmiInstance->BmcStatus = BMC_HARDFAIL;

//

// Call routine to check device specific failures.

//

GetDeviceSpecificTestResults (IpmiInstance);

}

Thanks,
Arun


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




Re: [edk2-devel] [PATCH v3 2/2] UefiPayloadPkg: Move INT prog outside common flow

2023-03-09 Thread Guo, Gua
Reviewed-by: Gua Guo  

-Original Message-
From: Dhaval Sharma  
Sent: Thursday, March 9, 2023 6:37 PM
To: devel@edk2.groups.io
Cc: Dong, Guo ; Ni, Ray ; Sean Rhodes 
; Lu, James ; Guo, Gua 

Subject: [PATCH v3 2/2] UefiPayloadPkg: Move INT prog outside common flow

8259 is very arch specific programming. It needs to be moved out to the 
respective arch flow. Added in both x64 and x32 paths

Test: Able to boot UEFI shell with Coreboot Tianocore payload on
x86 qemu

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Sean Rhodes 
Cc: James Lu 
Cc: Gua Guo 

Signed-off-by: Dhaval Sharma 
---

Notes:
v3:
- Added legacy INT intialization to X64 path as well

 UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c  | 6 ++
 UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c | 6 --
 UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c   | 6 ++
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c 
b/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c
index 9d2bfb2fa654..d41e5024b4a1 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c
@@ -271,6 +271,12 @@ HandOffToDxeCore (
   // Initialize floating point operating environment to be compliant with UEFI 
spec.   InitializeFloatingPointUnits (); +  //+  // Mask off all legacy 8259 
interrupt sources+  //+  IoWrite8 (LEGACY_8259_MASK_REGISTER_MASTER, 0xFF);+  
IoWrite8 (LEGACY_8259_MASK_REGISTER_SLAVE, 0xFF);+   //   // Clear page 0 and 
mark it as allocated if NULL pointer detection is enabled.   //diff --git 
a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c 
b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
index 07f4c1d29686..45127689a24b 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
@@ -478,12 +478,6 @@ _ModuleEntryPoint (
   Status = UniversalLoadDxeCore (DxeFv, );   
ASSERT_EFI_ERROR (Status); -  //-  // Mask off all legacy 8259 interrupt 
sources-  //-  IoWrite8 (LEGACY_8259_MASK_REGISTER_MASTER, 0xFF);-  IoWrite8 
(LEGACY_8259_MASK_REGISTER_SLAVE, 0xFF);-   Hob.HandoffInformationTable = 
(EFI_HOB_HANDOFF_INFO_TABLE *)GetFirstHob (EFI_HOB_TYPE_HANDOFF);   
HandOffToDxeCore (DxeCoreEntryPoint, Hob); diff --git 
a/UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c 
b/UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c
index 84a6112ce64a..1dfb7459e85a 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c
@@ -43,6 +43,12 @@ HandOffToDxeCore (
   // Initialize floating point operating environment to be compliant with UEFI 
spec.   InitializeFloatingPointUnits (); +  //+  // Mask off all legacy 8259 
interrupt sources+  //+  IoWrite8 (LEGACY_8259_MASK_REGISTER_MASTER, 0xFF);+  
IoWrite8 (LEGACY_8259_MASK_REGISTER_SLAVE, 0xFF);+   //   // Clear page 0 and 
mark it as allocated if NULL pointer detection is enabled.   //-- 
2.40.0.rc0.57.g454dfcbddf



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100944): https://edk2.groups.io/g/devel/message/100944
Mute This Topic: https://groups.io/mt/97493284/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] DynamicTablesPkg: Add SMBIOS String table helper library

2023-03-09 Thread Sami Mujawar
Hi Pierre,

On Tue, Oct 4, 2022 at 01:22 AM, PierreGondois wrote:

> 
> 
>> 
>>> +EFI_STATUS
>>> +EFIAPI
>>> +StringTablePublishStringSet (
>>> + IN STRING_TABLE *CONST StrTable,
>>> + IN CHAR8 *CONST SmbiosStringAreaStart,
>>> + IN CONST UINTN SmbiosStringAreaSize
>>> + )
>>> +{
>>> + UINT8 Index;
>>> + STRING_ELEMENT *StrElement;
>>> + CHAR8 *SmbiosString;
>>> + UINTN BytesRemaining;
>>> + UINTN BytesCopied;
>>> +
>>> + if ((StrTable == NULL) || (SmbiosStringAreaStart == NULL)) {
>>> + return EFI_INVALID_PARAMETER;
>>> + }
>>> +
>>> + if (SmbiosStringAreaSize < StringTableGetStringSetSize (StrTable)) {
>>> + return EFI_BUFFER_TOO_SMALL;
>>> + }
>>> +
>>> + SmbiosString = SmbiosStringAreaStart;
>>> + BytesRemaining = SmbiosStringAreaSize;
>>> +
>>> + if (StrTable->StrCount == 0) {
>>> + // See Section 6.1.3 Text strings, SMBIOS Specification Version 3.6.0
>>> + // If the formatted portion of the structure contains string-reference
>>> + // fields and all the string fields are set to 0 (no string references),
>>> 
>>> + // the formatted section of the structure is followed by two null (00h)
>>> + // BYTES.
>>> + *SmbiosString++ = '\0';
>>> + } else {
>>> + for (Index = 0; Index < StrTable->StrCount; Index++) {
>>> + StrElement = >Elements[Index];
>>> + AsciiStrCpyS (SmbiosString, BytesRemaining, StrElement->String);
>>> +
>>> + // See Section 6.1.3 Text strings, SMBIOS Specification Version 3.6.0
>>> + // - Each string is terminated with a null (00h) BYTE
>>> + // Bytes Copied = String length + 1 for the string NULL terminator.
>>> + BytesCopied = StrElement->StringLen + 1;
>>> + BytesRemaining -= BytesCopied;
>>> + SmbiosString += BytesCopied;
>>> + }
>>> + }
>>> +
>>> + // See Section 6.1.3 Text strings, SMBIOS Specification Version 3.6.0
>>> + // - the set of strings is terminated with an additional null (00h)
>>> BYTE.
>>> + *SmbiosString = '\0';
>> 
>> [GM] Shouldn't you advance the SmbiosString pointer by one more ? After
>> the loop isn't SmbiosString going to be at the NULL char of the last
>> string ? And we're trying to add one more NULL character ?
>> Should it be:
>> SmbiosString++;
>> *SmbiosString = '\0';
> 
> I didn't try to run the code, but it seems ok to me. Assuming the string
> has 9 chars:
> """
> // Copy 9 chars + 1 NULL char
> AsciiStrCpyS (SmbiosString, BytesRemaining, StrElement->String);
> 
> // We have copied 10 chars
> BytesCopied = StrElement->StringLen + 1;
> BytesRemaining -= BytesCopied;
> // Increment SmbiosString of 10 chars, so SmbiosString is pointing
> // to an un-initialized char now and we can continue.
> SmbiosString += BytesCopied;
> """
> 
> However, maybe we need to add an extra check/ASSERT for BytesRemaining
> before
> writing the last NULL char.

The check at the function entry i.e. "if (SmbiosStringAreaSize < 
StringTableGetStringSetSize (StrTable)) {"
should cover this, as BytesRemaining is derived from SmbiosStringAreaSize.
So as long as StringTableGetStringSetSize() returns the correct size, the 
additional check before writing
the last NULL char is not needed.

Please let me know if you think otherwise.

Regards,

Sami Mujawar


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




[edk2-devel] [PATCH v3 10/11] OvmfPkg: IntelTdx: use crypto includes

2023-03-09 Thread Gerd Hoffmann
Use the new crypto support include files.

Signed-off-by: Gerd Hoffmann 
---
 OvmfPkg/IntelTdx/IntelTdxX64.dsc | 15 +--
 OvmfPkg/IntelTdx/IntelTdxX64.fdf |  5 +
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.dsc b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
index d093660283dd..88f7b3c2cce2 100644
--- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc
+++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
@@ -36,6 +36,8 @@ [Defines]
   #
   DEFINE BUILD_SHELL = TRUE
 
+!include OvmfPkg/Include/Dsc/OvmfCryptoDefines.dsc.inc
+
   #
   # Device drivers
   #
@@ -191,8 +193,6 @@ [LibraryClasses]
   LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf
   
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
 
-  IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
-  OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
   RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
 
 !if $(SECURE_BOOT_ENABLE) == TRUE
@@ -220,8 +220,9 @@ [LibraryClasses]
   
Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibNull/DxeTcg2PhysicalPresenceLib.inf
   
TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf
 
+!include OvmfPkg/Include/Dsc/OvmfCryptoLibs.dsc.inc
+
 [LibraryClasses.common]
-  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
   CcExitLib|OvmfPkg/Library/CcExitLib/CcExitLib.inf
   TdxLib|MdePkg/Library/TdxLib/TdxLib.inf
   TdxMailboxLib|OvmfPkg/Library/TdxMailboxLib/TdxMailboxLib.inf
@@ -280,7 +281,6 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER]
   DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf
 !endif
   UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
-  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
   PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf
   QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf
   
VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLibRuntimeDxe.inf
@@ -356,7 +356,6 @@ [LibraryClasses.common.DXE_SMM_DRIVER]
   DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf
 !endif
   
CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf
-  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
   PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf
 
 [LibraryClasses.common.SMM_CORE]
@@ -553,7 +552,6 @@ [Components]
 
   
NULL|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
   NULL|OvmfPkg/IntelTdx/TdxHelperLib/SecTdxHelperLib.inf
-  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf
   }
 
   #
@@ -720,6 +718,11 @@ [Components]
   MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.inf
   
MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
 
+  #
+  # Crypto Support
+  #
+!include OvmfPkg/Include/Dsc/OvmfCryptoComponentsDxe.dsc.inc
+
   #
   # Usb Support
   #
diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.fdf b/OvmfPkg/IntelTdx/IntelTdxX64.fdf
index 73dffc104301..e1b07449b7a9 100644
--- a/OvmfPkg/IntelTdx/IntelTdxX64.fdf
+++ b/OvmfPkg/IntelTdx/IntelTdxX64.fdf
@@ -257,6 +257,11 @@ [FV.DXEFV]
 #
 INF SecurityPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.inf
 
+#
+# Crypto support
+#
+!include OvmfPkg/Include/Fdf/OvmfCryptoDxeSmm.fdf.inc
+
 

 
 [FV.NCCFV]
-- 
2.39.2



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




[edk2-devel] [PATCH v3 08/11] OvmfPkg: OvmfPkgIa32: use crypto includes

2023-03-09 Thread Gerd Hoffmann
Use the new crypto support include files.

Signed-off-by: Gerd Hoffmann 
---
 OvmfPkg/OvmfPkgIa32.dsc | 22 +-
 OvmfPkg/OvmfPkgIa32.fdf |  6 ++
 2 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
index 22dc29330d2d..8ca29e9747c1 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -35,6 +35,7 @@ [Defines]
   DEFINE LOAD_X64_ON_IA32_ENABLE = FALSE
 
 !include OvmfPkg/Include/Dsc/OvmfTpmDefines.dsc.inc
+!include OvmfPkg/Include/Dsc/OvmfCryptoDefines.dsc.inc
 
   #
   # Shell can be useful for debugging but should not be enabled for production
@@ -211,12 +212,6 @@ [LibraryClasses]
   LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf
   
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
 
-  IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
-!if $(NETWORK_TLS_ENABLE) == TRUE
-  OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
-!else
-  OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
-!endif
   RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
 
 !if $(SECURE_BOOT_ENABLE) == TRUE
@@ -239,10 +234,6 @@ [LibraryClasses]
   #
 !include NetworkPkg/NetworkLibs.dsc.inc
 
-!if $(NETWORK_TLS_ENABLE) == TRUE
-  TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
-!endif
-
 !if $(BUILD_SHELL) == TRUE
   ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
 !endif
@@ -253,9 +244,9 @@ [LibraryClasses]
   
OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf
 
 !include OvmfPkg/Include/Dsc/OvmfTpmLibs.dsc.inc
+!include OvmfPkg/Include/Dsc/OvmfCryptoLibs.dsc.inc
 
 [LibraryClasses.common]
-  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
   CcExitLib|UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.inf
   TdxMailboxLib|OvmfPkg/Library/TdxMailboxLib/TdxMailboxLibNull.inf
 
@@ -359,7 +350,6 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER]
   DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf
 !endif
   UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
-  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
   PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf
   QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf
   
VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLibRuntimeDxe.inf
@@ -447,7 +437,6 @@ [LibraryClasses.common.DXE_SMM_DRIVER]
 !if $(SOURCE_DEBUG_ENABLE) == TRUE
   DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf
 !endif
-  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
   PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf
   
SmmCpuRendezvousLib|UefiCpuPkg/Library/SmmCpuRendezvousLib/SmmCpuRendezvousLib.inf
 
@@ -888,6 +877,13 @@ [Components]
 
   OvmfPkg/VirtioNetDxe/VirtioNet.inf
 
+  #
+  # Crypto Support
+  #
+!include OvmfPkg/Include/Dsc/OvmfCryptoComponentsPei.dsc.inc
+!include OvmfPkg/Include/Dsc/OvmfCryptoComponentsSmm.dsc.inc
+!include OvmfPkg/Include/Dsc/OvmfCryptoComponentsDxe.dsc.inc
+
   #
   # Usb Support
   #
diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf
index 5451bfb84525..552730485123 100644
--- a/OvmfPkg/OvmfPkgIa32.fdf
+++ b/OvmfPkg/OvmfPkgIa32.fdf
@@ -173,6 +173,7 @@ [FV.PEIFV]
 INF  UefiCpuPkg/CpuMpPei/CpuMpPei.inf
 
 !include OvmfPkg/OvmfTpmPei.fdf.inc
+!include OvmfPkg/Include/Fdf/OvmfCryptoPei.fdf.inc
 
 

 
@@ -373,6 +374,11 @@ [FV.DXEFV]
 #
 !include OvmfPkg/OvmfTpmDxe.fdf.inc
 
+#
+# Crypto support
+#
+!include OvmfPkg/Include/Fdf/OvmfCryptoDxeSmm.fdf.inc
+
 !if $(LOAD_X64_ON_IA32_ENABLE) == TRUE
 INF  OvmfPkg/CompatImageLoaderDxe/CompatImageLoaderDxe.inf
 !endif
-- 
2.39.2



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




[edk2-devel] [PATCH v3 11/11] OvmfPkg: AmdSev: use crypto includes

2023-03-09 Thread Gerd Hoffmann
Use the new crypto support include files.

Signed-off-by: Gerd Hoffmann 
---
 OvmfPkg/AmdSev/AmdSevX64.dsc | 12 
 OvmfPkg/AmdSev/AmdSevX64.fdf |  6 ++
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc
index f0c4dc231071..69710469e9c7 100644
--- a/OvmfPkg/AmdSev/AmdSevX64.dsc
+++ b/OvmfPkg/AmdSev/AmdSevX64.dsc
@@ -34,6 +34,7 @@ [Defines]
   DEFINE SOURCE_DEBUG_ENABLE = FALSE
 
 !include OvmfPkg/Include/Dsc/OvmfTpmDefines.dsc.inc
+!include OvmfPkg/Include/Dsc/OvmfCryptoDefines.dsc.inc
 
   #
   # Shell can be useful for debugging but should not be enabled for production
@@ -182,8 +183,6 @@ [LibraryClasses]
   LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf
   
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
 
-  IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
-  OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
   RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
 
   
AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
@@ -201,9 +200,9 @@ [LibraryClasses]
   
OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf
 
 !include OvmfPkg/Include/Dsc/OvmfTpmLibs.dsc.inc
+!include OvmfPkg/Include/Dsc/OvmfCryptoLibs.dsc.inc
 
 [LibraryClasses.common]
-  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
   CcExitLib|OvmfPkg/Library/CcExitLib/CcExitLib.inf
   TdxLib|MdePkg/Library/TdxLib/TdxLib.inf
   TdxMailboxLib|OvmfPkg/Library/TdxMailboxLib/TdxMailboxLibNull.inf
@@ -310,7 +309,6 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER]
   DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf
 !endif
   UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
-  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
   PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf
   QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf
   
VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLibRuntimeDxe.inf
@@ -709,6 +707,12 @@ [Components]
   OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf
   
MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
 
+  #
+  # Crypto Support
+  #
+!include OvmfPkg/Include/Dsc/OvmfCryptoComponentsPei.dsc.inc
+!include OvmfPkg/Include/Dsc/OvmfCryptoComponentsDxe.dsc.inc
+
   #
   # Usb Support
   #
diff --git a/OvmfPkg/AmdSev/AmdSevX64.fdf b/OvmfPkg/AmdSev/AmdSevX64.fdf
index 5fb3b5d27632..84842a601262 100644
--- a/OvmfPkg/AmdSev/AmdSevX64.fdf
+++ b/OvmfPkg/AmdSev/AmdSevX64.fdf
@@ -163,6 +163,7 @@ [FV.PEIFV]
 INF  OvmfPkg/AmdSev/SecretPei/SecretPei.inf
 
 !include OvmfPkg/OvmfTpmPei.fdf.inc
+!include OvmfPkg/Include/Fdf/OvmfCryptoPei.fdf.inc
 
 

 
@@ -318,6 +319,11 @@ [FV.DXEFV]
 #
 !include OvmfPkg/OvmfTpmDxe.fdf.inc
 
+#
+# Crypto support
+#
+!include OvmfPkg/Include/Fdf/OvmfCryptoDxeSmm.fdf.inc
+
 

 
 [FV.FVMAIN_COMPACT]
-- 
2.39.2



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




[edk2-devel] [PATCH v3 09/11] OvmfPkg: Microvm: use crypto includes

2023-03-09 Thread Gerd Hoffmann
Use the new crypto support include files.

Signed-off-by: Gerd Hoffmann 
---
 OvmfPkg/Microvm/MicrovmX64.dsc | 24 +++-
 OvmfPkg/Microvm/MicrovmX64.fdf |  7 +++
 2 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc b/OvmfPkg/Microvm/MicrovmX64.dsc
index 76fc54865015..9ae375107414 100644
--- a/OvmfPkg/Microvm/MicrovmX64.dsc
+++ b/OvmfPkg/Microvm/MicrovmX64.dsc
@@ -33,6 +33,8 @@ [Defines]
   DEFINE SMM_REQUIRE = FALSE
   DEFINE SOURCE_DEBUG_ENABLE = FALSE
 
+!include OvmfPkg/Include/Dsc/OvmfCryptoDefines.dsc.inc
+
   #
   # Network definition
   #
@@ -206,12 +208,6 @@ [LibraryClasses]
   LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf
   
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
 
-  IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
-!if $(NETWORK_TLS_ENABLE) == TRUE
-  OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
-!else
-  OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
-!endif
   RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
 
 !if $(SECURE_BOOT_ENABLE) == TRUE
@@ -234,10 +230,6 @@ [LibraryClasses]
   #
 !include NetworkPkg/NetworkLibs.dsc.inc
 
-!if $(NETWORK_TLS_ENABLE) == TRUE
-  TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
-!endif
-
   ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
   ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf
   
S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf
@@ -247,8 +239,9 @@ [LibraryClasses]
   
Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibNull/DxeTcg2PhysicalPresenceLib.inf
   
TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
 
+!include OvmfPkg/Include/Dsc/OvmfCryptoLibs.dsc.inc
+
 [LibraryClasses.common]
-  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
   CcExitLib|OvmfPkg/Library/CcExitLib/CcExitLib.inf
   
SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf
   
PlatformHookLib|MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatformHookLibNull.inf
@@ -356,7 +349,6 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER]
   DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf
 !endif
   UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
-  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
 #  PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf
 #  PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
 #  
PciExpressLib|OvmfPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf
@@ -442,7 +434,6 @@ [LibraryClasses.common.DXE_SMM_DRIVER]
 !if $(SOURCE_DEBUG_ENABLE) == TRUE
   DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf
 !endif
-  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
   PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf
   PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
   
PciExpressLib|OvmfPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf
@@ -830,6 +821,13 @@ [Components]
 
   OvmfPkg/VirtioNetDxe/VirtioNet.inf
 
+  #
+  # Crypto Support
+  #
+!include OvmfPkg/Include/Dsc/OvmfCryptoComponentsPei.dsc.inc
+!include OvmfPkg/Include/Dsc/OvmfCryptoComponentsSmm.dsc.inc
+!include OvmfPkg/Include/Dsc/OvmfCryptoComponentsDxe.dsc.inc
+
   #
   # Usb Support
   #
diff --git a/OvmfPkg/Microvm/MicrovmX64.fdf b/OvmfPkg/Microvm/MicrovmX64.fdf
index b83fd1e6e4fe..92d4b446b7fe 100644
--- a/OvmfPkg/Microvm/MicrovmX64.fdf
+++ b/OvmfPkg/Microvm/MicrovmX64.fdf
@@ -149,6 +149,8 @@ [FV.PEIFV]
 INF  UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf
 INF  UefiCpuPkg/CpuMpPei/CpuMpPei.inf
 
+!include OvmfPkg/Include/Fdf/OvmfCryptoPei.fdf.inc
+
 

 
 [FV.DXEFV]
@@ -302,6 +304,11 @@ [FV.DXEFV]
 INF  MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
 INF  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
 
+#
+# Crypto support
+#
+!include OvmfPkg/Include/Fdf/OvmfCryptoDxeSmm.fdf.inc
+
 

 
 [FV.FVMAIN_COMPACT]
-- 
2.39.2



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




[edk2-devel] [PATCH v3 06/11] OvmfPkg: OvmfPkgX64: use crypto includes

2023-03-09 Thread Gerd Hoffmann
Use the new crypto support include files.

Signed-off-by: Gerd Hoffmann 
---
 OvmfPkg/OvmfPkgX64.dsc | 22 +-
 OvmfPkg/OvmfPkgX64.fdf |  6 ++
 2 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index 04d50704c736..fed5723c4c40 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -35,6 +35,7 @@ [Defines]
   DEFINE CC_MEASUREMENT_ENABLE   = FALSE
 
 !include OvmfPkg/Include/Dsc/OvmfTpmDefines.dsc.inc
+!include OvmfPkg/Include/Dsc/OvmfCryptoDefines.dsc.inc
 
   #
   # Shell can be useful for debugging but should not be enabled for production
@@ -232,12 +233,6 @@ [LibraryClasses]
   LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf
   
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
 
-  IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
-!if $(NETWORK_TLS_ENABLE) == TRUE
-  OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
-!else
-  OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
-!endif
   RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
 
 !if $(SECURE_BOOT_ENABLE) == TRUE
@@ -260,10 +255,6 @@ [LibraryClasses]
   #
 !include NetworkPkg/NetworkLibs.dsc.inc
 
-!if $(NETWORK_TLS_ENABLE) == TRUE
-  TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
-!endif
-
 !if $(BUILD_SHELL) == TRUE
   ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
 !endif
@@ -274,9 +265,9 @@ [LibraryClasses]
   
OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf
 
 !include OvmfPkg/Include/Dsc/OvmfTpmLibs.dsc.inc
+!include OvmfPkg/Include/Dsc/OvmfCryptoLibs.dsc.inc
 
 [LibraryClasses.common]
-  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
   CcExitLib|OvmfPkg/Library/CcExitLib/CcExitLib.inf
   TdxLib|MdePkg/Library/TdxLib/TdxLib.inf
   TdxMailboxLib|OvmfPkg/Library/TdxMailboxLib/TdxMailboxLib.inf
@@ -385,7 +376,6 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER]
   DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf
 !endif
   UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
-  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
   PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf
   QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf
   
VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLibRuntimeDxe.inf
@@ -474,7 +464,6 @@ [LibraryClasses.common.DXE_SMM_DRIVER]
 !if $(SOURCE_DEBUG_ENABLE) == TRUE
   DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf
 !endif
-  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
   PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf
   
SmmCpuRendezvousLib|UefiCpuPkg/Library/SmmCpuRendezvousLib/SmmCpuRendezvousLib.inf
 
@@ -976,6 +965,13 @@ [Components]
 
   OvmfPkg/VirtioNetDxe/VirtioNet.inf
 
+  #
+  # Crypto Support
+  #
+!include OvmfPkg/Include/Dsc/OvmfCryptoComponentsPei.dsc.inc
+!include OvmfPkg/Include/Dsc/OvmfCryptoComponentsSmm.dsc.inc
+!include OvmfPkg/Include/Dsc/OvmfCryptoComponentsDxe.dsc.inc
+
   #
   # Usb Support
   #
diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf
index 1ba24440..541e0df85e1d 100644
--- a/OvmfPkg/OvmfPkgX64.fdf
+++ b/OvmfPkg/OvmfPkgX64.fdf
@@ -189,6 +189,7 @@ [FV.PEIFV]
 INF  FILE_GUID = $(UP_CPU_PEI_GUID) UefiCpuPkg/CpuMpPei/CpuMpPei.inf
 
 !include OvmfPkg/OvmfTpmPei.fdf.inc
+!include OvmfPkg/Include/Fdf/OvmfCryptoPei.fdf.inc
 
 

 
@@ -414,6 +415,11 @@ [FV.DXEFV]
 #
 !include OvmfPkg/OvmfTpmDxe.fdf.inc
 
+#
+# Crypto support
+#
+!include OvmfPkg/Include/Fdf/OvmfCryptoDxeSmm.fdf.inc
+
 

 
 [FV.FVMAIN_COMPACT]
-- 
2.39.2



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




[edk2-devel] [PATCH v3 05/11] OvmfPkg: add OvmfCrypto*.inc

2023-03-09 Thread Gerd Hoffmann
Create include files for crypto support, so the configuration can be
shared for all OVMF build variants.  Also add support for using the
Crypto Driver.

The Crypto Driver is by default for enabled SMM + DXE and disabled for
PEI.  This can be changed using the {PEI,SMM,DXE}_USE_CRYPTO_DRIVER
options.  The config option is intended to be temporary and will
probably stay for one or two releases as fallback, then be removed.

The configuration follows mostly the recommendations given in
CryptoPkg/Readme.md, with some minor exceptions like only compiling
TLS support in case NETWORK_TLS_ENABLE is TRUE.

Signed-off-by: Gerd Hoffmann 
---
 .../Dsc/OvmfCryptoComponentsDxe.dsc.inc   | 23 ++
 .../Dsc/OvmfCryptoComponentsPei.dsc.inc   | 19 +
 .../Dsc/OvmfCryptoComponentsSmm.dsc.inc   | 18 +
 OvmfPkg/Include/Dsc/OvmfCryptoDefines.dsc.inc |  7 ++
 OvmfPkg/Include/Dsc/OvmfCryptoLibs.dsc.inc| 72 +++
 OvmfPkg/Include/Fdf/OvmfCryptoDxeSmm.fdf.inc  | 12 
 OvmfPkg/Include/Fdf/OvmfCryptoPei.fdf.inc |  7 ++
 7 files changed, 158 insertions(+)
 create mode 100644 OvmfPkg/Include/Dsc/OvmfCryptoComponentsDxe.dsc.inc
 create mode 100644 OvmfPkg/Include/Dsc/OvmfCryptoComponentsPei.dsc.inc
 create mode 100644 OvmfPkg/Include/Dsc/OvmfCryptoComponentsSmm.dsc.inc
 create mode 100644 OvmfPkg/Include/Dsc/OvmfCryptoDefines.dsc.inc
 create mode 100644 OvmfPkg/Include/Dsc/OvmfCryptoLibs.dsc.inc
 create mode 100644 OvmfPkg/Include/Fdf/OvmfCryptoDxeSmm.fdf.inc
 create mode 100644 OvmfPkg/Include/Fdf/OvmfCryptoPei.fdf.inc

diff --git a/OvmfPkg/Include/Dsc/OvmfCryptoComponentsDxe.dsc.inc 
b/OvmfPkg/Include/Dsc/OvmfCryptoComponentsDxe.dsc.inc
new file mode 100644
index ..72728aea68f5
--- /dev/null
+++ b/OvmfPkg/Include/Dsc/OvmfCryptoComponentsDxe.dsc.inc
@@ -0,0 +1,23 @@
+##
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+# mostly following CryptoPkg/Readme.md recommendations
+##
+
+!if $(DXE_USE_CRYPTO_DRIVER) == TRUE
+
+  CryptoPkg/Driver/CryptoDxe.inf {
+
+  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
+!if $(NETWORK_TLS_ENABLE) == TRUE
+  TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
+  OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
+!else
+  TlsLib|CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
+  OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+!endif
+
+!include CryptoPkg/Include/Dsc/CryptoServicePcd.min_dxe_smm.dsc.inc
+  }
+
+!endif
diff --git a/OvmfPkg/Include/Dsc/OvmfCryptoComponentsPei.dsc.inc 
b/OvmfPkg/Include/Dsc/OvmfCryptoComponentsPei.dsc.inc
new file mode 100644
index ..0457235f8eb0
--- /dev/null
+++ b/OvmfPkg/Include/Dsc/OvmfCryptoComponentsPei.dsc.inc
@@ -0,0 +1,19 @@
+##
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+# mostly following CryptoPkg/Readme.md recommendations
+##
+
+!if $(PEI_USE_CRYPTO_DRIVER) == TRUE
+
+  CryptoPkg/Driver/CryptoPei.inf {
+
+  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
+  TlsLib|CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
+  OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+
+#!include CryptoPkg/Include/Dsc/CryptoServicePcd.min_pei.dsc.inc
+!include CryptoPkg/Include/Dsc/CryptoServicePcd.hash_only.dsc.inc
+  }
+
+!endif
diff --git a/OvmfPkg/Include/Dsc/OvmfCryptoComponentsSmm.dsc.inc 
b/OvmfPkg/Include/Dsc/OvmfCryptoComponentsSmm.dsc.inc
new file mode 100644
index ..be1647397a60
--- /dev/null
+++ b/OvmfPkg/Include/Dsc/OvmfCryptoComponentsSmm.dsc.inc
@@ -0,0 +1,18 @@
+##
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+# mostly following CryptoPkg/Readme.md recommendations
+##
+
+!if $(SMM_USE_CRYPTO_DRIVER) == TRUE && $(SMM_REQUIRE) == TRUE
+
+  CryptoPkg/Driver/CryptoSmm.inf {
+
+  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
+  TlsLib|CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
+  OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+
+!include CryptoPkg/Include/Dsc/CryptoServicePcd.min_dxe_smm.dsc.inc
+  }
+
+!endif
diff --git a/OvmfPkg/Include/Dsc/OvmfCryptoDefines.dsc.inc 
b/OvmfPkg/Include/Dsc/OvmfCryptoDefines.dsc.inc
new file mode 100644
index ..f005f593b4eb
--- /dev/null
+++ b/OvmfPkg/Include/Dsc/OvmfCryptoDefines.dsc.inc
@@ -0,0 +1,7 @@
+##
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+
+  DEFINE PEI_USE_CRYPTO_DRIVER = FALSE
+  DEFINE SMM_USE_CRYPTO_DRIVER = TRUE
+  DEFINE DXE_USE_CRYPTO_DRIVER = TRUE
diff --git a/OvmfPkg/Include/Dsc/OvmfCryptoLibs.dsc.inc 
b/OvmfPkg/Include/Dsc/OvmfCryptoLibs.dsc.inc
new file mode 100644
index ..f9fdf36c1dab
--- /dev/null
+++ b/OvmfPkg/Include/Dsc/OvmfCryptoLibs.dsc.inc
@@ -0,0 +1,72 @@
+##
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+# mostly following CryptoPkg/Readme.md recommendations
+##
+
+[LibraryClasses]
+  HashApiLib|CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.inf
+  IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+

[edk2-devel] [PATCH v3 07/11] OvmfPkg: OvmfPkgIa32X64: use crypto includes

2023-03-09 Thread Gerd Hoffmann
Use the new crypto support include files.

Signed-off-by: Gerd Hoffmann 
---
 OvmfPkg/OvmfPkgIa32X64.dsc | 22 +-
 OvmfPkg/OvmfPkgIa32X64.fdf |  6 ++
 2 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
index 51db692b10fb..b032d4a3c99d 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -34,6 +34,7 @@ [Defines]
   DEFINE SOURCE_DEBUG_ENABLE = FALSE
 
 !include OvmfPkg/Include/Dsc/OvmfTpmDefines.dsc.inc
+!include OvmfPkg/Include/Dsc/OvmfCryptoDefines.dsc.inc
 
   #
   # Shell can be useful for debugging but should not be enabled for production
@@ -215,12 +216,6 @@ [LibraryClasses]
   LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf
   
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
 
-  IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
-!if $(NETWORK_TLS_ENABLE) == TRUE
-  OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
-!else
-  OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
-!endif
   RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
 
 !if $(SECURE_BOOT_ENABLE) == TRUE
@@ -243,10 +238,6 @@ [LibraryClasses]
   #
 !include NetworkPkg/NetworkLibs.dsc.inc
 
-!if $(NETWORK_TLS_ENABLE) == TRUE
-  TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
-!endif
-
 !if $(BUILD_SHELL) == TRUE
   ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
 !endif
@@ -257,9 +248,9 @@ [LibraryClasses]
   
OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf
 
 !include OvmfPkg/Include/Dsc/OvmfTpmLibs.dsc.inc
+!include OvmfPkg/Include/Dsc/OvmfCryptoLibs.dsc.inc
 
 [LibraryClasses.common]
-  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
   CcExitLib|UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.inf
   TdxLib|MdePkg/Library/TdxLib/TdxLib.inf
   TdxMailboxLib|OvmfPkg/Library/TdxMailboxLib/TdxMailboxLibNull.inf
@@ -364,7 +355,6 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER]
   DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf
 !endif
   UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
-  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
   PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf
   QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf
   
VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLibRuntimeDxe.inf
@@ -453,7 +443,6 @@ [LibraryClasses.common.DXE_SMM_DRIVER]
 !if $(SOURCE_DEBUG_ENABLE) == TRUE
   DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf
 !endif
-  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
   PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf
   
SmmCpuRendezvousLib|UefiCpuPkg/Library/SmmCpuRendezvousLib/SmmCpuRendezvousLib.inf
 
@@ -740,6 +729,7 @@ [Components.IA32]
   UefiCpuPkg/CpuMpPei/CpuMpPei.inf
 
 !include OvmfPkg/Include/Dsc/OvmfTpmComponentsPei.dsc.inc
+!include OvmfPkg/Include/Dsc/OvmfCryptoComponentsPei.dsc.inc
 
 [Components.X64]
   #
@@ -902,6 +892,12 @@ [Components.X64]
 
   OvmfPkg/VirtioNetDxe/VirtioNet.inf
 
+  #
+  # Crypto Support
+  #
+!include OvmfPkg/Include/Dsc/OvmfCryptoComponentsSmm.dsc.inc
+!include OvmfPkg/Include/Dsc/OvmfCryptoComponentsDxe.dsc.inc
+
   #
   # Usb Support
   #
diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf
index 4c5bd0dbc3b0..cf287303cb2c 100644
--- a/OvmfPkg/OvmfPkgIa32X64.fdf
+++ b/OvmfPkg/OvmfPkgIa32X64.fdf
@@ -173,6 +173,7 @@ [FV.PEIFV]
 INF  UefiCpuPkg/CpuMpPei/CpuMpPei.inf
 
 !include OvmfPkg/OvmfTpmPei.fdf.inc
+!include OvmfPkg/Include/Fdf/OvmfCryptoPei.fdf.inc
 
 

 
@@ -380,6 +381,11 @@ [FV.DXEFV]
 #
 !include OvmfPkg/OvmfTpmDxe.fdf.inc
 
+#
+# Crypto support
+#
+!include OvmfPkg/Include/Fdf/OvmfCryptoDxeSmm.fdf.inc
+
 

 
 [FV.FVMAIN_COMPACT]
-- 
2.39.2



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




[edk2-devel] [PATCH v3 04/11] BaseTools: GCC5: enable lto for noopt builds on IA32 and X64

2023-03-09 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann 
---
 BaseTools/Conf/tools_def.template | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/BaseTools/Conf/tools_def.template 
b/BaseTools/Conf/tools_def.template
index 471eb67c0c83..7f73ed817cd9 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -2310,8 +2310,8 @@ RELEASE_GCC49_AARCH64_DLINK_XIPFLAGS = -z 
common-page-size=0x20
 RELEASE_GCC5_IA32_CC_FLAGS   = DEF(GCC5_IA32_CC_FLAGS) -flto 
-Wno-unused-but-set-variable -Wno-unused-const-variable
 RELEASE_GCC5_IA32_DLINK_FLAGS= DEF(GCC5_IA32_X64_DLINK_FLAGS) -flto -Os 
-Wl,-m,elf_i386,--oformat=elf32-i386
 
-  NOOPT_GCC5_IA32_CC_FLAGS   = DEF(GCC5_IA32_CC_FLAGS) -O0
-  NOOPT_GCC5_IA32_DLINK_FLAGS= DEF(GCC5_IA32_X64_DLINK_FLAGS) 
-Wl,-m,elf_i386,--oformat=elf32-i386 -O0
+  NOOPT_GCC5_IA32_CC_FLAGS   = DEF(GCC5_IA32_CC_FLAGS) -flto -O0
+  NOOPT_GCC5_IA32_DLINK_FLAGS= DEF(GCC5_IA32_X64_DLINK_FLAGS) -flto 
-Wl,-m,elf_i386,--oformat=elf32-i386 -O0
 
 ##
 # GCC5 X64 definitions
@@ -2342,8 +2342,8 @@ RELEASE_GCC5_IA32_DLINK_FLAGS= 
DEF(GCC5_IA32_X64_DLINK_FLAGS) -flto -Os -Wl,
 RELEASE_GCC5_X64_CC_FLAGS= DEF(GCC5_X64_CC_FLAGS) -flto -DUSING_LTO 
-Wno-unused-but-set-variable -Wno-unused-const-variable
 RELEASE_GCC5_X64_DLINK_FLAGS = DEF(GCC5_X64_DLINK_FLAGS) -flto -Os
 
-  NOOPT_GCC5_X64_CC_FLAGS= DEF(GCC5_X64_CC_FLAGS) -O0
-  NOOPT_GCC5_X64_DLINK_FLAGS = DEF(GCC5_X64_DLINK_FLAGS) -O0
+  NOOPT_GCC5_X64_CC_FLAGS= DEF(GCC5_X64_CC_FLAGS) -flto -DUSING_LTO -O0
+  NOOPT_GCC5_X64_DLINK_FLAGS = DEF(GCC5_X64_DLINK_FLAGS) -flto -O0
 
 ##
 # GCC5 ARM definitions
-- 
2.39.2



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




[edk2-devel] [PATCH v3 02/11] CryptoPkg/Driver: add CryptoServicePcd.hash_only.dsc.inc

2023-03-09 Thread Gerd Hoffmann
Contains only hash functions needed for measurements.

Signed-off-by: Gerd Hoffmann 
---
 CryptoPkg/Include/Dsc/CryptoServicePcd.hash_only.dsc.inc | 8 
 1 file changed, 8 insertions(+)
 create mode 100644 CryptoPkg/Include/Dsc/CryptoServicePcd.hash_only.dsc.inc

diff --git a/CryptoPkg/Include/Dsc/CryptoServicePcd.hash_only.dsc.inc 
b/CryptoPkg/Include/Dsc/CryptoServicePcd.hash_only.dsc.inc
new file mode 100644
index ..0d5402be9a1a
--- /dev/null
+++ b/CryptoPkg/Include/Dsc/CryptoServicePcd.hash_only.dsc.inc
@@ -0,0 +1,8 @@
+##
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha1.Family 
| PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Family   
| PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Family   
| PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha512.Family   
| PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sm3.Family  
| PCD_CRYPTO_SERVICE_ENABLE_FAMILY
-- 
2.39.2



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




[edk2-devel] [PATCH v3 03/11] CryptoPkg/Driver: add TPM hashes to CryptoServicePcd.min_dxe_smm.dsc.inc

2023-03-09 Thread Gerd Hoffmann
Enable Sha384 + Sha512 + Sm3.

Signed-off-by: Gerd Hoffmann 
---
 CryptoPkg/Include/Dsc/CryptoServicePcd.min_dxe_smm.dsc.inc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/CryptoPkg/Include/Dsc/CryptoServicePcd.min_dxe_smm.dsc.inc 
b/CryptoPkg/Include/Dsc/CryptoServicePcd.min_dxe_smm.dsc.inc
index aaf35e4c6061..9209b4c526a7 100644
--- a/CryptoPkg/Include/Dsc/CryptoServicePcd.min_dxe_smm.dsc.inc
+++ b/CryptoPkg/Include/Dsc/CryptoServicePcd.min_dxe_smm.dsc.inc
@@ -18,7 +18,9 @@
   
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.GetPublicKeyFromX509
| TRUE
   gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha1.Family 
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
   gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Family   
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
-  
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Services.HashAll
  | FALSE
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Family   
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha512.Family   
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sm3.Family  
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
   
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.X509.Services.GetSubjectName
 | TRUE
   
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.X509.Services.GetCommonName
  | TRUE
   
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.X509.Services.GetOrganizationName
| TRUE
-- 
2.39.2



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




[edk2-devel] [PATCH v3 01/11] CryptoPkg/Driver: move PCD configs to include files

2023-03-09 Thread Gerd Hoffmann
Makes it easier to reuse the predefined config sets in other places.

Signed-off-by: Gerd Hoffmann 
---
 .../Include/Dsc/CryptoServicePcd.all.dsc.inc  | 29 +++
 .../Dsc/CryptoServicePcd.min_dxe_smm.dsc.inc  | 35 +
 .../Dsc/CryptoServicePcd.min_pei.dsc.inc  | 20 +
 CryptoPkg/CryptoPkg.dsc   | 78 +--
 4 files changed, 87 insertions(+), 75 deletions(-)
 create mode 100644 CryptoPkg/Include/Dsc/CryptoServicePcd.all.dsc.inc
 create mode 100644 CryptoPkg/Include/Dsc/CryptoServicePcd.min_dxe_smm.dsc.inc
 create mode 100644 CryptoPkg/Include/Dsc/CryptoServicePcd.min_pei.dsc.inc

diff --git a/CryptoPkg/Include/Dsc/CryptoServicePcd.all.dsc.inc 
b/CryptoPkg/Include/Dsc/CryptoServicePcd.all.dsc.inc
new file mode 100644
index ..1c3ffa461ca5
--- /dev/null
+++ b/CryptoPkg/Include/Dsc/CryptoServicePcd.all.dsc.inc
@@ -0,0 +1,29 @@
+##
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Family   
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha384.Family   
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Family 
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Dh.Family   
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Random.Family   
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Family  
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha1.Family 
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Family   
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Family   
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha512.Family   
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.X509.Family 
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Aes.Services.GetContextSize
  | TRUE
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Aes.Services.Init   
 | TRUE
+  
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Aes.Services.CbcEncrypt
  | TRUE
+  
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Aes.Services.CbcDecrypt
  | TRUE
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Arc4.Family 
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sm3.Family  
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Hkdf.Family 
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Tls.Family  
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.TlsSet.Family   
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.TlsGet.Family   
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.RsaPss.Family   
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.ParallelHash.Family 
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.AeadAesGcm.Family   
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Bn.Family   
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Ec.Family   
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
diff --git a/CryptoPkg/Include/Dsc/CryptoServicePcd.min_dxe_smm.dsc.inc 
b/CryptoPkg/Include/Dsc/CryptoServicePcd.min_dxe_smm.dsc.inc
new file mode 100644
index ..aaf35e4c6061
--- /dev/null
+++ b/CryptoPkg/Include/Dsc/CryptoServicePcd.min_dxe_smm.dsc.inc
@@ -0,0 +1,35 @@
+##
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Family   
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
+  gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha384.Family   
 | 

[edk2-devel] [PATCH v3 00/11] OvmfPkg: add Crypto Driver support

2023-03-09 Thread Gerd Hoffmann
v3 changes:
 - rebase to latest master.
 - enable crypto driver only for SMM + DXE.
 - CI passes now \o/
v2 changes:
 - turn on crypto driver support by default.
 - left the config option in for now as fallback option.
   When all goes as planned remove it one or two releases
   later.
 - fix various build problems.

Gerd Hoffmann (11):
  CryptoPkg/Driver: move PCD configs to include files
  CryptoPkg/Driver: add CryptoServicePcd.hash_only.dsc.inc
  CryptoPkg/Driver: add TPM hashes to
CryptoServicePcd.min_dxe_smm.dsc.inc
  BaseTools: GCC5: enable lto for noopt builds on IA32 and X64
  OvmfPkg: add OvmfCrypto*.inc
  OvmfPkg: OvmfPkgX64: use crypto includes
  OvmfPkg: OvmfPkgIa32X64: use crypto includes
  OvmfPkg: OvmfPkgIa32: use crypto includes
  OvmfPkg: Microvm: use crypto includes
  OvmfPkg: IntelTdx: use crypto includes
  OvmfPkg: AmdSev: use crypto includes

 .../Include/Dsc/CryptoServicePcd.all.dsc.inc  | 29 +++
 .../Dsc/CryptoServicePcd.hash_only.dsc.inc|  8 ++
 .../Dsc/CryptoServicePcd.min_dxe_smm.dsc.inc  | 37 +
 .../Dsc/CryptoServicePcd.min_pei.dsc.inc  | 20 +
 .../Dsc/OvmfCryptoComponentsDxe.dsc.inc   | 23 ++
 .../Dsc/OvmfCryptoComponentsPei.dsc.inc   | 19 +
 .../Dsc/OvmfCryptoComponentsSmm.dsc.inc   | 18 +
 OvmfPkg/Include/Dsc/OvmfCryptoDefines.dsc.inc |  7 ++
 OvmfPkg/Include/Dsc/OvmfCryptoLibs.dsc.inc| 72 +
 CryptoPkg/CryptoPkg.dsc   | 78 +--
 OvmfPkg/AmdSev/AmdSevX64.dsc  | 12 ++-
 OvmfPkg/IntelTdx/IntelTdxX64.dsc  | 15 ++--
 OvmfPkg/Microvm/MicrovmX64.dsc| 24 +++---
 OvmfPkg/OvmfPkgIa32.dsc   | 22 +++---
 OvmfPkg/OvmfPkgIa32X64.dsc| 22 +++---
 OvmfPkg/OvmfPkgX64.dsc| 22 +++---
 OvmfPkg/AmdSev/AmdSevX64.fdf  |  6 ++
 OvmfPkg/IntelTdx/IntelTdxX64.fdf  |  5 ++
 OvmfPkg/Microvm/MicrovmX64.fdf|  7 ++
 OvmfPkg/OvmfPkgIa32.fdf   |  6 ++
 OvmfPkg/OvmfPkgIa32X64.fdf|  6 ++
 OvmfPkg/OvmfPkgX64.fdf|  6 ++
 BaseTools/Conf/tools_def.template |  8 +-
 OvmfPkg/Include/Fdf/OvmfCryptoDxeSmm.fdf.inc  | 12 +++
 OvmfPkg/Include/Fdf/OvmfCryptoPei.fdf.inc |  7 ++
 25 files changed, 350 insertions(+), 141 deletions(-)
 create mode 100644 CryptoPkg/Include/Dsc/CryptoServicePcd.all.dsc.inc
 create mode 100644 CryptoPkg/Include/Dsc/CryptoServicePcd.hash_only.dsc.inc
 create mode 100644 CryptoPkg/Include/Dsc/CryptoServicePcd.min_dxe_smm.dsc.inc
 create mode 100644 CryptoPkg/Include/Dsc/CryptoServicePcd.min_pei.dsc.inc
 create mode 100644 OvmfPkg/Include/Dsc/OvmfCryptoComponentsDxe.dsc.inc
 create mode 100644 OvmfPkg/Include/Dsc/OvmfCryptoComponentsPei.dsc.inc
 create mode 100644 OvmfPkg/Include/Dsc/OvmfCryptoComponentsSmm.dsc.inc
 create mode 100644 OvmfPkg/Include/Dsc/OvmfCryptoDefines.dsc.inc
 create mode 100644 OvmfPkg/Include/Dsc/OvmfCryptoLibs.dsc.inc
 create mode 100644 OvmfPkg/Include/Fdf/OvmfCryptoDxeSmm.fdf.inc
 create mode 100644 OvmfPkg/Include/Fdf/OvmfCryptoPei.fdf.inc

-- 
2.39.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100931): https://edk2.groups.io/g/devel/message/100931
Mute This Topic: https://groups.io/mt/97493569/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 1/1] DynamicTablesPkg: Add SMBIOS table generation

2023-03-09 Thread Sami Mujawar
Hi Girish,


On 08/03/2023, 19:21, "Girish Mahadevan" mailto:gmahade...@nvidia.com>> wrote:


Hi Sami,


Thanks for your response.


I will update my patch series based on v2 of your dispatcher code and 
point you to v3. (mid/late next week)


Can you also merge the Smbios String related patch (the 
SmbiosStringLibrary).
It works well. (I think I've ack'd that patch).
[SAMI] I will get the SmbiosStringLibrary merged soon. 

Regards,

Sami Mujawar

My responses inline [GM].


Best Regards
Girish


On 3/8/2023 1:31 AM, Sami Mujawar wrote:
> *External email: Use caution opening links or attachments*
> 
> 
> Hi Girish,
> 
> Apologies for the delay in reply and thank you for this patch and for 
> sharing the link to the github branch.
> 
> I have also posted a v2 series for the SMBIOS dispatcher at 
> https://edk2.groups.io/g/devel/message/100833 
> . Any feedback would be 
> most appreciated.
> 
> It appears that DynamicTableManagerDxe.c and AcpiTableBuilder.c are a 
> mix of latest edk2 upstream and an older version. Can you check, please? 
> Also, this patch could be split into smaller chunks.
> 
> Other than that, please see my response inline marked [SAMI].
> 
> Regards,
> 
> Sami Mujawar
> 
> On 27/01/2023 11:58 pm, Girish Mahadevan wrote:
>> Add the SMBIOS Table generator code to the DynamicTablesPkg.
>>
>> This change includes adding new logic to the DynamicTableManager
>> to process and add SMBIOS tables and augmenting the existing SMBIOS
>> Factory generator to include installing multiple SMBIOS tables .
>> Also included is running the SMBIOS and ACPI table generation as part
>> of the SMBIOS and ACPI protocol GUID callback notifications respectively.
>>
>> The change can be seen at
>> https://github.com/gmahadevan/edk2-upstream/commits/RFC/smbios-dyntables 
>> 
>>
>> Signed-off-by: Girish Mahadevan> >
>> Reviewed-by: Jeff Brasenmailto:jbra...@nvidia.com>>
>> ---
>> .../DynamicTableFactory.h | 5 +
>> .../DynamicTableFactoryDxe.c | 7 +
>> .../SmbiosTableFactory/SmbiosTableFactory.c | 66 ++
>> .../DynamicTableManagerDxe/AcpiTableBuilder.c | 732 
>> .../DynamicTableManagerDxe.c | 794 +-
>> .../DynamicTableManagerDxe.inf | 5 +-
>> .../SmbiosTableBuilder.c | 608 ++
>> .../Include/ConfigurationManagerObject.h | 18 +-
>> .../Protocol/DynamicTableFactoryProtocol.h | 8 +
>> .../Include/SmbiosTableGenerator.h | 165 +++-
>> 10 files changed, 1653 insertions(+), 755 deletions(-)
>> create mode 100644 
>> DynamicTablesPkg/Drivers/DynamicTableManagerDxe/AcpiTableBuilder.c
>> create mode 100644 
>> DynamicTablesPkg/Drivers/DynamicTableManagerDxe/SmbiosTableBuilder.c
>>
>> diff --git 
>> a/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactory.h 
>> b/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactory.h
>> index b160dcf8ad..20e438ea70 100644
>> --- a/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactory.h
>> +++ b/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactory.h
>> @@ -49,6 +49,11 @@ typedef struct DynamicTableFactoryInfo {
>> CustomDtTableGeneratorList[FixedPcdGet16 (
>> PcdMaxCustomDTGenerators
>> )];
>> +
>> + /// An array for holding a map of SMBIOS handles and the CM Object
>> + /// token used to build the SMBIOS record.
>> + SMBIOS_HANDLE_MAP
>> + SmbiosHandleMap[MAX_SMBIOS_HANDLES];
>> } EDKII_DYNAMIC_TABLE_FACTORY_INFO;
>> 
>> /** Return a pointer to the ACPI table generator.
>> diff --git 
>> a/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.c 
>> b/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.c
>> index 6d6d3fa746..d0ee5d7b3b 100644
>> --- 
>> a/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.c
>> +++ 
>> b/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.c
>> @@ -44,6 +44,8 @@ EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL 
>> DynamicTableFactoryProtocol = {
>> GetDtTableGenerator,
>> RegisterDtTableGenerator,
>> DeregisterDtTableGenerator,
>> + AddSmbiosHandle,
>> + FindSmbiosHandle,
>> 
>> };
>> 
>> @@ -65,7 +67,12 @@ DynamicTableFactoryDxeInitialize (
>> )
>> {
>> EFI_STATUS Status;
>> + UINTN Idx;
>> 
>> + for (Idx = 0; Idx < MAX_SMBIOS_HANDLES; Idx++) {
>> + TableFactoryInfo.SmbiosHandleMap[Idx].SmbiosTblHandle = 
>> SMBIOS_HANDLE_PI_RESERVED;
>> + TableFactoryInfo.SmbiosHandleMap[Idx].SmbiosCmToken = 0;
>> + }
>> Status = gBS->InstallProtocolInterface (
>> ,
>> ,
>> diff --git 
>> a/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/SmbiosTableFactory/SmbiosTableFactory.c
>>  
>> b/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/SmbiosTableFactory/SmbiosTableFactory.c
>> index 87795919f8..b81724d2a0 100644
>> --- 
>> a/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/SmbiosTableFactory/SmbiosTableFactory.c
>> +++ 
>> 

Re: [edk2-devel] [PATCH v2 2/4] DynamicTablesPkg: Add SMBIOS table dispatcher

2023-03-09 Thread Sami Mujawar
Hi Girish,

Thank you for your feedback.

Please find my response inline marked [SAMI].

Regards,

Sami Mujawar

On 08/03/2023, 17:41, "Girish Mahadevan" mailto:gmahade...@nvidia.com>> wrote:


Hi Sami


Thanks for v2, I will apply these to my tree and test it out.
One small comment before I review/test the patch train inline (prefixed 
by [GM])


Best Regards
Girish


On 3/8/2023 1:16 AM, Sami Mujawar wrote:
> External email: Use caution opening links or attachments
> 
> 
> Some SMBIOS structure/table fields have dependency on other SMBIOS
> structures/tables. These dependencies are established using handles
> pointing to the dependent tables.
> 
> A SMBIOS table handle can be obtained by either installing a SMBIOS
> table or by allocating a handle, which requires complex management
> to avoid any clashes.
> 
> Obtaining a SMBIOS handle by installation requires that the dependent
> table is installed before the parent SMBIOS table can be installed.
> Therefore, introduce a SMBIOS table dispatcher that walks the SMBIOS
> dependency list and schedules the dependent tables to be installed
> before the parent table is installed.
> 
> Signed-off-by: Sami Mujawar  >
> Cc: Alexei Fedorov mailto:alexei.fedo...@arm.com>>
> Cc: Pierre Gondois mailto:pierre.gond...@arm.com>>
> Cc: Girish Mahadevan mailto:gmahade...@nvidia.com>>
> Cc: Jeff Brasen mailto:jbra...@nvidia.com>>
> Cc: Ashish Singhal mailto:ashishsin...@nvidia.com>>
> Cc: Nick Ramirez mailto:nrami...@nvidia.com>>
> Cc: William Watson mailto:wwat...@nvidia.com>>
> Cc: Abner Chang mailto:abner.ch...@amd.com>>
> Cc: Samer El-Haj-Mahmoud  >
> Cc: Jose Marinho mailto:jose.mari...@arm.com>>
> ---
> 
> Notes:
> v2:
> - Update dispatcher state machine to remove StUnknown. [SAMI]
> - Move extern function to header file and move debug [ABNER]
> code together.
> - Updated code based on review feedback to move extern [SAMI]
> function to header file and also moved the debug code
> together.
> Ref: https://edk2.groups.io/g/devel/message/95341 
> 
> 
> DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf | 
> 4 +-
> DynamicTablesPkg/Drivers/DynamicTableManagerDxe/SmbiosTableDispatcher.c | 282 
> 
> DynamicTablesPkg/Drivers/DynamicTableManagerDxe/SmbiosTableDispatcher.h | 159 
> +++
> 3 files changed, 444 insertions(+), 1 deletion(-)
> 
> diff --git 
> a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf 
> b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf
> index 
> ad8b3d037c169ca848b5ea84fd1086b83f37876f..b09272d883c6f4f05eb03dcdab3efeda92b2fbb6
>  100644
> --- 
> a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf
> +++ 
> b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf
> @@ -1,7 +1,7 @@
> ## @file
> # Module that drives the table generation and installation process.
> #
> -# Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
> +# Copyright (c) 2017 - 2022, Arm Limited. All rights reserved.
> #
> # SPDX-License-Identifier: BSD-2-Clause-Patent
> ##
> @@ -22,6 +22,8 @@ [Defines]
> 
> [Sources]
> DynamicTableManagerDxe.c
> + SmbiosTableDispatcher.c
> + SmbiosTableDispatcher.h
> 
> [Packages]
> MdePkg/MdePkg.dec
> diff --git 
> a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/SmbiosTableDispatcher.c 
> b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/SmbiosTableDispatcher.c
> new file mode 100644
> index 
> ..0e728538d9f6eb0b164fea3a160d3233db833f8d
> --- /dev/null
> +++ b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/SmbiosTableDispatcher.c
> @@ -0,0 +1,282 @@
> +/** @file
> + Dynamic Smbios Table Dispatcher
> +
> + Copyright (c) 2022 - 2023, Arm Limited. All rights reserved.
> +
> + SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +
> +/**
> + The SMBIOS dispatcher state table.
> +
> + The SMBIOS dispatcher state table is used to establish the dependency
> + order in which the SMBIOS tables are installed. This allows the SMBIOS
> + dispatcher to dispatch the dependent tables for installation before the
> + parent table is installed.
> + The SMBIOS_TABLE_DISPATCHER.Dependency[] field is used to establish the
> + dependency list.
> + Elements in the Dependency list are resolved by increasing index. However,
> + all orders are equivalent as:
> + - the Parent SMBIOS table will only be installed once all dependencies
> + have been satisfied.
> + - no cyclic dependency is allowed.
> + The dependency list is terminated by SMTT_NULL.
> +*/
> +STATIC
> +SMBIOS_TABLE_DISPATCHER mSmBiosDispatcher[MAX_SMBIOS_TABLES] = {
> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_BIOS_INFORMATION, SMTT_NULL, SMTT_NULL, 
> SMTT_NULL, SMTT_NULL, SMTT_NULL),
> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_SYSTEM_INFORMATION, SMTT_NULL, 

[edk2-devel] [PATCH v3 2/2] UefiPayloadPkg: Move INT prog outside common flow

2023-03-09 Thread Dhaval Sharma
8259 is very arch specific programming. It needs to be moved out to
the respective arch flow. Added in both x64 and x32 paths

Test: Able to boot UEFI shell with Coreboot Tianocore payload on
x86 qemu

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Sean Rhodes 
Cc: James Lu 
Cc: Gua Guo 

Signed-off-by: Dhaval Sharma 
---

Notes:
v3:
- Added legacy INT intialization to X64 path as well

 UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c  | 6 ++
 UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c | 6 --
 UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c   | 6 ++
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c 
b/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c
index 9d2bfb2fa654..d41e5024b4a1 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c
@@ -271,6 +271,12 @@ HandOffToDxeCore (
   // Initialize floating point operating environment to be compliant with UEFI 
spec.
   InitializeFloatingPointUnits ();
 
+  //
+  // Mask off all legacy 8259 interrupt sources
+  //
+  IoWrite8 (LEGACY_8259_MASK_REGISTER_MASTER, 0xFF);
+  IoWrite8 (LEGACY_8259_MASK_REGISTER_SLAVE, 0xFF);
+
   //
   // Clear page 0 and mark it as allocated if NULL pointer detection is 
enabled.
   //
diff --git a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c 
b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
index 07f4c1d29686..45127689a24b 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
@@ -478,12 +478,6 @@ _ModuleEntryPoint (
   Status = UniversalLoadDxeCore (DxeFv, );
   ASSERT_EFI_ERROR (Status);
 
-  //
-  // Mask off all legacy 8259 interrupt sources
-  //
-  IoWrite8 (LEGACY_8259_MASK_REGISTER_MASTER, 0xFF);
-  IoWrite8 (LEGACY_8259_MASK_REGISTER_SLAVE, 0xFF);
-
   Hob.HandoffInformationTable = (EFI_HOB_HANDOFF_INFO_TABLE *)GetFirstHob 
(EFI_HOB_TYPE_HANDOFF);
   HandOffToDxeCore (DxeCoreEntryPoint, Hob);
 
diff --git a/UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c 
b/UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c
index 84a6112ce64a..1dfb7459e85a 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c
@@ -43,6 +43,12 @@ HandOffToDxeCore (
   // Initialize floating point operating environment to be compliant with UEFI 
spec.
   InitializeFloatingPointUnits ();
 
+  //
+  // Mask off all legacy 8259 interrupt sources
+  //
+  IoWrite8 (LEGACY_8259_MASK_REGISTER_MASTER, 0xFF);
+  IoWrite8 (LEGACY_8259_MASK_REGISTER_SLAVE, 0xFF);
+
   //
   // Clear page 0 and mark it as allocated if NULL pointer detection is 
enabled.
   //
-- 
2.40.0.rc0.57.g454dfcbddf



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




[edk2-devel] [PATCH v3 1/2] UefiPayloadPkg: Remove FP Init from UPL entry

2023-03-09 Thread Dhaval Sharma
According to UPL spec BL should initialize FP init meaning UPL
does not need to initialize it. Besides this is arch specific init
and needs to be moved out of UPL common flow. In order to not break
current BL implementations, for now just moving the init to later
point of time but for both x32 and x64 eventually this should be
removed once BL impelement this logic.

Test: Verified booting  UEFI shell on coreboot on qemu.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Sean Rhodes 
Cc: James Lu 
Cc: Gua Guo 

Signed-off-by: Dhaval Sharma 
---

Notes:
v3:
- Added FP initialization to X64 path as well

 UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c  | 3 +++
 UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c | 3 ---
 UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c   | 3 +++
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c 
b/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c
index c66e56aee15a..9d2bfb2fa654 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c
@@ -268,6 +268,9 @@ HandOffToDxeCore (
   UINT32   Index;
   X64_IDT_TABLE*IdtTableForX64;
 
+  // Initialize floating point operating environment to be compliant with UEFI 
spec.
+  InitializeFloatingPointUnits ();
+
   //
   // Clear page 0 and mark it as allocated if NULL pointer detection is 
enabled.
   //
diff --git a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c 
b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
index 46ee27c905e9..07f4c1d29686 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
@@ -470,9 +470,6 @@ _ModuleEntryPoint (
 PrintHob (mHobList);
 );
 
-  // Initialize floating point operating environment to be compliant with UEFI 
spec.
-  InitializeFloatingPointUnits ();
-
   // Build HOB based on information from Bootloader
   Status = BuildHobs (BootloaderParameter, );
   ASSERT_EFI_ERROR (Status);
diff --git a/UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c 
b/UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c
index 346e3feb0459..84a6112ce64a 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c
@@ -40,6 +40,9 @@ HandOffToDxeCore (
   VOID   *GhcbBase;
   UINTN  GhcbSize;
 
+  // Initialize floating point operating environment to be compliant with UEFI 
spec.
+  InitializeFloatingPointUnits ();
+
   //
   // Clear page 0 and mark it as allocated if NULL pointer detection is 
enabled.
   //
-- 
2.40.0.rc0.57.g454dfcbddf



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




[edk2-devel] [PATCH v3 0/2] Upl remove arch spec initialization

2023-03-09 Thread Dhaval Sharma
Looking at adding support for Risc-V for UPL. In the process realised
there are several initialisation sequences which need not be part of
common UPL entry flow. The flow should be agnostic to both BL and Arch
with required hooks provided along the boot path. This patch set
addresses 2 such instances related to 8259 interrupt and FP programming.
To be on a safer side for now just moving this init to arch folders.

Dhaval Sharma (2):
  UefiPayloadPkg: Remove FP Init from UPL entry
  UefiPayloadPkg: Move INT prog outside common flow

 UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c  | 9 +
 UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c | 9 -
 UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c   | 9 +
 3 files changed, 18 insertions(+), 9 deletions(-)

-- 
2.40.0.rc0.57.g454dfcbddf



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100926): https://edk2.groups.io/g/devel/message/100926
Mute This Topic: https://groups.io/mt/97493282/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/1] OvmfPkg/SmbiosPlatformDxe: tweak fallback release date

2023-03-09 Thread Ard Biesheuvel
On Thu, 9 Mar 2023 at 10:02, Gerd Hoffmann  wrote:
>
> In case PcdFirmwareReleaseDateString is not set use a valid date
> as fallback.  Using "unknown" makes Windows unhappy.
>
> Fixes: 4cb94f20b002 ("OvmfPkg/SmbiosPlatformDxe: use PcdFirmware*")
> Reported-by: ruifeng@intel.com
> Signed-off-by: Gerd Hoffmann 

Ack. Will queue this one up as well, thanks.

> ---
>  OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c 
> b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c
> index dc1e6aed634f..0ca37760455c 100644
> --- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c
> +++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c
> @@ -160,7 +160,7 @@ InstallAllStructures (
>  DateStr = (CHAR16 *)FixedPcdGetPtr (PcdFirmwareReleaseDateString);
>  DateLen = StrLen (DateStr);
>  if (DateLen < 3) {
> -  DateStr = L"unknown";
> +  DateStr = L"2/2/2022";
>DateLen = StrLen (DateStr);
>  }
>
> --
> 2.39.2
>
>
>
> 
>
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100925): https://edk2.groups.io/g/devel/message/100925
Mute This Topic: https://groups.io/mt/97492398/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/1] ArmPkg/SemihostFs: replace SetMem with ZeroMem

2023-03-09 Thread Ard Biesheuvel
On Thu, 9 Mar 2023 at 10:16, Gerd Hoffmann  wrote:
>
> Ping.  Two reviews and the freeze is over.  Merge this now?
>

Pong. Thanks for the reminder - I'll go and merge this.

> On Wed, Feb 15, 2023 at 03:37:32PM +0100, Gerd Hoffmann wrote:
> > SetMem arguments 2+3 are in the wrong order, resulting in
> > the call having no effect because Length is zero.
> >
> > Fix this by using ZeroMem instead.
> >
> > Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=4205
> > Reported-by: Jeremy Boone 
> > Signed-off-by: Gerd Hoffmann 
> > ---
> >  ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c 
> > b/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c
> > index 39a30533ee57..9cc9ed7d3637 100644
> > --- a/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c
> > +++ b/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c
> > @@ -574,7 +574,7 @@ ExtendFile (
> >}
> >
> >Remaining = Size;
> > -  SetMem (WriteBuffer, 0, sizeof (WriteBuffer));
> > +  ZeroMem (WriteBuffer, sizeof (WriteBuffer));
> >while (Remaining > 0) {
> >  WriteNb   = MIN (Remaining, sizeof (WriteBuffer));
> >  WriteSize = WriteNb;
> > --
> > 2.39.1
> >
>
> --
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100924): https://edk2.groups.io/g/devel/message/100924
Mute This Topic: https://groups.io/mt/96983558/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/1] ArmPkg/SemihostFs: replace SetMem with ZeroMem

2023-03-09 Thread Gerd Hoffmann
Ping.  Two reviews and the freeze is over.  Merge this now?

On Wed, Feb 15, 2023 at 03:37:32PM +0100, Gerd Hoffmann wrote:
> SetMem arguments 2+3 are in the wrong order, resulting in
> the call having no effect because Length is zero.
> 
> Fix this by using ZeroMem instead.
> 
> Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=4205
> Reported-by: Jeremy Boone 
> Signed-off-by: Gerd Hoffmann 
> ---
>  ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c 
> b/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c
> index 39a30533ee57..9cc9ed7d3637 100644
> --- a/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c
> +++ b/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c
> @@ -574,7 +574,7 @@ ExtendFile (
>}
>  
>Remaining = Size;
> -  SetMem (WriteBuffer, 0, sizeof (WriteBuffer));
> +  ZeroMem (WriteBuffer, sizeof (WriteBuffer));
>while (Remaining > 0) {
>  WriteNb   = MIN (Remaining, sizeof (WriteBuffer));
>  WriteSize = WriteNb;
> -- 
> 2.39.1
> 

-- 



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




[edk2-devel] [PATCH 1/1] OvmfPkg/SmbiosPlatformDxe: tweak fallback release date

2023-03-09 Thread Gerd Hoffmann
In case PcdFirmwareReleaseDateString is not set use a valid date
as fallback.  Using "unknown" makes Windows unhappy.

Fixes: 4cb94f20b002 ("OvmfPkg/SmbiosPlatformDxe: use PcdFirmware*")
Reported-by: ruifeng@intel.com
Signed-off-by: Gerd Hoffmann 
---
 OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c 
b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c
index dc1e6aed634f..0ca37760455c 100644
--- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c
+++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c
@@ -160,7 +160,7 @@ InstallAllStructures (
 DateStr = (CHAR16 *)FixedPcdGetPtr (PcdFirmwareReleaseDateString);
 DateLen = StrLen (DateStr);
 if (DateLen < 3) {
-  DateStr = L"unknown";
+  DateStr = L"2/2/2022";
   DateLen = StrLen (DateStr);
 }
 
-- 
2.39.2



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