Re: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record types support in FitGen.c

2022-10-27 Thread Bob Feng
Hi Pavamana,

I found there are few patch format issues.  Please use 
edk2\BaseTools\Scripts\PatchCheck.py to check the patch and fix them. After 
that, I’ll merge it.

Thanks,
Bob

From: devel@edk2.groups.io  On Behalf Of gaoliming via 
groups.io
Sent: Friday, October 28, 2022 9:11 AM
To: Holland, Michael ; Hv, Pavamana 
; devel@edk2.groups.io; Chaganty, Rangasai V 
; Lohr, Paul A ; Feng, 
Bob C 
Subject: 回复: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record 
types support in FitGen.c

Michael:
 Thanks for your sharing.

Pavamana:
 FIT spec 1.4 has been published. So, this change can be merged now.

Thanks
Liming
发件人: Holland, Michael 
mailto:michael.holl...@intel.com>>
发送时间: 2022年10月28日 1:41
收件人: Gao, Liming mailto:gaolim...@byosoft.com.cn>>; 
Hv, Pavamana mailto:pavamana...@intel.com>>; 
devel@edk2.groups.io; Chaganty, Rangasai V 
mailto:rangasai.v.chaga...@intel.com>>; Lohr, 
Paul A mailto:paul.a.l...@intel.com>>; Feng, Bob C 
mailto:bob.c.f...@intel.com>>
主题: RE: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record types 
support in FitGen.c

Hi Liming,

Please see published FIT spec 1.4:  
https://edc.intel.com/content/www/us/en/design/products-and-solutions/software-and-services/firmware-and-bios/firmware-interface-table/

Thanks,
Michael

From: gaoliming mailto:gaolim...@byosoft.com.cn>>
Sent: Wednesday, October 26, 2022 07:59 PM
To: Hv, Pavamana mailto:pavamana...@intel.com>>; 
Holland, Michael mailto:michael.holl...@intel.com>>; 
devel@edk2.groups.io; Chaganty, Rangasai V 
mailto:rangasai.v.chaga...@intel.com>>; Lohr, 
Paul A mailto:paul.a.l...@intel.com>>; Feng, Bob C 
mailto:bob.c.f...@intel.com>>
Subject: 回复: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record 
types support in FitGen.c

Pavamana:
 The change should be merged after new FIT spec is published, because FitGen 
tool follows the public FIT spec.

Thanks
Liming
发件人: Hv, Pavamana mailto:pavamana...@intel.com>>
发送时间: 2022年10月26日 23:13
收件人: Holland, Michael 
mailto:michael.holl...@intel.com>>; Gao, Liming 
mailto:gaolim...@byosoft.com.cn>>; 
devel@edk2.groups.io; Chaganty, Rangasai V 
mailto:rangasai.v.chaga...@intel.com>>; Lohr, 
Paul A mailto:paul.a.l...@intel.com>>; Feng, Bob C 
mailto:bob.c.f...@intel.com>>
主题: RE: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record types 
support in FitGen.c

Thanks for the review, Liming.
@Feng, Bob C,
What is the next step to merge the change?
Let me know if anything is needed from me.
Thanks for your help again.
Regards,
Pavamana


From: Holland, Michael 
mailto:michael.holl...@intel.com>>
Sent: Tuesday, October 25, 2022 8:36 PM
To: Gao, Liming mailto:gaolim...@byosoft.com.cn>>; 
devel@edk2.groups.io; Hv, Pavamana 
mailto:pavamana...@intel.com>>; Chaganty, Rangasai V 
mailto:rangasai.v.chaga...@intel.com>>; Lohr, 
Paul A mailto:paul.a.l...@intel.com>>
Cc: Feng, Bob C mailto:bob.c.f...@intel.com>>
Subject: RE: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record 
types support in FitGen.c

Hi Liming,

The spec is in process of being published.

@Chaganty, Rangasai V @Lohr, Paul 
A

Any update on FIT spec being published?

Thanks,
Michael

From: gaoliming mailto:gaolim...@byosoft.com.cn>>
Sent: Tuesday, October 25, 2022 09:18 PM
To: devel@edk2.groups.io; Hv, Pavamana 
mailto:pavamana...@intel.com>>
Cc: Feng, Bob C mailto:bob.c.f...@intel.com>>; Holland, 
Michael mailto:michael.holl...@intel.com>>
Subject: 回复: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record 
types support in FitGen.c


Pavamana:

 The code change looks good. Now,  is FIT spec 1.4 public to be downloaded?

Thanks
Liming
发件人: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>> 代表 Hv, Pavamana
发送时间: 2022年10月26日 5:50
收件人: devel@edk2.groups.io; Gao, Liming 
mailto:gaolim...@byosoft.com.cn>>
抄送: Feng, Bob C mailto:bob.c.f...@intel.com>>; Holland, 
Michael mailto:michael.holl...@intel.com>>
主题: Re: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record types 
support in FitGen.c
重要性: 高

Hi Liming,
Any update on this? Please treat this with urgency as we have a release coming 
up and needs this change.

-Pavamana

From: Hv, Pavamana
Sent: Monday, October 24, 2022 10:05 AM
To: devel@edk2.groups.io; Gao, Liming 
mailto:gaolim...@byosoft.com.cn>>
Subject: RE: [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record types support 
in FitGen.c


@Gao, Liming,

Can you please review the patch and let me know if this can be merged?

Thanks in advance for your help.

Regards,

Pavamana



-Original Message-
From: Hv, Pavamana mailto:pavamana...@intel.com>>
Sent: Wednesday, October 19, 2022 8:57 PM

[edk2-devel] [Patch V2] UefiCpuPkg: Restore HpetTimer after CpuExceptionHandlerLib test

2022-10-27 Thread duntan
Disable/Restore HpetTimer before and after running the Dxe
CpuExceptionHandlerLib unit test module. During the UnitTest, a
new Idt is initialized for the test. There is no handler for timer
intrrupt in this new idt. After the test module, HpetTimer does
not work any more since the comparator value register and main
counter value register for timer does not match. To fix this issue,
disable/restore HpetTimer before and after Unit Test if HpetTimer
driver has been dispatched. We don't need to send Apic Eoi in this
unit test module.When disabling timer, after RaiseTPL(), if there
is a pending timer interrupt, bit64 of Interrupt Request Register
(IRR) will be set to 1 to indicate there is a pending timer
interrupt. After RestoreTPL(), CPU will handle the pending
interrupt in IRR.Then TimerInterruptHandler calls SendApicEoi().

Signed-off-by: Dun Tan 
Cc: Eric Dong 
Cc: Ray Ni 
Cc: Rahul Kumar 
Cc: Michael D Kinney 
---
 
UefiCpuPkg/Library/CpuExceptionHandlerLib/UnitTest/DxeCpuExceptionHandlerLibUnitTest.inf
 |  1 +
 
UefiCpuPkg/Library/CpuExceptionHandlerLib/UnitTest/DxeCpuExceptionHandlerUnitTest.c
  | 30 +-
 2 files changed, 30 insertions(+), 1 deletion(-)

diff --git 
a/UefiCpuPkg/Library/CpuExceptionHandlerLib/UnitTest/DxeCpuExceptionHandlerLibUnitTest.inf
 
b/UefiCpuPkg/Library/CpuExceptionHandlerLib/UnitTest/DxeCpuExceptionHandlerLibUnitTest.inf
index e3dbe7b9ab..a904eb2504 100644
--- 
a/UefiCpuPkg/Library/CpuExceptionHandlerLib/UnitTest/DxeCpuExceptionHandlerLibUnitTest.inf
+++ 
b/UefiCpuPkg/Library/CpuExceptionHandlerLib/UnitTest/DxeCpuExceptionHandlerLibUnitTest.inf
@@ -53,6 +53,7 @@
 
 [Protocols]
   gEfiMpServiceProtocolGuid
+  gEfiTimerArchProtocolGuid
 
 [Depex]
   gEfiMpServiceProtocolGuid
diff --git 
a/UefiCpuPkg/Library/CpuExceptionHandlerLib/UnitTest/DxeCpuExceptionHandlerUnitTest.c
 
b/UefiCpuPkg/Library/CpuExceptionHandlerLib/UnitTest/DxeCpuExceptionHandlerUnitTest.c
index 917fc549bf..1cec3ed809 100644
--- 
a/UefiCpuPkg/Library/CpuExceptionHandlerLib/UnitTest/DxeCpuExceptionHandlerUnitTest.c
+++ 
b/UefiCpuPkg/Library/CpuExceptionHandlerLib/UnitTest/DxeCpuExceptionHandlerUnitTest.c
@@ -8,6 +8,7 @@
 
 #include "CpuExceptionHandlerTest.h"
 #include 
+#include 
 
 /**
   Initialize Bsp Idt with a new Idt table and return the IA32_DESCRIPTOR 
buffer.
@@ -162,8 +163,12 @@ CpuExceptionHandlerTestEntry (
 {
   EFI_STATUS  Status;
   UNIT_TEST_FRAMEWORK_HANDLE  Framework;
+  EFI_TIMER_ARCH_PROTOCOL *TimerArchProtocol;
+  UINT64  TimerPeriod;
 
-  Framework = NULL;
+  Framework = NULL;
+  TimerArchProtocol = NULL;
+  TimerPeriod   = 0;
 
   DEBUG ((DEBUG_INFO, "%a v%a\n", UNIT_TEST_APP_NAME, UNIT_TEST_APP_VERSION));
 
@@ -182,11 +187,34 @@ CpuExceptionHandlerTestEntry (
 goto EXIT;
   }
 
+  //
+  // If HpetTimer driver has been dispatched, disable HpetTimer before Unit 
Test.
+  //
+  gBS->LocateProtocol (, NULL, (VOID 
**));
+  if (TimerArchProtocol != NULL) {
+Status = TimerArchProtocol->GetTimerPeriod (TimerArchProtocol, 
);
+ASSERT_EFI_ERROR (Status);
+if (TimerPeriod > 0) {
+  DEBUG ((DEBUG_INFO, "HpetTimer has been dispatched. Disable 
HpetTimer.\n"));
+  Status = TimerArchProtocol->SetTimerPeriod (TimerArchProtocol, 0);
+  ASSERT_EFI_ERROR (Status);
+}
+  }
+
   //
   // Execute the tests.
   //
   Status = RunAllTestSuites (Framework);
 
+  //
+  // Restore HpetTimer after Unit Test.
+  //
+  if ((TimerArchProtocol != NULL) && (TimerPeriod > 0)) {
+DEBUG ((DEBUG_INFO, "Restore HpetTimer after DxeCpuExceptionHandlerLib 
UnitTest.\n"));
+Status = TimerArchProtocol->SetTimerPeriod (TimerArchProtocol, 
TimerPeriod);
+ASSERT_EFI_ERROR (Status);
+  }
+
 EXIT:
   if (Framework) {
 FreeUnitTestFramework (Framework);
-- 
2.31.1.windows.1



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




[edk2-devel] [PATCH] IntelFsp2Pkg: Update Function header to support IA32/X64.

2022-10-27 Thread Chiu, Chasel
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4126

Common functions will have either 32bit or 64bit instances which
having different return code size. Function header should support both
scenarios.

Cc: Nate DeSimone 
Cc: Star Zeng 
Signed-off-by: Chasel Chiu 
---
 IntelFsp2Pkg/FspSecCore/SecFsp.h |  4 ++--
 IntelFsp2Pkg/Include/Library/FspSecPlatformLib.h | 12 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/IntelFsp2Pkg/FspSecCore/SecFsp.h b/IntelFsp2Pkg/FspSecCore/SecFsp.h
index e84528b378..d7a5976c12 100644
--- a/IntelFsp2Pkg/FspSecCore/SecFsp.h
+++ b/IntelFsp2Pkg/FspSecCore/SecFsp.h
@@ -70,7 +70,7 @@ FspDataPointerFixUp (
   @return   FSP binary base address.
 
 **/
-UINT32
+UINTN
 EFIAPI
 AsmGetFspBaseAddress (
   VOID
@@ -82,7 +82,7 @@ AsmGetFspBaseAddress (
   @return   FSP binary base address.
 
 **/
-UINT32
+UINTN
 EFIAPI
 AsmGetFspInfoHeader (
   VOID
diff --git a/IntelFsp2Pkg/Include/Library/FspSecPlatformLib.h 
b/IntelFsp2Pkg/Include/Library/FspSecPlatformLib.h
index c91ea4a78f..598fdb9ec5 100644
--- a/IntelFsp2Pkg/Include/Library/FspSecPlatformLib.h
+++ b/IntelFsp2Pkg/Include/Library/FspSecPlatformLib.h
@@ -17,10 +17,10 @@
   The callee should not use XMM6/XMM7.
   The return address is saved in MM7.
 
-  @retval in saved in EAX - 0 means platform initialization success.
+  @retval in saved in EAX/RAX - 0 means platform initialization success.
 other means platform initialization fail.
 **/
-UINT32
+UINTN
 EFIAPI
 SecPlatformInit (
   VOID
@@ -37,10 +37,10 @@ SecPlatformInit (
 
   @param[in] FsptUpdDataPtr Address pointer to the FSPT_UPD data 
structure. It is saved in ESP.
 
-  @retval in saved in EAX - 0 means Microcode is loaded successfully.
+  @retval in saved in EAX/RAX - 0 means Microcode is loaded successfully.
 other means Microcode is not loaded successfully.
 **/
-UINT32
+UINTN
 EFIAPI
 LoadMicrocode (
   IN  VOID  *FsptUpdDataPtr
@@ -56,10 +56,10 @@ LoadMicrocode (
 
   @param[in] FsptUpdDataPtr Address pointer to the FSPT_UPD data 
structure. It is saved in ESP.
 
-  @retval in saved in EAX - 0 means CAR initialization success.
+  @retval in saved in EAX/RAX - 0 means CAR initialization success.
 other means CAR initialization fail.
 **/
-UINT32
+UINTN
 EFIAPI
 SecCarInit (
   IN  VOID  *FsptUpdDataPtr
-- 
2.35.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#95662): https://edk2.groups.io/g/devel/message/95662
Mute This Topic: https://groups.io/mt/94619463/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] MdeModulePkg/ScsiDiskDxe: Update proper device name for ScsiDisk drive

2022-10-27 Thread Wu, Hao A
Thanks.
Reviewed-by: Hao A Wu 

Will wait a couple of days before merging to see if comments from other 
reviewers.

Best Regards,
Hao Wu

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Cheripally
> Gopi via groups.io
> Sent: Thursday, October 27, 2022 3:07 PM
> To: devel@edk2.groups.io
> Cc: Selvaraj, Sundaresan ; Sambandan, Vasudevan
> ; Cheripally Gopi 
> Subject: [edk2-devel] [PATCH v2] MdeModulePkg/ScsiDiskDxe: Update proper
> device name for ScsiDisk drive
> 
> ScsiDiskDxe driver updates ControllerNameTable with common string
> "SCSI Disk Device" for all SCSI disks. Due to this, when multiple
> SCSI disk devices connected, facing difficulty in identifying correct SCSI
> disk device. As per SCSI spec, standard Inquiry Data is having the fields
> to know Vendor and Product information. Updated "ControllerNameTable" with
> Vendor and Product information. So that, device specific name can be
> retrieved using ComponentName protocol.
> 
> Cc: Vasudevan Sambandan 
> Cc: Sundaresan Selvaraj 
> Signed-off-by: Cheripally Gopi 
> ---
>  MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c  | 53 ++-
>  MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h  |  9 
>  .../Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf  |  2 +
>  3 files changed, 62 insertions(+), 2 deletions(-)
> 
> diff --git a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c
> b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c
> index 98e84b4ea8..0928605dc4 100644
> --- a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c
> +++ b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c
> @@ -2,6 +2,7 @@
>SCSI disk driver that layers on every SCSI IO protocol in the system.
> 
> 
> 
>  Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
> 
> +Copyright (c) 1985 - 2022, American Megatrends International LLC.
> 
>  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> 
> 
>  **/
> 
> @@ -67,6 +68,33 @@ FreeAlignedBuffer (
>}
> 
>  }
> 
> 
> 
> +/**
> 
> +  Remove trailing spaces from the string.
> 
> +
> 
> +  @param String   The ASCII string to remove the trailing spaces.
> 
> +
> 
> +  @retval the new length of the string.
> 
> +**/
> 
> +UINTN
> 
> +RemoveTrailingSpaces (
> 
> +  IN OUT CHAR8  *String
> 
> +  )
> 
> +{
> 
> +  UINTN  Length;
> 
> +
> 
> +  Length = AsciiStrLen (String);
> 
> +  if (Length == 0) {
> 
> +return 0;
> 
> +  }
> 
> +
> 
> +  while ((Length > 0) && (String[Length-1] == ' ')) {
> 
> +Length--;
> 
> +  }
> 
> +
> 
> +  String[Length] = '\0';
> 
> +  return Length;
> 
> +}
> 
> +
> 
>  /**
> 
>The user Entry Point for module ScsiDisk.
> 
> 
> 
> @@ -203,6 +231,9 @@ ScsiDiskDriverBindingStart (
>UINT8 MaxRetry;
> 
>BOOLEAN   NeedRetry;
> 
>BOOLEAN   MustReadCapacity;
> 
> +  CHAR8 VendorStr[VENDOR_IDENTIFICATION_LENGTH + 1];
> 
> +  CHAR8 ProductStr[PRODUCT_IDENTIFICATION_LENGTH + 1];
> 
> +  CHAR16DeviceStr[VENDOR_IDENTIFICATION_LENGTH +
> PRODUCT_IDENTIFICATION_LENGTH + 2];
> 
> 
> 
>MustReadCapacity = TRUE;
> 
> 
> 
> @@ -354,19 +385,37 @@ ScsiDiskDriverBindingStart (
>}
> 
>  }
> 
> 
> 
> +CopyMem (
> 
> +  VendorStr,
> 
> +  
> >InquiryData.Reserved_5_95[VENDOR_IDENTIFICATION_OFFSET],
> 
> +  VENDOR_IDENTIFICATION_LENGTH
> 
> +  );
> 
> +VendorStr[VENDOR_IDENTIFICATION_LENGTH] = 0;
> 
> +RemoveTrailingSpaces (VendorStr);
> 
> +
> 
> +CopyMem (
> 
> +  ProductStr,
> 
> +  
> >InquiryData.Reserved_5_95[PRODUCT_IDENTIFICATION_OFFSET],
> 
> +  PRODUCT_IDENTIFICATION_LENGTH
> 
> +  );
> 
> +ProductStr[PRODUCT_IDENTIFICATION_LENGTH] = 0;
> 
> +RemoveTrailingSpaces (ProductStr);
> 
> +
> 
> +UnicodeSPrint (DeviceStr, sizeof (DeviceStr), L"%a %a", VendorStr,
> ProductStr);
> 
> +
> 
>  ScsiDiskDevice->ControllerNameTable = NULL;
> 
>  AddUnicodeString2 (
> 
>"eng",
> 
>gScsiDiskComponentName.SupportedLanguages,
> 
>>ControllerNameTable,
> 
> -  L"SCSI Disk Device",
> 
> +  DeviceStr,
> 
>TRUE
> 
>);
> 
>  AddUnicodeString2 (
> 
>"en",
> 
>gScsiDiskComponentName2.SupportedLanguages,
> 
>>ControllerNameTable,
> 
> -  L"SCSI Disk Device",
> 
> +  DeviceStr,
> 
>FALSE
> 
>);
> 
>  return EFI_SUCCESS;
> 
> diff --git a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h
> b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h
> index d54282df5f..5b4047e1db 100644
> --- a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h
> +++ b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h
> @@ -2,6 +2,7 @@
>Header file for SCSI Disk Driver.
> 
> 
> 
>  Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.
> 
> +Copyright (c) 1985 - 2022, American Megatrends International LLC.
> 
>  

回复: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record types support in FitGen.c

2022-10-27 Thread gaoliming via groups.io
Michael:

 Thanks for your sharing. 

 

Pavamana:

 FIT spec 1.4 has been published. So, this change can be merged now. 

 

Thanks

Liming

发件人: Holland, Michael  
发送时间: 2022年10月28日 1:41
收件人: Gao, Liming ; Hv, Pavamana 
; devel@edk2.groups.io; Chaganty, Rangasai V 
; Lohr, Paul A ; Feng, 
Bob C 
主题: RE: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record types 
support in FitGen.c

 

Hi Liming,

 

Please see published FIT spec 1.4:  
https://edc.intel.com/content/www/us/en/design/products-and-solutions/software-and-services/firmware-and-bios/firmware-interface-table/

 

Thanks,

Michael

 

From: gaoliming mailto:gaolim...@byosoft.com.cn> > 
Sent: Wednesday, October 26, 2022 07:59 PM
To: Hv, Pavamana mailto:pavamana...@intel.com> >; 
Holland, Michael mailto:michael.holl...@intel.com> 
>; devel@edk2.groups.io  ; Chaganty, Rangasai V 
mailto:rangasai.v.chaga...@intel.com> >; Lohr, 
Paul A mailto:paul.a.l...@intel.com> >; Feng, Bob C 
mailto:bob.c.f...@intel.com> >
Subject: 回复: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record 
types support in FitGen.c

 

Pavamana:

 The change should be merged after new FIT spec is published, because FitGen 
tool follows the public FIT spec. 

 

Thanks

Liming

发件人: Hv, Pavamana mailto:pavamana...@intel.com> > 
发送时间: 2022年10月26日 23:13
收件人: Holland, Michael mailto:michael.holl...@intel.com> >; Gao, Liming mailto:gaolim...@byosoft.com.cn> >; devel@edk2.groups.io 
 ; Chaganty, Rangasai V 
mailto:rangasai.v.chaga...@intel.com> >; Lohr, 
Paul A mailto:paul.a.l...@intel.com> >; Feng, Bob C 
mailto:bob.c.f...@intel.com> >
主题: RE: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record types 
support in FitGen.c

 

Thanks for the review, Liming.

  @Feng, Bob C,

What is the next step to merge the change?

Let me know if anything is needed from me.

Thanks for your help again.

Regards,

Pavamana

 

 

From: Holland, Michael mailto:michael.holl...@intel.com> > 
Sent: Tuesday, October 25, 2022 8:36 PM
To: Gao, Liming mailto:gaolim...@byosoft.com.cn> >; 
devel@edk2.groups.io  ; Hv, Pavamana 
mailto:pavamana...@intel.com> >; Chaganty, Rangasai V 
mailto:rangasai.v.chaga...@intel.com> >; Lohr, 
Paul A mailto:paul.a.l...@intel.com> >
Cc: Feng, Bob C mailto:bob.c.f...@intel.com> >
Subject: RE: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record 
types support in FitGen.c

 

Hi Liming,

 

The spec is in process of being published.

 

  @Chaganty, Rangasai V  
 @Lohr, Paul A

 

Any update on FIT spec being published?

 

Thanks,

Michael

 

From: gaoliming mailto:gaolim...@byosoft.com.cn> > 
Sent: Tuesday, October 25, 2022 09:18 PM
To: devel@edk2.groups.io  ; Hv, Pavamana 
mailto:pavamana...@intel.com> >
Cc: Feng, Bob C mailto:bob.c.f...@intel.com> >; Holland, 
Michael mailto:michael.holl...@intel.com> >
Subject: 回复: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record 
types support in FitGen.c

 

Pavamana:

 The code change looks good. Now,  is FIT spec 1.4 public to be downloaded?

 

Thanks

Liming

发件人: devel@edk2.groups.io   mailto:devel@edk2.groups.io> > 代表 Hv, Pavamana
发送时间: 2022年10月26日 5:50
收件人: devel@edk2.groups.io  ; Gao, Liming 
mailto:gaolim...@byosoft.com.cn> >
抄送: Feng, Bob C mailto:bob.c.f...@intel.com> >; Holland, 
Michael mailto:michael.holl...@intel.com> >
主题: Re: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record types 
support in FitGen.c
重要性: 高

 

Hi Liming,

Any update on this? Please treat this with urgency as we have a release coming 
up and needs this change.

 

-Pavamana

 

From: Hv, Pavamana 
Sent: Monday, October 24, 2022 10:05 AM
To: devel@edk2.groups.io  ; Gao, Liming 
mailto:gaolim...@byosoft.com.cn> >
Subject: RE: [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record types support 
in FitGen.c

 

  @Gao, Liming,

Can you please review the patch and let me know if this can be merged?

Thanks in advance for your help.

Regards,

Pavamana

 

-Original Message-
From: Hv, Pavamana mailto:pavamana...@intel.com> > 
Sent: Wednesday, October 19, 2022 8:57 PM
To: devel@edk2.groups.io  
Cc: Hv, Pavamana mailto:pavamana...@intel.com> >
Subject: [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record types support in 
FitGen.c

 

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

 

This commit adds support for new FIT record type for Vendor Authorized Boot 
(VAB) security technology(FIT spec revision 1.4).

VAB defines 3 new following types

Vendor Authorized Boot Provisioning Table (Type 0x1A) Vendor Authorized Boot 
Image Manifest (Type 0x1B) Vendor 

Re: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record types support in FitGen.c

2022-10-27 Thread Holland, Michael
Hi Liming,

Please see published FIT spec 1.4:  
https://edc.intel.com/content/www/us/en/design/products-and-solutions/software-and-services/firmware-and-bios/firmware-interface-table/

Thanks,
Michael

From: gaoliming 
Sent: Wednesday, October 26, 2022 07:59 PM
To: Hv, Pavamana ; Holland, Michael 
; devel@edk2.groups.io; Chaganty, Rangasai V 
; Lohr, Paul A ; Feng, 
Bob C 
Subject: 回复: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record 
types support in FitGen.c

Pavamana:
 The change should be merged after new FIT spec is published, because FitGen 
tool follows the public FIT spec.

Thanks
Liming
发件人: Hv, Pavamana mailto:pavamana...@intel.com>>
发送时间: 2022年10月26日 23:13
收件人: Holland, Michael 
mailto:michael.holl...@intel.com>>; Gao, Liming 
mailto:gaolim...@byosoft.com.cn>>; 
devel@edk2.groups.io; Chaganty, Rangasai V 
mailto:rangasai.v.chaga...@intel.com>>; Lohr, 
Paul A mailto:paul.a.l...@intel.com>>; Feng, Bob C 
mailto:bob.c.f...@intel.com>>
主题: RE: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record types 
support in FitGen.c

Thanks for the review, Liming.
@Feng, Bob C,
What is the next step to merge the change?
Let me know if anything is needed from me.
Thanks for your help again.
Regards,
Pavamana


From: Holland, Michael 
mailto:michael.holl...@intel.com>>
Sent: Tuesday, October 25, 2022 8:36 PM
To: Gao, Liming mailto:gaolim...@byosoft.com.cn>>; 
devel@edk2.groups.io; Hv, Pavamana 
mailto:pavamana...@intel.com>>; Chaganty, Rangasai V 
mailto:rangasai.v.chaga...@intel.com>>; Lohr, 
Paul A mailto:paul.a.l...@intel.com>>
Cc: Feng, Bob C mailto:bob.c.f...@intel.com>>
Subject: RE: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record 
types support in FitGen.c

Hi Liming,

The spec is in process of being published.

@Chaganty, Rangasai V @Lohr, Paul 
A

Any update on FIT spec being published?

Thanks,
Michael

From: gaoliming mailto:gaolim...@byosoft.com.cn>>
Sent: Tuesday, October 25, 2022 09:18 PM
To: devel@edk2.groups.io; Hv, Pavamana 
mailto:pavamana...@intel.com>>
Cc: Feng, Bob C mailto:bob.c.f...@intel.com>>; Holland, 
Michael mailto:michael.holl...@intel.com>>
Subject: 回复: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record 
types support in FitGen.c


Pavamana:

 The code change looks good. Now,  is FIT spec 1.4 public to be downloaded?

Thanks
Liming
发件人: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>> 代表 Hv, Pavamana
发送时间: 2022年10月26日 5:50
收件人: devel@edk2.groups.io; Gao, Liming 
mailto:gaolim...@byosoft.com.cn>>
抄送: Feng, Bob C mailto:bob.c.f...@intel.com>>; Holland, 
Michael mailto:michael.holl...@intel.com>>
主题: Re: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record types 
support in FitGen.c
重要性: 高

Hi Liming,
Any update on this? Please treat this with urgency as we have a release coming 
up and needs this change.

-Pavamana

From: Hv, Pavamana
Sent: Monday, October 24, 2022 10:05 AM
To: devel@edk2.groups.io; Gao, Liming 
mailto:gaolim...@byosoft.com.cn>>
Subject: RE: [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record types support 
in FitGen.c


@Gao, Liming,

Can you please review the patch and let me know if this can be merged?

Thanks in advance for your help.

Regards,

Pavamana



-Original Message-
From: Hv, Pavamana mailto:pavamana...@intel.com>>
Sent: Wednesday, October 19, 2022 8:57 PM
To: devel@edk2.groups.io
Cc: Hv, Pavamana mailto:pavamana...@intel.com>>
Subject: [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record types support in 
FitGen.c



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



This commit adds support for new FIT record type for Vendor Authorized Boot 
(VAB) security technology(FIT spec revision 1.4).

VAB defines 3 new following types

Vendor Authorized Boot Provisioning Table (Type 0x1A) Vendor Authorized Boot 
Image Manifest (Type 0x1B) Vendor Authorized Boot Key Manifest (Type 0x1C) The 
code has been updated to align these binaries on 64 byte boundary and not to 
overlap with other regions, similar to Key manifest, Boot Policy manifest and 
other optional types.



Also added macros to define FIT spec Major and Minor version numbers and print 
the same instead of hardcoded string.



Signed-off-by: Pavamana Holavanahalli 
mailto:pavamana...@intel.com>>

---

Silicon/Intel/Tools/FitGen/FitGen.c | 61 +++--  
Silicon/Intel/Tools/FitGen/FitGen.h |  5 ++-

2 files changed, 44 insertions(+), 22 deletions(-)



diff --git a/Silicon/Intel/Tools/FitGen/FitGen.c 
b/Silicon/Intel/Tools/FitGen/FitGen.c

index 21dfcf1ebb..87123f9922 100644

--- a/Silicon/Intel/Tools/FitGen/FitGen.c

+++ b/Silicon/Intel/Tools/FitGen/FitGen.c

@@ 

[edk2-devel] [PATCH v4 1/1] MdePkg: Use ANSI colors to indicate debug message severity

2022-10-27 Thread Rebecca Cran
There currently isn't a way to differentiate the different
levels of DEBUG output: DEBUG_ERROR, DEBUG_WARN, DEBUG_INFO
etc.

To improve this, wrap DEBUG_ERROR and DEBUG_WARN level
messages in ANSI color code escape sequences. DEBUG_ERROR
messages will be displayed in red text, and DEBUG_WARN
in yellow.

Only enable this new functionality if the FeatureFlag
gEfiMdePkgTokenSpaceGuid.PcdDebugAnsiSeqSupport
is set to TRUE. By default it's FALSE.

Signed-off-by: Rebecca Cran 
---
 MdePkg/MdePkg.dec|  6 ++
 MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf |  2 +-
 MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf |  2 +-
 MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c | 64 

 MdePkg/Library/UefiDebugLibConOut/DebugLib.c | 64 

 5 files changed, 136 insertions(+), 2 deletions(-)

diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index 4c81cbd75ab2..8ddc46b62e7d 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -4,6 +4,7 @@
 # It also provides the definitions(including PPIs/PROTOCOLs/GUIDs) of
 # EFI1.10/UEFI2.7/PI1.7 and some Industry Standards.
 #
+# Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
 # Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.
 # Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
 # (C) Copyright 2016 - 2021 Hewlett Packard Enterprise Development LP
@@ -1977,6 +1978,11 @@ [PcdsFeatureFlag]
   # @Prompt Validate ORDERED_COLLECTION structure
   
gEfiMdePkgTokenSpaceGuid.PcdValidateOrderedCollection|FALSE|BOOLEAN|0x002a
 
+  ## Indicates if DEBUG output should use ANSI sequences.
+  #   TRUE  - Will use ANSI sequences in DEBUG output.
+  #   FALSE - Will not use ANSI sequences in DEBUG output.
+  gEfiMdePkgTokenSpaceGuid.PcdDebugAnsiSeqSupport|FALSE|BOOLEAN|0x002f
+
 [PcdsFixedAtBuild]
   ## Status code value for indicating a watchdog timer has expired.
   # EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_TIMER_EXPIRED
diff --git a/MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 
b/MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
index 7504faee67f0..8d6ed759e974 100644
--- a/MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
+++ b/MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
@@ -41,4 +41,4 @@ [Pcd]
   gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue  ## SOMETIMES_CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask  ## CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel ## CONSUMES
-
+  gEfiMdePkgTokenSpaceGuid.PcdDebugAnsiSeqSupport   ## CONSUMES
diff --git a/MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf 
b/MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf
index 53bbc8ce3f65..694494ffc7a3 100644
--- a/MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf
+++ b/MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf
@@ -50,4 +50,4 @@ [Pcd]
   gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue## 
SOMETIMES_CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask## CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel## CONSUMES
-
+  gEfiMdePkgTokenSpaceGuid.PcdDebugAnsiSeqSupport  ## CONSUMES
diff --git a/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c 
b/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c
index bd5686947712..df31bd1ffb9f 100644
--- a/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c
+++ b/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c
@@ -26,6 +26,10 @@
 //
 #define MAX_DEBUG_MESSAGE_LENGTH  0x100
 
+#define RED_ESC_SEQ "\033[31m"
+#define YELLOW_ESC_SEQ  "\033[33m"
+#define END_ESC_SEQ "\033[0m"
+
 //
 // VA_LIST can not initialize to NULL for all compiler, so we use this to
 // indicate a null VA_LIST
@@ -77,6 +81,62 @@ DebugPrint (
   VA_END (Marker);
 }
 
+/**
+  Wraps a message with ANSI color escape codes.
+
+  @param String The string to wrap.
+  @param StringLen  The size of the String buffer in characters.
+  @param ErrorLevel The error level.
+
+  @retval RETURN_SUCCESS  The string was successfully updated.
+  @retval RETURN_BUFFER_TOO_SMALL The buffer is too small.
+
+**/
+STATIC
+RETURN_STATUS
+AsciiDebugGetColorString (
+  IN OUT CHAR8  *String,
+  IN UINTN  StringLen,
+  IN UINTN  ErrorLevel
+  )
+{
+  CHAR8  Buffer[MAX_DEBUG_MESSAGE_LENGTH];
+  UINTN  ReqBufferLen;
+
+  ReqBufferLen = AsciiStrLen (String) +
+ AsciiStrLen (RED_ESC_SEQ) +
+ AsciiStrLen (END_ESC_SEQ) +
+ 1;
+
+  if (StringLen < ReqBufferLen) {
+return RETURN_BUFFER_TOO_SMALL;
+  }
+
+  ZeroMem (Buffer, sizeof (Buffer));
+
+  switch (ErrorLevel) {
+case DEBUG_WARN:
+  AsciiStrCpyS (Buffer, MAX_DEBUG_MESSAGE_LENGTH, YELLOW_ESC_SEQ);
+  break;
+case DEBUG_ERROR:
+  AsciiStrCpyS (Buffer, MAX_DEBUG_MESSAGE_LENGTH, 

Re: [edk2-devel] [PATCH 1/1] ArmPlatformPkg: Remove AP support from PrePi/PrePeiCore

2022-10-27 Thread Ard Biesheuvel
On Thu, 27 Oct 2022 at 19:31, Rebecca Cran  wrote:
>
> Modern platforms use TF-A, so there's no need for support of
> secondary cores in EDK2 since TF-A will keep them in a holding
> pen until the PSCI_CPU_ON SMC call is received.
>
> Therefore, remove the code that handles secondary CPUs from
> PrePeiCore and PrePi and add ASSERTs if a secondary core
> reaches the functions.
>
> Signed-off-by: Rebecca Cran 

No objections to this patch, but this change will break the old SMP
32-bit ARM platforms in edk2-platforms so you will need to propose a
solution for those as well.


> ---
>  ArmPlatformPkg/PrePeiCore/MainMPCore.c  | 92 
>  ArmPlatformPkg/PrePeiCore/MainUniCore.c |  9 --
>  ArmPlatformPkg/PrePeiCore/PrePeiCore.c  | 37 
>  ArmPlatformPkg/PrePi/MainMPCore.c   | 69 ---
>  ArmPlatformPkg/PrePi/MainUniCore.c  |  9 --
>  ArmPlatformPkg/PrePi/PrePi.c| 36 
>  6 files changed, 34 insertions(+), 218 deletions(-)
>
> diff --git a/ArmPlatformPkg/PrePeiCore/MainMPCore.c 
> b/ArmPlatformPkg/PrePeiCore/MainMPCore.c
> index b5d0d3a6442f..44850a4f3946 100644
> --- a/ArmPlatformPkg/PrePeiCore/MainMPCore.c
> +++ b/ArmPlatformPkg/PrePeiCore/MainMPCore.c
> @@ -12,98 +12,6 @@
>
>  #include "PrePeiCore.h"
>
> -/*
> - * This is the main function for secondary cores. They loop around until a 
> non Null value is written to
> - * SYS_FLAGS register.The SYS_FLAGS register is platform specific.
> - * Note:The secondary cores, while executing secondary_main, assumes that:
> - *  : SGI 0 is configured as Non-secure interrupt
> - *  : Priority Mask is configured to allow SGI 0
> - *  : Interrupt Distributor and CPU interfaces are enabled
> - *
> - */
> -VOID
> -EFIAPI
> -SecondaryMain (
> -  IN UINTN  MpId
> -  )
> -{
> -  EFI_STATUS  Status;
> -  UINTN   PpiListSize;
> -  UINTN   PpiListCount;
> -  EFI_PEI_PPI_DESCRIPTOR  *PpiList;
> -  ARM_MP_CORE_INFO_PPI*ArmMpCoreInfoPpi;
> -  UINTN   Index;
> -  UINTN   ArmCoreCount;
> -  ARM_CORE_INFO   *ArmCoreInfoTable;
> -  UINT32  ClusterId;
> -  UINT32  CoreId;
> -
> -  VOID  (*SecondaryStart)(
> -VOID
> -);
> -  UINTN  SecondaryEntryAddr;
> -  UINTN  AcknowledgeInterrupt;
> -  UINTN  InterruptId;
> -
> -  ClusterId = GET_CLUSTER_ID (MpId);
> -  CoreId= GET_CORE_ID (MpId);
> -
> -  // Get the gArmMpCoreInfoPpiGuid
> -  PpiListSize = 0;
> -  ArmPlatformGetPlatformPpiList (, );
> -  PpiListCount = PpiListSize / sizeof (EFI_PEI_PPI_DESCRIPTOR);
> -  for (Index = 0; Index < PpiListCount; Index++, PpiList++) {
> -if (CompareGuid (PpiList->Guid, ) == TRUE) {
> -  break;
> -}
> -  }
> -
> -  // On MP Core Platform we must implement the ARM MP Core Info PPI
> -  ASSERT (Index != PpiListCount);
> -
> -  ArmMpCoreInfoPpi = PpiList->Ppi;
> -  ArmCoreCount = 0;
> -  Status   = ArmMpCoreInfoPpi->GetMpCoreInfo (, 
> );
> -  ASSERT_EFI_ERROR (Status);
> -
> -  // Find the core in the ArmCoreTable
> -  for (Index = 0; Index < ArmCoreCount; Index++) {
> -if ((GET_MPIDR_AFF1 (ArmCoreInfoTable[Index].Mpidr) == ClusterId) &&
> -(GET_MPIDR_AFF0 (ArmCoreInfoTable[Index].Mpidr) == CoreId))
> -{
> -  break;
> -}
> -  }
> -
> -  // The ARM Core Info Table must define every core
> -  ASSERT (Index != ArmCoreCount);
> -
> -  // Clear Secondary cores MailBox
> -  MmioWrite32 (ArmCoreInfoTable[Index].MailboxClearAddress, 
> ArmCoreInfoTable[Index].MailboxClearValue);
> -
> -  do {
> -ArmCallWFI ();
> -
> -// Read the Mailbox
> -SecondaryEntryAddr = MmioRead32 
> (ArmCoreInfoTable[Index].MailboxGetAddress);
> -
> -// Acknowledge the interrupt and send End of Interrupt signal.
> -AcknowledgeInterrupt = ArmGicAcknowledgeInterrupt (PcdGet64 
> (PcdGicInterruptInterfaceBase), );
> -// Check if it is a valid interrupt ID
> -if (InterruptId < ArmGicGetMaxNumInterrupts (PcdGet64 
> (PcdGicDistributorBase))) {
> -  // Got a valid SGI number hence signal End of Interrupt
> -  ArmGicEndOfInterrupt (PcdGet64 (PcdGicInterruptInterfaceBase), 
> AcknowledgeInterrupt);
> -}
> -  } while (SecondaryEntryAddr == 0);
> -
> -  // Jump to secondary core entry point.
> -  SecondaryStart = (VOID (*)()) SecondaryEntryAddr;
> -  SecondaryStart ();
> -
> -  // The secondaries shouldn't reach here
> -  ASSERT (FALSE);
> -}
> -
>  VOID
>  EFIAPI
>  PrimaryMain (
> diff --git a/ArmPlatformPkg/PrePeiCore/MainUniCore.c 
> b/ArmPlatformPkg/PrePeiCore/MainUniCore.c
> index 1c2580eb923b..3d3c6caaa32a 100644
> --- a/ArmPlatformPkg/PrePeiCore/MainUniCore.c
> +++ b/ArmPlatformPkg/PrePeiCore/MainUniCore.c
> @@ -8,15 +8,6 @@
>
>  #include "PrePeiCore.h"
>
> -VOID
> -EFIAPI
> -SecondaryMain (
> -  IN UINTN  MpId
> -  )
> -{
> -  ASSERT (FALSE);
> -}
> -
>  VOID
>  EFIAPI
>  PrimaryMain (
> diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCore.c 
> 

[edk2-devel] [PATCH 1/1] ArmPlatformPkg: Remove AP support from PrePi/PrePeiCore

2022-10-27 Thread Rebecca Cran
Modern platforms use TF-A, so there's no need for support of
secondary cores in EDK2 since TF-A will keep them in a holding
pen until the PSCI_CPU_ON SMC call is received.

Therefore, remove the code that handles secondary CPUs from
PrePeiCore and PrePi and add ASSERTs if a secondary core
reaches the functions.

Signed-off-by: Rebecca Cran 
---
 ArmPlatformPkg/PrePeiCore/MainMPCore.c  | 92 
 ArmPlatformPkg/PrePeiCore/MainUniCore.c |  9 --
 ArmPlatformPkg/PrePeiCore/PrePeiCore.c  | 37 
 ArmPlatformPkg/PrePi/MainMPCore.c   | 69 ---
 ArmPlatformPkg/PrePi/MainUniCore.c  |  9 --
 ArmPlatformPkg/PrePi/PrePi.c| 36 
 6 files changed, 34 insertions(+), 218 deletions(-)

diff --git a/ArmPlatformPkg/PrePeiCore/MainMPCore.c 
b/ArmPlatformPkg/PrePeiCore/MainMPCore.c
index b5d0d3a6442f..44850a4f3946 100644
--- a/ArmPlatformPkg/PrePeiCore/MainMPCore.c
+++ b/ArmPlatformPkg/PrePeiCore/MainMPCore.c
@@ -12,98 +12,6 @@
 
 #include "PrePeiCore.h"
 
-/*
- * This is the main function for secondary cores. They loop around until a non 
Null value is written to
- * SYS_FLAGS register.The SYS_FLAGS register is platform specific.
- * Note:The secondary cores, while executing secondary_main, assumes that:
- *  : SGI 0 is configured as Non-secure interrupt
- *  : Priority Mask is configured to allow SGI 0
- *  : Interrupt Distributor and CPU interfaces are enabled
- *
- */
-VOID
-EFIAPI
-SecondaryMain (
-  IN UINTN  MpId
-  )
-{
-  EFI_STATUS  Status;
-  UINTN   PpiListSize;
-  UINTN   PpiListCount;
-  EFI_PEI_PPI_DESCRIPTOR  *PpiList;
-  ARM_MP_CORE_INFO_PPI*ArmMpCoreInfoPpi;
-  UINTN   Index;
-  UINTN   ArmCoreCount;
-  ARM_CORE_INFO   *ArmCoreInfoTable;
-  UINT32  ClusterId;
-  UINT32  CoreId;
-
-  VOID  (*SecondaryStart)(
-VOID
-);
-  UINTN  SecondaryEntryAddr;
-  UINTN  AcknowledgeInterrupt;
-  UINTN  InterruptId;
-
-  ClusterId = GET_CLUSTER_ID (MpId);
-  CoreId= GET_CORE_ID (MpId);
-
-  // Get the gArmMpCoreInfoPpiGuid
-  PpiListSize = 0;
-  ArmPlatformGetPlatformPpiList (, );
-  PpiListCount = PpiListSize / sizeof (EFI_PEI_PPI_DESCRIPTOR);
-  for (Index = 0; Index < PpiListCount; Index++, PpiList++) {
-if (CompareGuid (PpiList->Guid, ) == TRUE) {
-  break;
-}
-  }
-
-  // On MP Core Platform we must implement the ARM MP Core Info PPI
-  ASSERT (Index != PpiListCount);
-
-  ArmMpCoreInfoPpi = PpiList->Ppi;
-  ArmCoreCount = 0;
-  Status   = ArmMpCoreInfoPpi->GetMpCoreInfo (, 
);
-  ASSERT_EFI_ERROR (Status);
-
-  // Find the core in the ArmCoreTable
-  for (Index = 0; Index < ArmCoreCount; Index++) {
-if ((GET_MPIDR_AFF1 (ArmCoreInfoTable[Index].Mpidr) == ClusterId) &&
-(GET_MPIDR_AFF0 (ArmCoreInfoTable[Index].Mpidr) == CoreId))
-{
-  break;
-}
-  }
-
-  // The ARM Core Info Table must define every core
-  ASSERT (Index != ArmCoreCount);
-
-  // Clear Secondary cores MailBox
-  MmioWrite32 (ArmCoreInfoTable[Index].MailboxClearAddress, 
ArmCoreInfoTable[Index].MailboxClearValue);
-
-  do {
-ArmCallWFI ();
-
-// Read the Mailbox
-SecondaryEntryAddr = MmioRead32 
(ArmCoreInfoTable[Index].MailboxGetAddress);
-
-// Acknowledge the interrupt and send End of Interrupt signal.
-AcknowledgeInterrupt = ArmGicAcknowledgeInterrupt (PcdGet64 
(PcdGicInterruptInterfaceBase), );
-// Check if it is a valid interrupt ID
-if (InterruptId < ArmGicGetMaxNumInterrupts (PcdGet64 
(PcdGicDistributorBase))) {
-  // Got a valid SGI number hence signal End of Interrupt
-  ArmGicEndOfInterrupt (PcdGet64 (PcdGicInterruptInterfaceBase), 
AcknowledgeInterrupt);
-}
-  } while (SecondaryEntryAddr == 0);
-
-  // Jump to secondary core entry point.
-  SecondaryStart = (VOID (*)()) SecondaryEntryAddr;
-  SecondaryStart ();
-
-  // The secondaries shouldn't reach here
-  ASSERT (FALSE);
-}
-
 VOID
 EFIAPI
 PrimaryMain (
diff --git a/ArmPlatformPkg/PrePeiCore/MainUniCore.c 
b/ArmPlatformPkg/PrePeiCore/MainUniCore.c
index 1c2580eb923b..3d3c6caaa32a 100644
--- a/ArmPlatformPkg/PrePeiCore/MainUniCore.c
+++ b/ArmPlatformPkg/PrePeiCore/MainUniCore.c
@@ -8,15 +8,6 @@
 
 #include "PrePeiCore.h"
 
-VOID
-EFIAPI
-SecondaryMain (
-  IN UINTN  MpId
-  )
-{
-  ASSERT (FALSE);
-}
-
 VOID
 EFIAPI
 PrimaryMain (
diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCore.c 
b/ArmPlatformPkg/PrePeiCore/PrePeiCore.c
index 42a7ccc9c6a0..64d1ef601ea3 100644
--- a/ArmPlatformPkg/PrePeiCore/PrePeiCore.c
+++ b/ArmPlatformPkg/PrePeiCore/PrePeiCore.c
@@ -117,27 +117,26 @@ CEntryPoint (
 
   // Note: The MMU will be enabled by MemoryPeim. Only the primary core will 
have the MMU on.
 
-  // If not primary Jump to Secondary Main
-  if (ArmPlatformIsPrimaryCore (MpId)) {
-// Invoke "ProcessLibraryConstructorList" to have all library constructors
-// called.
-ProcessLibraryConstructorList ();
-

Re: [edk2-devel] [PATCH edk2-platforms] Platform/SbsaQemu: Switch to VirtNorFlashDxe

2022-10-27 Thread Ard Biesheuvel
On Thu, 27 Oct 2022 at 12:48, Leif Lindholm  wrote:
>
> On Wed, Oct 26, 2022 at 19:42:10 +0200, Ard Biesheuvel wrote:
> > Switch to the OVMF version of the NOR flash DXE driver, which supports
> > QEMU's NOR flash emulation specifically, and carries some optimizations
> > that are therefore permitted.
> >
> > Cc: Leif Lindholm 
> > Cc: Graeme Gregory 
>
> Graeme Gregory  is probably more likely to
> be seen these days. Patch to Maintainers.txt coming up (although
> Graeme is out this week).
>
> > Signed-off-by: Ard Biesheuvel 
>
> Reviewed-by: Leif Lindholm 
>
>

Thanks

Merged as 8ea6ec38da88..2ce82b713db8


> > ---
> >  Platform/Qemu/SbsaQemu/SbsaQemu.dsc   
> > |  4 ++--
> >  Platform/Qemu/SbsaQemu/SbsaQemu.fdf   
> > |  2 +-
> >  Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf 
> > |  4 ++--
> >  Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.c   
> > | 12 ++--
> >  4 files changed, 11 insertions(+), 11 deletions(-)
> >
> > diff --git a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc 
> > b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
> > index ff280709a509..79dd200ca7fc 100644
> > --- a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
> > +++ b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
> > @@ -178,7 +178,7 @@ [LibraryClasses.common]
> >
> > ArmPlatformLib|ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.inf
> >
> >TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
> > -  
> > NorFlashPlatformLib|Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf
> > +  
> > VirtNorFlashPlatformLib|Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf
> >
> >CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
> >BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf
> > @@ -663,7 +663,7 @@ [Components.common]
> >
> >ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
> >ArmPkg/Drivers/TimerDxe/TimerDxe.inf
> > -  ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
> > +  OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.inf
> >MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
> >
> >#
> > diff --git a/Platform/Qemu/SbsaQemu/SbsaQemu.fdf 
> > b/Platform/Qemu/SbsaQemu/SbsaQemu.fdf
> > index 9f031c3e6649..781215707c3d 100644
> > --- a/Platform/Qemu/SbsaQemu/SbsaQemu.fdf
> > +++ b/Platform/Qemu/SbsaQemu/SbsaQemu.fdf
> > @@ -189,7 +189,7 @@ [FV.FvMain]
> >
> >INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
> >INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf
> > -  INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
> > +  INF OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.inf
> >INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
> >
> >#
> > diff --git 
> > a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf 
> > b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf
> > index f2ba41e1df99..f7e3f8e05eec 100644
> > --- 
> > a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf
> > +++ 
> > b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf
> > @@ -14,16 +14,16 @@ [Defines]
> >FILE_GUID  = c53d904d-de50-40f1-a148-a2ece48303d8
> >MODULE_TYPE= BASE
> >VERSION_STRING = 1.0
> > -  LIBRARY_CLASS  = NorFlashPlatformLib
> > +  LIBRARY_CLASS  = VirtNorFlashPlatformLib
> >
> >  [Sources.common]
> >SbsaQemuNorFlashLib.c
> >
> >  [Packages]
> > -  ArmPlatformPkg/ArmPlatformPkg.dec
> >ArmPkg/ArmPkg.dec
> >MdePkg/MdePkg.dec
> >MdeModulePkg/MdeModulePkg.dec
> > +  OvmfPkg/OvmfPkg.dec
> >
> >  [FixedPcd]
> >gArmTokenSpaceGuid.PcdFdBaseAddress
> > diff --git 
> > a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.c 
> > b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.c
> > index 0946327cb529..56c26019a140 100644
> > --- 
> > a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.c
> > +++ 
> > b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.c
> > @@ -8,19 +8,19 @@
> >
> >  #include 
> >  #include 
> > -#include 
> > +#include 
> >
> >  #define QEMU_NOR_BLOCK_SIZESIZE_256KB
> >
> >  EFI_STATUS
> > -NorFlashPlatformInitialization (
> > +VirtNorFlashPlatformInitialization (
> >VOID
> >)
> >  {
> >return EFI_SUCCESS;
> >  }
> >
> > -NOR_FLASH_DESCRIPTION mNorFlashDevice =
> > +STATIC VIRT_NOR_FLASH_DESCRIPTION mNorFlashDevice =
> >  {
> >   FixedPcdGet64(PcdFdBaseAddress),
> >   FixedPcdGet64(PcdFlashNvStorageVariableBase),
> > @@ -29,9 +29,9 @@ NOR_FLASH_DESCRIPTION mNorFlashDevice =
> >  };
> >
> >  EFI_STATUS
> > -NorFlashPlatformGetDevices (
> > -  OUT NOR_FLASH_DESCRIPTION   **NorFlashDescriptions,
> > -  OUT UINT32  *Count
> > +VirtNorFlashPlatformGetDevices (
> > +  OUT VIRT_NOR_FLASH_DESCRIPTION  

Re: [edk2-devel] [PATCH 00/11] ArmVirtPkg: introduce VirtNorFlashDxe

2022-10-27 Thread Ard Biesheuvel
On Thu, 27 Oct 2022 at 06:47, Sunil V L  wrote:
>
> On Mon, Oct 24, 2022 at 07:01:11PM +0200, Ard Biesheuvel wrote:
> > Create a new driver VirtNorFlashDxe that targets QEMU and KvmTool's NOR
> > flash emulation specifically, and retire the ArmPlatformPkg one.
> >
> > This permits new virt implementations to wire up QEMU's NOR flash
> > emulation without having to rely on ARM specific packages. It also
> > permits us to implement some tweaks to work around some rough
> > performance edges of KVM memslot backed NOR flash.
> >
>
> Thank you very much!. Looks good to me. May be you want to fix the
> include gaurd in NorFlash.h and VirtNorFlashPlatformLib.h as per the
> coding standards.
>
> Reviewed-by: Sunil V L 

Thanks. I've merged these now.


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




[edk2-devel] [edk2-CCodingStandardsSpecification] Create release/2.30 branch

2022-10-27 Thread Chang, Abner via groups.io
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Abner Chang 
---
 book.json | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/book.json b/book.json
index d112b26..1fdd570 100644
--- a/book.json
+++ b/book.json
@@ -1,8 +1,7 @@
 {

   "variables" : {

-"draft"   : "yes",

 "title"   : "EDK II C Coding Standards Specification",

-"version" : "Revision 2.2"

+"version" : "Revision 2.3"

   },

   "plugins": ["puml-aleung"],

   "pluginsConfig": {}

-- 
2.37.1.windows.1



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




Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: remove substring 368 from py uefi app name

2022-10-27 Thread Michael D Kinney
Reviewed-by: Michael D Kinney 

> -Original Message-
> From: Jayaprakash, N 
> Sent: Thursday, October 27, 2022 2:53 AM
> To: devel@edk2.groups.io
> Cc: Rebecca Cran ; Kinney, Michael D 
> ; Jayaprakash, N
> 
> Subject: [edk2-libc Patch 1/1] edk2-libc: remove substring 368 from py uefi 
> app name
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4124
> 
> This patch contains the changes to remove the substring
> 368 from the name of the python uefi interpreter app.
> With the changes in this patch the python interpreter app
> name will be changed from python368.efi to python.efi.
> This change was requested by chipsec team.
> 
> Cc: Rebecca Cran 
> Cc: Michael D Kinney 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jayaprakash N 
> ---
>  .../Python-3.6.8/GCCCompilationBKMs.rst   | 10 +--
>  .../Python/Python-3.6.8/Py368ReadMe.txt   | 14 ++--
>  .../Python/Python-3.6.8/Python368.inf |  2 +-
>  ...ython368_pkg.bat => create_python_pkg.bat} | 78 +--
>  ..._python368_pkg.sh => create_python_pkg.sh} |  7 +-
>  5 files changed, 54 insertions(+), 57 deletions(-)
>  rename AppPkg/Applications/Python/Python-3.6.8/{create_python368_pkg.bat => 
> create_python_pkg.bat} (87%)
>  rename AppPkg/Applications/Python/Python-3.6.8/{create_python368_pkg.sh => 
> create_python_pkg.sh} (92%)
> 
> diff --git a/AppPkg/Applications/Python/Python-3.6.8/GCCCompilationBKMs.rst 
> b/AppPkg/Applications/Python/Python-
> 3.6.8/GCCCompilationBKMs.rst
> index c72788f..525bef8 100644
> --- a/AppPkg/Applications/Python/Python-3.6.8/GCCCompilationBKMs.rst
> +++ b/AppPkg/Applications/Python/Python-3.6.8/GCCCompilationBKMs.rst
> @@ -167,24 +167,24 @@ Execute the below command to build the X64 version of 
> the Python 3.6.8 interpret
>  -
> 
>  To create an usable Python UEFI package with all the dependencies from the 
> build environment,
> -you can use the bash shell script create_python368_pkg.sh available under 
> /AppPkg/Applications/Python/Python-3.6.8
> +you can use the bash shell script create_python_pkg.sh available under 
> /AppPkg/Applications/Python/Python-3.6.8
>  folder.
> 
>  Use the following commands to create Python UEFI package::
> 
>  bash$ cd ~/src/edk2/AppPkg/Applications/Python/Python-3.6.8/
> -bash$ chmod 777 create_python368_pkg.sh
> -./create_python368_pkg.sh GCC5 RELEASE X64 myPyUEFI
> +bash$ chmod 777 create_python_pkg.sh
> +./create_python_pkg.sh GCC5 RELEASE X64 myPyUEFI
> 
>  where GCC5 refers to the tool chain, RELEASE refers to the build type, X64 
> refers to the architecture
>  myPyUEFI refers to the name of the folder where the Python UEFI package 
> needs to be created.
> 
> -When you run the create_python368_pkg.sh without any parameters it lists the 
> help
> +When you run the create_python_pkg.sh without any parameters it lists the 
> help
>  information as shown below:
> 
>  Shell Script to create Python EFI Package.
> 
> -Usage: ./create_python368_pkg.sh
> 
> +Usage: ./create_python_pkg.sh
> 
>  Where
>  * ToolChain :  name of the tool chain such as GCC5
> diff --git a/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt 
> b/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt
> index 94dbccc..8c69210 100644
> --- a/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt
> +++ b/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt
> @@ -98,7 +98,7 @@ target system.
>  These directories, on the target system, are populated from the development
>  system as follows:
> 
> -  * \Efi\Tools receives a copy of 
> Build/AppPkg/RELEASE_VS2017/X64/Python368.efi.
> +  * \Efi\Tools receives a copy of Build/AppPkg/RELEASE_VS2017/X64/Python.efi.
> 
>  Modify the host path to match your build type and compiler.
> 
> @@ -115,12 +115,12 @@ system as follows:
>  the \Efi\StdLib\lib\python36.8\lib-dynload directory.  This 
> functionality is not
>  yet implemented.
> 
> -  A script, create_python368_pkg.bat , is provided which facilitates the 
> population
> +  A script, create_python_pkg.bat , is provided which facilitates the 
> population
>of the target EFI package.  Execute this script from within the
>AppPkg/Applications/Python/Python-3.6.8 directory, providing the Tool 
> Chain, Target
>Build and destination directory which is the path to the destination 
> directory.
>The appropriate contents of the 
> AppPkg/Applications/Python/Python-3.6.8/Lib and
> -  Python368.efi Application from Build/AppPkg/RELEASE_VS2017/X64/ will be
> +  Python.efi Application from Build/AppPkg/RELEASE_VS2017/X64/ will be
>^^
>copied into the specified destination directory.
> 
> @@ -130,10 +130,10 @@ system as follows:
>  6. Example: Enabling socket support
>  

Re: [edk2-devel] [PATCH edk2-platforms 2/2] Maintainers.txt: update email address for Graeme Gregory

2022-10-27 Thread Michael D Kinney
Reviewed-by: Michael D Kinney 

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Leif Lindholm
> Sent: Thursday, October 27, 2022 4:05 AM
> To: devel@edk2.groups.io
> Cc: Leif Lindholm ; Graeme Gregory ; 
> Graeme Gregory ; Kinney,
> Michael D ; Ard Biesheuvel 
> 
> Subject: [edk2-devel] [PATCH edk2-platforms 2/2] Maintainers.txt: update 
> email address for Graeme Gregory
> 
> From: Leif Lindholm 
> 
> Signed-off-by: Leif Lindholm 
> Cc: Graeme Gregory 
> Cc: Graeme Gregory 
> Cc: Michael D Kinney 
> Cc: Ard Biesheuvel 
> ---
>  Maintainers.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt
> index 1a5b6828a867..bbf9c00c 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -355,7 +355,7 @@ F: Platform/Qemu/SbsaQemu/
>  F: Silicon/Qemu/SbsaQemu/
>  M: Ard Biesheuvel 
>  M: Leif Lindholm 
> -R: Graeme Gregory 
> +R: Graeme Gregory 
>  R: Radoslaw Biernacki 
> 
>  Raspberry Pi platforms and silicon
> --
> 2.30.2
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#95650): https://edk2.groups.io/g/devel/message/95650
Mute This Topic: https://groups.io/mt/94601215/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 1/2] Maintainers.txt: fix incorrect line ending

2022-10-27 Thread Michael D Kinney
Reviewed-by: Michael D Kinney 

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Leif Lindholm
> Sent: Thursday, October 27, 2022 4:05 AM
> To: devel@edk2.groups.io
> Cc: Leif Lindholm ; Ni, Ray ; Kinney, 
> Michael D 
> Subject: [edk2-devel] [PATCH edk2-platforms 1/2] Maintainers.txt: fix 
> incorrect line ending
> 
> From: Leif Lindholm 
> 
> Commit 005ab4a11e22a
> ("Maintainers.txt: Update reviewers for IntelSiliconPkg")
> introduced incorrect line ending on the added line. Tidy this up.
> 
> Signed-off-by: Leif Lindholm 
> Cc: Ray Ni 
> Cc: Michael D Kinney 
> ---
>  Maintainers.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt
> index b1adf63dde3d..1a5b6828a867 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -269,7 +269,7 @@ F: Silicon/Intel/IntelSiliconPkg/
>  M: Ray Ni 
>  M: Rangasai V Chaganty 
>  M: Isaac Oram 
> -R: Ashraf Ali S 
> +R: Ashraf Ali S 
> 
>  Silicon/Intel/QuarkSocPkg
>  F: Silicon/Intel/QuarkSocPkg/
> --
> 2.30.2
> 
> 
> 
> 
> 



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




Re: [edk2-devel] [PATCH] edk II C Coding Standard: Fix the missing hyperlink

2022-10-27 Thread Michael D Kinney
Reviewed-by: Michael D Kinney 

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Chang, Abner 
> via groups.io
> Sent: Thursday, October 27, 2022 5:12 AM
> To: devel@edk2.groups.io
> Cc: Ni, Ray ; Kinney, Michael D 
> Subject: [edk2-devel] [PATCH] edk II C Coding Standard: Fix the missing 
> hyperlink
> 
> From: Abner Chang 
> 
> Correct the hyperlink of section 4.2 Directory Names
> in SUMMARY.md.
> 
> Signed-off-by: Abner Chang 
> Cc: Ray Ni 
> Cc: Michael D Kinney 
> ---
>  SUMMARY.md | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/SUMMARY.md b/SUMMARY.md
> index 32a575d..9be642c 100644
> --- a/SUMMARY.md
> +++ b/SUMMARY.md
> @@ -50,7 +50,7 @@
>* [3.4 Documentation](3_quick_reference.md#34-documentation)
>  * [4 Naming Conventions](4_naming_conventions/README.md#4-naming-conventions)
>* [4.1 General Naming 
> Rules](4_naming_conventions/README.md#41-general-naming-rules)
> -  * [4.2 Directory 
> Names](4_naming_conventions/42_file_names.md#42-directory-names)
> +  * [4.2 Directory 
> Names](4_naming_conventions/42_directory_names.md#42-directory-names)
>* [4.3 File Names](4_naming_conventions/43_file_names.md#43-file-names)
>* [4.4 Identifiers](4_naming_conventions/44_identifiers.md#44-identifiers)
>* [4.5 Global & Module 
> Variables](4_naming_conventions/45_global_&_module_variables.md#45-global--module-variables)
> --
> 2.37.1.windows.1
> 
> 
> 
> 
> 



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




Re: [edk2-devel] [PATCH v7 0/7] Add safe unaccepted memory behavior

2022-10-27 Thread Dionna Glaze via groups.io
>
> btw it still fails in CoreTerminateMemoryMap() with the current upstream
> kernel which is not aware of the lazy memory acceptance, is this
> something known? Thanks,
>

It wasn't known. I'll take a look. Thanks for the report.

-- 
-Dionna Glaze, PhD (she/her)


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




Re: [edk2-devel] [PATCH] RedfishPkg/RedfishPlatformCredentialLib: IPMI implementation

2022-10-27 Thread Igor Kulchytskyy via groups.io
Hi Nickle,
Pleased, see my comments on your questions below.

Another point I missed in my previous mail.
You have that function in the library to get credentials and it is used by 
RedfishCredentialsDxe driver to create the protocol which in its turn will be 
used by other Redfish modules.
We do not know how many modules and how many times will call this function 
during boot. Right?
And on each call of this function you call IPMI command. That command will 
create new Redfish account on BMC side according to Redfish HI specification:

" If the Get Bootstrap Account Credentials command has been issued and responds 
with the completion code 00h, a
bootstrap account shall be added to the manager's account collection and 
enabled. If the Get Bootstrap Account
Credentials command is sent subsequent times and responds with the completion 
code 00h, a new account shall be
created based on the newly generated credentials. Any existing bootstrap 
accounts shall remain active."

As I know BMC may have some restrictions on the number of Redfish accounts they 
can support.
And because of that BOS may hit this limit. Which is not good.
On the other hand I'm not sure we need to have different credentials for 
different modules? All those modules are part of FW. And all of them will be 
associated with the same RoleID (FW role) on BMC side.
So, all of them may use the same credentials.
Could we cash the credentials on first call of that 
RedfishCredentialGetAuthInfo and then use those cashed credentials on 
subsequential calls?
It will also may save a boot time, since there is no need to send IPMI command.

Thank you,
Igor

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Nickle Wang via 
groups.io
Sent: Thursday, October 27, 2022 9:26 AM
To: devel@edk2.groups.io; Igor Kulchytskyy ; abner.ch...@amd.com
Cc: Nick Ramirez 
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH] 
RedfishPkg/RedfishPlatformCredentialLib: IPMI implementation


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

Hi Igor,

Thank you for your help to review my changes.

> And it will be blocked by our IPMI call.

I see your point. So, BIOS should never be the person to shutdown credential 
service because BIOS always get executed prior to OS, right?

Igor: Yes, my point is that we should not shutdown credential service from 
BIOS. Even if OS sends that IPMI command, new account will be created and BIOS 
credentials will not be compromised.

> Should it be configured with some PCD? Maybe user may select in Setup what 
> method should be used? Or it could be build time configuration?

I have below assumption while I implemented the library. I admit this is not 
always true.

No Auth: I think this is rare case for Redfish service which gives anonymous 
privilege to change BIOS settings.
Basic Auth: this is the authentication method which uses username and password 
to build base64 encoded string.
Session Auth: I assume that client must have a session token first and then use 
this authentication method. Can we use username and password to generate 
session token on our own? If my memory serves me correctly, client has to do a 
login with username and password first and then client can receive session 
token from server.

Igor: BIOS will use the credentials to create session. It should send POST 
request to the session URI with user name and password to create session.
If a session created successfully then on response BMC returns header 
"X-Auth-Token" which then used for the subsequential calls.

If we really like to know what authentication method that Redfish service used, 
we can issue a HTTP query to "/redfish/v1/Systems" with "No Auth". Then we can 
know what authentication method is required by reading the "WWW-Authenticate " 
filed in returned HTTP header.

Igor: As my understanding, even if you include authentication header (Base64 
encoded) in the request to BMC and BMC has NoAuth configuration, then that 
authentication header would be just ignored by BMC.

Thanks,
Nickle

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Igor Kulchytskyy 
via groups.io
Sent: Wednesday, October 26, 2022 11:26 PM
To: Nickle Wang ; devel@edk2.groups.io; abner.ch...@amd.com
Cc: Nick Ramirez 
Subject: Re: [edk2-devel] [PATCH] RedfishPkg/RedfishPlatformCredentialLib: IPMI 
implementation

External email: Use caution opening links or attachments


Hi Nickle,
I would like to discuss that DisableBootstrapControl flag and how it is used in 
our implementation.
According to Redfish HI specification we can use this flag to disable 
credential bootstrapping control.
It can be disabled permanently or till next reboot of the host or service. That 
depend on the  EnableAfterReset  setting on BMC side:
CredentialBootstrapping (v1.3+)
{ object The credential bootstrapping settings for this interface.
EnableAfterReset (v1.3+) Boolean 

[edk2-devel] [PATCH 1/2] MdePkg/IndustryStandard: add definitions for ACPI APMT

2022-10-27 Thread Jeff Brasen via groups.io
This adds #defines and struct typedefs for the various node types in

the  ACPI Arm Performance Monitoring Unit (APMT) table.



Signed-off-by: Jeff Brasen 

---

 MdePkg/Include/IndustryStandard/Acpi64.h  |  5 ++

 .../ArmPerformanceMonitoringUnitTable.h   | 69 +++

 2 files changed, 74 insertions(+)

 create mode 100644 
MdePkg/Include/IndustryStandard/ArmPerformanceMonitoringUnitTable.h



diff --git a/MdePkg/Include/IndustryStandard/Acpi64.h 
b/MdePkg/Include/IndustryStandard/Acpi64.h

index fe5ebfac2b..575ca0430c 100644

--- a/MdePkg/Include/IndustryStandard/Acpi64.h

+++ b/MdePkg/Include/IndustryStandard/Acpi64.h

@@ -2847,6 +2847,11 @@ typedef struct {

 ///

 #define EFI_ACPI_6_4_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE  
SIGNATURE_32('A', 'P', 'I', 'C')

 

+///

+/// "APMT" Arm Performance Monitoring Unit Table

+///

+#define EFI_ACPI_6_4_ARM_PERFORMANCE_MONITORING_UNIT_TABLE_SIGNATURE  
SIGNATURE_32('A', 'P', 'M', 'T')

+

 ///

 /// "BERT" Boot Error Record Table

 ///

diff --git 
a/MdePkg/Include/IndustryStandard/ArmPerformanceMonitoringUnitTable.h 
b/MdePkg/Include/IndustryStandard/ArmPerformanceMonitoringUnitTable.h

new file mode 100644

index 00..fe7084cffd

--- /dev/null

+++ b/MdePkg/Include/IndustryStandard/ArmPerformanceMonitoringUnitTable.h

@@ -0,0 +1,69 @@

+/** @file

+  ACPI Arm Performance Monitoring Unit (APMT) table

+  as specified in ARM spec DEN0117

+

+  Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.

+  Copyright (c) 2022, ARM Limited. All rights reserved.

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#ifndef ARM_PERFORMANCE_MONITORING_UNIT_TABLE_H_

+#define ARM_PERFORMANCE_MONITORING_UNIT_TABLE_H_

+

+#include 

+

+#pragma pack(1)

+

+///

+/// Arm Performance Monitoring Unit (APMT) tabl

+///

+typedef struct {

+  EFI_ACPI_DESCRIPTION_HEADERHeader;

+} EFI_ACPI_ARM_PERFORMANCE_MONITORING_UNIT_TABLE_HEADER;

+

+///

+/// APMT Revision (as defined in DEN0117.)

+///

+#define EFI_ACPI_ARM_PERFORMANCE_MONITORING_UNIT_TABLE_REVISION  0x00

+

+///

+/// Arm PMU Node Structure

+///

+

+// Node Flags

+#define EFI_ACPI_APMT_DUAL_PAGE_EXTENSION_SUPPORTED  BIT0

+#define EFI_ACPI_APMT_PROCESSOR_AFFINITY_TYPE_CONTAINER  BIT1

+#define EFI_ACPI_APMT_PROCESSOR_AFFINITY_TYPE_PROCESSOR  0 // BIT 1

+#define EFI_ACPI_APMT_64BIT_SINGLE_COPY_ATOMICITY_SUPPORTED  BIT2

+

+// Interrupt Flags

+#define EFI_ACPI_APMT_INTERRUPT_MODE_EDGE_TRIGGERED   BIT0

+#define EFI_ACPI_APMT_INTERRUPT_MODE_LEVEL_TRIGGERED  0 // BIT 0

+#define EFI_ACPI_APMT_INTERRUPT_TYPE_WIRED0 // BIT 1

+

+// Node Type

+#define EFI_ACPI_APMT_NODE_TYPE_MEMORY_CONTROLLER  0x00

+#define EFI_ACPI_APMT_NODE_TYPE_SMMU   0x01

+#define EFI_ACPI_APMT_NODE_TYPE_PCIE_ROOT_COMPLEX  0x02

+#define EFI_ACPI_APMT_NODE_TYPE_ACPI_DEVICE0x03

+#define EFI_ACPI_APMT_NODE_TYPE_CPU_CACHE  0x04

+

+typedef struct {

+  UINT16Length;

+  UINT8 NodeFlags;

+  UINT8 NodeType;

+  UINT32Identifier;

+  UINT64NodeInstancePrimary;

+  UINT32NodeInstanceSecondary;

+  UINT64BaseAddress0;

+  UINT64BaseAddress1;

+  UINT32OverflowInterrupt;

+  UINT32Reserved1;

+  UINT32OverflowInterruptFlags;

+  UINT32ProcessorAffinity;

+  UINT32ImplementationId;

+} EFI_ACPI_ARM_PERFORMANCE_MONITORING_UNIT_NODE;

+

+#pragma pack()

+

+#endif

-- 

2.25.1





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




[edk2-devel] [PATCH 2/2] ShellPkg/AcpiView: APMT Parser

2022-10-27 Thread Jeff Brasen via groups.io
Add a new parser for the Arm Performance Monitoring Unit Table.

The APMT table describes the properties of PMU support

implemented by components in an Arm-based system.



Signed-off-by: Jeff Brasen 

---

 .../UefiShellAcpiViewCommandLib/AcpiParser.h  |  21 

 .../Parsers/Apmt/ApmtParser.c | 105 ++

 .../UefiShellAcpiViewCommandLib.c |   1 +

 .../UefiShellAcpiViewCommandLib.inf   |   1 +

 4 files changed, 128 insertions(+)

 create mode 100644 
ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Apmt/ApmtParser.c



diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h 
b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h

index db8c88f6df..6a1de4e12b 100644

--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h

+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h

@@ -531,6 +531,27 @@ ParseAcpiAest (

   IN UINT8AcpiTableRevision

   );

 

+/**

+  This function parses the ACPI APMT table.

+  When trace is enabled this function parses the APMT table and

+  traces the ACPI table fields.

+

+  This function also performs validation of the ACPI table fields.

+

+  @param [in] Trace  If TRUE, trace the ACPI fields.

+  @param [in] PtrPointer to the start of the buffer.

+  @param [in] AcpiTableLengthLength of the ACPI table.

+  @param [in] AcpiTableRevision  Revision of the ACPI table.

+**/

+VOID

+EFIAPI

+ParseAcpiApmt (

+  IN BOOLEAN  Trace,

+  IN UINT8*Ptr,

+  IN UINT32   AcpiTableLength,

+  IN UINT8AcpiTableRevision

+  );

+

 /**

   This function parses the ACPI BGRT table.

   When trace is enabled this function parses the BGRT table and

diff --git 
a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Apmt/ApmtParser.c 
b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Apmt/ApmtParser.c

new file mode 100644

index 00..b036cd12d3

--- /dev/null

+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Apmt/ApmtParser.c

@@ -0,0 +1,105 @@

+/** @file

+  APMT table parser

+

+  Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.

+  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+

+  @par Reference(s):

+- ACPI 6.2 Specification - Errata A, September 2017

+**/

+

+#include 

+#include 

+#include 

+#include "AcpiParser.h"

+#include "AcpiTableParser.h"

+

+// Local variables

+STATIC ACPI_DESCRIPTION_HEADER_INFO  AcpiHdrInfo;

+STATIC CONST UINT16  *NodeLength;

+

+/**

+  An ACPI_PARSER array describing the ACPI APMT Table.

+**/

+STATIC CONST ACPI_PARSER  ApmtParser[] = {

+  PARSE_ACPI_HEADER ()

+};

+

+/**

+  An ACPI_PARSER array describing the ACPI Arm PMU Node.

+**/

+STATIC CONST ACPI_PARSER  ArmPmuNodeParser[] = {

+  { L"Length",   2, 0,  L"0x%x",  NULL, (VOID **), 
NULL, NULL },

+  { L"Node flags",   1, 2,  L"0x%x",  NULL, NULL, 
NULL, NULL },

+  { L"Node type",1, 3,  L"0x%x",  NULL, NULL, 
NULL, NULL },

+  { L"Identifier",   4, 4,  L"0x%x",  NULL, NULL, 
NULL, NULL },

+  { L"Node Instance primary",8, 8,  L"0x%lx", NULL, NULL, 
NULL, NULL },

+  { L"Node Instance secondary",  4, 16, L"0x%x",  NULL, NULL, 
NULL, NULL },

+  { L"Base address 0",   8, 20, L"0x%lx", NULL, NULL, 
NULL, NULL },

+  { L"Base address 1",   8, 28, L"0x%lx", NULL, NULL, 
NULL, NULL },

+  { L"Overflow interrupt",   4, 36, L"0x%x",  NULL, NULL, 
NULL, NULL },

+  { L"Reserved1",4, 40, L"0x%x",  NULL, NULL, 
NULL, NULL },

+  { L"Overflow interrupt flags", 4, 44, L"0x%x",  NULL, NULL, 
NULL, NULL },

+  { L"Processor affinity",   4, 48, L"0x%x",  NULL, NULL, 
NULL, NULL },

+  { L"Implementation ID",4, 52, L"0x%x",  NULL, NULL, 
NULL, NULL }

+};

+

+/**

+  This function parses the ACPI APMT table.

+  When trace is enabled this function parses the APMT table and

+  traces the ACPI table fields.

+

+  This function also performs validation of the ACPI table fields.

+

+  @param [in] Trace  If TRUE, trace the ACPI fields.

+  @param [in] PtrPointer to the start of the buffer.

+  @param [in] AcpiTableLengthLength of the ACPI table.

+  @param [in] AcpiTableRevision  Revision of the ACPI table.

+**/

+VOID

+EFIAPI

+ParseAcpiApmt (

+  IN BOOLEAN  Trace,

+  IN UINT8*Ptr,

+  IN UINT32   AcpiTableLength,

+  IN UINT8AcpiTableRevision

+  )

+{

+  UINT32  Offset;

+

+  if (!Trace) {

+return;

+  }

+

+  ParseAcpi (

+Trace,

+0,

+"APMT",

+Ptr,

+AcpiTableLength,

+PARSER_PARAMS (ApmtParser)

+);

+  Offset = sizeof (EFI_ACPI_DESCRIPTION_HEADER);

+

+  while 

Re: [edk2-devel] [PATCH] RedfishPkg/RedfishPlatformCredentialLib: IPMI implementation

2022-10-27 Thread Nickle Wang via groups.io
Hi Igor,

Thank you for your help to review my changes. 

> And it will be blocked by our IPMI call.

I see your point. So, BIOS should never be the person to shutdown credential 
service because BIOS always get executed prior to OS, right? 

> Should it be configured with some PCD? Maybe user may select in Setup what 
> method should be used? Or it could be build time configuration?

I have below assumption while I implemented the library. I admit this is not 
always true.

No Auth: I think this is rare case for Redfish service which gives anonymous 
privilege to change BIOS settings.
Basic Auth: this is the authentication method which uses username and password 
to build base64 encoded string.
Session Auth: I assume that client must have a session token first and then use 
this authentication method. Can we use username and password to generate 
session token on our own? If my memory serves me correctly, client has to do a 
login with username and password first and then client can receive session 
token from server.

If we really like to know what authentication method that Redfish service used, 
we can issue a HTTP query to "/redfish/v1/Systems" with "No Auth". Then we can 
know what authentication method is required by reading the "WWW-Authenticate " 
filed in returned HTTP header.

Thanks,
Nickle

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Igor Kulchytskyy 
via groups.io
Sent: Wednesday, October 26, 2022 11:26 PM
To: Nickle Wang ; devel@edk2.groups.io; abner.ch...@amd.com
Cc: Nick Ramirez 
Subject: Re: [edk2-devel] [PATCH] RedfishPkg/RedfishPlatformCredentialLib: IPMI 
implementation

External email: Use caution opening links or attachments


Hi Nickle,
I would like to discuss that DisableBootstrapControl flag and how it is used in 
our implementation.
According to Redfish HI specification we can use this flag to disable 
credential bootstrapping control.
It can be disabled permanently or till next reboot of the host or service. That 
depend on the  EnableAfterReset  setting on BMC side:
CredentialBootstrapping (v1.3+)
{ object The credential bootstrapping settings for this interface.
EnableAfterReset (v1.3+) Boolean read-write (null) An indication of 
whether credential bootstrapping is enabled after a reset for this interface.
Enabled (v1.3+) Boolean read-write (null) An indication of whether 
credential bootstrapping is enabled for this interface.
RoleId (v1.3+) string read-write The role used for the bootstrap 
account created for this interface.
}
So, if EnableAfterReset set to false, that means BMC will response with 0x80 
error and will not return any credentials after reboot. And BIOS BMC 
communication will fail.
Another concern with  disabling credential bootstrapping control is that we do 
it on Exit Boot event before passing a control to OS.
But OS may also need to communicate to BMC through Redfish Host Interface to 
post some information. And it will be blocked by our IPMI call.
We create that SMBIOS Type 42 table with Redfish Host Interface settings which 
can be used by OS to communicate with BMC. But without the credentials it will 
not be possible.

Another question is AuthMethod parameter you initialize in this library:
*AuthMethod = AuthMethodHttpBasic;
According to Redfish HI specification 3 methods may be used - No Auth, Basic 
Auth and Session Auth.
Basic Auth and Session Auth methods are required the credentials to be used by 
BIOS. And both of them should be supported by BMC.
And your high level function RedfishCreateLibredfishService also supports of 
creation Basic or Session Auth service.
I'm not sure why low level library which is created to get credentials from BMC 
should decide what Authentication method should be used?
Should it be configured with some PCD? Maybe user may select in Setup what 
method should be used? Or it could be build time configuration?

Thank you,
Igor

-Original Message-
From: Nickle Wang 
Sent: Tuesday, October 25, 2022 4:24 AM
To: devel@edk2.groups.io; abner.ch...@amd.com
Cc: Nick Ramirez ; Igor Kulchytskyy 
Subject: [EXTERNAL] RE: [edk2-devel] [PATCH] 
RedfishPkg/RedfishPlatformCredentialLib: IPMI implementation


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

Thanks for your review comments, Abner! I will update new version patch later. 
The CI build error will be handled together.

> please add Igor as reviewer too
Sure!


> +  *UserId = AllocateZeroPool (sizeof (CHAR8) * USERNAME_MAX_SIZE); if
[Chang, Abner]
Allocation memory with the size (USERNAME_MAX_LENGTH + 1)  for both 
BootUsername and BootstrapPassword?   Because the maximum number of characters 
defined in the spec is USERNAME_MAX_LENGTH for the user/password.

Yes, the additional one byte is for NULL terminator. USERNAME_MAX_LENGTH is 
defined as 16 and follow host interface specification.

Regards,
Nickle

-Original 

[edk2-devel] [PATCH] edk II C Coding Standard: Fix the missing hyperlink

2022-10-27 Thread Chang, Abner via groups.io
From: Abner Chang 

Correct the hyperlink of section 4.2 Directory Names
in SUMMARY.md.

Signed-off-by: Abner Chang 
Cc: Ray Ni 
Cc: Michael D Kinney 
---
 SUMMARY.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/SUMMARY.md b/SUMMARY.md
index 32a575d..9be642c 100644
--- a/SUMMARY.md
+++ b/SUMMARY.md
@@ -50,7 +50,7 @@
   * [3.4 Documentation](3_quick_reference.md#34-documentation)
 * [4 Naming Conventions](4_naming_conventions/README.md#4-naming-conventions)
   * [4.1 General Naming 
Rules](4_naming_conventions/README.md#41-general-naming-rules)
-  * [4.2 Directory 
Names](4_naming_conventions/42_file_names.md#42-directory-names)  
+  * [4.2 Directory 
Names](4_naming_conventions/42_directory_names.md#42-directory-names)  
   * [4.3 File Names](4_naming_conventions/43_file_names.md#43-file-names)
   * [4.4 Identifiers](4_naming_conventions/44_identifiers.md#44-identifiers)
   * [4.5 Global & Module 
Variables](4_naming_conventions/45_global_&_module_variables.md#45-global--module-variables)
-- 
2.37.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#95643): https://edk2.groups.io/g/devel/message/95643
Mute This Topic: https://groups.io/mt/94602288/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 2/2] Maintainers.txt: update email address for Graeme Gregory

2022-10-27 Thread Ard Biesheuvel
On Thu, 27 Oct 2022 at 13:05, Leif Lindholm  wrote:
>
> From: Leif Lindholm 
>
> Signed-off-by: Leif Lindholm 
> Cc: Graeme Gregory 
> Cc: Graeme Gregory 
> Cc: Michael D Kinney 
> Cc: Ard Biesheuvel 

Acked-by: Ard Biesheuvel 

> ---
>  Maintainers.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Maintainers.txt b/Maintainers.txt
> index 1a5b6828a867..bbf9c00c 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -355,7 +355,7 @@ F: Platform/Qemu/SbsaQemu/
>  F: Silicon/Qemu/SbsaQemu/
>  M: Ard Biesheuvel 
>  M: Leif Lindholm 
> -R: Graeme Gregory 
> +R: Graeme Gregory 
>  R: Radoslaw Biernacki 
>
>  Raspberry Pi platforms and silicon
> --
> 2.30.2
>


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




[edk2-devel] [PATCH edk2-platforms 2/2] Maintainers.txt: update email address for Graeme Gregory

2022-10-27 Thread Leif Lindholm
From: Leif Lindholm 

Signed-off-by: Leif Lindholm 
Cc: Graeme Gregory 
Cc: Graeme Gregory 
Cc: Michael D Kinney 
Cc: Ard Biesheuvel 
---
 Maintainers.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Maintainers.txt b/Maintainers.txt
index 1a5b6828a867..bbf9c00c 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -355,7 +355,7 @@ F: Platform/Qemu/SbsaQemu/
 F: Silicon/Qemu/SbsaQemu/
 M: Ard Biesheuvel 
 M: Leif Lindholm 
-R: Graeme Gregory 
+R: Graeme Gregory 
 R: Radoslaw Biernacki 
 
 Raspberry Pi platforms and silicon
-- 
2.30.2



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




[edk2-devel] [PATCH edk2-platforms 1/2] Maintainers.txt: fix incorrect line ending

2022-10-27 Thread Leif Lindholm
From: Leif Lindholm 

Commit 005ab4a11e22a
("Maintainers.txt: Update reviewers for IntelSiliconPkg")
introduced incorrect line ending on the added line. Tidy this up.

Signed-off-by: Leif Lindholm 
Cc: Ray Ni 
Cc: Michael D Kinney 
---
 Maintainers.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Maintainers.txt b/Maintainers.txt
index b1adf63dde3d..1a5b6828a867 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -269,7 +269,7 @@ F: Silicon/Intel/IntelSiliconPkg/
 M: Ray Ni 
 M: Rangasai V Chaganty 
 M: Isaac Oram 
-R: Ashraf Ali S 
+R: Ashraf Ali S 
 
 Silicon/Intel/QuarkSocPkg
 F: Silicon/Intel/QuarkSocPkg/
-- 
2.30.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#95640): https://edk2.groups.io/g/devel/message/95640
Mute This Topic: https://groups.io/mt/94601214/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] Platform/SbsaQemu: Switch to VirtNorFlashDxe

2022-10-27 Thread Leif Lindholm
On Wed, Oct 26, 2022 at 19:42:10 +0200, Ard Biesheuvel wrote:
> Switch to the OVMF version of the NOR flash DXE driver, which supports
> QEMU's NOR flash emulation specifically, and carries some optimizations
> that are therefore permitted.
> 
> Cc: Leif Lindholm 
> Cc: Graeme Gregory 

Graeme Gregory  is probably more likely to
be seen these days. Patch to Maintainers.txt coming up (although
Graeme is out this week).

> Signed-off-by: Ard Biesheuvel 

Reviewed-by: Leif Lindholm 


> ---
>  Platform/Qemu/SbsaQemu/SbsaQemu.dsc   |  
> 4 ++--
>  Platform/Qemu/SbsaQemu/SbsaQemu.fdf   |  
> 2 +-
>  Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf |  
> 4 ++--
>  Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.c   | 
> 12 ++--
>  4 files changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc 
> b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
> index ff280709a509..79dd200ca7fc 100644
> --- a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
> +++ b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
> @@ -178,7 +178,7 @@ [LibraryClasses.common]
>
> ArmPlatformLib|ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.inf
>  
>TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
> -  
> NorFlashPlatformLib|Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf
> +  
> VirtNorFlashPlatformLib|Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf
>  
>CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
>BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf
> @@ -663,7 +663,7 @@ [Components.common]
>  
>ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
>ArmPkg/Drivers/TimerDxe/TimerDxe.inf
> -  ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
> +  OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.inf
>MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
>  
>#
> diff --git a/Platform/Qemu/SbsaQemu/SbsaQemu.fdf 
> b/Platform/Qemu/SbsaQemu/SbsaQemu.fdf
> index 9f031c3e6649..781215707c3d 100644
> --- a/Platform/Qemu/SbsaQemu/SbsaQemu.fdf
> +++ b/Platform/Qemu/SbsaQemu/SbsaQemu.fdf
> @@ -189,7 +189,7 @@ [FV.FvMain]
>  
>INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
>INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf
> -  INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
> +  INF OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.inf
>INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
>  
>#
> diff --git 
> a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf 
> b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf
> index f2ba41e1df99..f7e3f8e05eec 100644
> --- 
> a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf
> +++ 
> b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf
> @@ -14,16 +14,16 @@ [Defines]
>FILE_GUID  = c53d904d-de50-40f1-a148-a2ece48303d8
>MODULE_TYPE= BASE
>VERSION_STRING = 1.0
> -  LIBRARY_CLASS  = NorFlashPlatformLib
> +  LIBRARY_CLASS  = VirtNorFlashPlatformLib
>  
>  [Sources.common]
>SbsaQemuNorFlashLib.c
>  
>  [Packages]
> -  ArmPlatformPkg/ArmPlatformPkg.dec
>ArmPkg/ArmPkg.dec
>MdePkg/MdePkg.dec
>MdeModulePkg/MdeModulePkg.dec
> +  OvmfPkg/OvmfPkg.dec
>  
>  [FixedPcd]
>gArmTokenSpaceGuid.PcdFdBaseAddress
> diff --git 
> a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.c 
> b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.c
> index 0946327cb529..56c26019a140 100644
> --- a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.c
> +++ b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.c
> @@ -8,19 +8,19 @@
>  
>  #include 
>  #include 
> -#include 
> +#include 
>  
>  #define QEMU_NOR_BLOCK_SIZESIZE_256KB
>  
>  EFI_STATUS
> -NorFlashPlatformInitialization (
> +VirtNorFlashPlatformInitialization (
>VOID
>)
>  {
>return EFI_SUCCESS;
>  }
>  
> -NOR_FLASH_DESCRIPTION mNorFlashDevice =
> +STATIC VIRT_NOR_FLASH_DESCRIPTION mNorFlashDevice =
>  {
>   FixedPcdGet64(PcdFdBaseAddress),
>   FixedPcdGet64(PcdFlashNvStorageVariableBase),
> @@ -29,9 +29,9 @@ NOR_FLASH_DESCRIPTION mNorFlashDevice =
>  };
>  
>  EFI_STATUS
> -NorFlashPlatformGetDevices (
> -  OUT NOR_FLASH_DESCRIPTION   **NorFlashDescriptions,
> -  OUT UINT32  *Count
> +VirtNorFlashPlatformGetDevices (
> +  OUT VIRT_NOR_FLASH_DESCRIPTION  **NorFlashDescriptions,
> +  OUT UINT32  *Count
>)
>  {
>*NorFlashDescriptions = 
> -- 
> 2.35.1
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#95639): https://edk2.groups.io/g/devel/message/95639
Mute This Topic: https://groups.io/mt/94587261/21656
Group Owner: 

[edk2-devel] [edk2-libc Patch 1/1] edk2-libc: remove substring 368 from py uefi app name

2022-10-27 Thread Jayaprakash, N
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4124

This patch contains the changes to remove the substring
368 from the name of the python uefi interpreter app.
With the changes in this patch the python interpreter app
name will be changed from python368.efi to python.efi.
This change was requested by chipsec team.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jayaprakash N 
---
 .../Python-3.6.8/GCCCompilationBKMs.rst   | 10 +--
 .../Python/Python-3.6.8/Py368ReadMe.txt   | 14 ++--
 .../Python/Python-3.6.8/Python368.inf |  2 +-
 ...ython368_pkg.bat => create_python_pkg.bat} | 78 +--
 ..._python368_pkg.sh => create_python_pkg.sh} |  7 +-
 5 files changed, 54 insertions(+), 57 deletions(-)
 rename AppPkg/Applications/Python/Python-3.6.8/{create_python368_pkg.bat => 
create_python_pkg.bat} (87%)
 rename AppPkg/Applications/Python/Python-3.6.8/{create_python368_pkg.sh => 
create_python_pkg.sh} (92%)

diff --git a/AppPkg/Applications/Python/Python-3.6.8/GCCCompilationBKMs.rst 
b/AppPkg/Applications/Python/Python-3.6.8/GCCCompilationBKMs.rst
index c72788f..525bef8 100644
--- a/AppPkg/Applications/Python/Python-3.6.8/GCCCompilationBKMs.rst
+++ b/AppPkg/Applications/Python/Python-3.6.8/GCCCompilationBKMs.rst
@@ -167,24 +167,24 @@ Execute the below command to build the X64 version of the 
Python 3.6.8 interpret
 -
 
 To create an usable Python UEFI package with all the dependencies from the 
build environment,
-you can use the bash shell script create_python368_pkg.sh available under 
/AppPkg/Applications/Python/Python-3.6.8
+you can use the bash shell script create_python_pkg.sh available under 
/AppPkg/Applications/Python/Python-3.6.8
 folder.
 
 Use the following commands to create Python UEFI package::
 
 bash$ cd ~/src/edk2/AppPkg/Applications/Python/Python-3.6.8/
-bash$ chmod 777 create_python368_pkg.sh
-./create_python368_pkg.sh GCC5 RELEASE X64 myPyUEFI
+bash$ chmod 777 create_python_pkg.sh
+./create_python_pkg.sh GCC5 RELEASE X64 myPyUEFI
 
 where GCC5 refers to the tool chain, RELEASE refers to the build type, X64 
refers to the architecture
 myPyUEFI refers to the name of the folder where the Python UEFI package needs 
to be created.
 
-When you run the create_python368_pkg.sh without any parameters it lists the 
help
+When you run the create_python_pkg.sh without any parameters it lists the help
 information as shown below:
 
 Shell Script to create Python EFI Package.
 
-Usage: ./create_python368_pkg.sh

+Usage: ./create_python_pkg.sh
 
 Where
 * ToolChain :  name of the tool chain such as GCC5
diff --git a/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt 
b/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt
index 94dbccc..8c69210 100644
--- a/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt
+++ b/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt
@@ -98,7 +98,7 @@ target system.
 These directories, on the target system, are populated from the development
 system as follows:
 
-  * \Efi\Tools receives a copy of 
Build/AppPkg/RELEASE_VS2017/X64/Python368.efi.
+  * \Efi\Tools receives a copy of Build/AppPkg/RELEASE_VS2017/X64/Python.efi.

 Modify the host path to match your build type and compiler.
 
@@ -115,12 +115,12 @@ system as follows:
 the \Efi\StdLib\lib\python36.8\lib-dynload directory.  This functionality 
is not
 yet implemented.
 
-  A script, create_python368_pkg.bat , is provided which facilitates the 
population
+  A script, create_python_pkg.bat , is provided which facilitates the 
population
   of the target EFI package.  Execute this script from within the
   AppPkg/Applications/Python/Python-3.6.8 directory, providing the Tool Chain, 
Target
   Build and destination directory which is the path to the destination 
directory.  
   The appropriate contents of the AppPkg/Applications/Python/Python-3.6.8/Lib 
and
-  Python368.efi Application from Build/AppPkg/RELEASE_VS2017/X64/ will be
+  Python.efi Application from Build/AppPkg/RELEASE_VS2017/X64/ will be
   ^^   
   copied into the specified destination directory.
 
@@ -130,10 +130,10 @@ system as follows:
 6. Example: Enabling socket support
 ===
   1.  enable {"_socket", init_socket}, in PyMod-3.6.8\Modules\config.c
-  2.  enable LibraryClasses BsdSocketLib and EfiSocketLib in Python368.inf.
-  3.  Build Python368
+  2.  enable LibraryClasses BsdSocketLib and EfiSocketLib in Python368.inf
+  3.  Build Python interpreter application using below command
   build -a X64 -p AppPkg\AppPkg.dsc
-  6.  copy Build\AppPkg\RELEASE_VS2017\X64\Python368.efi to \Efi\Tools on your
+  6.  copy Build\AppPkg\RELEASE_VS2017\X64\Python.efi to \Efi\Tools 

[edk2-devel] [edk2-libc Patch 0/1] edk2-libc - to remove substring 368 from python uefi app name

2022-10-27 Thread Jayaprakash, N
This patch request contains the necessary changes to remove the 
substring 368 from the name of the python uefi interpreter app.
The app name will change from python368.efi to python.efi

Jayaprakash Nevara (1):
  edk2-libc: remove substring 368 from py uefi app name

 .../Python-3.6.8/GCCCompilationBKMs.rst   | 10 +--
 .../Python/Python-3.6.8/Py368ReadMe.txt   | 14 ++--
 .../Python/Python-3.6.8/Python368.inf |  2 +-
 ...ython368_pkg.bat => create_python_pkg.bat} | 78 +--
 ..._python368_pkg.sh => create_python_pkg.sh} |  7 +-
 5 files changed, 54 insertions(+), 57 deletions(-)
 rename AppPkg/Applications/Python/Python-3.6.8/{create_python368_pkg.bat => 
create_python_pkg.bat} (87%)
 rename AppPkg/Applications/Python/Python-3.6.8/{create_python368_pkg.sh => 
create_python_pkg.sh} (92%)

-- 
2.33.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#95637): https://edk2.groups.io/g/devel/message/95637
Mute This Topic: https://groups.io/mt/94600512/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] edk2Platforms-Silicon:Add VAB FIT record types support in FitGen.c

2022-10-27 Thread Holland, Michael
Hi Liming,

The spec is in process of being published.

@Chaganty, Rangasai V @Lohr, Paul 
A

Any update on FIT spec being published?

Thanks,
Michael

From: gaoliming 
Sent: Tuesday, October 25, 2022 09:18 PM
To: devel@edk2.groups.io; Hv, Pavamana 
Cc: Feng, Bob C ; Holland, Michael 

Subject: 回复: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record 
types support in FitGen.c


Pavamana:

 The code change looks good. Now,  is FIT spec 1.4 public to be downloaded?

Thanks
Liming
发件人: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>> 代表 Hv, Pavamana
发送时间: 2022年10月26日 5:50
收件人: devel@edk2.groups.io; Gao, Liming 
mailto:gaolim...@byosoft.com.cn>>
抄送: Feng, Bob C mailto:bob.c.f...@intel.com>>; Holland, 
Michael mailto:michael.holl...@intel.com>>
主题: Re: [edk2-devel] [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record types 
support in FitGen.c
重要性: 高

Hi Liming,
Any update on this? Please treat this with urgency as we have a release coming 
up and needs this change.

-Pavamana

From: Hv, Pavamana
Sent: Monday, October 24, 2022 10:05 AM
To: devel@edk2.groups.io; Gao, Liming 
mailto:gaolim...@byosoft.com.cn>>
Subject: RE: [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record types support 
in FitGen.c


@Gao, Liming,

Can you please review the patch and let me know if this can be merged?

Thanks in advance for your help.

Regards,

Pavamana



-Original Message-
From: Hv, Pavamana mailto:pavamana...@intel.com>>
Sent: Wednesday, October 19, 2022 8:57 PM
To: devel@edk2.groups.io
Cc: Hv, Pavamana mailto:pavamana...@intel.com>>
Subject: [PATCH v2] edk2Platforms-Silicon:Add VAB FIT record types support in 
FitGen.c



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



This commit adds support for new FIT record type for Vendor Authorized Boot 
(VAB) security technology(FIT spec revision 1.4).

VAB defines 3 new following types

Vendor Authorized Boot Provisioning Table (Type 0x1A) Vendor Authorized Boot 
Image Manifest (Type 0x1B) Vendor Authorized Boot Key Manifest (Type 0x1C) The 
code has been updated to align these binaries on 64 byte boundary and not to 
overlap with other regions, similar to Key manifest, Boot Policy manifest and 
other optional types.



Also added macros to define FIT spec Major and Minor version numbers and print 
the same instead of hardcoded string.



Signed-off-by: Pavamana Holavanahalli 
mailto:pavamana...@intel.com>>

---

Silicon/Intel/Tools/FitGen/FitGen.c | 61 +++--  
Silicon/Intel/Tools/FitGen/FitGen.h |  5 ++-

2 files changed, 44 insertions(+), 22 deletions(-)



diff --git a/Silicon/Intel/Tools/FitGen/FitGen.c 
b/Silicon/Intel/Tools/FitGen/FitGen.c

index 21dfcf1ebb..87123f9922 100644

--- a/Silicon/Intel/Tools/FitGen/FitGen.c

+++ b/Silicon/Intel/Tools/FitGen/FitGen.c

@@ -234,20 +234,24 @@ typedef struct {

#define FLASH_TO_MEMORY(Address, FvBuffer, FvSize)  \  (VOID 
*)(UINTN)((UINTN)(FvBuffer) + (UINTN)(FvSize) - (TOP_FLASH_ADDRESS - 
(UINTN)(Address))) -#define FIT_TABLE_TYPE_HEADER 0-#define 
FIT_TABLE_TYPE_MICROCODE  1-#define FIT_TABLE_TYPE_STARTUP_ACM  
  2-#define FIT_TABLE_TYPE_DIAGNST_ACM3-#define 
FIT_TABLE_TYPE_BIOS_MODULE7-#define FIT_TABLE_TYPE_TPM_POLICY   
  8-#define FIT_TABLE_TYPE_BIOS_POLICY9-#define 
FIT_TABLE_TYPE_TXT_POLICY 10-#define FIT_TABLE_TYPE_KEY_MANIFEST
   11-#define FIT_TABLE_TYPE_BOOT_POLICY_MANIFEST   12-#define 
FIT_TABLE_TYPE_BIOS_DATA_AREA 13-#define FIT_TABLE_TYPE_CSE_SECURE_BOOT 
   16-#define FIT_TABLE_SUBTYPE_FIT_PATCH_MANIFEST  12-#define 
FIT_TABLE_SUBTYPE_ACM_MANIFEST13+#define FIT_TABLE_TYPE_HEADER  
0+#define FIT_TABLE_TYPE_MICROCODE   1+#define 
FIT_TABLE_TYPE_STARTUP_ACM 2+#define FIT_TABLE_TYPE_DIAGNST_ACM 
3+#define FIT_TABLE_TYPE_BIOS_MODULE 7+#define 
FIT_TABLE_TYPE_TPM_POLICY  8+#define FIT_TABLE_TYPE_BIOS_POLICY 
9+#define FIT_TABLE_TYPE_TXT_POLICY  10+#define 
FIT_TABLE_TYPE_KEY_MANIFEST11+#define 
FIT_TABLE_TYPE_BOOT_POLICY_MANIFEST12+#define 
FIT_TABLE_TYPE_BIOS_DATA_AREA  13+#define 
FIT_TABLE_TYPE_CSE_SECURE_BOOT 16+#define 
FIT_TABLE_SUBTYPE_FIT_PATCH_MANIFEST   12+#define 
FIT_TABLE_SUBTYPE_ACM_MANIFEST 13+#define 
FIT_TABLE_TYPE_VAB_PROVISION_TABLE 26+#define 
FIT_TABLE_TYPE_VAB_BOOT_IMAGE_MANIFEST 27+#define 
FIT_TABLE_TYPE_VAB_BOOT_KEY_MANIFEST   28+  // // With OptionalModule 
Address isn't known until free space has been@@ -322,8 +326,10 @@ Returns:

--*/ {   printf (-"%s - Tiano IA32/X64 FIT table 

Re: [edk2-devel] [PATCH v2 1/1] MdePkg/BaseLib: Fix out-of-bounds reads in SafeString

2022-10-27 Thread Marvin Häuser
Comment inline.

> On 26. Oct 2022, at 15:35, Yao, Jiewen  wrote:
> 
> That is good catch.
> 
> Reviewed-by: Jiewen Yao 
> 
> 
>> -Original Message-
>> From: Kinney, Michael D 
>> Sent: Wednesday, October 26, 2022 12:23 AM
>> To: Pedro Falcato ; devel@edk2.groups.io
>> Cc: Vitaly Cheptsov ; Marvin Häuser
>> ; Gao, Liming ; Liu,
>> Zhiguang ; Yao, Jiewen 
>> Subject: RE: [PATCH v2 1/1] MdePkg/BaseLib: Fix out-of-bounds reads in
>> SafeString
>> 
>> Adding Jiewen Yao.
>> 
>> Mike
>> 
>>> -Original Message-
>>> From: Pedro Falcato 
>>> Sent: Monday, October 24, 2022 3:43 PM
>>> To: devel@edk2.groups.io
>>> Cc: Pedro Falcato ; Vitaly Cheptsov
>> ; Marvin Häuser ;
>>> Kinney, Michael D ; Gao, Liming
>> ; Liu, Zhiguang 
>>> Subject: [PATCH v2 1/1] MdePkg/BaseLib: Fix out-of-bounds reads in
>> SafeString
>>> 
>>> OpenCore folks established an ASAN-equipped project to fuzz Ext4Dxe,
>>> which was able to catch these (mostly harmless) issues.
>>> 
>>> Signed-off-by: Pedro Falcato 
>>> Cc: Vitaly Cheptsov 
>>> Cc: Marvin Häuser 
>>> Cc: Michael D Kinney 
>>> Cc: Liming Gao 
>>> Cc: Zhiguang Liu 
>>> ---
>>> MdePkg/Library/BaseLib/SafeString.c | 24 
>>> 1 file changed, 20 insertions(+), 4 deletions(-)
>>> 
>>> diff --git a/MdePkg/Library/BaseLib/SafeString.c
>> b/MdePkg/Library/BaseLib/SafeString.c
>>> index f338a32a3a41..77a2585ad56d 100644
>>> --- a/MdePkg/Library/BaseLib/SafeString.c
>>> +++ b/MdePkg/Library/BaseLib/SafeString.c
>>> @@ -863,6 +863,9 @@ StrHexToUintnS (
>>>   OUT   UINTN   *Data
>>>   )
>>> {
>>> +  BOOLEAN  FoundLeadingZero;
>>> +
>>> +  FoundLeadingZero = FALSE;
>>>   ASSERT (((UINTN)String & BIT0) == 0);
>>> 
>>>   //
>>> @@ -893,11 +896,12 @@ StrHexToUintnS (
>>>   // Ignore leading Zeros after the spaces
>>>   //
>>>   while (*String == L'0') {
>>> +FoundLeadingZero = TRUE;

I would just assign these outside the loop. Simpler, easier to read and 
understand, might emit better bins.

Best regards,
Marvin

>>> String++;
>>>   }
>>> 
>>>   if (CharToUpper (*String) == L'X') {
>>> -if (*(String - 1) != L'0') {
>>> +if (!FoundLeadingZero) {
>>>   *Data = 0;
>>>   return RETURN_SUCCESS;
>>> }
>>> @@ -992,6 +996,9 @@ StrHexToUint64S (
>>>   OUT   UINT64  *Data
>>>   )
>>> {
>>> +  BOOLEAN  FoundLeadingZero;
>>> +
>>> +  FoundLeadingZero = FALSE;
>>>   ASSERT (((UINTN)String & BIT0) == 0);
>>> 
>>>   //
>>> @@ -1022,11 +1029,12 @@ StrHexToUint64S (
>>>   // Ignore leading Zeros after the spaces
>>>   //
>>>   while (*String == L'0') {
>>> +FoundLeadingZero = TRUE;
>>> String++;
>>>   }
>>> 
>>>   if (CharToUpper (*String) == L'X') {
>>> -if (*(String - 1) != L'0') {
>>> +if (!FoundLeadingZero) {
>>>   *Data = 0;
>>>   return RETURN_SUCCESS;
>>> }
>>> @@ -2393,6 +2401,9 @@ AsciiStrHexToUintnS (
>>>   OUT   UINTN  *Data
>>>   )
>>> {
>>> +  BOOLEAN  FoundLeadingZero;
>>> +
>>> +  FoundLeadingZero = FALSE;
>>>   //
>>>   // 1. Neither String nor Data shall be a null pointer.
>>>   //
>>> @@ -2421,11 +2432,12 @@ AsciiStrHexToUintnS (
>>>   // Ignore leading Zeros after the spaces
>>>   //
>>>   while (*String == '0') {
>>> +FoundLeadingZero = TRUE;
>>> String++;
>>>   }
>>> 
>>>   if (AsciiCharToUpper (*String) == 'X') {
>>> -if (*(String - 1) != '0') {
>>> +if (!FoundLeadingZero) {
>>>   *Data = 0;
>>>   return RETURN_SUCCESS;
>>> }
>>> @@ -2517,6 +2529,9 @@ AsciiStrHexToUint64S (
>>>   OUT   UINT64  *Data
>>>   )
>>> {
>>> +  BOOLEAN  FoundLeadingZero;
>>> +
>>> +  FoundLeadingZero = FALSE;
>>>   //
>>>   // 1. Neither String nor Data shall be a null pointer.
>>>   //
>>> @@ -2545,11 +2560,12 @@ AsciiStrHexToUint64S (
>>>   // Ignore leading Zeros after the spaces
>>>   //
>>>   while (*String == '0') {
>>> +FoundLeadingZero = TRUE;
>>> String++;
>>>   }
>>> 
>>>   if (AsciiCharToUpper (*String) == 'X') {
>>> -if (*(String - 1) != '0') {
>>> +if (!FoundLeadingZero) {
>>>   *Data = 0;
>>>   return RETURN_SUCCESS;
>>> }
>>> --
>>> 2.38.1
> 



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




[edk2-devel] [PATCH v2] MdeModulePkg/ScsiDiskDxe: Update proper device name for ScsiDisk drive

2022-10-27 Thread Cheripally Gopi via groups.io
ScsiDiskDxe driver updates ControllerNameTable with common string
"SCSI Disk Device" for all SCSI disks. Due to this, when multiple
SCSI disk devices connected, facing difficulty in identifying correct SCSI
disk device. As per SCSI spec, standard Inquiry Data is having the fields
to know Vendor and Product information. Updated "ControllerNameTable" with
Vendor and Product information. So that, device specific name can be
retrieved using ComponentName protocol.

Cc: Vasudevan Sambandan 
Cc: Sundaresan Selvaraj 
Signed-off-by: Cheripally Gopi 
---
 MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c  | 53 ++-
 MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h  |  9 
 .../Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf  |  2 +
 3 files changed, 62 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c 
b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c
index 98e84b4ea8..0928605dc4 100644
--- a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c
+++ b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c
@@ -2,6 +2,7 @@
   SCSI disk driver that layers on every SCSI IO protocol in the system.



 Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.

+Copyright (c) 1985 - 2022, American Megatrends International LLC.

 SPDX-License-Identifier: BSD-2-Clause-Patent



 **/

@@ -67,6 +68,33 @@ FreeAlignedBuffer (
   }

 }



+/**

+  Remove trailing spaces from the string.

+

+  @param String   The ASCII string to remove the trailing spaces.

+

+  @retval the new length of the string.

+**/

+UINTN

+RemoveTrailingSpaces (

+  IN OUT CHAR8  *String

+  )

+{

+  UINTN  Length;

+

+  Length = AsciiStrLen (String);

+  if (Length == 0) {

+return 0;

+  }

+

+  while ((Length > 0) && (String[Length-1] == ' ')) {

+Length--;

+  }

+

+  String[Length] = '\0';

+  return Length;

+}

+

 /**

   The user Entry Point for module ScsiDisk.



@@ -203,6 +231,9 @@ ScsiDiskDriverBindingStart (
   UINT8 MaxRetry;

   BOOLEAN   NeedRetry;

   BOOLEAN   MustReadCapacity;

+  CHAR8 VendorStr[VENDOR_IDENTIFICATION_LENGTH + 1];

+  CHAR8 ProductStr[PRODUCT_IDENTIFICATION_LENGTH + 1];

+  CHAR16DeviceStr[VENDOR_IDENTIFICATION_LENGTH + 
PRODUCT_IDENTIFICATION_LENGTH + 2];



   MustReadCapacity = TRUE;



@@ -354,19 +385,37 @@ ScsiDiskDriverBindingStart (
   }

 }



+CopyMem (

+  VendorStr,

+  
>InquiryData.Reserved_5_95[VENDOR_IDENTIFICATION_OFFSET],

+  VENDOR_IDENTIFICATION_LENGTH

+  );

+VendorStr[VENDOR_IDENTIFICATION_LENGTH] = 0;

+RemoveTrailingSpaces (VendorStr);

+

+CopyMem (

+  ProductStr,

+  
>InquiryData.Reserved_5_95[PRODUCT_IDENTIFICATION_OFFSET],

+  PRODUCT_IDENTIFICATION_LENGTH

+  );

+ProductStr[PRODUCT_IDENTIFICATION_LENGTH] = 0;

+RemoveTrailingSpaces (ProductStr);

+

+UnicodeSPrint (DeviceStr, sizeof (DeviceStr), L"%a %a", VendorStr, 
ProductStr);

+

 ScsiDiskDevice->ControllerNameTable = NULL;

 AddUnicodeString2 (

   "eng",

   gScsiDiskComponentName.SupportedLanguages,

   >ControllerNameTable,

-  L"SCSI Disk Device",

+  DeviceStr,

   TRUE

   );

 AddUnicodeString2 (

   "en",

   gScsiDiskComponentName2.SupportedLanguages,

   >ControllerNameTable,

-  L"SCSI Disk Device",

+  DeviceStr,

   FALSE

   );

 return EFI_SUCCESS;

diff --git a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h 
b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h
index d54282df5f..5b4047e1db 100644
--- a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h
+++ b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h
@@ -2,6 +2,7 @@
   Header file for SCSI Disk Driver.



 Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.

+Copyright (c) 1985 - 2022, American Megatrends International LLC.

 SPDX-License-Identifier: BSD-2-Clause-Patent



 **/

@@ -30,6 +31,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include 

 #include 

 #include 

+#include 



 #include 

 #include 

@@ -179,6 +181,13 @@ extern EFI_COMPONENT_NAME2_PROTOCOL  
gScsiDiskComponentName2;
 #define SCSI_COMMAND_VERSION_2  0x02

 #define SCSI_COMMAND_VERSION_3  0x03



+// Per SCSI spec, EFI_SCSI_INQUIRY_DATA.Reserved_5_95[3 - 10] has the Vendor 
identification

+// EFI_SCSI_INQUIRY_DATA.Reserved_5_95[11 - 26] has the product identification

+#define VENDOR_IDENTIFICATION_OFFSET   3

+#define VENDOR_IDENTIFICATION_LENGTH   8

+#define PRODUCT_IDENTIFICATION_OFFSET  11

+#define PRODUCT_IDENTIFICATION_LENGTH  16

+

 //

 // SCSI Disk Timeout Experience Value

 //

diff --git a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf 
b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
index 40818e669b..26227132e8 100644
--- 

Re: [edk2-devel] [PATCH] MdeModulePkg: Improved ScsiDiskDxe driver updates ControllerNameTable with common string SCSI Disk Device for all SCSI disk

2022-10-27 Thread Cheripally Gopi via groups.io
created pull request.
Pull request link: MdeModulePkg/ScsiDiskDxe: Update proper device name for 
ScsiDisk drives by GopiCheripally · Pull Request #3537 · tianocore/edk2 
(github.com) ( https://github.com/tianocore/edk2/pull/3537 )


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