[edk2-devel] [PATCH v1 2/2] MdeModulePkg/Bus/Usb/UsbMouseDxe: Fix MISSING_BREAK Coverity issues

2023-10-03 Thread Ranbir Singh
From: Ranbir Singh 

The function GetNextHidItem has a switch-case code in which the
case 1: falls through to case 2: and then case 2: falls through
to case 3: in the block.

While this may be intentional, it is not evident to any general
code reader as well as any static analyzer tool. Just adding

// No break; here as this is an intentional fallthrough.

as comment in between makes a reader as well as Coverity happy.

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

Cc: Hao A Wu 
Cc: Ray Ni 
Co-authored-by: Veeresh Sangolli 
Signed-off-by: Ranbir Singh 
Signed-off-by: Ranbir Singh 
---
 MdeModulePkg/Bus/Usb/UsbMouseDxe/MouseHid.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/MdeModulePkg/Bus/Usb/UsbMouseDxe/MouseHid.c 
b/MdeModulePkg/Bus/Usb/UsbMouseDxe/MouseHid.c
index acc19acd98e0..bc9a4824208b 100644
--- a/MdeModulePkg/Bus/Usb/UsbMouseDxe/MouseHid.c
+++ b/MdeModulePkg/Bus/Usb/UsbMouseDxe/MouseHid.c
@@ -89,6 +89,10 @@ GetNextHidItem (
   return StartPos;
 }
 
+//
+// No break; here as this is an intentional fallthrough
+//
+
   case 2:
 //
 // 2-byte data
@@ -99,6 +103,10 @@ GetNextHidItem (
   return StartPos;
 }
 
+//
+// No break; here as this is an intentional fallthrough
+//
+
   case 3:
 //
 // 4-byte data, adjust size
-- 
2.34.1



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




[edk2-devel] [PATCH v1 1/2] MdeModulePkg/Bus/Usb/UsbMouseDxe: Fix REVERSE_INULL Coverity issue

2023-10-03 Thread Ranbir Singh
From: Ranbir Singh 

The function USBMouseDriverBindingStart do have

ASSERT (UsbMouseDevice != NULL);

after AllocateZeroPool, but it is applicable only in DEBUG mode.
In RELEASE mode, if for whatever reasons UsbMouseDevice is NULL
at this point, the code proceeds to dereference "UsbMouseDevice"
afterwards which will lead to CRASH.

Hence, for safety add NULL pointer checks always.

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

Cc: Hao A Wu 
Cc: Ray Ni 
Co-authored-by: Veeresh Sangolli 
Signed-off-by: Ranbir Singh 
Signed-off-by: Ranbir Singh 
---
 MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouse.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouse.c 
b/MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouse.c
index 451d4b934f4c..621d09713b24 100644
--- a/MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouse.c
+++ b/MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouse.c
@@ -161,6 +161,10 @@ USBMouseDriverBindingStart (
 
   UsbMouseDevice = AllocateZeroPool (sizeof (USB_MOUSE_DEV));
   ASSERT (UsbMouseDevice != NULL);
+  if (UsbMouseDevice == NULL) {
+Status = EFI_OUT_OF_RESOURCES;
+goto ErrorExit;
+  }
 
   UsbMouseDevice->UsbIo = UsbIo;
   UsbMouseDevice->Signature = USB_MOUSE_DEV_SIGNATURE;
-- 
2.34.1



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




[edk2-devel] [PATCH v1 0/2] BZ 4222: Fix MdeModulePkg/Bus/Usb/UsbMouseDxe issues pointed by Coverity

2023-10-03 Thread Ranbir Singh
Ranbir Singh (2):
  MdeModulePkg/Bus/Usb/UsbMouseDxe: Fix REVERSE_INULL Coverity issue
  MdeModulePkg/Bus/Usb/UsbMouseDxe: Fix MISSING_BREAK Coverity issues

 MdeModulePkg/Bus/Usb/UsbMouseDxe/MouseHid.c | 8 
 MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouse.c | 4 
 2 files changed, 12 insertions(+)

-- 
2.34.1



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




Re: [edk2-devel] [PATCH] UefiCpuPkg: RISC-V: MMU: Introduce a PCD for SATP mode

2023-10-03 Thread Dhaval Sharma
Reviewed-by: Dhaval Sharma 


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




Re: [edk2-devel] [PATCH v1 1/1] MdeModulePkg: Fix issue with ACPI table creation

2023-10-03 Thread Dhaval Sharma
Hi everyone,
A gentle remonder to review the patch..


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




Re: [edk2-devel] [edk2-redfish-client][PATCH v2] RedfishClientPkg: update Readme.md

2023-10-03 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Thanks!

Reviewed-by: Abner Chang 

> -Original Message-
> From: Nickle Wang 
> Sent: Tuesday, October 3, 2023 8:02 PM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; Igor Kulchytskyy
> 
> Subject: [edk2-redfish-client][PATCH v2] RedfishClientPkg: update
> Readme.md
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Update readme for below topics:
> - The call flow of BIOS Redfish provisioning scenario.
> - The call flow of BIOS Redfish pending settings scenario.
> - The call flow of Redfish feature driver dispatch.
> - Redfish foundation driver stack design.
> - The design of Redfish Platform Config Protocol.
> - The design of synchronization between BIOS and Redfish service.
>
> Signed-off-by: Nickle Wang 
> Cc: Abner Chang 
> Cc: Igor Kulchytskyy 
> ---
>  .../redfish-call-flow-pending-settings.svg|  58 ++
>  .../Media/redfish-call-flow-provisioning.svg  |  46 +
>  .../redfish-feature-driver-call-flow.svg  | 133 ++
>  .../Media/redfish-foundation-driver-stack.svg |  75 
>  ...redfish-platform-config-protocol-stack.svg |  99 ++
>  .../Media/redfish-synchronization-design.svg  |  75 
>  RedfishClientPkg/Readme.md| 170 --
>  7 files changed, 641 insertions(+), 15 deletions(-)
>  create mode 100755 RedfishClientPkg/Documents/Media/redfish-call-flow-
> pending-settings.svg
>  create mode 100755 RedfishClientPkg/Documents/Media/redfish-call-flow-
> provisioning.svg
>  create mode 100755 RedfishClientPkg/Documents/Media/redfish-feature-
> driver-call-flow.svg
>  create mode 100755 RedfishClientPkg/Documents/Media/redfish-
> foundation-driver-stack.svg
>  create mode 100755 RedfishClientPkg/Documents/Media/redfish-platform-
> config-protocol-stack.svg
>  create mode 100755 RedfishClientPkg/Documents/Media/redfish-
> synchronization-design.svg
>
> diff --git a/RedfishClientPkg/Documents/Media/redfish-call-flow-pending-
> settings.svg b/RedfishClientPkg/Documents/Media/redfish-call-flow-
> pending-settings.svg
> new file mode 100755
> index ..c7338c69
> --- /dev/null
> +++ b/RedfishClientPkg/Documents/Media/redfish-call-flow-pending-
> settings.svg
> @@ -0,0 +1,58 @@
> + xmlns="http://www.w3.org/2000/svg";
> xmlns:xlink="http://www.w3.org/1999/xlink"; xml:space="preserve"
> overflow="hidden">
> +  
> +
> +  
> +
> +  
> +  
> + stroke-width="4.58333" stroke-linejoin="round" stroke-miterlimit="10"
> fill="#FF"/>
> + weight="700" font-size="64" transform="matrix(1 0 0 1 2143.23
> 758)">Feature Driver
> + stroke-width="4.58333" stroke-linejoin="round" stroke-miterlimit="10"
> fill="#FF"/>
> + weight="700" font-size="64" transform="matrix(1 0 0 1 763.66 758)">EDK2
> HII
> + stroke-width="4.58333" stroke-linejoin="round" stroke-miterlimit="10"
> fill="#FF"/>
> + weight="700" font-size="64" transform="matrix(1 0 0 1 3499.14
> 758)">Redfish Service
> +
> +
> +
> +
> + font-weight="400" font-size="50" transform="matrix(1 0 0 1 990.014
> 1568)">3
> + font-weight="400" font-size="50" transform="matrix(1 0 0 1 1016.37
> 1568)">. If 
> + font-weight="400" font-size="50" transform="matrix(1 0 0 1 1098.29
> 1568)">HII question exists and pending value is changed
> + font-weight="400" font-size="50" transform="matrix(1 0 0 1 1051.89
> 1628)">Use HII protocol/library to submit new value
> + fill="#00" fill-rule="evenodd"/>
> + fill="#00" fill-rule="evenodd"/>
> + font-weight="400" font-size="50" transform="matrix(1 0 0 1 990.014
> 1239)">2. Check and see if there is HII question with lang:
> + font-weight="400" font-size="50" transform="matrix(1 0 0 1 1051.89
> 1299)">/
> + font-weight="400" font-size="50" transform="matrix(1 0 0 1 1078.24
> 1299)">bios/attributes/
> + font-weight="400" font-size="50" transform="matrix(1 0 0 1 1444.91
> 1299)">ATTRIBUTE_
> + font-weight="400" font-size="50" transform="matrix(1 0 0 1 1719.91
> 1299)">NAME
> + font-weight="400" font-size="50" transform="matrix(1 0 0 1 2378.69
> 1805)">4. Update current settings to 
> + font-weight="400" font-size="50" transform="matrix(1 0 0 1 2440.56
> 1865)">/redfish/v1/systems/SYS/Bios 
> + font-weight="400" font-size="50" transform="matrix(1 0 0 1 3138.38
> 1865)">(provisioning)
> + fill="#8C8C8C"/>
> + font-weight="400" font-size="50" transform="matrix(1 0 0 1 2393.47
> 968)">1. Use 
> + font-weight="400" font-size="50" transform="matrix(1 0 0 1 2549.88
> 968)">HTTP âEURoeGETâEUR� to download pending settings from
> + font-weight="400" font-size="50" transform="matrix(1 0 0 1 2455.35
> 1028)">/redfish
> + font-weight="400" font-size="50" transform="matrix(1 0 0 1 2638.11
> 1028)">/v1/systems/SYS/Bios/Settings
> + fill="#8C8C8C"/>
> + font-weight="400" font-size="50" transform=

[edk2-devel] [PATCH] UefiCpuPkg: RISC-V: MMU: Introduce a PCD for SATP mode

2023-10-03 Thread Tuan Phan
Introduce a PCD to control the maximum SATP mode that MMU allowed
to use. This PCD helps RISC-V platform set bare or minimum SATA mode
during bring up to debug memory map issue.

Signed-off-by: Tuan Phan 
---
 UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c   | 6 +-
 UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.inf | 3 +++
 UefiCpuPkg/UefiCpuPkg.dec  | 8 
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c 
b/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c
index 9cca5fc128af..826a1d32a1d4 100644
--- a/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c
+++ b/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c
@@ -36,7 +36,7 @@
 #define PTE_PPN_SHIFT 10
 #define RISCV_MMU_PAGE_SHIFT  12
 
-STATIC UINTN  mModeSupport[] = { SATP_MODE_SV57, SATP_MODE_SV48, 
SATP_MODE_SV39 };
+STATIC UINTN  mModeSupport[] = { SATP_MODE_SV57, SATP_MODE_SV48, 
SATP_MODE_SV39, SATP_MODE_OFF };
 STATIC UINTN  mMaxRootTableLevel;
 STATIC UINTN  mBitPerLevel;
 STATIC UINTN  mTableEntryCount;
@@ -590,6 +590,10 @@ RiscVMmuSetSatpMode  (
   UINTNIndex;
   EFI_STATUS   Status;
 
+  if (SatpMode > PcdGet32 (PcdCpuRiscVMmuMaxSatpMode)) {
+return EFI_DEVICE_ERROR;
+  }
+
   switch (SatpMode) {
 case SATP_MODE_OFF:
   return EFI_SUCCESS;
diff --git a/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.inf 
b/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.inf
index 9b28a98cb346..51ebe1750e97 100644
--- a/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.inf
+++ b/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.inf
@@ -25,3 +25,6 @@
 
 [LibraryClasses]
   BaseLib
+
+[Pcd]
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuRiscVMmuMaxSatpMode  ## CONSUMES
diff --git a/UefiCpuPkg/UefiCpuPkg.dec b/UefiCpuPkg/UefiCpuPkg.dec
index 68473fc640e6..79191af18a05 100644
--- a/UefiCpuPkg/UefiCpuPkg.dec
+++ b/UefiCpuPkg/UefiCpuPkg.dec
@@ -396,6 +396,14 @@
   # @Prompt Access to non-SMRAM memory is restricted to reserved, runtime and 
ACPI NVS type after SmmReadyToLock.
   
gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmRestrictedMemoryAccess|TRUE|BOOLEAN|0x3213210F
 
+[PcdsFixedAtBuild.RISCV64]
+  ## Indicate the maximum SATP mode allowed.
+  #  0 - Bare mode.
+  #  8 - 39bit mode.
+  #  9 - 48bit mode.
+  #  10 - 57bit mode.
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuRiscVMmuMaxSatpMode|0|UINT32|0x6021
+
 [PcdsDynamic, PcdsDynamicEx]
   ## Contains the pointer to a CPU S3 data buffer of structure ACPI_CPU_DATA.
   # @Prompt The pointer to a CPU S3 data buffer.
-- 
2.25.1



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




Re: [edk2-devel] [PATCH v4 00/14] Add ImagePropertiesRecordLib and Fix MAT Bugs

2023-10-03 Thread Taylor Beebe

Thank you , Ard. I very much appreciate your responsiveness.

The majority of these patches fall under MdeModulePkg maintainers so 
I'll also need help from them to drive this forward.


On 10/3/2023 11:57 AM, Ard Biesheuvel wrote:

On Tue, 3 Oct 2023 at 17:56, Taylor Beebe  wrote:

Have we given up on this patch series and Bug 4492?


I haven't, I promise. I will get to this on Thursday or Friday.



On 9/26/2023 9:02 AM, Taylor Beebe via groups.io wrote:

Reviews on this patch series would be much appreciated :)

On 8/28/23 9:38 AM, Ard Biesheuvel wrote:

I was hoping to get around to this before the end of the week (but I
am not a MdeModulePkg maintainer)


On Mon, 28 Aug 2023 at 18:27, Taylor Beebe 
wrote:

Can I please get reviews/feedback on this patch series?

On 8/16/23 11:14 AM, Taylor Beebe via groups.io wrote:

Can I please get reviews/feedback on this patch series?

On 8/4/2023 12:46 PM, Taylor Beebe via groups.io wrote:

From: Taylor Beebe 

v4:
- Expose additional functions in the Library API
- Add NULL checks to library functions and return a
 status where applicable.

v3:
- Refactor patch series so the transition of logic from the DXE
 MAT logic to the new library is more clear.
- Update function headers to improve clarity and follow EDK2
 standards.
- Add Create and Delete functions for Image Properties Records
 and redirect some of the SMM and DXE MAT code to use these
 functions.
- Update/Add DumpImageRecords() to print the image name and code
 sections of each runtime image which will be put in the MAT.
 The DXE and SMM MAT logic will now invoke the DumpImageRecords()
 on DEBUG builds at the EndOfDxe event to install the MAT.

v2:
- A one-line change in patch 3 was moved to patch 9 for correctness.

Reference: https://github.com/tianocore/edk2/pull/4590
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=4492

The UEFI and SMM MAT logic contains duplicate logic for manipulating
image
properties records which is used to track runtime images.
This patch series adds a new library, ImagePropertiesRecordLib,
which consolidates this logic and fixes the bugs which currently
exist in
the MAT logic.

The first patch adds the ImagePropertiesRecordLib implementation
which
is a copy of the UEFI MAT logic with minor modifications to remove
the
reliance on globabl variables and make the code unit testable.

The second patch adds a unit test for the
ImagePropertiesRecordLib. The
logic tests various potential layouts of the EFI memory map and
runtime
images. 3/4 of these tests will fail which demonstrates the MAT logic
bugs.

The third patch fixes the logic in the ImagePropertiesRecordLib so
that all of the unit tests pass and the MAT logic can be fixed by
using the library.

The remaining patches add library instances to DSC files and remove
the image properties record logic from the SMM and UEFI MAT logic.

Cc: Andrew Fish 
Cc: Ard Biesheuvel 
Cc: Dandan Bi 
Cc: Eric Dong 
Cc: Gerd Hoffmann 
Cc: Guo Dong 
Cc: Gua Guo 
Cc: James Lu 
Cc: Jian J Wang 
Cc: Jiewen Yao 
Cc: Jordan Justen 
Cc: Leif Lindholm 
Cc: Liming Gao 
Cc: Rahul Kumar 
Cc: Ray Ni 
Cc: Sami Mujawar 
Cc: Sean Rhodes 

Taylor Beebe (14):
 MdeModulePkg: Add ImagePropertiesRecordLib
 ArmVirtPkg: Add ImagePropertiesRecordLib Instance
 EmulatorPkg: Add ImagePropertiesRecordLib Instance
 OvmfPkg: Add ImagePropertiesRecordLib Instance
 UefiPayloadPkg: Add ImagePropertiesRecordLib Instance
 MdeModulePkg: Update MemoryAttributesTable.c to Reduce Global
Variable
   Use
 MdeModulePkg: Move Some DXE MAT Logic to ImagePropertiesRecordLib
 MdeModulePkg: Add ImagePropertiesRecordLib Host-Based Unit Test
 MdeModulePkg: Fix Bugs in MAT Logic
 MdeModulePkg: Add NULL checks and Return Status to
   ImagePropertiesRecordLib
 UefiCpuPkg: Use Attribute From SMM MemoryAttributesTable if
Nonzero
 MdeModulePkg: Transition SMM MAT Logic to Use
ImagePropertiesRecordLib
 MdeModulePkg: Add Logic to Create/Delete Image Properties Records
 MdeModulePkg: Update DumpImageRecord() in
ImagePropertiesRecordLib

MdeModulePkg/Core/Dxe/Misc/MemoryAttributesTable.c |  967
+
MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c |   24 +-
MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c |  958
+---
MdeModulePkg/Library/ImagePropertiesRecordLib/ImagePropertiesRecordLib.c

| 1144 
MdeModulePkg/Library/ImagePropertiesRecordLib/UnitTest/ImagePropertiesRecordLibUnitTestHost.c

|  938 
UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c |   19 +-
ArmVirtPkg/ArmVirt.dsc.inc |1 +
EmulatorPkg/EmulatorPkg.dsc |1 +
MdeModulePkg/Core/Dxe/DxeMain.h |   20 -
MdeModulePkg/Core/Dxe/DxeMain.inf |1 +
MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf |1 +
MdeModulePkg/Include/Library/ImagePropertiesRecordLib.h | 234 
MdeModulePkg/Library/ImagePropertiesRecordLib/ImagePropertiesRecordLib.inf

|   31 +
MdeModulePkg/Library/ImagePro

Re: [edk2-devel] [PATCH v4 00/14] Add ImagePropertiesRecordLib and Fix MAT Bugs

2023-10-03 Thread Ard Biesheuvel
On Tue, 3 Oct 2023 at 17:56, Taylor Beebe  wrote:
>
> Have we given up on this patch series and Bug 4492?
>

I haven't, I promise. I will get to this on Thursday or Friday.


> On 9/26/2023 9:02 AM, Taylor Beebe via groups.io wrote:
> > Reviews on this patch series would be much appreciated :)
> >
> > On 8/28/23 9:38 AM, Ard Biesheuvel wrote:
> >> I was hoping to get around to this before the end of the week (but I
> >> am not a MdeModulePkg maintainer)
> >>
> >>
> >> On Mon, 28 Aug 2023 at 18:27, Taylor Beebe 
> >> wrote:
> >>> Can I please get reviews/feedback on this patch series?
> >>>
> >>> On 8/16/23 11:14 AM, Taylor Beebe via groups.io wrote:
>  Can I please get reviews/feedback on this patch series?
> 
>  On 8/4/2023 12:46 PM, Taylor Beebe via groups.io wrote:
> > From: Taylor Beebe 
> >
> > v4:
> > - Expose additional functions in the Library API
> > - Add NULL checks to library functions and return a
> > status where applicable.
> >
> > v3:
> > - Refactor patch series so the transition of logic from the DXE
> > MAT logic to the new library is more clear.
> > - Update function headers to improve clarity and follow EDK2
> > standards.
> > - Add Create and Delete functions for Image Properties Records
> > and redirect some of the SMM and DXE MAT code to use these
> > functions.
> > - Update/Add DumpImageRecords() to print the image name and code
> > sections of each runtime image which will be put in the MAT.
> > The DXE and SMM MAT logic will now invoke the DumpImageRecords()
> > on DEBUG builds at the EndOfDxe event to install the MAT.
> >
> > v2:
> > - A one-line change in patch 3 was moved to patch 9 for correctness.
> >
> > Reference: https://github.com/tianocore/edk2/pull/4590
> > Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=4492
> >
> > The UEFI and SMM MAT logic contains duplicate logic for manipulating
> > image
> > properties records which is used to track runtime images.
> > This patch series adds a new library, ImagePropertiesRecordLib,
> > which consolidates this logic and fixes the bugs which currently
> > exist in
> > the MAT logic.
> >
> > The first patch adds the ImagePropertiesRecordLib implementation
> > which
> > is a copy of the UEFI MAT logic with minor modifications to remove
> > the
> > reliance on globabl variables and make the code unit testable.
> >
> > The second patch adds a unit test for the
> > ImagePropertiesRecordLib. The
> > logic tests various potential layouts of the EFI memory map and
> > runtime
> > images. 3/4 of these tests will fail which demonstrates the MAT logic
> > bugs.
> >
> > The third patch fixes the logic in the ImagePropertiesRecordLib so
> > that all of the unit tests pass and the MAT logic can be fixed by
> > using the library.
> >
> > The remaining patches add library instances to DSC files and remove
> > the image properties record logic from the SMM and UEFI MAT logic.
> >
> > Cc: Andrew Fish 
> > Cc: Ard Biesheuvel 
> > Cc: Dandan Bi 
> > Cc: Eric Dong 
> > Cc: Gerd Hoffmann 
> > Cc: Guo Dong 
> > Cc: Gua Guo 
> > Cc: James Lu 
> > Cc: Jian J Wang 
> > Cc: Jiewen Yao 
> > Cc: Jordan Justen 
> > Cc: Leif Lindholm 
> > Cc: Liming Gao 
> > Cc: Rahul Kumar 
> > Cc: Ray Ni 
> > Cc: Sami Mujawar 
> > Cc: Sean Rhodes 
> >
> > Taylor Beebe (14):
> > MdeModulePkg: Add ImagePropertiesRecordLib
> > ArmVirtPkg: Add ImagePropertiesRecordLib Instance
> > EmulatorPkg: Add ImagePropertiesRecordLib Instance
> > OvmfPkg: Add ImagePropertiesRecordLib Instance
> > UefiPayloadPkg: Add ImagePropertiesRecordLib Instance
> > MdeModulePkg: Update MemoryAttributesTable.c to Reduce Global
> > Variable
> >   Use
> > MdeModulePkg: Move Some DXE MAT Logic to ImagePropertiesRecordLib
> > MdeModulePkg: Add ImagePropertiesRecordLib Host-Based Unit Test
> > MdeModulePkg: Fix Bugs in MAT Logic
> > MdeModulePkg: Add NULL checks and Return Status to
> >   ImagePropertiesRecordLib
> > UefiCpuPkg: Use Attribute From SMM MemoryAttributesTable if
> > Nonzero
> > MdeModulePkg: Transition SMM MAT Logic to Use
> > ImagePropertiesRecordLib
> > MdeModulePkg: Add Logic to Create/Delete Image Properties Records
> > MdeModulePkg: Update DumpImageRecord() in
> > ImagePropertiesRecordLib
> >
> > MdeModulePkg/Core/Dxe/Misc/MemoryAttributesTable.c |  967
> > +
> > MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c |   24 +-
> > MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c |  958
> > +---
> > MdeModulePkg/Library/ImagePropertiesRecordLib/ImagePropertiesReco

Re: [edk2-devel] [PATCH v4 00/14] Add ImagePropertiesRecordLib and Fix MAT Bugs

2023-10-03 Thread Taylor Beebe

Have we given up on this patch series and Bug 4492?

On 9/26/2023 9:02 AM, Taylor Beebe via groups.io wrote:

Reviews on this patch series would be much appreciated :)

On 8/28/23 9:38 AM, Ard Biesheuvel wrote:

I was hoping to get around to this before the end of the week (but I
am not a MdeModulePkg maintainer)


On Mon, 28 Aug 2023 at 18:27, Taylor Beebe  
wrote:

Can I please get reviews/feedback on this patch series?

On 8/16/23 11:14 AM, Taylor Beebe via groups.io wrote:

Can I please get reviews/feedback on this patch series?

On 8/4/2023 12:46 PM, Taylor Beebe via groups.io wrote:

From: Taylor Beebe 

v4:
- Expose additional functions in the Library API
- Add NULL checks to library functions and return a
    status where applicable.

v3:
- Refactor patch series so the transition of logic from the DXE
    MAT logic to the new library is more clear.
- Update function headers to improve clarity and follow EDK2
    standards.
- Add Create and Delete functions for Image Properties Records
    and redirect some of the SMM and DXE MAT code to use these
    functions.
- Update/Add DumpImageRecords() to print the image name and code
    sections of each runtime image which will be put in the MAT.
    The DXE and SMM MAT logic will now invoke the DumpImageRecords()
    on DEBUG builds at the EndOfDxe event to install the MAT.

v2:
- A one-line change in patch 3 was moved to patch 9 for correctness.

Reference: https://github.com/tianocore/edk2/pull/4590
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=4492

The UEFI and SMM MAT logic contains duplicate logic for manipulating
image
properties records which is used to track runtime images.
This patch series adds a new library, ImagePropertiesRecordLib,
which consolidates this logic and fixes the bugs which currently
exist in
the MAT logic.

The first patch adds the ImagePropertiesRecordLib implementation 
which
is a copy of the UEFI MAT logic with minor modifications to remove 
the

reliance on globabl variables and make the code unit testable.

The second patch adds a unit test for the 
ImagePropertiesRecordLib. The
logic tests various potential layouts of the EFI memory map and 
runtime

images. 3/4 of these tests will fail which demonstrates the MAT logic
bugs.

The third patch fixes the logic in the ImagePropertiesRecordLib so
that all of the unit tests pass and the MAT logic can be fixed by
using the library.

The remaining patches add library instances to DSC files and remove
the image properties record logic from the SMM and UEFI MAT logic.

Cc: Andrew Fish 
Cc: Ard Biesheuvel 
Cc: Dandan Bi 
Cc: Eric Dong 
Cc: Gerd Hoffmann 
Cc: Guo Dong 
Cc: Gua Guo 
Cc: James Lu 
Cc: Jian J Wang 
Cc: Jiewen Yao 
Cc: Jordan Justen 
Cc: Leif Lindholm 
Cc: Liming Gao 
Cc: Rahul Kumar 
Cc: Ray Ni 
Cc: Sami Mujawar 
Cc: Sean Rhodes 

Taylor Beebe (14):
    MdeModulePkg: Add ImagePropertiesRecordLib
    ArmVirtPkg: Add ImagePropertiesRecordLib Instance
    EmulatorPkg: Add ImagePropertiesRecordLib Instance
    OvmfPkg: Add ImagePropertiesRecordLib Instance
    UefiPayloadPkg: Add ImagePropertiesRecordLib Instance
    MdeModulePkg: Update MemoryAttributesTable.c to Reduce Global
Variable
  Use
    MdeModulePkg: Move Some DXE MAT Logic to ImagePropertiesRecordLib
    MdeModulePkg: Add ImagePropertiesRecordLib Host-Based Unit Test
    MdeModulePkg: Fix Bugs in MAT Logic
    MdeModulePkg: Add NULL checks and Return Status to
  ImagePropertiesRecordLib
    UefiCpuPkg: Use Attribute From SMM MemoryAttributesTable if 
Nonzero

    MdeModulePkg: Transition SMM MAT Logic to Use
ImagePropertiesRecordLib
    MdeModulePkg: Add Logic to Create/Delete Image Properties Records
    MdeModulePkg: Update DumpImageRecord() in 
ImagePropertiesRecordLib


MdeModulePkg/Core/Dxe/Misc/MemoryAttributesTable.c |  967
+
MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c |   24 +-
MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c |  958
+---
MdeModulePkg/Library/ImagePropertiesRecordLib/ImagePropertiesRecordLib.c 


| 1144 
MdeModulePkg/Library/ImagePropertiesRecordLib/UnitTest/ImagePropertiesRecordLibUnitTestHost.c 


|  938 
UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c |   19 +-
ArmVirtPkg/ArmVirt.dsc.inc |    1 +
EmulatorPkg/EmulatorPkg.dsc |    1 +
MdeModulePkg/Core/Dxe/DxeMain.h |   20 -
MdeModulePkg/Core/Dxe/DxeMain.inf |    1 +
MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf |    1 +
MdeModulePkg/Include/Library/ImagePropertiesRecordLib.h | 234 
MdeModulePkg/Library/ImagePropertiesRecordLib/ImagePropertiesRecordLib.inf 


|   31 +
MdeModulePkg/Library/ImagePropertiesRecordLib/UnitTest/ImagePropertiesRecordLibUnitTestHost.inf 


|   35 +
MdeModulePkg/MdeModulePkg.dec |    5 +
MdeModulePkg/MdeModulePkg.dsc |    2 +
MdeModulePkg/Test/MdeModulePkgHostTest.dsc |    6 +
OvmfPkg/AmdSev/AmdSevX64.dsc |    1 +
OvmfPkg/Bhyve/BhyveX64.dsc |    1 +
OvmfPkg/CloudHv/CloudHvX64.dsc |    1 +
OvmfPkg/IntelTdx/IntelTdxX64.dsc |  

Re: [edk2-devel] reg: Two IAID assignment for single MAC Address

2023-10-03 Thread Sivaraman Nainar via groups.io
+ Saloni and Zachary.

From: Sivaraman Nainar
Sent: Tuesday, October 3, 2023 10:39 PM
To: devel@edk2.groups.io; Maciej Rabeda 
Cc: Santhosh Kumar V ; Mike Su (蘇得緣) ; 
Dhanaraj V 
Subject: reg: Two IAID assignment for single MAC Address

Hello Maciej:

When IPV6 PXE Boot performed in the environment where client and server are 
connected behind Routers, there are two SARR process happens, and both are 
using different IAID’s.

During the PXE Boot IPV6, SARR Process Initiated to get the Boot File 
information. During that time one IAID Created (ff76fdbd). 
PxeBcCreateIp6Children()
During the Router Advertisement , SARR Process Initiated to get the Boot File. 
Ip6ConfigInitInstance()

Besides, according to the definition of 
IA(RFC-3315):

An "identity-association" (IA) is a construct through which a server
and a client can identify, group, and manage a set of related IPv6
addresses. Each IA consists of an IAID and associated configuration
information.

A client must associate at least one distinct IA with each of its
network interfaces for which it is to request the assignment of IPv6
addresses from a DHCP server. The client uses the IAs assigned to an
interface to obtain configuration information from a server for that
interface. Each IA must be associated with exactly one interface.

But as per EDK2 Network Implementation it defines two IA IDs for same client.  
Is there any reasoning behind this implementation?

What if both the process uses Same IAID?

Thanks
Siva
-The information contained in this message may be confidential and proprietary 
to American Megatrends (AMI). This communication is intended to be read only by 
the individual or entity to whom it is addressed or by their designee. If the 
reader of this message is not the intended recipient, you are on notice that 
any distribution of this message, in any form, is strictly prohibited. Please 
promptly notify the sender by reply e-mail or by telephone at 770-246-8600, and 
then delete or destroy all copies of the transmission.


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

2023-10-03 Thread Leif Lindholm
On Tue, Oct 03, 2023 at 18:21:44 +0200, Marcin Juszkiewicz wrote:
> It is weird that I can have NVME, can install OS on it but cannot boot
> from it.
> 
> This change adds NVME support so it can be mapped and used.

Oops, that's a silly thing to have left out.

> Signed-off-by: Marcin Juszkiewicz 

Reviewed-by: Leif Lindholm 
Pushed as d6e36a151ff8.

Thanks!

/
Leif

> ---
>  Platform/Qemu/SbsaQemu/SbsaQemu.dsc | 6 ++
>  Platform/Qemu/SbsaQemu/SbsaQemu.fdf | 5 +
>  2 files changed, 11 insertions(+)
> 
> diff --git a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc 
> b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
> index 948e42326c33..36723e21d7b5 100644
> --- a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
> +++ b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
> @@ -738,6 +738,12 @@ [Components.common]
>MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
>MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
>  
> +  #
> +  # NVME support
> +  #
> +
> +  MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
> +
>#
># Video support (VGA)
>#
> diff --git a/Platform/Qemu/SbsaQemu/SbsaQemu.fdf 
> b/Platform/Qemu/SbsaQemu/SbsaQemu.fdf
> index 6bc55d701120..6fcfd25faaeb 100644
> --- a/Platform/Qemu/SbsaQemu/SbsaQemu.fdf
> +++ b/Platform/Qemu/SbsaQemu/SbsaQemu.fdf
> @@ -251,6 +251,11 @@ [FV.FvMain]
>INF MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
>INF MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
>  
> +  #
> +  # NVME support
> +  #
> +  INF  MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
> +
>#
># USB Support
>#
> -- 
> 2.41.0
> 
> 
> 
> 
> 
> 


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




Re: [edk2-devel] [PATCH 1/1] MdePkg/DxeRngLib: Add missing GUID declaration in inf

2023-10-03 Thread Leif Lindholm
+Zhiguang

Tested-by: Leif Lindholm 

MdePkg maintainers - this is currently breaking several platforms in
edk2-platforms.

Regards,

Leif

On Fri, Sep 29, 2023 at 13:08:50 +, Sami Mujawar wrote:
> Hi Pierre,
> 
> Thank you for this fix.
> 
> Unfortunately, this did not get trapped by the edk2 CI as well. 
> 
> Reviewed-by: Sami Mujawar 
> 
> Regards,
> 
> Sami Mujawar
> 
> On 29/09/2023, 13:30, "pierre.gond...@arm.com 
> "  > wrote:
> 
> 
> From: Pierre Gondois mailto:pierre.gond...@arm.com>>
> 
> 
> Add missing GUID declaration in DxeRngLib.inf.
> 
> 
> Fixes: bd1f0eecc1df ("MdePkg/DxeRngLib: Request raw algorithm
> instead of default")
> 
> 
> Signed-off-by: Pierre Gondois  >
> ---
> MdePkg/Library/DxeRngLib/DxeRngLib.inf | 1 +
> 1 file changed, 1 insertion(+)
> 
> 
> diff --git a/MdePkg/Library/DxeRngLib/DxeRngLib.inf 
> b/MdePkg/Library/DxeRngLib/DxeRngLib.inf
> index 9c11959f8aeb..281fec46502f 100644
> --- a/MdePkg/Library/DxeRngLib/DxeRngLib.inf
> +++ b/MdePkg/Library/DxeRngLib/DxeRngLib.inf
> @@ -36,3 +36,4 @@ [Guids]
> gEfiRngAlgorithmSp80090Ctr256Guid
> gEfiRngAlgorithmSp80090Hash256Guid
> gEfiRngAlgorithmSp80090Hmac256Guid
> + gEfiRngAlgorithmRaw
> -- 
> 2.25.1
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 


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




[edk2-devel] reg: Two IAID assignment for single MAC Address

2023-10-03 Thread Sivaraman Nainar via groups.io
Hello Maciej:

When IPV6 PXE Boot performed in the environment where client and server are 
connected behind Routers, there are two SARR process happens, and both are 
using different IAID’s.

During the PXE Boot IPV6, SARR Process Initiated to get the Boot File 
information. During that time one IAID Created (ff76fdbd). 
PxeBcCreateIp6Children()
During the Router Advertisement , SARR Process Initiated to get the Boot File. 
Ip6ConfigInitInstance()

Besides, according to the definition of 
IA(RFC-3315):

An "identity-association" (IA) is a construct through which a server
and a client can identify, group, and manage a set of related IPv6
addresses. Each IA consists of an IAID and associated configuration
information.

A client must associate at least one distinct IA with each of its
network interfaces for which it is to request the assignment of IPv6
addresses from a DHCP server. The client uses the IAs assigned to an
interface to obtain configuration information from a server for that
interface. Each IA must be associated with exactly one interface.

But as per EDK2 Network Implementation it defines two IA IDs for same client.  
Is there any reasoning behind this implementation?

What if both the process uses Same IAID?

Thanks
Siva
-The information contained in this message may be confidential and proprietary 
to American Megatrends (AMI). This communication is intended to be read only by 
the individual or entity to whom it is addressed or by their designee. If the 
reader of this message is not the intended recipient, you are on notice that 
any distribution of this message, in any form, is strictly prohibited. Please 
promptly notify the sender by reply e-mail or by telephone at 770-246-8600, and 
then delete or destroy all copies of the transmission.


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

2023-10-03 Thread Marcin Juszkiewicz
It is weird that I can have NVME, can install OS on it but cannot boot
from it.

This change adds NVME support so it can be mapped and used.

Signed-off-by: Marcin Juszkiewicz 
---
 Platform/Qemu/SbsaQemu/SbsaQemu.dsc | 6 ++
 Platform/Qemu/SbsaQemu/SbsaQemu.fdf | 5 +
 2 files changed, 11 insertions(+)

diff --git a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc 
b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
index 948e42326c33..36723e21d7b5 100644
--- a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
+++ b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
@@ -738,6 +738,12 @@ [Components.common]
   MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
   MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
 
+  #
+  # NVME support
+  #
+
+  MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
+
   #
   # Video support (VGA)
   #
diff --git a/Platform/Qemu/SbsaQemu/SbsaQemu.fdf 
b/Platform/Qemu/SbsaQemu/SbsaQemu.fdf
index 6bc55d701120..6fcfd25faaeb 100644
--- a/Platform/Qemu/SbsaQemu/SbsaQemu.fdf
+++ b/Platform/Qemu/SbsaQemu/SbsaQemu.fdf
@@ -251,6 +251,11 @@ [FV.FvMain]
   INF MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
   INF MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
 
+  #
+  # NVME support
+  #
+  INF  MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
+
   #
   # USB Support
   #
-- 
2.41.0



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




Re: [edk2-devel] [PATCH] BaseStackCheckLib: Fix STACK FAULT message

2023-10-03 Thread Michael D Kinney
I think the macro RETURN_ADDRESS from Base.h should be used instead of
direct use of the builtin.

Mike

> -Original Message-
> From: Name j...@nvidia.com 
> Sent: Tuesday, October 3, 2023 6:20 AM
> To: devel@edk2.groups.io
> Cc: Kinney, Michael D ; Gao, Liming
> ; Liu, Zhiguang ; Jake
> Garver 
> Subject: [PATCH] BaseStackCheckLib: Fix STACK FAULT message
> 
> From: Jake Garver 
> 
> __builtin_return_address returns a pointer, not a string.  Fix the STACK
> FAULT message in BaseStackCheckLib appropriately.
> 
> Signed-off-by: Jake Garver 
> ---
>  MdePkg/Library/BaseStackCheckLib/BaseStackCheckGcc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/MdePkg/Library/BaseStackCheckLib/BaseStackCheckGcc.c
> b/MdePkg/Library/BaseStackCheckLib/BaseStackCheckGcc.c
> index 0d2918668e..3b970391b7 100644
> --- a/MdePkg/Library/BaseStackCheckLib/BaseStackCheckGcc.c
> +++ b/MdePkg/Library/BaseStackCheckLib/BaseStackCheckGcc.c
> @@ -34,7 +34,7 @@ __stack_chk_fail (
>  {
>UINT8  DebugPropertyMask;
> 
> -  DEBUG ((DEBUG_ERROR, "STACK FAULT: Buffer Overflow in function %a.\n",
> __builtin_return_address (0)));
> +  DEBUG ((DEBUG_ERROR, "STACK FAULT: Buffer Overflow at 0x%p.\n",
> __builtin_return_address (0)));
> 
>//
>// Generate a Breakpoint, DeadLoop, or NOP based on PCD settings even if
> --
> 2.34.1



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




Re: [edk2-devel] [PATCH v2 5/5] MdePkg/BaseLib: ensure ARM LongJump never returns 0

2023-10-03 Thread Philippe Mathieu-Daudé

On 26/9/23 19:15, Leif Lindholm wrote:

The ARM implementation of of InternalLongJump always returned the value
Value - but it is not supposed to ever return 0. Add the test to prevent
that, and return 1 if Value is 0 - as is already present in AArch64.

Signed-off-by: Leif Lindholm 
Cc: Ard Biesheuvel 
Cc: Sami Mujawar 
---
  MdePkg/Library/BaseLib/Arm/SetJumpLongJump.S   | 2 ++
  MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm | 2 ++


Reviewed-by: Philippe Mathieu-Daudé 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109289): https://edk2.groups.io/g/devel/message/109289
Mute This Topic: https://groups.io/mt/101600811/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 4/5] MdePkg/BaseLib: correct register sizes in AArch64 SetJump/LongJump

2023-10-03 Thread Philippe Mathieu-Daudé

On 26/9/23 19:15, Leif Lindholm wrote:

Both in SetJump and in InternalLongJump, 32-bit w register views were
used for the UINTN return value. In SetJump, this did not cause errors;
it was only counterintuitive. But in InternalLongJump, it meant the top
32 bits of Value were stripped off.

Change all of these to use the 64-bit x register views.

Signed-off-by: Leif Lindholm 
Reanimated-by: Andrei Warkentin 


=)

Reviewed-by: Philippe Mathieu-Daudé 


Cc: Ard Biesheuvel 
Cc: Sami Mujawar 
---
  MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S   | 8 
  MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm | 8 
  2 files changed, 8 insertions(+), 8 deletions(-)




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




[edk2-devel] [PATCH 0/1] ShellPkg/SmbiosView: Add Type45 entry to query table

2023-10-03 Thread Werner Lewis
Entry added to display Firmware Inventory Information title for Type45
tables in smbiosview, as per SMBIOS Specification 3.5.

Werner Lewis (1):
  ShellPkg/SmbiosView: Add Type45 entry to query table

 .../UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c   | 5 +
 1 file changed, 5 insertions(+)

-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109292): https://edk2.groups.io/g/devel/message/109292
Mute This Topic: https://groups.io/mt/101736629/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 3/5] MdePkg/BaseLib: use normal register init in ARM SetJump implementations

2023-10-03 Thread Philippe Mathieu-Daudé

Hi Leif,

On 26/9/23 19:15, Leif Lindholm wrote:

There may be architectures on which there are benefits to
   eor r0, r0(, r0)
but ARM was never one of them. Change to more readable
   mov r0, #0
instead.

Signed-off-by: Leif Lindholm 
Cc: Ard Biesheuvel 
Cc: Sami Mujawar 
---
  MdePkg/Library/BaseLib/Arm/SetJumpLongJump.S   | 2 +-
  MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)




diff --git a/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm 
b/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm
index e1eff758f7ab..ef02d85e0e66 100644
--- a/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm
+++ b/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm
@@ -33,7 +33,7 @@
  SetJump
MOV  R3, R13
STM  R0, {R3-R12,R14}
-  EOR  R0, R0
+  MOV  RO, #0


Hmm. s/RO/R0/ ?


BX   LR
  
  ;/**




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




[edk2-devel] [PATCH 1/1] ShellPkg/SmbiosView: Add Type45 entry to query table

2023-10-03 Thread Werner Lewis
The type field for Smbios tables in smbiosview is set from values in
this query table. An entry is added to correctly display the Type 45
table name rather than "Undefined Value" in smbiosview output.

Signed-off-by: Werner Lewis 
---
 .../UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c   | 5 +
 1 file changed, 5 insertions(+)

diff --git 
a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c 
b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
index 82bb7a41f0e6..e9bc92314a46 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
@@ -5,6 +5,7 @@
   Copyright (c) 2005 - 2023, Intel Corporation. All rights reserved.
   (C) Copyright 2016-2019 Hewlett Packard Enterprise Development LP
   Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+  Copyright (c) 2023, Arm Limited. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -3882,6 +3883,10 @@ TABLE_ITEM  StructureTypeInfoTable[] = {
 44,
 L" Processor Additional Information"
   },
+  {
+45,
+L" Firmware Inventory Information"
+  },
   {
 0x7E,
 L" Inactive"
-- 
2.25.1



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




Re: [edk2-devel] [PATCH 1/1] MdePkg/BaseLib: fix typo in Arm SetJump

2023-10-03 Thread Philippe Mathieu-Daudé

On 3/10/23 12:39, Leif Lindholm wrote:

RO -> R0

Signed-off-by: Leif Lindholm 
Reported-by: Philippe Mathieu-Daudé 
Cc: Ard Biesheuvel 
Cc: Sami Mujawar 
---
  MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm 
b/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm
index 15eb3dc28fb7..f89cfa231bbc 100644
--- a/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm
+++ b/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm
@@ -33,7 +33,7 @@
  SetJump
MOV  R3, R13
STM  R0, {R3-R12,R14}
-  MOV  RO, #0
+  MOV  R0, #0


Reviewed-by: Philippe Mathieu-Daudé 

Thanks!


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




Re: [edk2-devel] [[edk2-non-osi][Silicon/AMD][PATCH] VanGogh Silicon initialization firmware binaries 1/2] Maintainers.txt: Add maintainer for Silicon/AMD and Silicon/AMD/Vangogh

2023-10-03 Thread Zhai, MingXin (Duke) via groups.io
[AMD Official Use Only - General]

It looks good to me.

Reviewed-by:  Zhai MingXin

Thanks!
Duke Zhai

-Original Message-
From: Chang, Abner 
Sent: Saturday, September 30, 2023 12:18 AM
To: Leif Lindholm ; devel@edk2.groups.io
Cc: Xing, Eric ; Michael D Kinney 
; Attar, AbdulLateef (Abdul Lateef) 
; Zhai, MingXin (Duke) 
Subject: RE: [edk2-devel] [[edk2-non-osi][Silicon/AMD][PATCH] VanGogh Silicon 
initialization firmware binaries 1/2] Maintainers.txt: Add maintainer for 
Silicon/AMD and Silicon/AMD/Vangogh

[AMD Official Use Only - General]

> -Original Message-
> From: Leif Lindholm 
> Sent: Friday, September 29, 2023 11:31 PM
> To: devel@edk2.groups.io; Chang, Abner 
> Cc: Xing, Eric ; Michael D Kinney
> ; Attar, AbdulLateef (Abdul Lateef)
> ; Zhai, MingXin (Duke) 
> Subject: Re: [edk2-devel] [[edk2-non-osi][Silicon/AMD][PATCH] VanGogh
> Silicon initialization firmware binaries 1/2] Maintainers.txt: Add
> maintainer for Silicon/AMD and Silicon/AMD/Vangogh
>
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
>
>
> On Fri, Sep 29, 2023 at 14:52:23 +, Chang, Abner via groups.io wrote:
> > > -Original Message-
> > > From: Leif Lindholm 
> > > Sent: Friday, September 29, 2023 6:49 PM
> > > To: Chang, Abner 
> > > Cc: Xing, Eric ; devel@edk2.groups.io; Michael
> > > D
> Kinney
> > > ; Attar, AbdulLateef (Abdul Lateef)
> > > 
> > > Subject: Re: [[edk2-non-osi][Silicon/AMD][PATCH] VanGogh Silicon
> > > initialization firmware binaries 1/2] Maintainers.txt: Add
> > > maintainer for Silicon/AMD and Silicon/AMD/Vangogh
> > >
> > > Caution: This message originated from an External Source. Use
> > > proper
> caution
> > > when opening attachments, clicking links, or responding.
> > >
> > >
> > > Hi Abner,
> > >
> > > On Fri, Sep 29, 2023 at 09:09:25 +, Chang, Abner wrote:
> > > > We have done the review on these patches.
> > >
> > > Still waiting for an R-b from Duke. Hmm, who doesn't seem to have
> > > been cc:d.
> >
> > Hmm... he is not in CCed. I add him in CC. Lets just wait for his
> > RB, it  may take a while as China is in a long holiday. I will that
> > him know as well.
>
> Thanks.
>
> > > > Are you the steward of this repo and able to grant AMD folks the
> > > > merge privilege? To Eric, Abdul and me.
> > >
> > > I'm not a github admin - Mike?
> >
> > I thought you can do anything!! :-D
>
> Haha, thankfully not.
>
> > > But that reminds me, we should start adding github IDs in []
> > > brackets after email, like we do for edk2/edk2-platforms.
> >
> > I don’t quite understand. Any example?
>
> Ah, I'm getting ahead of myself - we haven't done that for
> edk2-platform yet, but:
>
> https://github.com/tianocore/edk2/blob/master/Maintainers.txt#L196
Ah, I got your point.

>
> > > > Btw, do we have to create a PR against non OSI repo for merging
> > > > or we can just push it?
> > >
> > > Just push. But send out for review first.
> >
> > Ok.
> >
> > >
> > > Are any of you attending the plugfest?
> > > If more maintainers are joining edk2-non-osi, maybe we should have
> > > a proper chat about it.
> >
> > I am checking now, I am not able to join this time though. But I
> > prefer you come to Taipei if there is an UEFI Plugfest in Taipei. 😊
>
> But will there be kaoliang? ;)
Absolutely, I will prepare one bottle for you if you come,  58% one for you. 😊

Abner

>
> Regards,
>
> Leif
>
> >
> > Abner
> >
> > >
> > > Regards,
> > >
> > > Leif
> > >
> > > > Get Outlook for Android
> > > > 
> > > > From: Leif Lindholm 
> > > > Sent: Friday, September 29, 2023 1:39:07 AM
> > > > To: Xing, Eric 
> > > > Cc: devel@edk2.groups.io ; Michael D
> > > > Kinney
> > > ; Attar, AbdulLateef (Abdul Lateef)
> > > ; Chang, Abner 
> > > > Subject: Re: [[edk2-non-osi][Silicon/AMD][PATCH] VanGogh Silicon
> > > initialization firmware binaries 1/2] Maintainers.txt: Add
> > > maintainer for Silicon/AMD and Silicon/AMD/Vangogh
> > > >
> > > > Caution: This message originated from an External Source. Use
> > > > proper
> > > caution when opening attachments, clicking links, or responding.
> > > >
> > > >
> > > > Hi Eric,
> > > >
> > > > Thanks.
> > > > You didn't really need to rework the patch, but I do want to see
> > > > the Reviewed-by's from the other added people before merging.
> > > >
> > > > Best Regards,
> > > >
> > > > Leif
> > > >
> > > > On Thu, Sep 28, 2023 at 17:13:36 +, Xing, Eric wrote:
> > > > > [AMD Official Use Only - General]
> > > > >
> > > > > Thanks Leif for your quick response and reminder. I added
> > > > > Abner as CC
> in
> > > PATCH v2.
> > > > > Sorry troubling you, would you help review it again so I can
> > > > > get your
> > > approved with v2 patch? Thanks again.
> > > > >
> > > > > Eric
> > > > >
> > > > > -Original Message-
> > > > > From: Leif Lindholm 
> > > > > Sent: Friday, September 29, 2023 12:15 AM
> > > > > To: X

Re: [edk2-devel] [PATCH] DynamicTablesPkg/AmlLib: Enumerate memory cacheability and type

2023-10-03 Thread Leif Lindholm
On Mon, Oct 02, 2023 at 21:52:52 +, Jeshua Smith wrote:
> AmlCodeGenRdQWordMemory's and AmlCodeGenRdDWordMemory's Cacheable
> and MemoryRangeType parameters treat specific values as having
> specific meanings. This change adds enums to map those meanings to their
> corresponding values.
> 
> Signed-off-by: Jeshua Smith 

Looks like a nice bit of cleanup.
Acked-by: Leif Lindholm 

/
Leif

> ---
>  .../Include/Library/AmlLib/AmlLib.h   | 33 +++
>  .../AcpiSsdtPcieLibArm/SsdtPcieGenerator.c| 12 +++
>  2 files changed, 39 insertions(+), 6 deletions(-)
> 
> diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h 
> b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
> index 510c79a399..6a273059fb 100644
> --- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
> +++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
> @@ -59,6 +59,39 @@ typedef void *AML_DATA_NODE_HANDLE;
>  
>  #endif // AML_HANDLE
>  
> +/** Cacheable parameter values
> +
> +  Possible values are:
> +0-The memory is non-cacheable
> +1-The memory is cacheable
> +2-The memory is cacheable and supports
> +  write combining
> +3-The memory is cacheable and prefetchable
> +
> +**/
> +typedef enum {
> +  AML_MEMORY_NONCACHEABLE = 0,
> +  AML_MEMORY_CACHEABLE= 1,
> +  AML_MEMORY_CACHEABLE_WC = 2,
> +  AML_MEMORY_CACHEABLE_PF = 3
> +} AML_MEMORY_CACHEABILITY;
> +
> +/** MemoryRangeType parameter values
> +
> +  Possible values are:
> +0-AddressRangeMemory
> +1-AddressRangeReserved
> +2-AddressRangeACPI
> +3-AddressRangeNVS
> +
> +**/
> +typedef enum {
> +  AML_MEMORY_RANGE_TYPE_MEMORY   = 0,
> +  AML_MEMORY_RANGE_TYPE_RESERVED = 1,
> +  AML_MEMORY_RANGE_TYPE_ACPI = 2,
> +  AML_MEMORY_RANGE_TYPE_NVS  = 3
> +} AML_MEMORY_RANGE_TYPE;
> +
>  /** Parse the definition block.
>  
>The function parses the whole AML blob. It starts with the ACPI DSDT/SSDT
> diff --git 
> a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c 
> b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
> index 9ddaddc198..7df7117352 100644
> --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
> +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
> @@ -566,7 +566,7 @@ GeneratePciCrs (
> IsPosDecode,
> TRUE,
> TRUE,
> -   TRUE,
> +   AML_MEMORY_CACHEABLE,
> TRUE,
> 0,
> AddrMapInfo->PciAddress,
> @@ -575,7 +575,7 @@ GeneratePciCrs (
> AddrMapInfo->AddressSize,
> 0,
> NULL,
> -   0,
> +   AML_MEMORY_RANGE_TYPE_MEMORY,
> TRUE,
> CrsNode,
> NULL
> @@ -588,7 +588,7 @@ GeneratePciCrs (
> IsPosDecode,
> TRUE,
> TRUE,
> -   TRUE,
> +   AML_MEMORY_CACHEABLE,
> TRUE,
> 0,
> AddrMapInfo->PciAddress,
> @@ -597,7 +597,7 @@ GeneratePciCrs (
> AddrMapInfo->AddressSize,
> 0,
> NULL,
> -   0,
> +   AML_MEMORY_RANGE_TYPE_MEMORY,
> TRUE,
> CrsNode,
> NULL
> @@ -718,7 +718,7 @@ ReserveEcamSpace (
>   TRUE,
>   TRUE,
>   TRUE,
> - FALSE,  // non-cacheable
> + AML_MEMORY_NONCACHEABLE,
>   TRUE,
>   0,
>   AddressMinimum,
> @@ -727,7 +727,7 @@ ReserveEcamSpace (
>   AddressMaximum - AddressMinimum + 1,
>   0,
>   NULL,
> - 0,
> + AML_MEMORY_RANGE_TYPE_MEMORY,
>   TRUE,
>   CrsNode,
>   NULL
> -- 
> 2.25.1
> 


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




[edk2-devel] [PATCH] MdeModulePkg/RegularExpressinoDxe: Fix clang error

2023-10-03 Thread Jake Garver via groups.io
Ignore old style declaration warnings in oniguruma/src/st.c.  This was
already ignored for MSFT, but newer versions of clang complain as well.

Signed-off-by: Jake Garver 
---
 .../Universal/RegularExpressionDxe/RegularExpressionDxe.inf  | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf 
b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf
index 84489c2942..0092531a67 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf
+++ b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf
@@ -102,6 +102,7 @@
 
   # Oniguruma: old style declaration in st.c
   MSFT:*_*_*_CC_FLAGS = /wd4131
+  GCC:*_*_*_CC_FLAGS = -Wno-deprecated-non-prototype
 
   # Oniguruma: 'type cast' : truncation from 'OnigUChar *' to 'unsigned int'
   MSFT:*_*_*_CC_FLAGS = /wd4305 /wd4306
-- 
2.34.1



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




Re: [edk2-devel] [[edk2-non-osi][Silicon/AMD][PATCH v2] 1/2] Maintainers.txt: Add maintainer for Silicon/AMD and Silicon/AMD/Vangogh

2023-10-03 Thread Leif Lindholm
On Fri, Sep 29, 2023 at 01:06:45 +0800, eric.x...@amd.com wrote:
> From: Eric Xing 
> 
> Cc: Michael D Kinney 
> Cc: Abner Chang 
> Cc: Leif Lindholm 
> Cc: Abdul Lateef Attar 
> Signed-off-by: Eric Xing 

Reviewed-by: Leif Lindholm 
Pushed as 00cba21930fc.

/
Leif

> ---
>  Maintainers.txt | 9 +
>  1 file changed, 9 insertions(+)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt
> index c42d135..1d5dacb 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -58,6 +58,15 @@ Platform/Intel/CometlakeSiliconBinPkg
>  M: Kathappan Esakkithevar 
>  M: Sai Chaganty 
>  
> +Silicon/AMD
> +M: Abner Chang 
> +M: Abdul Lateef Attar 
> +M: Eric Xing 
> +
> +Silicon/AMD/Vangogh
> +M: Duke Zhai 
> +M: Eric Xing 
> +
>  Silicon/Ampere/AmpereAltraBinPkg
>  M: Nhi Pham 
>  M: Vu Nguyen 
> -- 
> 2.17.1
> 


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




Re: [edk2-devel] [RFC][PATCH 0/2][edk2-redfish-client]: tune uncrustify script

2023-10-03 Thread Nickle Wang via groups.io


Patch set  Reviewed-by: Nickle Wang 
mailto:nick...@nvidia.com>>



Hi @Mike Maslenkin, could you please add Abner 
and my Reviewed-by to two commit messages in this PR? 
https://github.com/tianocore/edk2-redfish-client/pull/53 And then I will merge 
this pull request.



This is an example:



Original "HEAD~$NO_COMMITS" returns a diff agains current repo state

including not stashed changes. As the purpose of uncrustify is to

check commits, let's get changes against HEAD itself and ignore

local modifications.



Signed-off-by: Mike Maslenkin 
mailto:mike.maslen...@gmail.com>>

Reviewed-by: Abner Chang mailto:abner.ch...@amd.com>>

Reviewed-by: Nickle Wang mailto:nick...@nvidia.com>>



Thanks,

Nickle



> -Original Message-

> From: Mike Maslenkin 

> Sent: Saturday, September 30, 2023 6:24 AM

> To: devel@edk2.groups.io

> Cc: abner.ch...@amd.com; Nickle Wang ;

> ig...@ami.com; Mike Maslenkin 

> Subject: [RFC][PATCH 0/2][edk2-redfish-client]: tune uncrustify script

>

> External email: Use caution opening links or attachments

>

>

> Please, look at these changes. I've had some troubles when tried to run 
> uncrustify

> checks locally on macOS and those fixes helped me.

> Also I tried this set on Linux and it worked.

>

> Here is a link to PR:

> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.co

> m%2Ftianocore%2Fedk2-redfish-

> client%2Fpull%2F53&data=05%7C01%7Cnicklew%40nvidia.com%7Cb0010e3e1b

> 704e77ebf308dbc13ad2d3%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0

> %7C638316230613811494%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAw

> MDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C

> &sdata=Edar%2Fg4kjvKcj9v6DFz6PBu7zGrIUNt2pU%2FYwyMz6JE%3D&reserved

> =0

>

> Cc: Abner Chang mailto:abner.ch...@amd.com>>

> Cc: Nickle Wang mailto:nick...@nvidia.com>>

> Cc: Igor Kulchytskyy mailto:ig...@ami.com>>

> Signed-off-by: Mike Maslenkin 
> mailto:mike.maslen...@gmail.com>>




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




[edk2-devel] [edk2-redfish-client][PATCH v2] RedfishClientPkg: update Readme.md

2023-10-03 Thread Nickle Wang via groups.io
Update readme for below topics:
- The call flow of BIOS Redfish provisioning scenario.
- The call flow of BIOS Redfish pending settings scenario.
- The call flow of Redfish feature driver dispatch.
- Redfish foundation driver stack design.
- The design of Redfish Platform Config Protocol.
- The design of synchronization between BIOS and Redfish service.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
---
 .../redfish-call-flow-pending-settings.svg|  58 ++
 .../Media/redfish-call-flow-provisioning.svg  |  46 +
 .../redfish-feature-driver-call-flow.svg  | 133 ++
 .../Media/redfish-foundation-driver-stack.svg |  75 
 ...redfish-platform-config-protocol-stack.svg |  99 ++
 .../Media/redfish-synchronization-design.svg  |  75 
 RedfishClientPkg/Readme.md| 170 --
 7 files changed, 641 insertions(+), 15 deletions(-)
 create mode 100755 
RedfishClientPkg/Documents/Media/redfish-call-flow-pending-settings.svg
 create mode 100755 
RedfishClientPkg/Documents/Media/redfish-call-flow-provisioning.svg
 create mode 100755 
RedfishClientPkg/Documents/Media/redfish-feature-driver-call-flow.svg
 create mode 100755 
RedfishClientPkg/Documents/Media/redfish-foundation-driver-stack.svg
 create mode 100755 
RedfishClientPkg/Documents/Media/redfish-platform-config-protocol-stack.svg
 create mode 100755 
RedfishClientPkg/Documents/Media/redfish-synchronization-design.svg

diff --git 
a/RedfishClientPkg/Documents/Media/redfish-call-flow-pending-settings.svg 
b/RedfishClientPkg/Documents/Media/redfish-call-flow-pending-settings.svg
new file mode 100755
index ..c7338c69
--- /dev/null
+++ b/RedfishClientPkg/Documents/Media/redfish-call-flow-pending-settings.svg
@@ -0,0 +1,58 @@
+http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink"; 
xml:space="preserve" overflow="hidden">
+  
+
+  
+
+  
+  
+
+Feature Driver
+
+EDK2 
HII
+
+Redfish Service
+
+
+
+
+3
+. If 

+HII 
question exists and pending value is changed
+Use 
HII protocol/library to submit new value
+
+
+2. 
Check and see if there is HII question with lang:
+/
+bios/attributes/
+ATTRIBUTE_
+NAME
+4. 
Update current settings to 
+/redfish/v1/systems/SYS/Bios 
+(provisioning)
+
+1. Use 

+HTTP 
“GET” to download pending settings from
+/redfish
+/v1/systems/SYS/Bios/Settings
+
+6. 

+System reboot
+
+Chipset/HII 
+driver
+
+Chipset/HII 
+driver
+
+Chipset/HII 
+driver
+
+Chipset/HII 
+driver
+
+Consume pending 
+settings:
+BMC to BIOS
+5. 
BMC reset pending settings
+  
+
diff --git 
a/RedfishClientPkg/Documents/Media/redfish-call-flow-provisioning.svg 
b/RedfishClientPkg/Documents/Media/redfish-call-flow-provisioning.svg
new file mode 100755
index ..70556152
--- /dev/null
+++ b/RedfishClientPkg/Documents/Media/redfish-call-flow-provisioning.svg
@@ -0,0 +1,46 @@
+http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink"; 
xml:space="preserve" overflow="hidden">
+  
+
+  
+
+  
+  
+
+Feature 
Driver
+
+EDK2 
HII
+
+Redfish 
Service
+
+
+
+
+1. 
Find all HII questions with 
+language: 
+“/bios/attributes/*
+” 

+3. 
Get current value of each HII question and
+append value to attribute list
+
+2. 
Follow Bios schema and 
+create attribute list
+4. 
BIOS current settings is ready
+Issue 
HTTP “PUT” to /redfish/v1/systems/SYS/Bios
+
+
+Chipset/HII 
+driver
+
+Chipset/HII 
+driver
+
+Chipset/HII 
+driver
+
+Chipset/HII 
+driver
+
+Provisioning:
+BIOS to BMC
+  
+
diff --git 
a/RedfishClientPkg/Documents/Media/redfish-feature-driver-call-flow.svg 
b/RedfishClientPkg/Documents/Media/redfish-feature-driver-call-flow.svg
new file mode 100755
index ..acea6b44
--- /dev/null
+++ b/RedfishClientPkg/Documents/Media/redfish-feature-driver-call-flow.svg
@@ -0,0 +1,133 @@
+http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink"; 
xml:space="preserve" overflow="hidden">
+  
+
+  
+
+  
+  
+
+
+
+Redfish Feature 
+Core Driver
+
+Event 
driven
+PcdEdkIIRedfishFeatureDriverStartupEventGuid
+
+
+Ready
+-
+to
+-
+Provision Signal
+gEfiRedfishClientFeatureReadyToProvisionin
+gGuid
+
+After
+-
+Provision Signal
+gEfiRedfishClientFeatureAfterProvisioningG
+uid
+
+
+
+Service Root
+/redfish/v1
+
+
+ComputerSystemC
+ollection
+/redfish/v1/Systems
+
+
+ComputerSystem
+/redfish/v1/Systems/SYS
+
+
+Bios
+
+/redfish/v1/Systems/SYS/Bios
+
+MemoryCollection
+
+/redfish/v1

Re: [edk2-devel] [PATCH 1/1] MdePkg/BaseLib: fix typo in Arm SetJump

2023-10-03 Thread Leif Lindholm
On Tue, Oct 03, 2023 at 11:22:26 +, Sami Mujawar wrote:
> Hi Leif,
> 
> Thank you for this fix.
> Reviewed-by: Sami Mujawar 

Thanks!

Merged as 1497c4b07494.

/
Leif

> Regards,
> 
> Sami Mujawar
> 
> On 03/10/2023, 11:39, "Leif Lindholm"  > wrote:
> 
> 
> RO -> R0
> 
> 
> Signed-off-by: Leif Lindholm  >
> Reported-by: Philippe Mathieu-Daudé  >
> Cc: Ard Biesheuvel  >
> Cc: Sami Mujawar mailto:sami.muja...@arm.com>>
> ---
> MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 
> diff --git a/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm 
> b/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm
> index 15eb3dc28fb7..f89cfa231bbc 100644
> --- a/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm
> +++ b/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm
> @@ -33,7 +33,7 @@
> SetJump
> MOV R3, R13
> STM R0, {R3-R12,R14}
> - MOV RO, #0
> + MOV R0, #0
> BX LR
> 
> 
> ;/**
> -- 
> 2.30.2
> 
> 
> 
> 
> 


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




Re: [edk2-devel] [PATCH 1/1] MdePkg/BaseLib: fix typo in Arm SetJump

2023-10-03 Thread Sami Mujawar
Hi Leif,

Thank you for this fix.
Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar

On 03/10/2023, 11:39, "Leif Lindholm" mailto:quic_llind...@quicinc.com>> wrote:


RO -> R0


Signed-off-by: Leif Lindholm mailto:quic_llind...@quicinc.com>>
Reported-by: Philippe Mathieu-Daudé mailto:phi...@linaro.org>>
Cc: Ard Biesheuvel mailto:ardb+tianoc...@kernel.org>>
Cc: Sami Mujawar mailto:sami.muja...@arm.com>>
---
MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)


diff --git a/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm 
b/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm
index 15eb3dc28fb7..f89cfa231bbc 100644
--- a/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm
+++ b/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm
@@ -33,7 +33,7 @@
SetJump
MOV R3, R13
STM R0, {R3-R12,R14}
- MOV RO, #0
+ MOV R0, #0
BX LR


;/**
-- 
2.30.2







-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109278): https://edk2.groups.io/g/devel/message/109278
Mute This Topic: https://groups.io/mt/101731199/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 3/5] MdePkg/BaseLib: use normal register init in ARM SetJump implementations

2023-10-03 Thread Leif Lindholm
On Mon, Oct 02, 2023 at 20:00:21 +0200, Philippe Mathieu-Daudé wrote:
> Hi Leif,
> 
> On 26/9/23 19:15, Leif Lindholm wrote:
> > There may be architectures on which there are benefits to
> >eor r0, r0(, r0)
> > but ARM was never one of them. Change to more readable
> >mov r0, #0
> > instead.
> > 
> > Signed-off-by: Leif Lindholm 
> > Cc: Ard Biesheuvel 
> > Cc: Sami Mujawar 
> > ---
> >   MdePkg/Library/BaseLib/Arm/SetJumpLongJump.S   | 2 +-
> >   MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm | 2 +-
> >   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> 
> > diff --git a/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm 
> > b/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm
> > index e1eff758f7ab..ef02d85e0e66 100644
> > --- a/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm
> > +++ b/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm
> > @@ -33,7 +33,7 @@
> >   SetJump
> > MOV  R3, R13
> > STM  R0, {R3-R12,R14}
> > -  EOR  R0, R0
> > +  MOV  RO, #0
> 
> Hmm. s/RO/R0/ ?

Hmm, what?
I know for a fact I spotted that while importing the v1, and fixed it.
No idea how I managed to unfix it.

Too late, already got merged. Sent a fix out.

Hmm ... I think this says something about non-gcc/clang support for
(32-bit) Arm. Are we getting to the point where we might want to
retire it?

Thanks!

/
Leif

> > BX   LR
> >   ;/**
> 


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




[edk2-devel] [PATCH 1/1] MdePkg/BaseLib: fix typo in Arm SetJump

2023-10-03 Thread Leif Lindholm
RO -> R0

Signed-off-by: Leif Lindholm 
Reported-by: Philippe Mathieu-Daudé 
Cc: Ard Biesheuvel 
Cc: Sami Mujawar 
---
 MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm 
b/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm
index 15eb3dc28fb7..f89cfa231bbc 100644
--- a/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm
+++ b/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm
@@ -33,7 +33,7 @@
 SetJump
   MOV  R3, R13
   STM  R0, {R3-R12,R14}
-  MOV  RO, #0
+  MOV  R0, #0
   BX   LR
 
 ;/**
-- 
2.30.2



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




Re: [edk2-devel] [PATCH] DynamicTablesPkg/AmlLib: Enumerate memory cacheability and type

2023-10-03 Thread PierreGondois

Hello Jeshua,
just a few NITs:

On 10/2/23 23:52, Jeshua Smith wrote:

AmlCodeGenRdQWordMemory's and AmlCodeGenRdDWordMemory's Cacheable
and MemoryRangeType parameters treat specific values as having
specific meanings. This change adds enums to map those meanings to their
corresponding values.

Signed-off-by: Jeshua Smith 
---
  .../Include/Library/AmlLib/AmlLib.h   | 33 +++
  .../AcpiSsdtPcieLibArm/SsdtPcieGenerator.c| 12 +++
  2 files changed, 39 insertions(+), 6 deletions(-)

diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h 
b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
index 510c79a399..6a273059fb 100644
--- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
+++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
@@ -59,6 +59,39 @@ typedef void *AML_DATA_NODE_HANDLE;
  
  #endif // AML_HANDLE
  
+/** Cacheable parameter values

+
+  Possible values are:
+0-The memory is non-cacheable
+1-The memory is cacheable
+2-The memory is cacheable and supports
+  write combining
+3-The memory is cacheable and prefetchable


Is it possible add a reference to ACPI 6.5, s6.4.3.5.5 "Resource Type
Specific Flags" for future reference ? Same comment for the other enum.


+
+**/
+typedef enum {
+  AML_MEMORY_NONCACHEABLE = 0,
+  AML_MEMORY_CACHEABLE= 1,
+  AML_MEMORY_CACHEABLE_WC = 2,
+  AML_MEMORY_CACHEABLE_PF = 3


Just for a matter of unification in the package, is is possible to
use camelcase enum names, like AmlMemoryNonCacheable ?
Also would it be possible to add a AmlMemoryMax enum at the end ?
Same comment for the other enum.


+} AML_MEMORY_CACHEABILITY;
+
+/** MemoryRangeType parameter values
+
+  Possible values are:
+0-AddressRangeMemory
+1-AddressRangeReserved
+2-AddressRangeACPI
+3-AddressRangeNVS
+
+**/
+typedef enum {
+  AML_MEMORY_RANGE_TYPE_MEMORY   = 0,
+  AML_MEMORY_RANGE_TYPE_RESERVED = 1,
+  AML_MEMORY_RANGE_TYPE_ACPI = 2,
+  AML_MEMORY_RANGE_TYPE_NVS  = 3
+} AML_MEMORY_RANGE_TYPE;
+
  /** Parse the definition block.
  
The function parses the whole AML blob. It starts with the ACPI DSDT/SSDT

diff --git 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
index 9ddaddc198..7df7117352 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c


Is is possible to modify the definition/declaration of the modified functions
to use the newly created type ?


@@ -566,7 +566,7 @@ GeneratePciCrs (
 IsPosDecode,
 TRUE,
 TRUE,
-   TRUE,
+   AML_MEMORY_CACHEABLE,
 TRUE,
 0,
 AddrMapInfo->PciAddress,
@@ -575,7 +575,7 @@ GeneratePciCrs (
 AddrMapInfo->AddressSize,
 0,
 NULL,
-   0,
+   AML_MEMORY_RANGE_TYPE_MEMORY,
 TRUE,
 CrsNode,
 NULL
@@ -588,7 +588,7 @@ GeneratePciCrs (
 IsPosDecode,
 TRUE,
 TRUE,
-   TRUE,
+   AML_MEMORY_CACHEABLE,
 TRUE,
 0,
 AddrMapInfo->PciAddress,
@@ -597,7 +597,7 @@ GeneratePciCrs (
 AddrMapInfo->AddressSize,
 0,
 NULL,
-   0,
+   AML_MEMORY_RANGE_TYPE_MEMORY,
 TRUE,
 CrsNode,
 NULL
@@ -718,7 +718,7 @@ ReserveEcamSpace (
   TRUE,
   TRUE,
   TRUE,
- FALSE,  // non-cacheable
+ AML_MEMORY_NONCACHEABLE,
   TRUE,
   0,
   AddressMinimum,
@@ -727,7 +727,7 @@ ReserveEcamSpace (
   AddressMaximum - AddressMinimum + 1,
   0,
   NULL,
- 0,
+ AML_MEMORY_RANGE_TYPE_MEMORY,
   TRUE,
   CrsNode,
   NULL


Regards,
Pierre


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