Re: [edk2-devel] [edk2-test v2] SctPkg: Fixed a pinter error in DevicePathFromTextBBTestCoverage.c

2024-02-26 Thread G Edhaya Chandran
Hi Li Chao, Thank you for the solution.
Reviewed OK.

Reviewed-by: G Edhaya Chandran 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116007): https://edk2.groups.io/g/devel/message/116007
Mute This Topic: https://groups.io/mt/104598721/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 0/3] OvmfPkg: Update TDVMCALL to avoid leaking secrets to the VMM

2024-02-26 Thread Min Xu
Reviewed-by: Min Xu 

> -Original Message-
> From: Sun, CepingX 
> Sent: Tuesday, February 27, 2024 5:19 AM
> To: devel@edk2.groups.io
> Cc: Sun, CepingX ; Liming Gao
> ; Kinney, Michael D
> ; Aktas, Erdem ;
> James Bottomley ; Yao, Jiewen
> ; Xu, Min M ; Tom Lendacky
> ; Michael Roth ;
> Gerd Hoffmann ; Yamahata, Isaku
> 
> Subject: [PATCH V1 0/3] OvmfPkg: Update TDVMCALL to avoid leaking secrets
> to the VMM
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4696
> 
> According to section 2.4.1 of [GHCI] spec, RBP register is usually used as a
> frame pointer according to the C language calling convention.
> The software should not use RBP as an input/output parameter and should
> clear BIT5 (RBP) in the GPR mask in RCX.
> 
> Reference:
> [GHCI]: TDX Guest-Host-Communication Interface v1.5
> https://cdrdv2.intel.com/v1/dl/getContent/726792
> 
> 
> Cc: Liming Gao 
> Cc: Michael D Kinney 
> Cc: Erdem Aktas 
> Cc: James Bottomley 
> Cc: Jiewen Yao 
> Cc: Min Xu 
> Cc: Tom Lendacky 
> Cc: Michael Roth 
> Cc: Gerd Hoffmann 
> Cc: Isaku Yamahata 
> Signed-off-by: Ceping Sun 
> 
> Ceping Sun (3):
>   MdePkg/BaseLib: Update TDVMCALL_EXPOSE_REGS_MASK
>   OvmfPkg/CcExitLib: Update TDVMCALL_EXPOSE_REGS_MASK
>   OvmfPkg/TdxDxe: Clear the registers before tdcall
> 
>  MdePkg/Library/BaseLib/X64/TdVmcall.nasm  |  2 +-
>  .../Library/CcExitLib/X64/TdVmcallCpuid.nasm  |  2 +-
>  OvmfPkg/TdxDxe/X64/ApRunLoop.nasm | 30 ---
>  3 files changed, 28 insertions(+), 6 deletions(-)
> 
> --
> 2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116006): https://edk2.groups.io/g/devel/message/116006
Mute This Topic: https://groups.io/mt/104577516/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] SctPkg: Fixed a pinter error in DevicePathFromTextBBTestCoverage.c

2024-02-26 Thread Chao Li

Hi Heinrich,

I guess it is not allowed to make them the same now, so I submitted V2, 
added your recomended fix message to the commit message, and also added 
more reviewers.



Thanks,
Chao
On 2024/2/27 09:15, Chao Li wrote:


Hi Heinrich,

On 2024/2/26 19:02, Heinrich Schuchardt wrote:

On 26.02.24 11:17, Chao Li wrote:

DevicePathFromTextBBTextCoverage.c function CreateDNSDeviceNode has a
bug, code:

SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH)));


DNS is a pointer, which is increased by a structure size and converted
to EFI_IPv4_ADDRESS*, which will point to an unknown address. So fix 
it.


Hello Chao,

thanks for diving into this.

Please, add

Fixes: 847e0363e846 ("SctPkg: Fix the UefiSct 
-Wincompatible-pointer-types warnings")




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

Cc: G Edhaya Chandran 
Cc: Barton Gao 
Cc: Carolyn Gjertsen 
Signed-off-by: Chao Li 
---
  .../BlackBoxTest/DevicePathFromTextBBTestCoverage.c   | 8 


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

diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c 


index c96ee246..bd11c25a 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c

@@ -1734,13 +1734,13 @@ CreateDNSDeviceNode (
    }

    if (DNS->IsIPv6 == 0) {
-    SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH)));
-    SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS)));
+    SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)((UINT8 *)DNS + 
sizeof (DNS_DEVICE_PATH)));
+    SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)((UINT8 *)DNS + 
sizeof (DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS)));

    }

    if (DNS->IsIPv6 == 1) {
-    SctStrToIPv6Addr (, (EFI_IPv6_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH)));
-    SctStrToIPv6Addr (, (EFI_IPv6_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS)));
+    SctStrToIPv6Addr (, (EFI_IPv6_ADDRESS *)((UINT8 *)DNS + 
sizeof (DNS_DEVICE_PATH)));
+    SctStrToIPv6Addr (, (EFI_IPv6_ADDRESS *)((UINT8 *)DNS + 
sizeof (DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS)));


The change looks correct.

I would prefer using the fields of the DNS_DEVICE_PATH typedef from 
MdePkg/Include/Protocol/DevicePath.h to avoid the conversions:


> +    SctStrToIPv4Addr (, >DnsServerIp[0].v4)
> +    SctStrToIPv4Addr (, >DnsServerIp[1].v4)

> +    SctStrToIPv6Addr (, >DnsServerIp[0].v6)
> +    SctStrToIPv6Addr (, >DnsServerIp[1].v6)
I also prefer this way, but the definition of DNS in 
UEFI/Protocol/DevicePath.h is not same as the MdePkg version, should 
we make them the same?


Best regards

Heinrich


    }

    return (EFI_DEVICE_PATH_PROTOCOL *) DNS;
--
2.27.0











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




[edk2-devel] [edk2-test v2] SctPkg: Fixed a pinter error in DevicePathFromTextBBTestCoverage.c

2024-02-26 Thread Chao Li
DevicePathFromTextBBTextCoverage.c function CreateDNSDeviceNode has a
bug, code:

SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH)));

DNS is a pointer, which is increased by a structure size and converted
to EFI_IPv4_ADDRESS*, which will point to an unknown address. So fix it.

Fixes: 847e0363e846 ("SctPkg: Fix the UefiSct-Wincompatible-pointer-types 
warnings")

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

Cc: G Edhaya Chandran 
Cc: Barton Gao 
Cc: Carolyn Gjertsen 
Cc: Samer El-Haj-Mahmoud 
Cc: Eric Jin 
Cc: Arvin Chen 
Cc: Supreeth Venkatesh 
Cc: Heinrich Schuchardt 
Signed-off-by: Chao Li 
---
 .../BlackBoxTest/DevicePathFromTextBBTestCoverage.c   | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c
index c96ee246..bd11c25a 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c
@@ -1734,13 +1734,13 @@ CreateDNSDeviceNode (
   }
 
   if (DNS->IsIPv6 == 0) {
-SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH)));
-SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS)));
+SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)((UINT8 *)DNS + sizeof 
(DNS_DEVICE_PATH)));
+SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)((UINT8 *)DNS + sizeof 
(DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS)));
   }
 
   if (DNS->IsIPv6 == 1) {
-SctStrToIPv6Addr (, (EFI_IPv6_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH)));
-SctStrToIPv6Addr (, (EFI_IPv6_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS)));
+SctStrToIPv6Addr (, (EFI_IPv6_ADDRESS *)((UINT8 *)DNS + sizeof 
(DNS_DEVICE_PATH)));
+SctStrToIPv6Addr (, (EFI_IPv6_ADDRESS *)((UINT8 *)DNS + sizeof 
(DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS)));
   }
 
   return (EFI_DEVICE_PATH_PROTOCOL *) DNS;
-- 
2.27.0



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116004): https://edk2.groups.io/g/devel/message/116004
Mute This Topic: https://groups.io/mt/104598721/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] .github/workflows/codeql.yml: Update actions being deprecated

2024-02-26 Thread Michael D Kinney
> -Original Message-
> From: mikub...@linux.microsoft.com 
> Sent: Monday, February 26, 2024 8:39 PM
> To: devel@edk2.groups.io
> Cc: Sean Brogan ; Joey Vagedes
> ; Kinney, Michael D
> 
> Subject: [PATCH v1 1/1] .github/workflows/codeql.yml: Update actions
> being deprecated
> 
> From: Michael Kubacki 
> 
> Currently CodeQL runs have the following warnings:
> 
>   Node.js 16 actions are deprecated. Please update the following
>   actions to use Node.js 20: actions/setup-python@v4,
>   actions/upload-artifact@v3, actions/cache@v3. For more information
>   see:
>   https://github.blog/changelog/2023-09-22-github-actions-
> transitioning-from-node-16-to-node-20/.
> 
> And:
> 
>   CodeQL Action v2 will be deprecated on December 5th, 2024. Please
>   update all occurrences of the CodeQL Action in your workflow files
>   to v3. For more information, see:
>   https://github.blog/changelog/2024-01-12-code-scanning-deprecation-
> of-codeql-action-v2/
> 
> The first is resolved by updating the actions to the latest versions
> that were released to use Node.js 20. The second is specifically
> referring to the codeql-action/upload-sarif action which is at v2.
> 
> This change updates all of the actions to the latest releases to
> prevent deprecated versions from continuing to be used.
> 
> Cc: Sean Brogan 
> Cc: Joey Vagedes 
> Cc: Michael D Kinney 
> Signed-off-by: Michael Kubacki 
> ---
>  .github/workflows/codeql.yml | 37 +---
>  1 file changed, 24 insertions(+), 13 deletions(-)
> 
> diff --git a/.github/workflows/codeql.yml
> b/.github/workflows/codeql.yml
> index c91e9d4dbeb3..e0c5f69f6cdf 100644
> --- a/.github/workflows/codeql.yml
> +++ b/.github/workflows/codeql.yml
> @@ -79,7 +79,7 @@ jobs:
>uses: actions/checkout@v4
> 
>  - name: Install Python
> -  uses: actions/setup-python@v4
> +  uses: actions/setup-python@v5
>with:
>  python-version: '3.11'
>  cache: 'pip'
> @@ -136,15 +136,26 @@ jobs:
> 
> print(f'ci_setup_supported={str(ci_setup_supported).lower()}', file=fh)
>  print(f'setup_supported={str(setup_supported).lower()}',
> file=fh)
> 
> +- name: Convert Arch to Log Format
> +  id: convert_arch_hyphen
> +  env:
> +ARCH_LIST: ${{ matrix.ArchList }}
> +  shell: python
> +  run: |
> +import os
> +
> +with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
> +print(f'arch_list={os.environ["ARCH_LIST"].replace(",", "-
> ")}', file=fh)

I do not see this change described in the commit message.  Is it related?

> +
>  - name: Setup
>if: steps.get_ci_file_operations.outputs.setup_supported ==
> 'true'
>run: stuart_setup -c .pytool/CISettings.py -t DEBUG -a ${{
> matrix.ArchList }} TOOL_CHAIN_TAG=VS2019
> 
>  - name: Upload Setup Log As An Artifact
> -  uses: actions/upload-artifact@v3
> +  uses: actions/upload-artifact@v4
>if: (success() || failure()) &&
> steps.get_ci_file_operations.outputs.setup_supported == 'true'
>with:
> -name: ${{ matrix.Package }}-Logs
> +name: ${{ matrix.Package }}-${{
> steps.convert_arch_hyphen.outputs.arch_list }}-Setup-Log
>  path: |
>**/SETUPLOG.txt
>retention-days: 7
> @@ -155,10 +166,10 @@ jobs:
>run: stuart_ci_setup -c .pytool/CISettings.py -t DEBUG -a ${{
> matrix.ArchList }} TOOL_CHAIN_TAG=VS2019
> 
>  - name: Upload CI Setup Log As An Artifact
> -  uses: actions/upload-artifact@v3
> +  uses: actions/upload-artifact@v4
>if: (success() || failure()) &&
> steps.get_ci_file_operations.outputs.ci_setup_supported == 'true'
>with:
> -name: ${{ matrix.Package }}-Logs
> +name: ${{ matrix.Package }}-${{
> steps.convert_arch_hyphen.outputs.arch_list }}-CI-Setup-Log
>  path: |
>**/CISETUP.txt
>retention-days: 7
> @@ -168,10 +179,10 @@ jobs:
>run: stuart_update -c .pytool/CISettings.py -t DEBUG -a ${{
> matrix.ArchList }} TOOL_CHAIN_TAG=VS2019
> 
>  - name: Upload Update Log As An Artifact
> -  uses: actions/upload-artifact@v3
> +  uses: actions/upload-artifact@v4
>if: success() || failure()
>with:
> -name: ${{ matrix.Package }}-Logs
> +name: ${{ matrix.Package }}-${{
> steps.convert_arch_hyphen.outputs.arch_list }}-Update-Log
>  path: |
>**/UPDATE_LOG.txt
>  retention-days: 7
> @@ -228,7 +239,7 @@ jobs:
> 
>  - name: Attempt to Load CodeQL CLI From Cache
>id: codeqlcli_cache
> -  uses: actions/cache@v3
> +  uses: actions/cache@v4
>with:
>  path: ${{ steps.cache_key_gen.outputs.codeql_cli_ext_dep_dir
> }}
>  key: ${{ steps.cache_key_gen.outputs.codeql_cli_cache_key }}
> @@ -284,10 +295,10 @@ jobs:
>  delete_dirs(build_path)
> 
>  - name: Upload Build Logs As An Artifact
> -  uses: actions/upload-artifact@v3
> +  uses: 

Re: [edk2-devel] [PATCH v3 0/6] UefiCpuPkg/MpInitLib: Add support for multiple MP_HAND_OFF HOBs

2024-02-26 Thread Ni, Ray
Thank you, Laszlo!
The changes you made look good to me.

By the way, is the following a common way to call out additional changes?
> +[ler...@redhat.com: define one local variable per line [Ray]]

Thanks,
Ray
> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Laszlo
> Ersek
> Sent: Monday, February 26, 2024 11:20 PM
> To: devel@edk2.groups.io; kra...@redhat.com
> Cc: Ni, Ray ; Kumar, Rahul R ;
> Oliver Steffen 
> Subject: Re: [edk2-devel] [PATCH v3 0/6] UefiCpuPkg/MpInitLib: Add support
> for multiple MP_HAND_OFF HOBs
> 
> On 2/22/24 17:01, Gerd Hoffmann wrote:
> > Needed to boot guests with thousands of vcpus.
> >
> > v3:
> >  - refine comments and commit messages.
> >  - fix MaxCpusPerHob calculation.
> >  - pick up review tags.
> >  - add patch to speed up GetBspNumber a bit.
> > v2:
> >  - rework HOB loops for better performance: O(n) instead of O(n^2).
> >
> > Gerd Hoffmann (6):
> >   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to
> GetMpHandOffHob
> >   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to
> GetBspNumber()
> >   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to
> > SwitchApContext()
> >   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to
> > MpInitLibInitialize
> >   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to
> SaveCpuMpData()
> >   UefiCpuPkg/MpInitLib: return early in GetBspNumber()
> >
> >  UefiCpuPkg/Library/MpInitLib/MpLib.h|  14 ++-
> >  UefiCpuPkg/Library/MpInitLib/MpLib.c| 157
> +++-
> >  UefiCpuPkg/Library/MpInitLib/PeiMpLib.c |  44 ---
> >  3 files changed, 142 insertions(+), 73 deletions(-)
> >
> 
> BTW, differences in PR#5410 relative to v3 as posted:
> 
> 1:  678ed78d24a3 ! 1:  ecd6c4bb3396 UefiCpuPkg/MpInitLib: Add support
> for multiple HOBs to GetMpHandOffHob
> @@ Commit message
> 
>  Signed-off-by: Gerd Hoffmann 
>  Message-Id: <20240222160106.686484-2-kra...@redhat.com>
> +Reviewed-by: Ray Ni 
> +Reviewed-by: Laszlo Ersek 
> 
>   ## UefiCpuPkg/Library/MpInitLib/MpLib.h ##
>  @@ UefiCpuPkg/Library/MpInitLib/MpLib.h: SwitchApContext (
> 2:  23b3e66f9935 = 2:  189467980103 UefiCpuPkg/MpInitLib: Add support
> for multiple HOBs to GetBspNumber()
> 3:  e712d36775d0 = 3:  8ab0f63c0f04 UefiCpuPkg/MpInitLib: Add support
> for multiple HOBs to SwitchApContext()
> 4:  9a81417f4b76 ! 4:  995a8ace7801 UefiCpuPkg/MpInitLib: Add support
> for multiple HOBs to MpInitLibInitialize
> @@ Commit message
>  Signed-off-by: Gerd Hoffmann 
>  Reviewed-by: Ray Ni 
>  Message-Id: <20240222160106.686484-5-kra...@redhat.com>
> +Reviewed-by: Laszlo Ersek 
> 
>   ## UefiCpuPkg/Library/MpInitLib/MpLib.c ##
>  @@ UefiCpuPkg/Library/MpInitLib/MpLib.c: MpInitLibInitialize (
> 5:  3a089b25725e ! 5:  f23c0d125e48 UefiCpuPkg/MpInitLib: Add support
> for multiple HOBs to SaveCpuMpData()
> @@ Commit message
> 
>  Signed-off-by: Gerd Hoffmann 
>  Message-Id: <20240222160106.686484-6-kra...@redhat.com>
> +Reviewed-by: Ray Ni 
> +Reviewed-by: Laszlo Ersek 
> +[ler...@redhat.com: define one local variable per line [Ray]]
> 
>   ## UefiCpuPkg/Library/MpInitLib/PeiMpLib.c ##
>  @@ UefiCpuPkg/Library/MpInitLib/PeiMpLib.c: SaveCpuMpData (
> IN CPU_MP_DATA  *CpuMpData
> )
>   {
> -+  UINT32   MaxCpusPerHob, CpusInHob;
> ++  UINT32   MaxCpusPerHob;
> ++  UINT32   CpusInHob;
> UINT64   Data64;
>  -  UINTNIndex;
> -+  UINT32   Index, HobBase;
> ++  UINT32   Index;
> ++  UINT32   HobBase;
> CPU_INFO_IN_HOB  *CpuInfoInHob;
> MP_HAND_OFF  *MpHandOff;
> UINTNMpHandOffSize;
> 6:  09435495e6e1 ! 6:  fbd8a114cd6e UefiCpuPkg/MpInitLib: return early
> in GetBspNumber()
> @@ Commit message
>  Suggested-by: Laszlo Ersek 
>  Signed-off-by: Gerd Hoffmann 
>  Message-Id: <20240222160106.686484-7-kra...@redhat.com>
> +Reviewed-by: Ray Ni 
> +Reviewed-by: Laszlo Ersek 
> +[ler...@redhat.com: s/ASSERT (FALSE)/ASSERT_EFI_ERROR
> (EFI_NOT_FOUND)/ [Ray]]
> 
>   ## UefiCpuPkg/Library/MpInitLib/MpLib.c ##
>  @@ UefiCpuPkg/Library/MpInitLib/MpLib.c: GetBspNumber (
> @@ UefiCpuPkg/Library/MpInitLib/MpLib.c: GetBspNumber (
>  -  ASSERT (BspNumber != MAX_UINT32);
>  -
>  -  return BspNumber;
> -+  ASSERT (FALSE);
> ++  ASSERT_EFI_ERROR (EFI_NOT_FOUND);
>  +  return 0;
>   }
> 
> 
> 
> 
> 



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




Re: [edk2-devel] [PATCH] NetworkPkg:Resolved Consecutive Pxe-Http Boot Issue

2024-02-26 Thread Sivaraman Nainar via groups.io
Hi Laszlo,

We can see the issue not only with SLES, it can be seen with Ubuntu 22 also.

Do we have any channel to work with grub team to fix this issue?

Thanks
Siva
-Original Message-
From: Sivaraman Nainar
Sent: Monday, February 26, 2024 4:01 PM
To: devel@edk2.groups.io; Sivaraman Nainar ; Laszlo Ersek 
; Santhosh Kumar V ; Saloni Kasbekar 
; Zachary Clark-williams 

Cc: Raj V Akilan ; Soundharia R 
Subject: RE: [EXTERNAL] Re: [edk2-devel] [PATCH] NetworkPkg:Resolved 
Consecutive Pxe-Http Boot Issue

@Saloni Kasbekar, @Zachary Clark-williams,

Could you please add your feedback on the changes proposed?

Thanks
Siva
-Original Message-
From: devel@edk2.groups.io  On Behalf Of Sivaraman Nainar 
via groups.io
Sent: Thursday, February 22, 2024 7:33 AM
To: Laszlo Ersek ; devel@edk2.groups.io; Santhosh Kumar V 
; Saloni Kasbekar ; Zachary 
Clark-williams 
Cc: Raj V Akilan ; Soundharia R 
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH] NetworkPkg:Resolved Consecutive 
Pxe-Http Boot Issue


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

Laszlo:

Thanks for the detailed feedback on the changes for this issue. Since we are 
not sure if this change are valid / violate some purpose of SNP driver, it 
mentioned as Workaround.

@Saloni Kasbekar and @Clark-williams, Zachary can add more on these changes.

As you recommended, we can have PCD which controls these changes till the 
changes are addressed in grub.

@Santhosh Kumar V is this issue can be seen only in SLES 15 or it can be found 
in any OS having Grub 2.x?

Thanks
Siva
-Original Message-
From: Laszlo Ersek 
Sent: Thursday, February 22, 2024 5:15 AM
To: devel@edk2.groups.io; Santhosh Kumar V 
Cc: Sivaraman Nainar ; Raj V Akilan ; 
Soundharia R ; Saloni Kasbekar 
; Zachary Clark-williams 

Subject: [EXTERNAL] Re: [edk2-devel] [PATCH] NetworkPkg:Resolved Consecutive 
Pxe-Http Boot Issue


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

On 2/21/24 18:15, Santhosh Kumar V via groups.io wrote:
> The customer has a server environment where PXE and HTTP service run in same 
> Linux Server. In this environment a SUT trying to boot to SLES 15 OS via PXE 
> from the Boot Menu. After PXE Boot file downloaded and grub Loaded without 
> continuing for installation Exit is pressed and control back to Setup.
> Now the HTTP boot to SLES 15 OS tried in the same environment and failed to 
> download the file. If there is a reconnect -r performed before this HTTP Boot 
> then boot file download and installation is getting success.
> Root cause of the issue is, when Exit from grub performed, boot Loader Stops 
> the SNP Driver and starts the same.

This sentence feels like the key one.

Are you saying that grub calls Snp->Start() just before it exits?

If so, am I right to suspect that that's a grub bug? It sounds like a resource 
leak, after all.

Can you perhaps include a grub source code location / pointer in the commit 
message?

> During this process SNP is in Initialized State. When HTTP boot is performed 
> immediately after PXE Failure, the MNP configure method initiates the SNP 
> Start again. Since the SNP already started by grub it returns 
> EFI_ALREADY_STARTED and none of the upper Layer drivers are getting started.
> As a work around in MNPConfigure(), if the SNP Start failed with Already 
> Started and in Initialized state we can return success so that rest of the 
> drivers can be loaded and HTTP boot can work.
>
>
> Cc: Saloni Kasbekar 
> Cc: Zachary Clark-williams 
>
> Signed-off-by: SanthoshKumar 
> ---
>  NetworkPkg/MnpDxe/MnpConfig.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/NetworkPkg/MnpDxe/MnpConfig.c
> b/NetworkPkg/MnpDxe/MnpConfig.c index 93587d53aa..0f2df28d73 100644
> --- a/NetworkPkg/MnpDxe/MnpConfig.c
> +++ b/NetworkPkg/MnpDxe/MnpConfig.c
> @@ -1120,7 +1120,9 @@ MnpStartSnp (
>// Start the simple network.
>
>//
>
>Status = Snp->Start (Snp);
>
> -
>
> +  if ((Status == EFI_ALREADY_STARTED ) && (Snp->Mode->State ==
> + EfiSimpleNetworkInitialized)) {
>
> +  return EFI_SUCCESS;
>
> +  }
>
>if (!EFI_ERROR (Status)) {
>
>  //
>
>  // Initialize the simple network.
>

The commit message does say this is a workaround, and I don't immediately any 
see why this workaround (in the code) would be problematic in practice, but it 
still leaves a bad taste in my mouth.

Consider: the call path is the following:

MnpConfigure()   [NetworkPkg/MnpDxe/MnpConfig.c] -- public .Configure() 
protocol member function
  MnpConfigureInstance() [NetworkPkg/MnpDxe/MnpConfig.c]
MnpStart()   [NetworkPkg/MnpDxe/MnpConfig.c]
  // see notes!
  MnpStartSnp()  [NetworkPkg/MnpDxe/MnpConfig.c]

Notes: the MnpStartSnp() call in MnpStart() is conditional on two 

[edk2-devel] [PATCH v1 1/1] .github/workflows/codeql.yml: Update actions being deprecated

2024-02-26 Thread Michael Kubacki
From: Michael Kubacki 

Currently CodeQL runs have the following warnings:

  Node.js 16 actions are deprecated. Please update the following
  actions to use Node.js 20: actions/setup-python@v4,
  actions/upload-artifact@v3, actions/cache@v3. For more information
  see:
  
https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

And:

  CodeQL Action v2 will be deprecated on December 5th, 2024. Please
  update all occurrences of the CodeQL Action in your workflow files
  to v3. For more information, see:
  
https://github.blog/changelog/2024-01-12-code-scanning-deprecation-of-codeql-action-v2/

The first is resolved by updating the actions to the latest versions
that were released to use Node.js 20. The second is specifically
referring to the codeql-action/upload-sarif action which is at v2.

This change updates all of the actions to the latest releases to
prevent deprecated versions from continuing to be used.

Cc: Sean Brogan 
Cc: Joey Vagedes 
Cc: Michael D Kinney 
Signed-off-by: Michael Kubacki 
---
 .github/workflows/codeql.yml | 37 +---
 1 file changed, 24 insertions(+), 13 deletions(-)

diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index c91e9d4dbeb3..e0c5f69f6cdf 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -79,7 +79,7 @@ jobs:
   uses: actions/checkout@v4
 
 - name: Install Python
-  uses: actions/setup-python@v4
+  uses: actions/setup-python@v5
   with:
 python-version: '3.11'
 cache: 'pip'
@@ -136,15 +136,26 @@ jobs:
 print(f'ci_setup_supported={str(ci_setup_supported).lower()}', 
file=fh)
 print(f'setup_supported={str(setup_supported).lower()}', file=fh)
 
+- name: Convert Arch to Log Format
+  id: convert_arch_hyphen
+  env:
+ARCH_LIST: ${{ matrix.ArchList }}
+  shell: python
+  run: |
+import os
+
+with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
+print(f'arch_list={os.environ["ARCH_LIST"].replace(",", "-")}', 
file=fh)
+
 - name: Setup
   if: steps.get_ci_file_operations.outputs.setup_supported == 'true'
   run: stuart_setup -c .pytool/CISettings.py -t DEBUG -a ${{ 
matrix.ArchList }} TOOL_CHAIN_TAG=VS2019
 
 - name: Upload Setup Log As An Artifact
-  uses: actions/upload-artifact@v3
+  uses: actions/upload-artifact@v4
   if: (success() || failure()) && 
steps.get_ci_file_operations.outputs.setup_supported == 'true'
   with:
-name: ${{ matrix.Package }}-Logs
+name: ${{ matrix.Package }}-${{ 
steps.convert_arch_hyphen.outputs.arch_list }}-Setup-Log
 path: |
   **/SETUPLOG.txt
   retention-days: 7
@@ -155,10 +166,10 @@ jobs:
   run: stuart_ci_setup -c .pytool/CISettings.py -t DEBUG -a ${{ 
matrix.ArchList }} TOOL_CHAIN_TAG=VS2019
 
 - name: Upload CI Setup Log As An Artifact
-  uses: actions/upload-artifact@v3
+  uses: actions/upload-artifact@v4
   if: (success() || failure()) && 
steps.get_ci_file_operations.outputs.ci_setup_supported == 'true'
   with:
-name: ${{ matrix.Package }}-Logs
+name: ${{ matrix.Package }}-${{ 
steps.convert_arch_hyphen.outputs.arch_list }}-CI-Setup-Log
 path: |
   **/CISETUP.txt
   retention-days: 7
@@ -168,10 +179,10 @@ jobs:
   run: stuart_update -c .pytool/CISettings.py -t DEBUG -a ${{ 
matrix.ArchList }} TOOL_CHAIN_TAG=VS2019
 
 - name: Upload Update Log As An Artifact
-  uses: actions/upload-artifact@v3
+  uses: actions/upload-artifact@v4
   if: success() || failure()
   with:
-name: ${{ matrix.Package }}-Logs
+name: ${{ matrix.Package }}-${{ 
steps.convert_arch_hyphen.outputs.arch_list }}-Update-Log
 path: |
   **/UPDATE_LOG.txt
 retention-days: 7
@@ -228,7 +239,7 @@ jobs:
 
 - name: Attempt to Load CodeQL CLI From Cache
   id: codeqlcli_cache
-  uses: actions/cache@v3
+  uses: actions/cache@v4
   with:
 path: ${{ steps.cache_key_gen.outputs.codeql_cli_ext_dep_dir }}
 key: ${{ steps.cache_key_gen.outputs.codeql_cli_cache_key }}
@@ -284,10 +295,10 @@ jobs:
 delete_dirs(build_path)
 
 - name: Upload Build Logs As An Artifact
-  uses: actions/upload-artifact@v3
+  uses: actions/upload-artifact@v4
   if: success() || failure()
   with:
-name: ${{ matrix.Package }}-Logs
+name: ${{ matrix.Package }}-${{ 
steps.convert_arch_hyphen.outputs.arch_list }}-Build-Logs
 path: |
   **/BUILD_REPORT.TXT
   **/OVERRIDELOG.TXT
@@ -329,10 +340,10 @@ jobs:
 print(f'upload_sarif_file=false', file=fh)
 
 - name: Upload CodeQL Results (SARIF) As An Artifact
-  uses: actions/upload-artifact@v3
+  uses: actions/upload-artifact@v4
   if: steps.env_data.outputs.upload_sarif_file == 'true'
   with:
-name: ${{ 

Re: [edk2-devel] [PATCH v2 0/3] RISC-V: Support Svpbmt extension

2024-02-26 Thread Tuan Phan
Hi Sunil/ Andrei,
Any comments on this series?

Regards,

On Wed, Feb 14, 2024 at 10:16 PM Tuan Phan via groups.io  wrote:

>
>
> On Wed, Feb 14, 2024 at 9:43 PM Warkentin, Andrei <
> andrei.warken...@intel.com> wrote:
>
>> Do you mind sharing a GH branch with the patch set?
>>
> https://github.com/pttuan/edk2/tree/tphan/riscv_mmu_svpbmt
> Tuan
>
>>
>> A
>>
>> > -Original Message-
>> > From: Tuan Phan 
>> > Sent: Tuesday, February 6, 2024 7:29 PM
>> > To: devel@edk2.groups.io
>> > Cc: Kinney, Michael D ;
>> > gaolim...@byosoft.com.cn; Liu, Zhiguang ;
>> > kra...@redhat.com; ler...@redhat.com; Kumar, Rahul R
>> > ; Ni, Ray ;
>> > suni...@ventanamicro.com; Yao, Jiewen ;
>> Warkentin,
>> > Andrei ; ardb+tianoc...@kernel.org; Tuan
>> Phan
>> > 
>> > Subject: [PATCH v2 0/3] RISC-V: Support Svpbmt extension
>> >
>> > This patchset adds support for RISC-V Svpbmt extension.
>> >
>> > The GCD EFI_MEMORY_UC and EFI_MEMORY_WC attributes will be mapped to
>> > IO and NC mode defined in PBMT field.
>> >
>> > v2:
>> >   - Generated patch for each package.
>> >
>> > Tuan Phan (3):
>> >   MdePkg.dec: RISC-V: Define override bit for Svpbmt extension
>> >   UefiCpuPkg: RISC-V: MMU: Support Svpbmt extension
>> >   OvmfPkg/RiscVVirt: Override Svpbmt extension
>> >
>> >  MdePkg/MdePkg.dec |  2 ++
>> >  OvmfPkg/RiscVVirt/RiscVVirt.dsc.inc   |  2 +-
>> >  .../Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c | 25 ++-
>> >  .../BaseRiscVMmuLib/BaseRiscVMmuLib.inf   |  1 +
>> >  4 files changed, 28 insertions(+), 2 deletions(-)
>> >
>> > --
>> > 2.25.1
>>
>> 
>
>


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




[edk2-devel] [PATCH v2] SecurityPkg/SecureBootConfigDxe: Update UI according to UEFI spec

2024-02-26 Thread Tan, Ming
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4713

In UEFI_Spec_2_10_Aug29.pdf page 1694 section 35.5.4 for
EFI_BROWSER_ACTION_FORM_OPEN:
NOTE: EFI_FORM_BROWSER2_PROTOCOL.BrowserCallback() cannot be used with
this browser action because question values have not been retrieved yet.

So should not call HiiGetBrowserData() and HiiSetBrowserData() in FORM_OPEN
call back function.

Now call SecureBootExtractConfigFromVariable() to save the change to EFI
variable, then HII use EFI variable to control the UI.

Cc: Min Xu 
Cc: Jiewen Yao 
Signed-off-by: Ming Tan 
---
  V2: Change code style to pass uncrustify check.

 .../SecureBootConfigImpl.c| 37 ++-
 1 file changed, 20 insertions(+), 17 deletions(-)

diff --git 
a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c 
b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
index 2c11129526..e2e61d1e07 100644
--- 
a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
+++ 
b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
@@ -3366,6 +3366,8 @@ SecureBootExtractConfigFromVariable (
 ConfigData->FileEnrollType = UNKNOWN_FILE_TYPE;
   }
 
+  ConfigData->ListCount = Private->ListCount;
+
   //
   // If it is Physical Presence User, set the PhysicalPresent to true.
   //
@@ -4541,12 +4543,13 @@ SecureBootCallback (
   EFI_HII_POPUP_PROTOCOL  *HiiPopup;
   EFI_HII_POPUP_SELECTION UserSelection;
 
-  Status = EFI_SUCCESS;
-  SecureBootEnable   = NULL;
-  SecureBootMode = NULL;
-  SetupMode  = NULL;
-  File   = NULL;
-  EnrollKeyErrorCode = None_Error;
+  Status   = EFI_SUCCESS;
+  SecureBootEnable = NULL;
+  SecureBootMode   = NULL;
+  SetupMode= NULL;
+  File = NULL;
+  EnrollKeyErrorCode   = None_Error;
+  GetBrowserDataResult = FALSE;
 
   if ((This == NULL) || (Value == NULL) || (ActionRequest == NULL)) {
 return EFI_INVALID_PARAMETER;
@@ -4565,15 +4568,12 @@ SecureBootCallback (
 return EFI_OUT_OF_RESOURCES;
   }
 
-  GetBrowserDataResult = HiiGetBrowserData (, 
mSecureBootStorageName, BufferSize, (UINT8 *)IfrNvData);
-
   if (Action == EFI_BROWSER_ACTION_FORM_OPEN) {
 if (QuestionId == KEY_SECURE_BOOT_MODE) {
   //
   // Update secure boot strings when opening this form
   //
-  Status = UpdateSecureBootString (Private);
-  SecureBootExtractConfigFromVariable (Private, IfrNvData);
+  Status = UpdateSecureBootString (Private);
   mIsEnterSecureBootForm = TRUE;
 } else {
   //
@@ -4587,23 +4587,22 @@ SecureBootCallback (
   (QuestionId == KEY_SECURE_BOOT_DBT_OPTION))
   {
 CloseEnrolledFile (Private->FileContext);
-  } else if (QuestionId == KEY_SECURE_BOOT_DELETE_ALL_LIST) {
-//
-// Update ListCount field in varstore
-// Button "Delete All Signature List" is
-// enable when ListCount is greater than 0.
-//
-IfrNvData->ListCount = Private->ListCount;
   }
 }
 
 goto EXIT;
   }
 
+  GetBrowserDataResult = HiiGetBrowserData (, 
mSecureBootStorageName, BufferSize, (UINT8 *)IfrNvData);
+
   if (Action == EFI_BROWSER_ACTION_RETRIEVE) {
 Status = EFI_UNSUPPORTED;
 if (QuestionId == KEY_SECURE_BOOT_MODE) {
   if (mIsEnterSecureBootForm) {
+if (GetBrowserDataResult) {
+  SecureBootExtractConfigFromVariable (Private, IfrNvData);
+}
+
 Value->u8 = SECURE_BOOT_MODE_STANDARD;
 Status= EFI_SUCCESS;
   }
@@ -5179,6 +5178,10 @@ SecureBootCallback (
 }
   }
 
+  if (GetBrowserDataResult) {
+SecureBootExtractConfigFromVariable (Private, IfrNvData);
+  }
+
 EXIT:
 
   if (!EFI_ERROR (Status) && GetBrowserDataResult) {
-- 
2.31.1.windows.1



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




[edk2-devel] Event: TianoCore Bug Triage - APAC / NAMO - Tuesday, February 27, 2024 #cal-reminder

2024-02-26 Thread Group Notification
*Reminder: TianoCore Bug Triage - APAC / NAMO*

*When:*
Tuesday, February 27, 2024
6:30pm to 7:30pm
(UTC-08:00) America/Los Angeles

*Where:*
https://teams.microsoft.com/l/meetup-join/19%3ameeting_OTk1YzJhN2UtOGQwNi00NjY4LWEwMTktY2JiODRlYTY1NmY0%40thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%226e4ce4c4-1242-431b-9a51-92cd01a5df3c%22%7d

*Organizer:* Liming Gao gaolim...@byosoft.com.cn ( 
gaolim...@byosoft.com.cn?subject=Re:%20Event:%20TianoCore%20Bug%20Triage%20-%20APAC%20%2F%20NAMO
 )

View Event ( https://edk2.groups.io/g/devel/viewevent?eventid=2159760 )

*Description:*

TianoCore Bug Triage - APAC / NAMO

Hosted by Liming Gao



Microsoft Teams meeting

*Join on your computer or mobile app*

Click here to join the meeting ( 
https://teams.microsoft.com/l/meetup-join/19%3ameeting_OTk1YzJhN2UtOGQwNi00NjY4LWEwMTktY2JiODRlYTY1NmY0%40thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%226e4ce4c4-1242-431b-9a51-92cd01a5df3c%22%7d
 )

*Join with a video conferencing device*

te...@conf.intel.com

Video Conference ID: 116 062 094 0

Alternate VTC dialing instructions ( 
https://conf.intel.com/teams/?conf=1160620940=teams=conf.intel.com=test_call
 )

*Or call in (audio only)*

+1 916-245-6934,,77463821# ( tel:+19162456934,,77463821# ) United States, 
Sacramento

Phone Conference ID: 774 638 21#

Find a local number ( 
https://dialin.teams.microsoft.com/d195d438-2daa-420e-b9ea-da26f9d1d6d5?id=77463821
 ) | Reset PIN ( https://mysettings.lync.com/pstnconferencing )

Learn More ( https://aka.ms/JoinTeamsMeeting ) | Meeting options ( 
https://teams.microsoft.com/meetingOptions/?organizerId=b286b53a-1218-4db3-bfc9-3d4c5aa7669e=46c98d88-e344-4ed4-8496-4ed7712e255d=19_meeting_OTUyZTg2NjgtNDhlNS00ODVlLTllYTUtYzg1OTNjNjdiZjFh@thread.v2=0=en-US
 )


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




Re: [edk2-devel] Fixing edk2-basetools CI

2024-02-26 Thread Rebecca Cran
Is anyone familiar with how publishing to PyPi works? The "Publish to 
PyPI" step is failing:


Starting: Publish to PyPI
==
Task : Command line
Description  : Run a command line script using Bash on Linux and macOS 
and cmd.exe on Windows

Version  : 2.231.1
Author   : Microsoft Corporation
Help : 
https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line

==
Generating script.
Script contents: shell
twine upload -r Pypi-edk2-basetools --config-file 
D:\a\_temp\twineAuthenticate\HtPdQh\.pypirc dist/*
== Starting Command Output 
===
"C:\Windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL 
"D:\a\_temp\53734b8d-4c1a-4bd2-99b3-15f4d79433fc.cmd""

Uploading distributions to https://upload.pypi.org/legacy/
Uploading edk2_basetools-0.1.50-py3-none-any.whl

  0%  0.0/16.9 kB � --:-- � ?
  0%  0.0/16.9 kB � --:-- � ?
100%  16.9/16.9 kB � 00:00 � ?
100%  16.9/16.9 kB � 00:00 � ?
WARNING  Error during upload. Retry with the --verbose option for more 
details.

ERROR    HTTPError: 403 Forbidden from https://upload.pypi.org/legacy/
 Invalid or non-existent authentication information. See
 https://pypi.org/help/#invalid-auth for more information.
##[error]Cmd.exe exited with code '1'.
Finishing: Publish to PyPI

--
Rebecca Cran


On 2/13/24 12:42, Joey Vagedes wrote:

I agree - there are multiple blocking issues that will require some fixes - One 
additional thing I noted is that multiple areas still perform relative path 
imports - i.e. the import starts with `from .`.

These will all need to be updated to import from edk2basetools as some point 
soon as importing via relative paths can result in it importing the wrong file 
if the pypath environment variable is influenced. This open issue actually 
stems from that: https://github.com/tianocore/edk2-basetools/issues/110 as the 
end result is that edk2-basetools pip module can unexpectedly end up using the 
BaseTools/* source code rather than the pip module source code.

Thanks,
Joey

-Original Message-
From: Rebecca Cran 
Sent: Tuesday, February 13, 2024 11:28 AM
To: Joey Vagedes ; Rebecca Cran ; 
devel@edk2.groups.io; Kinney, Michael D ; Sean 
; Michael Kubacki 
Subject: Re: [EXTERNAL] Re: [edk2-devel] Fixing edk2-basetools CI

[You don't often get email from rebe...@bsdio.com. Learn why this is important 
at https://aka.ms/LearnAboutSenderIdentification ]

Thanks, I've updated
https://github.com/tianocore/edk2-basetools/pull/116 with the changes you 
suggested.

Unfortunately several of the tools don't work with the projects.scripts section 
because they don't have Main etc. It turns out even Ecc is currently broken in 
the edk2-basetools PyPI package because PYTHONPATH doesn't contain the parent 
directory. I'll plan to fix the issues in the near future, once I've worked 
through the other PRs.


--

Rebecca Cran


On 2/12/24 10:06, Joey Vagedes wrote:

Hello! Regarding flake8, I see. That will take some time to work through - I 
completely understand.

When ready to work through that, I suggest switching to ruff. It can resolve 
some errors automatically for you and allows you to customize it more than 
flake8 (it is also faster).

I just ran ruff on the project, showing about 11k errors. One nice thing is 
that a large majority of it is regarding importing using *. By fixing those, 
you can reduce the errors by almost 70% (to 3400 errors), so it is not *quite* 
as bad as it seems (though 3400 is still A LOT).

--
-

Regarding the setup tools question, the build-backend part of pytoml (L3) is the entry 
point that is invoked - so we are still invoking setuptools. However, it pulls the 
necessary metadata from pyproject.toml rather than setup.py's setup() function. The main 
thing that is different is the "get_version" functionality, which we replicate 
in the pyproject.toml with setuptools-scm[toml] which simply uses the latest tag to set 
the version.

--
-

Additionally, I wanted to comment on the wrappers that you mentioned.

Using the [projects.scripts] section (i.e. CLI Commands feature) is in my 
opinion the correct way to move forward as users will be able to invoke 
commands themselves easily (i.e. just call Bin2Pcd, and it will work). However, 
the wrappers will continue to be necessary until all python source is removed 
from Basetools, so that users can toggle between pip or local. However, once 

Re: [edk2-devel] [PATCH v1] SctPkg: Fixed a pinter error in DevicePathFromTextBBTestCoverage.c

2024-02-26 Thread Chao Li

Hi Heinrich,


Thanks,
Chao
On 2024/2/26 19:02, Heinrich Schuchardt wrote:

On 26.02.24 11:17, Chao Li wrote:

DevicePathFromTextBBTextCoverage.c function CreateDNSDeviceNode has a
bug, code:

SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH)));


DNS is a pointer, which is increased by a structure size and converted
to EFI_IPv4_ADDRESS*, which will point to an unknown address. So fix it.


Hello Chao,

thanks for diving into this.

Please, add

Fixes: 847e0363e846 ("SctPkg: Fix the UefiSct 
-Wincompatible-pointer-types warnings")




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

Cc: G Edhaya Chandran 
Cc: Barton Gao 
Cc: Carolyn Gjertsen 
Signed-off-by: Chao Li 
---
  .../BlackBoxTest/DevicePathFromTextBBTestCoverage.c   | 8 
  1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c 


index c96ee246..bd11c25a 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c

@@ -1734,13 +1734,13 @@ CreateDNSDeviceNode (
    }

    if (DNS->IsIPv6 == 0) {
-    SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH)));
-    SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS)));
+    SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)((UINT8 *)DNS + 
sizeof (DNS_DEVICE_PATH)));
+    SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)((UINT8 *)DNS + 
sizeof (DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS)));

    }

    if (DNS->IsIPv6 == 1) {
-    SctStrToIPv6Addr (, (EFI_IPv6_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH)));
-    SctStrToIPv6Addr (, (EFI_IPv6_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS)));
+    SctStrToIPv6Addr (, (EFI_IPv6_ADDRESS *)((UINT8 *)DNS + 
sizeof (DNS_DEVICE_PATH)));
+    SctStrToIPv6Addr (, (EFI_IPv6_ADDRESS *)((UINT8 *)DNS + 
sizeof (DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS)));


The change looks correct.

I would prefer using the fields of the DNS_DEVICE_PATH typedef from 
MdePkg/Include/Protocol/DevicePath.h to avoid the conversions:


> +    SctStrToIPv4Addr (, >DnsServerIp[0].v4)
> +    SctStrToIPv4Addr (, >DnsServerIp[1].v4)

> +    SctStrToIPv6Addr (, >DnsServerIp[0].v6)
> +    SctStrToIPv6Addr (, >DnsServerIp[1].v6)
I also prefer this way, but the definition of DNS in 
UEFI/Protocol/DevicePath.h is not same as the MdePkg version, should we 
make them the same?


Best regards

Heinrich


    }

    return (EFI_DEVICE_PATH_PROTOCOL *) DNS;
--
2.27.0









-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115995): https://edk2.groups.io/g/devel/message/115995
Mute This Topic: https://groups.io/mt/104579419/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] edk2-Redfish-client: Clarify HTTP method used for provisioning

2024-02-26 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Hi @Igor Kulchytskyy and @Mike Maslenkin,
I would like to wait until your review to make sure we all agree with the usage 
of HTTP methods in edk2 Redfish implementation.

Thanks
Abner

> -Original Message-
> From: Nickle Wang 
> Sent: Monday, February 26, 2024 9:51 PM
> To: Chang, Abner ; devel@edk2.groups.io
> Cc: Igor Kulchytskyy ; Mike Maslenkin
> 
> Subject: RE: [edk2-redfish-client][PATCH] edk2-Redfish-client: Clarify HTTP
> method used for provisioning
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Reviewed-by: Nickle Wang 
>
> Regards,
> Nickle
>
> > -Original Message-
> > From: abner.ch...@amd.com 
> > Sent: Monday, February 26, 2024 12:55 PM
> > To: devel@edk2.groups.io
> > Cc: Nickle Wang ; Igor Kulchytskyy ;
> > Mike Maslenkin 
> > Subject: [edk2-redfish-client][PATCH] edk2-Redfish-client: Clarify HTTP
> method
> > used for provisioning
> >
> > External email: Use caution opening links or attachments
> >
> >
> > From: Abner Chang 
> >
> > Clarify the HTTP method that is used to provision BIOS managed Redfish
> > resource.
> >
> > Signed-off-by: Abner Chang 
> > Cc: Nickle Wang 
> > Cc: Igor Kulchytskyy 
> > Cc: Mike Maslenkin 
> > ---
> >  RedfishClientPkg/Readme.md| 35 ---
> >  .../Media/redfish-call-flow-provisioning.svg  |  2 +-  .../Media/redfish-
> > synchronization-design.svg  |  4 +--
> >  3 files changed, 26 insertions(+), 15 deletions(-)
> >
> > diff --git a/RedfishClientPkg/Readme.md b/RedfishClientPkg/Readme.md
> index
> > 82cb9c8c99..1789dff6f8 100644
> > --- a/RedfishClientPkg/Readme.md
> > +++ b/RedfishClientPkg/Readme.md
> > @@ -310,21 +310,32 @@ job.
> >
> >  Several interfaces defined in EDKII Redfish Resource Config Protocol work
> > together to support Redfish synchronization:
> >  - Identify()
> > -  - This function is used to check if the given Redfish resource is the 
> > one the
> > feature driver wants to manage. A platform
> > -library `RedfishResourceIdentifyLib` is introduced for platform to
> implement its
> > own policy to identify Redfish resource.
> > +  - This function is used to check if the given Redfish resource is the 
> > one the
> > feature driver
> > +wants to manage. A platform library `RedfishResourceIdentifyLib` is
> > introduced for
> > +platform to implement its own policy to identify Redfish resource.
> >  - Check()
> > -  - This function is used to check the attribute status on Redfish 
> > service. If all
> > attributes the feature driver manages
> > -are presented in Redfish service, feature driver must provision them
> already.
> > Otherwise, Provisioning() will be called
> > -to perform resource provisioning job.
> > +  - This function is used to check the attribute status on Redfish 
> > service. If all
> > attributes
> > +the feature driver manages are presented in Redfish service, feature 
> > driver
> > must provision
> > +them already. Otherwise, Provisioning() will be called to perform 
> > resource
> > provisioning
> > +job.
> >  - Provisioning()
> > -  - When this function is called, feature driver will provision all 
> > attributes that
> it
> > managed to Redfish service. This
> > -operation usually create new resource at Redfish service and require
> different
> > operation that specified by Redfish service.
> > +  - When this function is called, feature driver will provision all 
> > attributes
> that it
> > managed
> > +to Redfish service. This operation usually creates the new Redfish
> properties
> > at the
> > +existing URI in Redfish service. Use HTTP PATCH to provision Redfish
> > properties as BIOS
> > +may only manage some but not all of the properties of the resource. See
> > [Redfish-edk2 implementation](#Redfish-Service-Implementation-that-
> > Incorporates-with-EDK2-Redfish) for
> > +the details. HTTP POST is still used for creating a collection member, 
> > such
> as
> > the
> > +collection member of processor or memory for the Redfish inventory
> > management.
> > +However, HTTP PUT to overwrite an entire Redfish resource is not used 
> > in
> > edk2 Redfish
> > +implementation as edk2 Redfish implementation has no idea of whether
> the
> > Redfish resource
> > +is entirely managed by BIOS or not.
> >  - Consume()
> > -  - When there is pending settings in Redfish service, this function is 
> > called
> for
> > feature driver to consume pending settings
> > -requested by user.
> > +  - When there is pending settings in Redfish service, this function is 
> > called
> for
> > feature
> > +driver to consume pending settings requested by user. HTTP GET is the
> method
> > used
> > +to retrieve Redfish properties.
> >  - Update()
> > -  - When platform configuration is updated, this function is called to 
> > update
> > configuration changes to Redfish service 

Re: [edk2-devel] [PATCH] RedfishPkg/RestJsonStructureDxe: Refine REST JSON C Structure DXE driver

2024-02-26 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

But thanks for this question. I update commit message and more some more 
explanations as below,

  Remove the references of "Redfish" from this driver.
  As REST JSON C Structure was not designed for Redfish only.
  Any RESTful applications can register the converter and
  provide JSON-C structure conversions through
  EFI_REST_JSON_STRUCTURE_PROTOCOL. Therefore this driver
  shouldn't have a dependency on Redfish package and the
  references of "Redfish" terminology.

Thanks
Abner
From: Nickle Wang 
Sent: Tuesday, February 27, 2024 8:48 AM
To: Chang, Abner ; devel@edk2.groups.io
Cc: Igor Kulchytskyy 
Subject: RE: [PATCH] RedfishPkg/RestJsonStructureDxe: Refine REST JSON C 
Structure DXE driver


[AMD Official Use Only - General]

Caution: This message originated from an External Source. Use proper caution 
when opening attachments, clicking links, or responding.

Thanks for your explanation, Abner.


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

Regards,
Nickle

From: Chang, Abner mailto:abner.ch...@amd.com>>
Sent: Tuesday, February 27, 2024 8:40 AM
To: Nickle Wang mailto:nick...@nvidia.com>>; 
devel@edk2.groups.io
Cc: Igor Kulchytskyy mailto:ig...@ami.com>>
Subject: RE: [PATCH] RedfishPkg/RestJsonStructureDxe: Refine REST JSON C 
Structure DXE driver

External email: Use caution opening links or attachments


[AMD Official Use Only - General]

Hi Nickle,
As from spec viewpoint, REST JSON C Structure was not designed for Redfish 
only. Which was designed for any RESTful application that uses JSON as the 
representation of data model.
I was proposed having this driver under MdeModulePkg long time ago when this 
driver was introduced, but as I can remember they considered this driver is 
only used by Redfish back to the moment. That's true, however this driver 
doesn't require any reference of Redfish actually.

Thanks
Abner


From: Nickle Wang mailto:nick...@nvidia.com>>
Sent: Monday, February 26, 2024 9:50 PM
To: Chang, Abner mailto:abner.ch...@amd.com>>; 
devel@edk2.groups.io
Cc: Igor Kulchytskyy mailto:ig...@ami.com>>
Subject: RE: [PATCH] RedfishPkg/RestJsonStructureDxe: Refine REST JSON C 
Structure DXE driver

Caution: This message originated from an External Source. Use proper caution 
when opening attachments, clicking links, or responding.


Hi @abner.ch...@amd.com,



RestJsonStructureDxe is a driver in RedfishPkg. May I know why we can not have 
dependency to RedfishPkg? Do we need to move it to MdeModulePkg for this goal 
(removing dependency to RedfishPkg)?



Regards,

Nickle



> -Original Message-

> From: abner.ch...@amd.com 
> mailto:abner.ch...@amd.com>>

> Sent: Monday, February 26, 2024 10:44 AM

> To: devel@edk2.groups.io

> Cc: Nickle Wang mailto:nick...@nvidia.com>>; Igor 
> Kulchytskyy mailto:ig...@ami.com>>

> Subject: [PATCH] RedfishPkg/RestJsonStructureDxe: Refine REST JSON C Structure

> DXE driver

>

> External email: Use caution opening links or attachments

>

>

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

>

> BZ #: 4711

> - Add mode debug messages.

> - This driver shouldn't have a dependency on Redfish package and

>   the references of "Redfish" terminology.

>   Remove the references of "Redfish" from this driver.

> - Fix the missing parameter of DEBUG macros used in this

>   driver.

>

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

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

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

> ---

>  .../RestJsonStructureDxe.inf  |  3 +-

>  .../RestJsonStructureInternal.h   |  3 +-

>  .../RestJsonStructureDxe.c| 96 ++-

>  3 files changed, 96 insertions(+), 6 deletions(-)

>

> diff --git a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf

> b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf

> index 61e6253d318..e74c9dfd38b 100644

> --- a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf

> +++ b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf

> @@ -2,6 +2,7 @@

>  # Implementation of EFI REST JSON Structure Protocol.

>  #

>  #  (C) Copyright 2020 Hewlett Packard Enterprise Development LP

> +#  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights

> +reserved.

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

>

> @@ -17,7 +18,6 @@

>  [Packages]

>MdePkg/MdePkg.dec

>MdeModulePkg/MdeModulePkg.dec

> -  RedfishPkg/RedfishPkg.dec

>

>  [Sources]

>RestJsonStructureDxe.c

> @@ -26,6 +26,7 @@

>  [LibraryClasses]

>BaseLib

>BaseMemoryLib

> +  DebugLib

>MemoryAllocationLib

>UefiBootServicesTableLib

>UefiDriverEntryPoint

> diff --git a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureInternal.h

> b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureInternal.h

> index 

Re: [edk2-devel] [PATCH v1 1/1] MdeModulePkg/Bus/Usb/UsbNetwork: Check array index range before access

2024-02-26 Thread Rebecca Cran

Reviewed-by: Rebecca Cran 

On 2/20/2024 8:21 AM, mikub...@linux.microsoft.com wrote:

From: Michael Kubacki 

Checks that an offset used to access array elements is within the
expected range before accessing the array item.

Cc: Liming Gao 
Cc: Ray Ni 
Cc: Rebecca Cran 
Cc: Richard Ho 
Signed-off-by: Michael Kubacki 
---
  MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcEcm/UsbEcmFunction.c  | 2 +-
  MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcNcm/UsbNcmFunction.c  | 2 +-
  MdeModulePkg/Bus/Usb/UsbNetwork/UsbRndis/UsbRndisFunction.c | 2 +-
  3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcEcm/UsbEcmFunction.c 
b/MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcEcm/UsbEcmFunction.c
index 29f4508a38ce..0c1f252b85df 100644
--- a/MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcEcm/UsbEcmFunction.c
+++ b/MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcEcm/UsbEcmFunction.c
@@ -769,7 +769,7 @@ ConvertFilter (
  
Count = sizeof (gTable)/sizeof (gTable[0]);
  
-  for (Index = 0; (gTable[Index].Src != 0) && (Index < Count); Index++) {

+  for (Index = 0; (Index < Count) && (gTable[Index].Src != 0); Index++) {
  if (gTable[Index].Src & Value) {
*CdcFilter |= gTable[Index].Dst;
  }
diff --git a/MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcNcm/UsbNcmFunction.c 
b/MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcNcm/UsbNcmFunction.c
index baa2225bf8a8..ef01a6f5458c 100644
--- a/MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcNcm/UsbNcmFunction.c
+++ b/MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcNcm/UsbNcmFunction.c
@@ -855,7 +855,7 @@ ConvertFilter (
  
Count = sizeof (gTable)/sizeof (gTable[0]);
  
-  for (Index = 0; (gTable[Index].Src != 0) && (Index < Count); Index++) {

+  for (Index = 0; (Index < Count) && (gTable[Index].Src != 0); Index++) {
  if (gTable[Index].Src & Value) {
*CdcFilter |= gTable[Index].Dst;
  }
diff --git a/MdeModulePkg/Bus/Usb/UsbNetwork/UsbRndis/UsbRndisFunction.c 
b/MdeModulePkg/Bus/Usb/UsbNetwork/UsbRndis/UsbRndisFunction.c
index 2c0dcae4cf96..6d45a1b775ba 100644
--- a/MdeModulePkg/Bus/Usb/UsbNetwork/UsbRndis/UsbRndisFunction.c
+++ b/MdeModulePkg/Bus/Usb/UsbNetwork/UsbRndis/UsbRndisFunction.c
@@ -803,7 +803,7 @@ ConvertFilter (
  
Count = sizeof (gTable)/sizeof (gTable[0]);
  
-  for (Index = 0; (gTable[Index].Src != 0) && (Index < Count); Index++) {

+  for (Index = 0; (Index < Count) && (gTable[Index].Src != 0); Index++) {
  if (gTable[Index].Src & Value) {
*CdcFilter |= gTable[Index].Dst;
  }





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115992): https://edk2.groups.io/g/devel/message/115992
Mute This Topic: https://groups.io/mt/104469090/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 2/6] RedfishPkg: implement Redfish HTTP protocol

2024-02-26 Thread Nickle Wang via groups.io
Thanks for your confirmation, Mike!

Version 3 patch set is here: https://edk2.groups.io/g/devel/message/115985

Regards,
Nickle

> -Original Message-
> From: Mike Maslenkin 
> Sent: Tuesday, February 27, 2024 8:13 AM
> To: Nickle Wang 
> Cc: devel@edk2.groups.io; Igor Kulchytskyy ; Abner Chang
> ; Nick Ramirez 
> Subject: Re: [edk2-devel] [PATCH v2 2/6] RedfishPkg: implement Redfish HTTP
> protocol
> 
> External email: Use caution opening links or attachments
> 
> 
> Hii Nickle,
> 
> 
> On Mon, Feb 26, 2024 at 4:44 PM Nickle Wang  wrote:
> >
> > Hi Mike,
> >
> > > So finally we have
> > > HttpFreeHeaderFields (Response->Headers, Response->HeaderCount); but
> > > Response->HeaderCount does not count partially allocated elements. Right?
> > >
> > > To fix this, it is required to set
> > > *DstHeaderCount = SrcHeaderCount unconditionally right after
> > > DstHeaders  allocation, and HttpFreeHeaderFields() will do the work
> > > then.
> >
> > I follow your suggestion to update DstHeaderCount right after DstHeaders is
> allocated.  So, HttpFreeHeaderFields can release headers correctly. I also 
> create a
> macro to implemented AsciiStrCpy. Please check below link to see my changes:
> > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith
> >
> ub.com%2Ftianocore%2Fedk2%2Fcompare%2F0f391b1c2f988d90a3ac723b314a
> c28b
> >
> a7b0b8df..f0fa1b8fdcd933beb52fd3127c2476443c00ef8d=05%7C02%7Cnic
> k
> >
> lew%40nvidia.com%7Cf3870f71360e44f3b4e208dc3728ff87%7C43083d1572734
> 0c1
> >
> b7db39efd9ccc17a%7C0%7C0%7C638445896465360452%7CUnknown%7CTWFp
> bGZsb3d8
> >
> eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%
> 7C0
> >
> %7C%7C%7C=K%2FEA2QWpk%2F8NHQ1QhzqkvQqao4db%2BILn1Jt%2BB
> qQ5n1E%3D
> > =0
> 
> These changes looks good. Internal strings initialization/deinitialization 
> code much
> cleaner now and possible leak seems to have been fixed.
> 
> Thank you!
> 
> Regards,
> Mike.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115991): https://edk2.groups.io/g/devel/message/115991
Mute This Topic: https://groups.io/mt/104505404/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/RestJsonStructureDxe: Refine REST JSON C Structure DXE driver

2024-02-26 Thread Nickle Wang via groups.io
Thanks for your explanation, Abner.


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

Regards,
Nickle

From: Chang, Abner 
Sent: Tuesday, February 27, 2024 8:40 AM
To: Nickle Wang ; devel@edk2.groups.io
Cc: Igor Kulchytskyy 
Subject: RE: [PATCH] RedfishPkg/RestJsonStructureDxe: Refine REST JSON C 
Structure DXE driver

External email: Use caution opening links or attachments


[AMD Official Use Only - General]

Hi Nickle,
As from spec viewpoint, REST JSON C Structure was not designed for Redfish 
only. Which was designed for any RESTful application that uses JSON as the 
representation of data model.
I was proposed having this driver under MdeModulePkg long time ago when this 
driver was introduced, but as I can remember they considered this driver is 
only used by Redfish back to the moment. That's true, however this driver 
doesn't require any reference of Redfish actually.

Thanks
Abner


From: Nickle Wang mailto:nick...@nvidia.com>>
Sent: Monday, February 26, 2024 9:50 PM
To: Chang, Abner mailto:abner.ch...@amd.com>>; 
devel@edk2.groups.io
Cc: Igor Kulchytskyy mailto:ig...@ami.com>>
Subject: RE: [PATCH] RedfishPkg/RestJsonStructureDxe: Refine REST JSON C 
Structure DXE driver

Caution: This message originated from an External Source. Use proper caution 
when opening attachments, clicking links, or responding.


Hi @abner.ch...@amd.com,



RestJsonStructureDxe is a driver in RedfishPkg. May I know why we can not have 
dependency to RedfishPkg? Do we need to move it to MdeModulePkg for this goal 
(removing dependency to RedfishPkg)?



Regards,

Nickle



> -Original Message-

> From: abner.ch...@amd.com 
> mailto:abner.ch...@amd.com>>

> Sent: Monday, February 26, 2024 10:44 AM

> To: devel@edk2.groups.io

> Cc: Nickle Wang mailto:nick...@nvidia.com>>; Igor 
> Kulchytskyy mailto:ig...@ami.com>>

> Subject: [PATCH] RedfishPkg/RestJsonStructureDxe: Refine REST JSON C Structure

> DXE driver

>

> External email: Use caution opening links or attachments

>

>

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

>

> BZ #: 4711

> - Add mode debug messages.

> - This driver shouldn't have a dependency on Redfish package and

>   the references of "Redfish" terminology.

>   Remove the references of "Redfish" from this driver.

> - Fix the missing parameter of DEBUG macros used in this

>   driver.

>

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

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

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

> ---

>  .../RestJsonStructureDxe.inf  |  3 +-

>  .../RestJsonStructureInternal.h   |  3 +-

>  .../RestJsonStructureDxe.c| 96 ++-

>  3 files changed, 96 insertions(+), 6 deletions(-)

>

> diff --git a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf

> b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf

> index 61e6253d318..e74c9dfd38b 100644

> --- a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf

> +++ b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf

> @@ -2,6 +2,7 @@

>  # Implementation of EFI REST JSON Structure Protocol.

>  #

>  #  (C) Copyright 2020 Hewlett Packard Enterprise Development LP

> +#  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights

> +reserved.

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

>

> @@ -17,7 +18,6 @@

>  [Packages]

>MdePkg/MdePkg.dec

>MdeModulePkg/MdeModulePkg.dec

> -  RedfishPkg/RedfishPkg.dec

>

>  [Sources]

>RestJsonStructureDxe.c

> @@ -26,6 +26,7 @@

>  [LibraryClasses]

>BaseLib

>BaseMemoryLib

> +  DebugLib

>MemoryAllocationLib

>UefiBootServicesTableLib

>UefiDriverEntryPoint

> diff --git a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureInternal.h

> b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureInternal.h

> index 8d7175125c1..04be5cc80b5 100644

> --- a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureInternal.h

> +++ b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureInternal.h

> @@ -3,6 +3,7 @@

>Protocol.

>

>(C) Copyright 2020 Hewlett Packard Enterprise Development LP

> +  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights

> + reserved.

>

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

>

> @@ -25,7 +26,7 @@

>  typedef struct _REST_JSON_STRUCTURE_INSTANCE {

>LIST_ENTRY   
> NextRestJsonStructureInstance; ///< Next

> convertor instance

>UINTNNumberOfNameSpaceToConvert;   
>  ///< Number

> of resource type this convertor supports.

> -  EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER   *SupportedRsrcIndentifier;

> ///< The resource type linklist

> +  EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER   *SupportedRsrcIndentifier;

> ///< The supported resource type array.

>EFI_REST_JSON_STRUCTURE_TO_STRUCTURE

[edk2-devel] [PATCH v3 6/6] RedfishPkg/RedfishCrtLib: fix unresolved external symbol issue

2024-02-26 Thread Nickle Wang via groups.io
-Fix below compiler error reported in edk2 CI.
ERROR - Linker #2001 from JsonLib.lib(load.obj) : unresolved external
symbol __ftol2
-The file MathFtol.c is copied from IntrinsicLib in CryptoPkg.
-Add MathFtol.c to EccCheck IgnoreFiles.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
Reviewed-by: Abner Chang 
Reviewed-by: Igor Kulchytskyy 
---
 .../RedfishCrtLib/RedfishCrtLib.inf   |  7 +++-
 .../RedfishCrtLib/Ia32/MathFtol.c | 37 +++
 RedfishPkg/RedfishPkg.ci.yaml |  2 +
 3 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 RedfishPkg/PrivateLibrary/RedfishCrtLib/Ia32/MathFtol.c

diff --git a/RedfishPkg/PrivateLibrary/RedfishCrtLib/RedfishCrtLib.inf 
b/RedfishPkg/PrivateLibrary/RedfishCrtLib/RedfishCrtLib.inf
index 6ff5dba75c..3a5e309d1a 100644
--- a/RedfishPkg/PrivateLibrary/RedfishCrtLib/RedfishCrtLib.inf
+++ b/RedfishPkg/PrivateLibrary/RedfishCrtLib/RedfishCrtLib.inf
@@ -3,6 +3,7 @@
 #
 # Copyright (c) 2019, Intel Corporation. All rights reserved.
 # (C) Copyright 2020 Hewlett Packard Enterprise Development LP
+# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 #
 #SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -23,6 +24,9 @@
 [Sources]
   RedfishCrtLib.c
 
+[Sources.IA32]
+  Ia32/MathFtol.c   | MSFT
+
 [LibraryClasses]
   BaseLib
   SortLib
@@ -35,4 +39,5 @@
   MdeModulePkg/MdeModulePkg.dec
   RedfishPkg/RedfishPkg.dec
 
-
+[BuildOptions]
+  MSFT:*_*_IA32_CC_FLAGS = /GL-
diff --git a/RedfishPkg/PrivateLibrary/RedfishCrtLib/Ia32/MathFtol.c 
b/RedfishPkg/PrivateLibrary/RedfishCrtLib/Ia32/MathFtol.c
new file mode 100644
index 00..e49f00eaf5
--- /dev/null
+++ b/RedfishPkg/PrivateLibrary/RedfishCrtLib/Ia32/MathFtol.c
@@ -0,0 +1,37 @@
+/** @file This file is copied from 
CryptoPkg/Library/IntrinsicLib/Ia32/MathFtol.c
+  64-bit Math Worker Function.
+  The 32-bit versions of C compiler generate calls to library routines
+  to handle 64-bit math. These functions use non-standard calling conventions.
+
+Copyright (c) 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+/*
+ * Floating point to integer conversion.
+ */
+__declspec(naked) void
+_ftol2 (
+  void
+  )
+{
+  _asm {
+fistp qword ptr [esp-8]
+mov   edx, [esp-4]
+mov   eax, [esp-8]
+ret
+  }
+}
+
+__declspec(naked) void
+_ftol2_sse (
+  void
+  )
+{
+  _asm {
+fistp dword ptr [esp-4]
+mov   eax,[esp-4]
+ret
+  }
+}
diff --git a/RedfishPkg/RedfishPkg.ci.yaml b/RedfishPkg/RedfishPkg.ci.yaml
index 69b6bf39f5..b95e8bfdc7 100644
--- a/RedfishPkg/RedfishPkg.ci.yaml
+++ b/RedfishPkg/RedfishPkg.ci.yaml
@@ -2,6 +2,7 @@
 # CI configuration for NetworkPkg
 #
 # (C) Copyright 2021 Hewlett Packard Enterprise Development LP
+# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
 {
@@ -38,6 +39,7 @@
 "PrivateInclude/Crt/string.h",
 "PrivateInclude/Crt/time.h",
 "PrivateLibrary/RedfishCrtLib/RedfishCrtLib.c",
+"PrivateLibrary/RedfishCrtLib/Ia32/MathFtol.c",
 "Include/Library/RedfishCrtLib.h",
 ##
 ## For jansson library open source
-- 
2.34.1



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




[edk2-devel] [PATCH v3 5/6] RedfishPkg/RedfishDebugLib: use RedfishHttpLib

2024-02-26 Thread Nickle Wang via groups.io
Remove RedfishLib and use RedfishHttpLib for debug printing
Redfish response data.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
Reviewed-by: Abner Chang 
Reviewed-by: Igor Kulchytskyy 
---
 RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf | 4 ++--
 RedfishPkg/Include/Library/RedfishDebugLib.h   | 2 +-
 RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.c   | 1 +
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf 
b/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
index 048d27c6dc..d468bb213b 100644
--- a/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
+++ b/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
@@ -1,7 +1,7 @@
 ## @file
 #  INF file for Redfish debug library.
 #
-#  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+#  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -32,7 +32,7 @@
   DebugLib
   JsonLib
   MemoryAllocationLib
-  RedfishLib
+  RedfishHttpLib
   UefiLib
 
 [Depex]
diff --git a/RedfishPkg/Include/Library/RedfishDebugLib.h 
b/RedfishPkg/Include/Library/RedfishDebugLib.h
index 3430cf1d14..ad7a697586 100644
--- a/RedfishPkg/Include/Library/RedfishDebugLib.h
+++ b/RedfishPkg/Include/Library/RedfishDebugLib.h
@@ -11,9 +11,9 @@
 #define REDFISH_DEBUG_LIB_H_
 
 #include 
+#include 
 #include 
 #include 
-#include 
 
 #include 
 
diff --git a/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.c 
b/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.c
index 3728f51213..8b0425b8c3 100644
--- a/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.c
+++ b/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.c
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #ifndef IS_EMPTY_STRING
-- 
2.34.1



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




[edk2-devel] [PATCH v3 4/6] RedfishPkg/RedfishLib: include RedfishServiceData.h

2024-02-26 Thread Nickle Wang via groups.io
Redfish common structures are moved to RedfishServiceData.h. Remove
them from RedfishLib.h

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
Reviewed-by: Abner Chang 
Reviewed-by: Igor Kulchytskyy 
---
 RedfishPkg/Include/Library/RedfishLib.h | 17 +
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/RedfishPkg/Include/Library/RedfishLib.h 
b/RedfishPkg/Include/Library/RedfishLib.h
index 8309a67c76..fb30ff68f6 100644
--- a/RedfishPkg/Include/Library/RedfishLib.h
+++ b/RedfishPkg/Include/Library/RedfishLib.h
@@ -70,6 +70,7 @@
 #ifndef REDFISH_LIB_H_
 #define REDFISH_LIB_H_
 
+#include 
 #include 
 
 #include 
@@ -78,22 +79,6 @@
 #define ODATA_TYPE_NAME_MAX_SIZE  128
 #define ODATA_TYPE_MAX_SIZE   128
 
-///
-/// Library class public defines
-///
-typedef  VOID  *REDFISH_SERVICE;
-typedef  VOID  *REDFISH_PAYLOAD;
-
-///
-/// Library class public structures/unions
-///
-typedef struct {
-  EFI_HTTP_STATUS_CODE*StatusCode;
-  UINTN   HeaderCount;
-  EFI_HTTP_HEADER *Headers;
-  REDFISH_PAYLOAD Payload;
-} REDFISH_RESPONSE;
-
 ///
 /// Odata type-name mapping structure.
 ///
-- 
2.34.1



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




[edk2-devel] [PATCH v3 3/6] RedfishPkg: introduce RedfishHttpLib

2024-02-26 Thread Nickle Wang via groups.io
RedfishHttpLib is a wrapper library for Redfish feature drivers to
call Redfish HTTP Protocol easily.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
Reviewed-by: Abner Chang 
Reviewed-by: Igor Kulchytskyy 
---
 RedfishPkg/RedfishPkg.dec |   5 +
 RedfishPkg/RedfishLibs.dsc.inc|   3 +-
 RedfishPkg/RedfishPkg.dsc |   3 +-
 .../Library/RedfishHttpLib/RedfishHttpLib.inf |  43 ++
 RedfishPkg/Include/Library/RedfishHttpLib.h   | 326 ++
 .../Library/RedfishHttpLib/RedfishHttpLib.c   | 585 ++
 6 files changed, 963 insertions(+), 2 deletions(-)
 create mode 100644 RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf
 create mode 100644 RedfishPkg/Include/Library/RedfishHttpLib.h
 create mode 100644 RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.c

diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec
index 114f8d2ad8..1a9c9ed7bc 100644
--- a/RedfishPkg/RedfishPkg.dec
+++ b/RedfishPkg/RedfishPkg.dec
@@ -69,6 +69,11 @@
   #
   RedfishPlatformConfigLib|Include/Library/RedfishPlatformConfigLib.h
 
+  ##  @libraryclass  Provides the library functions to access Redfish HTTP
+  #   protocol.
+  #
+  RedfishHttpLib|Include/Library/RedfishHttpLib.h
+
 [LibraryClasses.Common.Private]
   ##  @libraryclass  Provides the private C runtime library functions.
   #   CRT library is currently used by edk2 JsonLib (open source
diff --git a/RedfishPkg/RedfishLibs.dsc.inc b/RedfishPkg/RedfishLibs.dsc.inc
index 5426957da8..55846aaa9d 100644
--- a/RedfishPkg/RedfishLibs.dsc.inc
+++ b/RedfishPkg/RedfishLibs.dsc.inc
@@ -6,7 +6,7 @@
 # of EDKII network library classes.
 #
 # (C) Copyright 2021 Hewlett Packard Enterprise Development LP
-# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
 #
 #SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -21,5 +21,6 @@
   
RedfishPlatformCredentialLib|RedfishPkg/Library/RedfishPlatformCredentialIpmiLib/RedfishPlatformCredentialIpmiLib.inf
   HiiUtilityLib|RedfishPkg/Library/HiiUtilityLib/HiiUtilityLib.inf
   
RedfishPlatformConfigLib|RedfishPkg/Library/RedfishPlatformConfigLib/RedfishPlatformConfigLib.inf
+  RedfishHttpLib|RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf
 !endif
 
diff --git a/RedfishPkg/RedfishPkg.dsc b/RedfishPkg/RedfishPkg.dsc
index 5849e7cf9e..b0150043a9 100644
--- a/RedfishPkg/RedfishPkg.dsc
+++ b/RedfishPkg/RedfishPkg.dsc
@@ -4,7 +4,7 @@
 # Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.
 # (C) Copyright 2021 Hewlett-Packard Enterprise Development LP.
 # Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
-# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
 #
 #SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -74,5 +74,6 @@
   RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
   RedfishPkg/Library/HiiUtilityLib/HiiUtilityLib.inf
   RedfishPkg/Library/RedfishPlatformConfigLib/RedfishPlatformConfigLib.inf
+  RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf
 
   !include RedfishPkg/Redfish.dsc.inc
diff --git a/RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf 
b/RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf
new file mode 100644
index 00..fd53b8c2ed
--- /dev/null
+++ b/RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf
@@ -0,0 +1,43 @@
+## @file
+#  Redfish HTTP library is wrapper library for application to call Redfish
+#  HTTP protocol easily.
+#
+#  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010006
+  BASE_NAME  = RedfishHttpLib
+  FILE_GUID  = 62855D9B-441B-436B-9CA6-B7FEB7ABF54E
+  MODULE_TYPE= DXE_DRIVER
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = RedfishHttpLib| DXE_DRIVER UEFI_DRIVER
+  CONSTRUCTOR= RedfishHttpConstructor
+
+#
+#  VALID_ARCHITECTURES   = IA32 X64 EBC
+#
+
+[Sources]
+  RedfishHttpLib.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  RedfishPkg/RedfishPkg.dec
+
+[LibraryClasses]
+  BaseLib
+  DebugLib
+  UefiLib
+  UefiBootServicesTableLib
+
+[Protocols]
+  gEdkIIRedfishHttpProtocolGuid   ## CONSUMES ##
+
+[depex]
+  TRUE
+
diff --git a/RedfishPkg/Include/Library/RedfishHttpLib.h 
b/RedfishPkg/Include/Library/RedfishHttpLib.h
new file mode 100644
index 00..39b2098139
--- /dev/null
+++ b/RedfishPkg/Include/Library/RedfishHttpLib.h
@@ -0,0 +1,326 @@
+/** @file
+  This file defines the Redfish HTTP library interface.
+
+  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent

[edk2-devel] [PATCH v3 2/6] RedfishPkg: implement Redfish HTTP protocol

2024-02-26 Thread Nickle Wang via groups.io
implement Redfish HTTP protocol driver.

Signed-off-by: Nickle Wang 
Co-authored-by: Igor Kulchytskyy 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
Reviewed-by: Abner Chang 
Reviewed-by: Igor Kulchytskyy 
---
 RedfishPkg/RedfishPkg.dec |7 +-
 RedfishPkg/RedfishComponents.dsc.inc  |3 +-
 RedfishPkg/RedfishPkg.dsc |2 +
 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.inf  |   73 +
 RedfishPkg/RedfishHttpDxe/RedfishHttpData.h   |  256 
 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.h|   44 +
 .../RedfishHttpDxe/RedfishHttpOperation.h |   77 +
 RedfishPkg/RedfishHttpDxe/RedfishHttpData.c   |  667 
 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.c| 1344 +
 .../RedfishHttpDxe/RedfishHttpOperation.c |  692 +
 RedfishPkg/Redfish.fdf.inc|3 +-
 11 files changed, 3164 insertions(+), 4 deletions(-)
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.inf
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpData.h
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.h
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpOperation.h
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpData.c
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.c
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpOperation.c

diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec
index 9b424efdf3..114f8d2ad8 100644
--- a/RedfishPkg/RedfishPkg.dec
+++ b/RedfishPkg/RedfishPkg.dec
@@ -157,8 +157,11 @@
   # set to EFI_REST_EX_PROTOCOL.
   #
   
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishSendReceiveTimeout|5000|UINT32|0x1009
-  ## This is used to enable HTTP content encoding on Redfish communication.
-  
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishServiceContentEncoding|TRUE|BOOLEAN|0x100A
+  #
+  # This PCD string is introduced for platform developer to set the encoding 
method supported by BMC Redfish.
+  # Currently only "None" and "gzip" are supported.
+  #
+  
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishServiceContentEncoding|"None"|VOID*|0x100A
   #
   # Use below PCDs to control Redfhs HTTP protocol.
   #
diff --git a/RedfishPkg/RedfishComponents.dsc.inc 
b/RedfishPkg/RedfishComponents.dsc.inc
index 464ffc8606..d6c5b73d7f 100644
--- a/RedfishPkg/RedfishComponents.dsc.inc
+++ b/RedfishPkg/RedfishComponents.dsc.inc
@@ -7,7 +7,7 @@
 # "RedfishDefines.dsc.inc".
 #
 # (C) Copyright 2020-2021 Hewlett Packard Enterprise Development LP
-# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
 #
 #SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -28,4 +28,5 @@
   RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.inf
   RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.inf
   MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf
+  RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.inf
 !endif
diff --git a/RedfishPkg/RedfishPkg.dsc b/RedfishPkg/RedfishPkg.dsc
index 25ed193182..5849e7cf9e 100644
--- a/RedfishPkg/RedfishPkg.dsc
+++ b/RedfishPkg/RedfishPkg.dsc
@@ -45,6 +45,8 @@
   
UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf
   
RedfishPlatformCredentialLib|RedfishPkg/Library/PlatformCredentialLibNull/PlatformCredentialLibNull.inf
   
RedfishContentCodingLib|RedfishPkg/Library/RedfishContentCodingLibNull/RedfishContentCodingLibNull.inf
+  
ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
+  SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf
 
   # NULL instance of IPMI related library.
   IpmiLib|MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
diff --git a/RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.inf 
b/RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.inf
new file mode 100644
index 00..c7dfdffacf
--- /dev/null
+++ b/RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.inf
@@ -0,0 +1,73 @@
+## @file
+#  RedfishHttpDxe is the DXE driver which provides
+#  EdkIIRedfishHttpProtocol to EDK2 Redfish Feature
+#  drivers for HTTP operation.
+#
+#  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION= 0x0001000b
+  BASE_NAME  = RedfishHttpDxe
+  FILE_GUID  = 85ADB2F1-DA93-47D4-AF4F-3D920D9BD2C0
+  MODULE_TYPE= DXE_DRIVER
+  VERSION_STRING = 1.0
+  ENTRY_POINT= RedfishHttpEntryPoint
+  UNLOAD_IMAGE   = RedfishHttpDriverUnload
+
+#
+#  VALID_ARCHITECTURES   = IA32 X64 ARM AARCH64 RISCV64
+#
+
+[Sources]
+  RedfishHttpData.c
+  RedfishHttpData.h
+  RedfishHttpDxe.c
+  RedfishHttpDxe.h
+  RedfishHttpOperation.c
+  RedfishHttpOperation.h
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  

[edk2-devel] [PATCH v3 1/6] RedfishPkg: introduce Redfish HTTP protocol

2024-02-26 Thread Nickle Wang via groups.io
Introduce Redfish HTTP protocol to improve Redfish performance
and communication stability between BIOS and Redfish service.
- Feature drivers often query same Redfish resource multiple
times for different purpose. Implement HTTP cache mechanism to
improve HTTP GET performance. "UseCache" parameter is provided
if application likes to send HTTP GET request to Redfish service
without using cache data.
- This driver will retire stale cache data automatically when
application modify Redfish resource at service side.
- PCD PcdHttpCacheDisabled is used to disable cache mechanism in
this driver for debugging purpose.
- PCD PcdRedfishServiceContentEncoding is used to enable content
encoding while sending data to Redfish service.
- Redfish HTTP protocol also implement retry mechanism to retry
HTTP request when BIOS receive unexpected response from Redfish service.
This function helps BIOS Redfish to finish its job as much as possible.
- PCDs are defined to control how many times BIOS will retry the
request and how many time BIOS will wait between retries.

Signed-off-by: Nickle Wang 
Co-authored-by: Igor Kulchytskyy 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
Reviewed-by: Abner Chang 
Reviewed-by: Igor Kulchytskyy 
---
 RedfishPkg/RedfishPkg.dec |  24 +-
 .../Protocol/EdkIIRedfishHttpProtocol.h   | 308 ++
 RedfishPkg/Include/RedfishServiceData.h   |  43 +++
 3 files changed, 374 insertions(+), 1 deletion(-)
 create mode 100644 RedfishPkg/Include/Protocol/EdkIIRedfishHttpProtocol.h
 create mode 100644 RedfishPkg/Include/RedfishServiceData.h

diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec
index 3ea9ff3ef7..9b424efdf3 100644
--- a/RedfishPkg/RedfishPkg.dec
+++ b/RedfishPkg/RedfishPkg.dec
@@ -4,7 +4,7 @@
 # Copyright (c) 2019, Intel Corporation. All rights reserved.
 # (C) Copyright 2021 Hewlett Packard Enterprise Development LP
 # Copyright (c) 2023, American Megatrends International LLC.
-# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
@@ -93,6 +93,9 @@
   # Redfish Host Interface ready notification protocol
   gEdkIIRedfishHostInterfaceReadyProtocolGuid = { 0xC3F6D062, 0x3D38, 0x4EA4, 
{ 0x92, 0xB1, 0xE8, 0xF8, 0x02, 0x27, 0x63, 0xDF } }
 
+  ## Include/Protocol/EdkIIRedfishHttpProtocol.h
+  gEdkIIRedfishHttpProtocolGuid = { 0x58a0f47e, 0xf45f, 0x4d44, { 0x89, 0x5b, 
0x2a, 0xfe, 0xb0, 0x80, 0x15, 0xe2 } }
+
 [Guids]
   gEfiRedfishPkgTokenSpaceGuid  = { 0x4fdbccb7, 0xe829, 0x4b4c, { 0x88, 
0x87, 0xb2, 0x3f, 0xd7, 0x25, 0x4b, 0x85 }}
 
@@ -154,3 +157,22 @@
   # set to EFI_REST_EX_PROTOCOL.
   #
   
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishSendReceiveTimeout|5000|UINT32|0x1009
+  ## This is used to enable HTTP content encoding on Redfish communication.
+  
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishServiceContentEncoding|TRUE|BOOLEAN|0x100A
+  #
+  # Use below PCDs to control Redfhs HTTP protocol.
+  #
+  ## The number of retry when HTTP GET request failed. If the value is 0, 
there is no retry enabled.
+  gEfiRedfishPkgTokenSpaceGuid.PcdHttpGetRetry|0|UINT16|0x100B
+  ## The number of retry when HTTP PUT request failed. If the value is 0, 
there is no retry enabled.
+  gEfiRedfishPkgTokenSpaceGuid.PcdHttpPutRetry|0|UINT16|0x100C
+  ## The number of retry when HTTP PATCH request failed. If the value is 0, 
there is no retry enabled.
+  gEfiRedfishPkgTokenSpaceGuid.PcdHttpPatchRetry|0|UINT16|0x100D
+  ## The number of retry when HTTP POST request failed. If the value is 0, 
there is no retry enabled.
+  gEfiRedfishPkgTokenSpaceGuid.PcdHttpPostRetry|0|UINT16|0x100E
+  ## The number of retry when HTTP DELETE request failed. If the value is 0, 
there is no retry enabled.
+  gEfiRedfishPkgTokenSpaceGuid.PcdHttpDeleteRetry|0|UINT16|0x100F
+  ## The number of second to wait before driver retry HTTP request. If the 
value is 0, there is no wait before next retry.
+  gEfiRedfishPkgTokenSpaceGuid.PcdHttpRetryWaitInSecond|1|UINT16|0x1010
+  ## This is used to disable Redfish HTTP cache function and every request 
will be sent to Redfish service.
+  gEfiRedfishPkgTokenSpaceGuid.PcdHttpCacheDisabled|FALSE|BOOLEAN|0x1011
diff --git a/RedfishPkg/Include/Protocol/EdkIIRedfishHttpProtocol.h 
b/RedfishPkg/Include/Protocol/EdkIIRedfishHttpProtocol.h
new file mode 100644
index 00..59f1f865fc
--- /dev/null
+++ b/RedfishPkg/Include/Protocol/EdkIIRedfishHttpProtocol.h
@@ -0,0 +1,308 @@
+/** @file
+  This file defines the EDKII_REDFISH_HTTP_PROTOCOL interface.
+
+  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef EDKII_REDFISH_HTTP_PROTOCOL_H_
+#define EDKII_REDFISH_HTTP_PROTOCOL_H_
+
+#include 
+#include 
+#include 
+
+typedef struct _EDKII_REDFISH_HTTP_PROTOCOL 

[edk2-devel] [PATCH v3 0/6] Introduce Redfish http protocol

2024-02-26 Thread Nickle Wang via groups.io
v3: address review comments.
1) handle the condition while memory allocation failure happens to
HTTP headers. Make sure that HTTP headers can be released properly while 
calling HttpFreeHeaderFields().
2) Create macro ASCII_STR_DUPLICATE() to copy ASCII string.
3) Fix typos.

v2: address review comments.
1) add comment to show the source file of MathFtol.c
2) update macro to follow file name in RedfishHttpOperation.h

This patch series introduce Redfish HTTP protocol to RedfishPkg. 
This is to improve Redfish performance and communication stability 
between BIOS and Redfish service. Two big functions are introduced:
1) HTTP cache mechanism is implemented to reduce the number of 
communiocation between BIOS and BMC. 
2) HTTP request retry mechanism is implemented to handle communication 
failure. With retry mechanism, Redfish feature driver can finish its job 
as best as possible.

Several libraries are updated to fix build issues. Pull request is created:
https://github.com/tianocore/edk2/pull/5348

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

Nickle Wang (6):
  RedfishPkg: introduce Redfish HTTP protocol
  RedfishPkg: implement Redfish HTTP protocol
  RedfishPkg: introduce RedfishHttpLib
  RedfishPkg/RedfishLib: include RedfishServiceData.h
  RedfishPkg/RedfishDebugLib: use RedfishHttpLib
  RedfishPkg/RedfishCrtLib: fix unresolved external symbol issue

 RedfishPkg/RedfishPkg.dec |   32 +-
 RedfishPkg/RedfishComponents.dsc.inc  |3 +-
 RedfishPkg/RedfishLibs.dsc.inc|3 +-
 RedfishPkg/RedfishPkg.dsc |5 +-
 .../RedfishDebugLib/RedfishDebugLib.inf   |4 +-
 .../Library/RedfishHttpLib/RedfishHttpLib.inf |   43 +
 .../RedfishCrtLib/RedfishCrtLib.inf   |7 +-
 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.inf  |   73 +
 RedfishPkg/Include/Library/RedfishDebugLib.h  |2 +-
 RedfishPkg/Include/Library/RedfishHttpLib.h   |  326 
 RedfishPkg/Include/Library/RedfishLib.h   |   17 +-
 .../Protocol/EdkIIRedfishHttpProtocol.h   |  308 
 RedfishPkg/Include/RedfishServiceData.h   |   43 +
 RedfishPkg/RedfishHttpDxe/RedfishHttpData.h   |  256 
 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.h|   44 +
 .../RedfishHttpDxe/RedfishHttpOperation.h |   77 +
 .../Library/RedfishDebugLib/RedfishDebugLib.c |1 +
 .../Library/RedfishHttpLib/RedfishHttpLib.c   |  585 +++
 .../RedfishCrtLib/Ia32/MathFtol.c |   37 +
 RedfishPkg/RedfishHttpDxe/RedfishHttpData.c   |  667 
 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.c| 1344 +
 .../RedfishHttpDxe/RedfishHttpOperation.c |  692 +
 RedfishPkg/Redfish.fdf.inc|3 +-
 RedfishPkg/RedfishPkg.ci.yaml |2 +
 24 files changed, 4549 insertions(+), 25 deletions(-)
 create mode 100644 RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.inf
 create mode 100644 RedfishPkg/Include/Library/RedfishHttpLib.h
 create mode 100644 RedfishPkg/Include/Protocol/EdkIIRedfishHttpProtocol.h
 create mode 100644 RedfishPkg/Include/RedfishServiceData.h
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpData.h
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.h
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpOperation.h
 create mode 100644 RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.c
 create mode 100644 RedfishPkg/PrivateLibrary/RedfishCrtLib/Ia32/MathFtol.c
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpData.c
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.c
 create mode 100644 RedfishPkg/RedfishHttpDxe/RedfishHttpOperation.c

-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115983): https://edk2.groups.io/g/devel/message/115983
Mute This Topic: https://groups.io/mt/104594891/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/RestJsonStructureDxe: Refine REST JSON C Structure DXE driver

2024-02-26 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Hi Nickle,
As from spec viewpoint, REST JSON C Structure was not designed for Redfish 
only. Which was designed for any RESTful application that uses JSON as the 
representation of data model.
I was proposed having this driver under MdeModulePkg long time ago when this 
driver was introduced, but as I can remember they considered this driver is 
only used by Redfish back to the moment. That's true, however this driver 
doesn't require any reference of Redfish actually.

Thanks
Abner


From: Nickle Wang 
Sent: Monday, February 26, 2024 9:50 PM
To: Chang, Abner ; devel@edk2.groups.io
Cc: Igor Kulchytskyy 
Subject: RE: [PATCH] RedfishPkg/RestJsonStructureDxe: Refine REST JSON C 
Structure DXE driver

Caution: This message originated from an External Source. Use proper caution 
when opening attachments, clicking links, or responding.


Hi @abner.ch...@amd.com,



RestJsonStructureDxe is a driver in RedfishPkg. May I know why we can not have 
dependency to RedfishPkg? Do we need to move it to MdeModulePkg for this goal 
(removing dependency to RedfishPkg)?



Regards,

Nickle



> -Original Message-

> From: abner.ch...@amd.com 
> mailto:abner.ch...@amd.com>>

> Sent: Monday, February 26, 2024 10:44 AM

> To: devel@edk2.groups.io

> Cc: Nickle Wang mailto:nick...@nvidia.com>>; Igor 
> Kulchytskyy mailto:ig...@ami.com>>

> Subject: [PATCH] RedfishPkg/RestJsonStructureDxe: Refine REST JSON C Structure

> DXE driver

>

> External email: Use caution opening links or attachments

>

>

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

>

> BZ #: 4711

> - Add mode debug messages.

> - This driver shouldn't have a dependency on Redfish package and

>   the references of "Redfish" terminology.

>   Remove the references of "Redfish" from this driver.

> - Fix the missing parameter of DEBUG macros used in this

>   driver.

>

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

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

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

> ---

>  .../RestJsonStructureDxe.inf  |  3 +-

>  .../RestJsonStructureInternal.h   |  3 +-

>  .../RestJsonStructureDxe.c| 96 ++-

>  3 files changed, 96 insertions(+), 6 deletions(-)

>

> diff --git a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf

> b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf

> index 61e6253d318..e74c9dfd38b 100644

> --- a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf

> +++ b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf

> @@ -2,6 +2,7 @@

>  # Implementation of EFI REST JSON Structure Protocol.

>  #

>  #  (C) Copyright 2020 Hewlett Packard Enterprise Development LP

> +#  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights

> +reserved.

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

>

> @@ -17,7 +18,6 @@

>  [Packages]

>MdePkg/MdePkg.dec

>MdeModulePkg/MdeModulePkg.dec

> -  RedfishPkg/RedfishPkg.dec

>

>  [Sources]

>RestJsonStructureDxe.c

> @@ -26,6 +26,7 @@

>  [LibraryClasses]

>BaseLib

>BaseMemoryLib

> +  DebugLib

>MemoryAllocationLib

>UefiBootServicesTableLib

>UefiDriverEntryPoint

> diff --git a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureInternal.h

> b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureInternal.h

> index 8d7175125c1..04be5cc80b5 100644

> --- a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureInternal.h

> +++ b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureInternal.h

> @@ -3,6 +3,7 @@

>Protocol.

>

>(C) Copyright 2020 Hewlett Packard Enterprise Development LP

> +  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights

> + reserved.

>

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

>

> @@ -25,7 +26,7 @@

>  typedef struct _REST_JSON_STRUCTURE_INSTANCE {

>LIST_ENTRY   
> NextRestJsonStructureInstance; ///< Next

> convertor instance

>UINTNNumberOfNameSpaceToConvert;   
>  ///< Number

> of resource type this convertor supports.

> -  EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER   *SupportedRsrcIndentifier;

> ///< The resource type linklist

> +  EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER   *SupportedRsrcIndentifier;

> ///< The supported resource type array.

>EFI_REST_JSON_STRUCTURE_TO_STRUCTURE JsonToStructure;

> ///< JSON to C structure function

>EFI_REST_JSON_STRUCTURE_TO_JSON  StructureToJson;  
>  ///< C

> structure to JSON function

>EFI_REST_JSON_STRUCTURE_DESTORY_STRUCTUREDestroyStructure;

> ///< Destory C struture function.

> diff --git a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.c

> b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.c

> index 404866fb319..0da5132e5ae 100644

> --- 

Re: [edk2-devel] [PATCH v2 2/6] RedfishPkg: implement Redfish HTTP protocol

2024-02-26 Thread Mike Maslenkin
Hii Nickle,


On Mon, Feb 26, 2024 at 4:44 PM Nickle Wang  wrote:
>
> Hi Mike,
>
> > So finally we have
> > HttpFreeHeaderFields (Response->Headers, Response->HeaderCount);
> > but Response->HeaderCount does not count partially allocated elements. 
> > Right?
> >
> > To fix this, it is required to set
> > *DstHeaderCount = SrcHeaderCount unconditionally right after
> > DstHeaders  allocation, and HttpFreeHeaderFields() will do the work
> > then.
>
> I follow your suggestion to update DstHeaderCount right after DstHeaders is 
> allocated.  So, HttpFreeHeaderFields can release headers correctly. I also 
> create a macro to implemented AsciiStrCpy. Please check below link to see my 
> changes:
> https://github.com/tianocore/edk2/compare/0f391b1c2f988d90a3ac723b314ac28ba7b0b8df..f0fa1b8fdcd933beb52fd3127c2476443c00ef8d

These changes looks good. Internal strings
initialization/deinitialization code much cleaner now and possible
leak seems to have been fixed.

Thank you!

Regards,
Mike.


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




[edk2-devel] Cancelled Event: Tools, CI, Code base construction meeting series - Monday, February 26, 2024 #cal-cancelled

2024-02-26 Thread Group Notification
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Groups.io Inc//Groups.io Calendar//EN
METHOD:CANCEL
REFRESH-INTERVAL;VALUE=DURATION:PT1H
X-PUBLISHED-TTL:PT1H
CALSCALE:GREGORIAN
BEGIN:VTIMEZONE
TZID:America/Los_Angeles
LAST-MODIFIED:20231222T233358Z
TZURL:https://www.tzurl.org/zoneinfo-outlook/America/Los_Angeles
X-LIC-LOCATION:America/Los_Angeles
BEGIN:DAYLIGHT
TZNAME:PDT
TZOFFSETFROM:-0800
TZOFFSETTO:-0700
DTSTART:19700308T02
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:PST
TZOFFSETFROM:-0700
TZOFFSETTO:-0800
DTSTART:19701101T02
RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
X-GIOIDS:Event:2159765 
UID:rvop.1647284497725488626.j...@groups.io
DTSTAMP:20240226T234626Z
ORGANIZER;CN=devel@edk2.groups.io Group;SENT-BY="mailto:devel@edk2.groups
 .io":mailto:devel@edk2.groups.io
DTSTART:20240227T003000Z
DTEND:20240227T013000Z
SUMMARY:Tools\, CI\, Code base construction meeting series
DESCRIPTION:TianoCore community\,\n\nMicrosoft and Intel will be hosting 
 a series of open meetings to discuss build\, CI\, tools\, and other relat
 ed topics. If you are interested\, have ideas/opinions please join us. Th
 ese meetings will be Monday 4:30pm Pacific Time on Microsoft Teams.\n\nMS
  Teams Link in following discussion:\n* https://github.com/tianocore/edk2
 /discussions/2614\n\nAnyone is welcome to join.\n\n* tianocore/edk2: EDK 
 II (github.com)\n* tianocore/edk2-basetools: EDK II BaseTools Python tool
 s as a PIP module (github.com) https://github.com/tianocore/edk2-basetool
 s\n* tianocore/edk2-pytool-extensions: Extensions to the edk2 build syste
 m allowing for a more robust and plugin based build system and tool execu
 tion environment (github.com) https://github.com/tianocore/edk2-pytool-ex
 tensions\n* tianocore/edk2-pytool-library: Python library package that su
 pports UEFI development (github.com) https://github.com/tianocore/edk2-py
 tool-library\n\nMS Teams Browser Clients\n* https://docs.microsoft.com/en
 -us/microsoftteams/get-clients?tabs=Windows#browser-client
LOCATION:https://teams.microsoft.com/l/meetup-join/19%3ameeting_ZDI2ZDg4N
 mMtMjI1My00MzI5LWFmYjAtMGQyNjUzNTBjZGYw%40thread.v2/0?context=%7b%22Tid%2
 2%3a%2272f988bf-86f1-41af-91ab-2d7cd011db47%22%2c%22Oid%22%3a%2223af6561-
 6e1c-450d-b917-d9d674eb3cb6%22%7d
SEQUENCE:1
STATUS:CANCELLED
END:VEVENT
END:VCALENDAR


invite.ics
Description: application/ics


[edk2-devel] Event: Tools, CI, Code base construction meeting series - Monday, February 26, 2024 #cal-reminder

2024-02-26 Thread Group Notification
*Reminder: Tools, CI, Code base construction meeting series*

*When:*
Monday, February 26, 2024
4:30pm to 5:30pm
(UTC-08:00) America/Los Angeles

*Where:*
https://teams.microsoft.com/l/meetup-join/19%3ameeting_ZDI2ZDg4NmMtMjI1My00MzI5LWFmYjAtMGQyNjUzNTBjZGYw%40thread.v2/0?context=%7b%22Tid%22%3a%2272f988bf-86f1-41af-91ab-2d7cd011db47%22%2c%22Oid%22%3a%2223af6561-6e1c-450d-b917-d9d674eb3cb6%22%7d

View Event ( https://edk2.groups.io/g/devel/viewevent?eventid=2159765 )

*Description:*

TianoCore community,

Microsoft and Intel will be hosting a series of open meetings to discuss build, 
CI, tools, and other related topics. If you are interested, have ideas/opinions 
please join us. These meetings will be Monday 4:30pm Pacific Time on Microsoft 
Teams.

MS Teams Link in following discussion: * 
https://github.com/tianocore/edk2/discussions/2614

Anyone is welcome to join.

* tianocore/edk2: EDK II (github.com)
* tianocore/edk2-basetools: EDK II BaseTools Python tools as a PIP module 
(github.com) https://github.com/tianocore/edk2-basetools
* tianocore/edk2-pytool-extensions: Extensions to the edk2 build system 
allowing for a more robust and plugin based build system and tool execution 
environment (github.com) https://github.com/tianocore/edk2-pytool-extensions
* tianocore/edk2-pytool-library: Python library package that supports UEFI 
development (github.com) https://github.com/tianocore/edk2-pytool-library

MS Teams Browser Clients * 
https://docs.microsoft.com/en-us/microsoftteams/get-clients?tabs=Windows#browser-client


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




Re: [edk2-devel] [PATCH v3 0/6] UefiCpuPkg/MpInitLib: Add support for multiple MP_HAND_OFF HOBs

2024-02-26 Thread Laszlo Ersek
On 2/26/24 16:19, Laszlo Ersek wrote:
> On 2/22/24 17:01, Gerd Hoffmann wrote:
>> Needed to boot guests with thousands of vcpus.
>>
>> v3:
>>  - refine comments and commit messages.
>>  - fix MaxCpusPerHob calculation.
>>  - pick up review tags.
>>  - add patch to speed up GetBspNumber a bit.
>> v2:
>>  - rework HOB loops for better performance: O(n) instead of O(n^2).
>>
>> Gerd Hoffmann (6):
>>   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to GetMpHandOffHob
>>   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to GetBspNumber()
>>   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to
>> SwitchApContext()
>>   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to
>> MpInitLibInitialize
>>   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to SaveCpuMpData()
>>   UefiCpuPkg/MpInitLib: return early in GetBspNumber()
>>
>>  UefiCpuPkg/Library/MpInitLib/MpLib.h|  14 ++-
>>  UefiCpuPkg/Library/MpInitLib/MpLib.c| 157 +++-
>>  UefiCpuPkg/Library/MpInitLib/PeiMpLib.c |  44 ---
>>  3 files changed, 142 insertions(+), 73 deletions(-)
>>
> 
> BTW, differences in PR#5410 relative to v3 as posted:
> 
> 1:  678ed78d24a3 ! 1:  ecd6c4bb3396 UefiCpuPkg/MpInitLib: Add support for 
> multiple HOBs to GetMpHandOffHob
> @@ Commit message
> 
>  Signed-off-by: Gerd Hoffmann 
>  Message-Id: <20240222160106.686484-2-kra...@redhat.com>
> +Reviewed-by: Ray Ni 
> +Reviewed-by: Laszlo Ersek 
> 
>   ## UefiCpuPkg/Library/MpInitLib/MpLib.h ##
>  @@ UefiCpuPkg/Library/MpInitLib/MpLib.h: SwitchApContext (
> 2:  23b3e66f9935 = 2:  189467980103 UefiCpuPkg/MpInitLib: Add support for 
> multiple HOBs to GetBspNumber()
> 3:  e712d36775d0 = 3:  8ab0f63c0f04 UefiCpuPkg/MpInitLib: Add support for 
> multiple HOBs to SwitchApContext()
> 4:  9a81417f4b76 ! 4:  995a8ace7801 UefiCpuPkg/MpInitLib: Add support for 
> multiple HOBs to MpInitLibInitialize
> @@ Commit message
>  Signed-off-by: Gerd Hoffmann 
>  Reviewed-by: Ray Ni 
>  Message-Id: <20240222160106.686484-5-kra...@redhat.com>
> +Reviewed-by: Laszlo Ersek 
> 
>   ## UefiCpuPkg/Library/MpInitLib/MpLib.c ##
>  @@ UefiCpuPkg/Library/MpInitLib/MpLib.c: MpInitLibInitialize (
> 5:  3a089b25725e ! 5:  f23c0d125e48 UefiCpuPkg/MpInitLib: Add support for 
> multiple HOBs to SaveCpuMpData()
> @@ Commit message
> 
>  Signed-off-by: Gerd Hoffmann 
>  Message-Id: <20240222160106.686484-6-kra...@redhat.com>
> +Reviewed-by: Ray Ni 
> +Reviewed-by: Laszlo Ersek 
> +[ler...@redhat.com: define one local variable per line [Ray]]
> 
>   ## UefiCpuPkg/Library/MpInitLib/PeiMpLib.c ##
>  @@ UefiCpuPkg/Library/MpInitLib/PeiMpLib.c: SaveCpuMpData (
> IN CPU_MP_DATA  *CpuMpData
> )
>   {
> -+  UINT32   MaxCpusPerHob, CpusInHob;
> ++  UINT32   MaxCpusPerHob;
> ++  UINT32   CpusInHob;
> UINT64   Data64;
>  -  UINTNIndex;
> -+  UINT32   Index, HobBase;
> ++  UINT32   Index;
> ++  UINT32   HobBase;
> CPU_INFO_IN_HOB  *CpuInfoInHob;
> MP_HAND_OFF  *MpHandOff;
> UINTNMpHandOffSize;
> 6:  09435495e6e1 ! 6:  fbd8a114cd6e UefiCpuPkg/MpInitLib: return early in 
> GetBspNumber()
> @@ Commit message
>  Suggested-by: Laszlo Ersek 
>  Signed-off-by: Gerd Hoffmann 
>  Message-Id: <20240222160106.686484-7-kra...@redhat.com>
> +Reviewed-by: Ray Ni 
> +Reviewed-by: Laszlo Ersek 
> +[ler...@redhat.com: s/ASSERT (FALSE)/ASSERT_EFI_ERROR 
> (EFI_NOT_FOUND)/ [Ray]]
> 
>   ## UefiCpuPkg/Library/MpInitLib/MpLib.c ##
>  @@ UefiCpuPkg/Library/MpInitLib/MpLib.c: GetBspNumber (
> @@ UefiCpuPkg/Library/MpInitLib/MpLib.c: GetBspNumber (
>  -  ASSERT (BspNumber != MAX_UINT32);
>  -
>  -  return BspNumber;
> -+  ASSERT (FALSE);
> ++  ASSERT_EFI_ERROR (EFI_NOT_FOUND);
>  +  return 0;
>   }
> 

Merged as commit range 1f161a7915e1..d25421d0d8cd, via
.

Laszlo



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




回复: [edk2-devel] [PATCH v1 1/1] MdeModulePkg/Bus/Usb/UsbNetwork: Check array index range before access

2024-02-26 Thread gaoliming via groups.io
This change is good to me. Reviewed-by: Liming Gao


> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Michael
> Kubacki
> 发送时间: 2024年2月20日 23:22
> 收件人: devel@edk2.groups.io
> 抄送: Liming Gao ; Ray Ni ;
> Rebecca Cran ; Richard Ho 
> 主题: [edk2-devel] [PATCH v1 1/1] MdeModulePkg/Bus/Usb/UsbNetwork:
> Check array index range before access
> 
> From: Michael Kubacki 
> 
> Checks that an offset used to access array elements is within the
> expected range before accessing the array item.
> 
> Cc: Liming Gao 
> Cc: Ray Ni 
> Cc: Rebecca Cran 
> Cc: Richard Ho 
> Signed-off-by: Michael Kubacki 
> ---
>  MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcEcm/UsbEcmFunction.c  |
> 2 +-
>  MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcNcm/UsbNcmFunction.c  |
> 2 +-
>  MdeModulePkg/Bus/Usb/UsbNetwork/UsbRndis/UsbRndisFunction.c | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git
> a/MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcEcm/UsbEcmFunction.c
> b/MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcEcm/UsbEcmFunction.c
> index 29f4508a38ce..0c1f252b85df 100644
> --- a/MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcEcm/UsbEcmFunction.c
> +++ b/MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcEcm/UsbEcmFunction.c
> @@ -769,7 +769,7 @@ ConvertFilter (
> 
>Count = sizeof (gTable)/sizeof (gTable[0]);
> 
> -  for (Index = 0; (gTable[Index].Src != 0) && (Index < Count); Index++) {
> +  for (Index = 0; (Index < Count) && (gTable[Index].Src != 0); Index++) {
>  if (gTable[Index].Src & Value) {
>*CdcFilter |= gTable[Index].Dst;
>  }
> diff --git
> a/MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcNcm/UsbNcmFunction.c
> b/MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcNcm/UsbNcmFunction.c
> index baa2225bf8a8..ef01a6f5458c 100644
> --- a/MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcNcm/UsbNcmFunction.c
> +++
> b/MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcNcm/UsbNcmFunction.c
> @@ -855,7 +855,7 @@ ConvertFilter (
> 
>Count = sizeof (gTable)/sizeof (gTable[0]);
> 
> -  for (Index = 0; (gTable[Index].Src != 0) && (Index < Count); Index++) {
> +  for (Index = 0; (Index < Count) && (gTable[Index].Src != 0); Index++) {
>  if (gTable[Index].Src & Value) {
>*CdcFilter |= gTable[Index].Dst;
>  }
> diff --git
> a/MdeModulePkg/Bus/Usb/UsbNetwork/UsbRndis/UsbRndisFunction.c
> b/MdeModulePkg/Bus/Usb/UsbNetwork/UsbRndis/UsbRndisFunction.c
> index 2c0dcae4cf96..6d45a1b775ba 100644
> --- a/MdeModulePkg/Bus/Usb/UsbNetwork/UsbRndis/UsbRndisFunction.c
> +++ b/MdeModulePkg/Bus/Usb/UsbNetwork/UsbRndis/UsbRndisFunction.c
> @@ -803,7 +803,7 @@ ConvertFilter (
> 
>Count = sizeof (gTable)/sizeof (gTable[0]);
> 
> -  for (Index = 0; (gTable[Index].Src != 0) && (Index < Count); Index++) {
> +  for (Index = 0; (Index < Count) && (gTable[Index].Src != 0); Index++) {
>  if (gTable[Index].Src & Value) {
>*CdcFilter |= gTable[Index].Dst;
>  }
> --
> 2.40.1.vfs.0.0
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#115654):
> https://edk2.groups.io/g/devel/message/115654
> Mute This Topic: https://groups.io/mt/104469090/4905953
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub
> [gaolim...@byosoft.com.cn]
> -=-=-=-=-=-=
> 





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115977): https://edk2.groups.io/g/devel/message/115977
Mute This Topic: https://groups.io/mt/104586147/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 0/3] Fix Runtime Granularity Issues

2024-02-26 Thread Oliver Smith-Denny

Hi Liming,

Now that the stable tag is finished, can you review this MdeModulePkg patch?

Thanks,
Oliver

On 2/16/2024 5:27 PM, Oliver Smith-Denny wrote:

This patch series is the second version of
MdeModulePkg: DxeCore: Don't Guard Large Runtime Granularity Allocations​.
The subject line has been updated because this went from a one commit
patch with no cover letter to a multi-commit patch.

The commit messages cover the vast amount of detail here, but this
patchset fixes three issues:
- a UEFI spec violation for which memory types require runtime page
allocation granularity alignment
- An incompatibility of the heap guard system to guard these regions
that require runtime page allocation granularities greater than
the EFI_PAGE_SIZE.
- A CodeQL error that fails CI when updating the Page.c code

v2:
- Add commit to fix UEFI spec violation
- Add commit to fix newly flagged CodeQL error
- Update guard commit message, comments, and static assert to use
the correct types

Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
Cc: Sami Mujawar 
Cc: Liming Gao 

Oliver Smith-Denny (3):
   MdeModulePkg: DxeCore: Fix CodeQL Error in FreePages
   MdeModulePkg: DxeCore: Correct Runtime Granularity Memory Type
   MdeModulePkg: DxeCore: Do Not Apply Guards to Unsupported Types

  MdeModulePkg/MdeModulePkg.dec | 10 +
  MdeModulePkg/Core/Dxe/Mem/HeapGuard.h | 14 +
  MdeModulePkg/Core/Dxe/Mem/Page.c  | 22 +---
  MdeModulePkg/Core/Dxe/Mem/Pool.c  | 15 +++--
  MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c |  4 ++--
  MdeModulePkg/Core/Pei/Memory/MemoryServices.c |  2 +-
  6 files changed, 59 insertions(+), 8 deletions(-)




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




Re: [edk2-devel] [PATCH v3 0/6] UefiCpuPkg/MpInitLib: Add support for multiple MP_HAND_OFF HOBs

2024-02-26 Thread Laszlo Ersek
Hi Joey,
On 2/26/24 16:41, Joey Vagedes wrote:
> Hi Lazlo,
> 
> I just looked at the pipelines - Looks like everything is fine, there is just 
> currently a backup of runners of jobs in the runners. It is common for jobs 
> that end in CODE_COVERAGE to appear frozen in queued status, but this is 
> expected as this job not queued until all others have finished, which means 
> it gets put at the end of the list of pipelines to execute.
> 
> Taking a look at all the runners 
> (https://dev.azure.com/tianocore/edk2-ci/_settings/buildqueue?_a=concurrentJobs
>  [Click "Microsoft Hosted", "View in-progress jobs"]), I don't see any 
> runners that are frozen, which is why it appears it's just a backup.
> 
> I'll continue to monitor.

thanks -- meanwhile I've also found the blockage, just from a different
perspective.

I've known for a while that it is not ideal to have multiple PRs open at
the same time with the "push" label set. They will either compete for
resources (slow), or one will block the other ("queued" state); however,
the main annoyance is that once the first PR gets merged, the HEAD of
the master branch will move for all the other PRs, and then those PRs
will fail to merge even if their CIs run to completion. So in such
cases, the maintainer needs to notice the problem in the first place
(possibly after having waited for 30+ minutes), then perform a manual
rebase (using the github web UI or a local rebase + force push), and
then pray that their next attempt will get to the front of the queue.

It would be much better if:

- *either* the "preempted" PRs rebased themselves automatically to the
new master HEAD, and restarted the CI + merge train,

- *or*, if at least one PR with "push" were in progress at the time of
the maintainer creating a new PR with "push", the CI run wouldn't even
*start* -- instead, the maintainer would *immediately* get information
about being blocked (and about the inevitable need to rebase later, once
that "other" -- earlier-filed -- PR completes).

Now, I've been trying to implement strategy#2 myself, by checking the
"open PRs" view (with an eye towards the "push" label among those PRs)
just before submitting a PR myself. I did that this time as well, but
didn't see any concurrent push-PR. That's why I was confused -- first I
didn't understand what blocked my CI tasks, and then I didn't understand
what had preempted (= de-synced) my PR. When I fetched locally afresh, I
found two new commits, but didn't understand where those had come from,
given that I couldn't see any push-PR concurrently to mine.

*However*, searching my edk2-devel folder for the subjects of those
suddenly appearing new commits, I figured out the problem: PR
 was created in *December*
last year, but Liming set the "push" label on it only ~2 hours ago. In
other words, PR#5187 was the one to hold up and preempt mine. So, why
did I not see it in the "open PRs" view? (Because, as I wrote above, if
I had seen it, I wouldn't have submitted mine in the first place -- I'd
have known it would be useless, due to the master branch moving forward
anyway!)

Well the reason I didn't see PR#5187 (donning the "push" label at that)
was that PR#5187 had been *old as heck*, and so it simply didn't make
the first page of the "open PRs" listing! I didn't expect two months old
PRs to be merged.

So, my lesson from this is: it's not the plain "open PRs" view that I
need to check, when implementing approach #2 myself. Instead, I have to
explicitly search for open PRs with the "push" label:

https://github.com/tianocore/edk2/labels/push

Thanks!
Laszlo



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




Re: [edk2-devel] [PATCH v3 0/6] UefiCpuPkg/MpInitLib: Add support for multiple MP_HAND_OFF HOBs

2024-02-26 Thread Laszlo Ersek
On 2/26/24 16:41, Joey Vagedes via groups.io wrote:

> Taking a look at all the runners
> (https://dev.azure.com/tianocore/edk2-ci/_settings/buildqueue?_a=concurrentJobs
> [Click "Microsoft Hosted", "View in-progress jobs"]), I don't see any
> runners that are frozen, which is why it appears it's just a backup.

... unfortunately this URL seems to require a Microsoft account; it's
not publicly accessible.

Laszlo



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




Re: [edk2-devel] [PATCH v3 0/6] UefiCpuPkg/MpInitLib: Add support for multiple MP_HAND_OFF HOBs

2024-02-26 Thread Joey Vagedes via groups.io
Hi Lazlo,

I just looked at the pipelines - Looks like everything is fine, there is just 
currently a backup of runners of jobs in the runners. It is common for jobs 
that end in CODE_COVERAGE to appear frozen in queued status, but this is 
expected as this job not queued until all others have finished, which means it 
gets put at the end of the list of pipelines to execute.

Taking a look at all the runners 
(https://dev.azure.com/tianocore/edk2-ci/_settings/buildqueue?_a=concurrentJobs 
[Click "Microsoft Hosted", "View in-progress jobs"]), I don't see any runners 
that are frozen, which is why it appears it's just a backup.

I'll continue to monitor.

Thanks,
Joey

-Original Message-
From: Laszlo Ersek 
Sent: Monday, February 26, 2024 7:08 AM
To: devel@edk2.groups.io; kra...@redhat.com
Cc: Ni, Ray ; Rahul Kumar ; Oliver 
Steffen ; Kinney, Michael D ; 
Sean Brogan ; Joey Vagedes 

Subject: [EXTERNAL] Re: [edk2-devel] [PATCH v3 0/6] UefiCpuPkg/MpInitLib: Add 
support for multiple MP_HAND_OFF HOBs

[You don't often get email from ler...@redhat.com. Learn why this is important 
at https://aka.ms/LearnAboutSenderIdentification ]

On 2/22/24 17:01, Gerd Hoffmann wrote:
> Needed to boot guests with thousands of vcpus.
>
> v3:
>  - refine comments and commit messages.
>  - fix MaxCpusPerHob calculation.
>  - pick up review tags.
>  - add patch to speed up GetBspNumber a bit.
> v2:
>  - rework HOB loops for better performance: O(n) instead of O(n^2).
>
> Gerd Hoffmann (6):
>   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to GetMpHandOffHob
>   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to GetBspNumber()
>   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to
> SwitchApContext()
>   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to
> MpInitLibInitialize
>   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to SaveCpuMpData()
>   UefiCpuPkg/MpInitLib: return early in GetBspNumber()
>
>  UefiCpuPkg/Library/MpInitLib/MpLib.h|  14 ++-
>  UefiCpuPkg/Library/MpInitLib/MpLib.c| 157 +++-
>  UefiCpuPkg/Library/MpInitLib/PeiMpLib.c |  44 ---
>  3 files changed, 142 insertions(+), 73 deletions(-)

I created PR  with the "push" 
label set 40 minutes ago, for merging this series; however, the CI system seems 
to be stuck. Everything on Azure seems to be in Queued status, nothing is 
running.

Any ideas?

Thanks!
Laszlo



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115972): https://edk2.groups.io/g/devel/message/115972
Mute This Topic: https://groups.io/mt/104510905/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] MdeModulePkg: Load Serial driver earlier in DXE

2024-02-26 Thread Laszlo Ersek
On 2/26/24 16:13, Albecki, Mateusz wrote:
> 1. Using SerialDxe instead of PciSioSerialDxe - from our perspective
> the main idea is to avoid maintaining our own implementation of
> functions that actually communicate with UART controller. To use
> SerialDxe we would have to still maintain our own SerialPortLib that
> actually goes and sends data over UART. Also a note on LPSS UART - in
> terms of registers it is just a standard UART controller, the only
> quirk here is how to access it hence the custom PCI_IO_PROTOCOL
> implementation.

Is it possible to factor out a common base library class (with just one
instance) for accessing an LPSS UART? I guess the PCI B/D/F numbers
would have to be passed to the individual functions.

Then that library could be used in PciSioSerialDxe, and also in a (thin
wrapper) SerialPortLib instance.

>
> 2. Using ConnectController before BDS - I noticed that the section I
> quoted says that BDS will use ConnectController however it doesn't say
> that it can't be used outside of that context. I did search the UEFI
> spec to see whether it provides additional restrictions and the only
> section that elaborates on this is the following:
> /"Under the UEFI Driver Model , the act of connecting and
> disconnecting drivers from controllers in a platform is under the
> platform firmware’s control. This will typically be implemented as
> part of the UEFI Boot Manager, but other implementations are possible.
> " - from  Section 2.5.6 Platform components/ It seems to be rather
> permissive when it comes to who and when can call it.
>
> 3. How to make sure dispatch is early enough and not too late - this
> will depend on the overall platform implementation. For our part - we
> simply put it into flash as early as we can get away with. Even
> apriori section isn't strictly necessary if the platform is
> comfortable with relying on the fact that DXE core in MdeModulePkg
> dispatches modules in order of their placement in flash(that's not
> architectural as far as I know). Other platforms might choose to
> introduce explicit depex on gEfiSerialIoProtocolGuid. To reiterate
> this is the implementation that works for us in a sense that we get
> logs from all modules that change frequently from generation to
> generation, I understand that the same might not be true for platforms
> other than Intel however I think majority of platforms could still
> make at least some use of early UART debugging.
>
> 4. When exactly do we connect LPSS UART and start logging - we try to
> be as early as possible for this interface. We miss all of DXE_CORE
> logs(obviously), Pcd.inf and a couple of modules that implement some
> of the architectural protocols(from PciSio perspective metronome is
> the only actually required as far as we can tell since stall has to
> work).
>
> I also want to note that I get why this is a controversial change. I
> didn't realize it earlier but it would be the first DXE_DRIVER in EDK2
> tree that implements driver binding and in general it is strange to
> have PCI device driver that could potentially dispatch before PCI bus
> driver(however it is worth noting here that PciSioSerialDxe is not
> just a PCI driver, it is a combo driver capable of supporting PCI and
> SIO). That said I still think EDK2 in general needs a way to support
> early device drivers and using DXE_DRIVER seems like the least
> invasive idea. We need early drivers not just for debug(although that
> is one of the most important use cases I would say) other important
> use case is platform management through SMBUS/I2C/other serial
> interface which might be required to even be able to enumerate full
> PCI hierarchy(for instance some of the PCI slots might be powered down
> and you need to power them on sending commands over I2C) or maybe
> flash access to EFI variable storage(nothing says that you can't have
> it connected to PCI SPI controller) or maybe GPIO control to do any
> number of platform specific things.

To my eyes, this series saves a bit of refactoring now and the
maintenance of a thin wrapper library instance later, in exchange for a
very unconventional solution in MdeModulePkg that is not easily reusable
by other platforms. I don't like that trade-off; it makes me
uncomfortable.

If Liming and Mike accept this solution, I won't try to block it. In
that case however, please document the design (all we've discussed thus
far) in the "PciSioSerialDxeEarly.inf" file, in a (long) series of
comments.

Thanks
Laszlo



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115971): https://edk2.groups.io/g/devel/message/115971
Mute This Topic: https://groups.io/mt/104469297/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 1/2] MdePkg/SmBios.h: Add New ProcessorFamily definitions for SMBIOS Type4

2024-02-26 Thread Zeng, Star
Reviewed-by: Star Zeng  to this series.

-Original Message-
From: gaoliming  
Sent: Monday, February 26, 2024 9:32 PM
To: devel@edk2.groups.io; Lou, Yun 
Cc: Liu, Zhiguang ; Bi, Dandan ; 
Zeng, Star ; Gao, Zhichao ; Lin, 
Benny ; Guo, Gua ; Kinney, Michael D 

Subject: 回复: [edk2-devel] [PATCH v4 1/2] MdePkg/SmBios.h: Add New 
ProcessorFamily definitions for SMBIOS Type4

Reviewed-by: Liming Gao 

> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Jason Lou
> 发送时间: 2024年2月25日 17:06
> 收件人: devel@edk2.groups.io
> 抄送: Jason Lou ; Zhiguang Liu
;
> Dandan Bi ; Star Zeng ; 
> Zhichao Gao ; Benny Lin ; 
> Gua Guo ; Michael D Kinney 
> ; Liming Gao 
> 主题: [edk2-devel] [PATCH v4 1/2] MdePkg/SmBios.h: Add New 
> ProcessorFamily definitions for SMBIOS Type4
> 
> From: Jason Lou 
> 
> The patch adds new ProcessorFamily definitions for SMBIOS Type4 based 
> on SMBIOS 3.8.0.
> 
> Signed-off-by: Jason Lou 
> Cc: Zhiguang Liu 
> Cc: Dandan Bi 
> Cc: Star Zeng 
> Cc: Zhichao Gao 
> Cc: Benny Lin 
> Cc: Gua Guo 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> ---
>  MdePkg/Include/IndustryStandard/SmBios.h | 14 +++---
>  1 file changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/MdePkg/Include/IndustryStandard/SmBios.h
> b/MdePkg/Include/IndustryStandard/SmBios.h
> index 56cec615a0..bdb28fc3a3 100644
> --- a/MdePkg/Include/IndustryStandard/SmBios.h
> +++ b/MdePkg/Include/IndustryStandard/SmBios.h
> @@ -1,7 +1,7 @@
>  /** @file
> 
> -  Industry Standard Definitions of SMBIOS Table Specification v3.7.0.
> 
> +  Industry Standard Definitions of SMBIOS Table Specification v3.8.0.
> 
> 
> 
> -Copyright (c) 2006 - 2023, Intel Corporation. All rights 
> reserved.
> 
> +Copyright (c) 2006 - 2024, Intel Corporation. All rights 
> +reserved.
> 
>  (C) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
> 
>  (C) Copyright 2015 - 2019 Hewlett Packard Enterprise Development 
> LP
> 
>  Copyright (c) 2022, AMD Incorporated. All rights reserved.
> 
> @@ -774,7 +774,15 @@ typedef enum {
>ProcessorFamilyQuadCoreLoongson3B  = 0x026E,
> 
>ProcessorFamilyMultiCoreLoongson3B = 0x026F,
> 
>ProcessorFamilyMultiCoreLoongson3C = 0x0270,
> 
> -  ProcessorFamilyMultiCoreLoongson3D = 0x0271
> 
> +  ProcessorFamilyMultiCoreLoongson3D = 0x0271,
> 
> +  ProcessorFamilyIntelCore3  = 0x0300,
> 
> +  ProcessorFamilyIntelCore5  = 0x0301,
> 
> +  ProcessorFamilyIntelCore7  = 0x0302,
> 
> +  ProcessorFamilyIntelCore9  = 0x0303,
> 
> +  ProcessorFamilyIntelCoreUltra3 = 0x0304,
> 
> +  ProcessorFamilyIntelCoreUltra5 = 0x0305,
> 
> +  ProcessorFamilyIntelCoreUltra7 = 0x0306,
> 
> +  ProcessorFamilyIntelCoreUltra9 = 0x0307
> 
>  } PROCESSOR_FAMILY2_DATA;
> 
> 
> 
>  ///
> 
> --
> 2.39.1.windows.1
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#115921):
> https://edk2.groups.io/g/devel/message/115921
> Mute This Topic: https://groups.io/mt/104560570/4905953
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub
> [gaolim...@byosoft.com.cn]
> -=-=-=-=-=-=
> 





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




Re: [edk2-devel] [PATCH v3 0/6] UefiCpuPkg/MpInitLib: Add support for multiple MP_HAND_OFF HOBs

2024-02-26 Thread Laszlo Ersek
On 2/22/24 17:01, Gerd Hoffmann wrote:
> Needed to boot guests with thousands of vcpus.
>
> v3:
>  - refine comments and commit messages.
>  - fix MaxCpusPerHob calculation.
>  - pick up review tags.
>  - add patch to speed up GetBspNumber a bit.
> v2:
>  - rework HOB loops for better performance: O(n) instead of O(n^2).
>
> Gerd Hoffmann (6):
>   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to GetMpHandOffHob
>   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to GetBspNumber()
>   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to
> SwitchApContext()
>   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to
> MpInitLibInitialize
>   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to SaveCpuMpData()
>   UefiCpuPkg/MpInitLib: return early in GetBspNumber()
>
>  UefiCpuPkg/Library/MpInitLib/MpLib.h|  14 ++-
>  UefiCpuPkg/Library/MpInitLib/MpLib.c| 157 +++-
>  UefiCpuPkg/Library/MpInitLib/PeiMpLib.c |  44 ---
>  3 files changed, 142 insertions(+), 73 deletions(-)
>

BTW, differences in PR#5410 relative to v3 as posted:

1:  678ed78d24a3 ! 1:  ecd6c4bb3396 UefiCpuPkg/MpInitLib: Add support for 
multiple HOBs to GetMpHandOffHob
@@ Commit message

 Signed-off-by: Gerd Hoffmann 
 Message-Id: <20240222160106.686484-2-kra...@redhat.com>
+Reviewed-by: Ray Ni 
+Reviewed-by: Laszlo Ersek 

  ## UefiCpuPkg/Library/MpInitLib/MpLib.h ##
 @@ UefiCpuPkg/Library/MpInitLib/MpLib.h: SwitchApContext (
2:  23b3e66f9935 = 2:  189467980103 UefiCpuPkg/MpInitLib: Add support for 
multiple HOBs to GetBspNumber()
3:  e712d36775d0 = 3:  8ab0f63c0f04 UefiCpuPkg/MpInitLib: Add support for 
multiple HOBs to SwitchApContext()
4:  9a81417f4b76 ! 4:  995a8ace7801 UefiCpuPkg/MpInitLib: Add support for 
multiple HOBs to MpInitLibInitialize
@@ Commit message
 Signed-off-by: Gerd Hoffmann 
 Reviewed-by: Ray Ni 
 Message-Id: <20240222160106.686484-5-kra...@redhat.com>
+Reviewed-by: Laszlo Ersek 

  ## UefiCpuPkg/Library/MpInitLib/MpLib.c ##
 @@ UefiCpuPkg/Library/MpInitLib/MpLib.c: MpInitLibInitialize (
5:  3a089b25725e ! 5:  f23c0d125e48 UefiCpuPkg/MpInitLib: Add support for 
multiple HOBs to SaveCpuMpData()
@@ Commit message

 Signed-off-by: Gerd Hoffmann 
 Message-Id: <20240222160106.686484-6-kra...@redhat.com>
+Reviewed-by: Ray Ni 
+Reviewed-by: Laszlo Ersek 
+[ler...@redhat.com: define one local variable per line [Ray]]

  ## UefiCpuPkg/Library/MpInitLib/PeiMpLib.c ##
 @@ UefiCpuPkg/Library/MpInitLib/PeiMpLib.c: SaveCpuMpData (
IN CPU_MP_DATA  *CpuMpData
)
  {
-+  UINT32   MaxCpusPerHob, CpusInHob;
++  UINT32   MaxCpusPerHob;
++  UINT32   CpusInHob;
UINT64   Data64;
 -  UINTNIndex;
-+  UINT32   Index, HobBase;
++  UINT32   Index;
++  UINT32   HobBase;
CPU_INFO_IN_HOB  *CpuInfoInHob;
MP_HAND_OFF  *MpHandOff;
UINTNMpHandOffSize;
6:  09435495e6e1 ! 6:  fbd8a114cd6e UefiCpuPkg/MpInitLib: return early in 
GetBspNumber()
@@ Commit message
 Suggested-by: Laszlo Ersek 
 Signed-off-by: Gerd Hoffmann 
 Message-Id: <20240222160106.686484-7-kra...@redhat.com>
+Reviewed-by: Ray Ni 
+Reviewed-by: Laszlo Ersek 
+[ler...@redhat.com: s/ASSERT (FALSE)/ASSERT_EFI_ERROR (EFI_NOT_FOUND)/ 
[Ray]]

  ## UefiCpuPkg/Library/MpInitLib/MpLib.c ##
 @@ UefiCpuPkg/Library/MpInitLib/MpLib.c: GetBspNumber (
@@ UefiCpuPkg/Library/MpInitLib/MpLib.c: GetBspNumber (
 -  ASSERT (BspNumber != MAX_UINT32);
 -
 -  return BspNumber;
-+  ASSERT (FALSE);
++  ASSERT_EFI_ERROR (EFI_NOT_FOUND);
 +  return 0;
  }



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115969): https://edk2.groups.io/g/devel/message/115969
Mute This Topic: https://groups.io/mt/104510905/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] MdeModulePkg: Load Serial driver earlier in DXE

2024-02-26 Thread Albecki, Mateusz
1. Using SerialDxe instead of PciSioSerialDxe - from our perspective the main 
idea is to avoid maintaining our own implementation of functions that actually 
communicate with UART controller. To use SerialDxe we would have to still 
maintain our own SerialPortLib that actually goes and sends data over UART. 
Also a note on LPSS UART - in terms of registers it is just a standard UART 
controller, the only quirk here is how to access it hence the custom 
PCI_IO_PROTOCOL implementation.

2. Using ConnectController before BDS - I noticed that the section I quoted 
says that BDS will use ConnectController however it doesn't say that it can't 
be used outside of that context. I did search the UEFI spec to see whether it 
provides additional restrictions and the only section that elaborates on this 
is the following:
"Under the UEFI Driver Model , the act of connecting and disconnecting drivers 
from controllers in a platform is under the platform firmware’s control. This 
will typically be implemented as part of the UEFI Boot Manager, but other 
implementations are possible. " - from  Section 2.5.6 Platform components
It seems to be rather permissive when it comes to who and when can call it.

3. How to make sure dispatch is early enough and not too late - this will 
depend on the overall platform implementation. For our part - we simply put it 
into flash as early as we can get away with. Even apriori section isn't 
strictly necessary if the platform is comfortable with relying on the fact that 
DXE core in MdeModulePkg dispatches modules in order of their placement in 
flash(that's not architectural as far as I know). Other platforms might choose 
to introduce explicit depex on gEfiSerialIoProtocolGuid. To reiterate this is 
the implementation that works for us in a sense that we get logs from all 
modules that change frequently from generation to generation, I understand that 
the same might not be true for platforms other than Intel however I think 
majority of platforms could still make at least some use of early UART 
debugging.

4. When exactly do we connect LPSS UART and start logging - we try to be as 
early as possible for this interface. We miss all of DXE_CORE logs(obviously), 
Pcd.inf and a couple of modules that implement some of the architectural 
protocols(from PciSio perspective metronome is the only actually required as 
far as we can tell since stall has to work).

I also want to note that I get why this is a controversial change. I didn't 
realize it earlier but it would be the first DXE_DRIVER in EDK2 tree that 
implements driver binding and in general it is strange to have PCI device 
driver that could potentially dispatch before PCI bus driver(however it is 
worth noting here that PciSioSerialDxe is not just a PCI driver, it is a combo 
driver capable of supporting PCI and SIO). That said I still think EDK2 in 
general needs a way to support early device drivers and using DXE_DRIVER seems 
like the least invasive idea. We need early drivers not just for debug(although 
that is one of the most important use cases I would say) other important use 
case is platform management through SMBUS/I2C/other serial interface which 
might be required to even be able to enumerate full PCI hierarchy(for instance 
some of the PCI slots might be powered down and you need to power them on 
sending commands over I2C) or maybe flash access to EFI variable 
storage(nothing says that you can't have it connected to PCI SPI controller) or 
maybe GPIO control to do any number of platform specific things.

Thanks,
Mateusz


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




Re: [edk2-devel] [PATCH v3 0/6] UefiCpuPkg/MpInitLib: Add support for multiple MP_HAND_OFF HOBs

2024-02-26 Thread Laszlo Ersek
On 2/22/24 17:01, Gerd Hoffmann wrote:
> Needed to boot guests with thousands of vcpus.
> 
> v3:
>  - refine comments and commit messages.
>  - fix MaxCpusPerHob calculation.
>  - pick up review tags.
>  - add patch to speed up GetBspNumber a bit.
> v2:
>  - rework HOB loops for better performance: O(n) instead of O(n^2).
> 
> Gerd Hoffmann (6):
>   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to GetMpHandOffHob
>   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to GetBspNumber()
>   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to
> SwitchApContext()
>   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to
> MpInitLibInitialize
>   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to SaveCpuMpData()
>   UefiCpuPkg/MpInitLib: return early in GetBspNumber()
> 
>  UefiCpuPkg/Library/MpInitLib/MpLib.h|  14 ++-
>  UefiCpuPkg/Library/MpInitLib/MpLib.c| 157 +++-
>  UefiCpuPkg/Library/MpInitLib/PeiMpLib.c |  44 ---
>  3 files changed, 142 insertions(+), 73 deletions(-)

I created PR  with the
"push" label set 40 minutes ago, for merging this series; however, the
CI system seems to be stuck. Everything on Azure seems to be in Queued
status, nothing is running.

Any ideas?

Thanks!
Laszlo



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




[edk2-devel] [PATCH] SecurityPkg/SecureBootConfigDxe: Update UI according to UEFI spec

2024-02-26 Thread Tan, Ming
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4713

In UEFI_Spec_2_10_Aug29.pdf page 1694 section 35.5.4 for
EFI_BROWSER_ACTION_FORM_OPEN:
NOTE: EFI_FORM_BROWSER2_PROTOCOL.BrowserCallback() cannot be used with
this browser action because question values have not been retrieved yet.

So should not call HiiGetBrowserData() and HiiSetBrowserData() in FORM_OPEN
call back function.

Now call SecureBootExtractConfigFromVariable() to save the change to EFI
variable, then HII use EFI variable to control the UI.

Cc: Min Xu 
Cc: Jiewen Yao 
Signed-off-by: Ming Tan 
---
 .../SecureBootConfigImpl.c| 21 ++-
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git 
a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c 
b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
index 2c11129526..c7ddbbd9e9 100644
--- 
a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
+++ 
b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
@@ -3365,6 +3365,7 @@ SecureBootExtractConfigFromVariable (
   } else {
 ConfigData->FileEnrollType = UNKNOWN_FILE_TYPE;
   }
+  ConfigData->ListCount = Private->ListCount;
 
   //
   // If it is Physical Presence User, set the PhysicalPresent to true.
@@ -4547,6 +4548,7 @@ SecureBootCallback (
   SetupMode  = NULL;
   File   = NULL;
   EnrollKeyErrorCode = None_Error;
+  GetBrowserDataResult = FALSE;
 
   if ((This == NULL) || (Value == NULL) || (ActionRequest == NULL)) {
 return EFI_INVALID_PARAMETER;
@@ -4565,15 +4567,12 @@ SecureBootCallback (
 return EFI_OUT_OF_RESOURCES;
   }
 
-  GetBrowserDataResult = HiiGetBrowserData (, 
mSecureBootStorageName, BufferSize, (UINT8 *)IfrNvData);
-
   if (Action == EFI_BROWSER_ACTION_FORM_OPEN) {
 if (QuestionId == KEY_SECURE_BOOT_MODE) {
   //
   // Update secure boot strings when opening this form
   //
   Status = UpdateSecureBootString (Private);
-  SecureBootExtractConfigFromVariable (Private, IfrNvData);
   mIsEnterSecureBootForm = TRUE;
 } else {
   //
@@ -4587,23 +4586,21 @@ SecureBootCallback (
   (QuestionId == KEY_SECURE_BOOT_DBT_OPTION))
   {
 CloseEnrolledFile (Private->FileContext);
-  } else if (QuestionId == KEY_SECURE_BOOT_DELETE_ALL_LIST) {
-//
-// Update ListCount field in varstore
-// Button "Delete All Signature List" is
-// enable when ListCount is greater than 0.
-//
-IfrNvData->ListCount = Private->ListCount;
   }
 }
 
 goto EXIT;
   }
 
+  GetBrowserDataResult = HiiGetBrowserData (, 
mSecureBootStorageName, BufferSize, (UINT8 *)IfrNvData);
+
   if (Action == EFI_BROWSER_ACTION_RETRIEVE) {
 Status = EFI_UNSUPPORTED;
 if (QuestionId == KEY_SECURE_BOOT_MODE) {
   if (mIsEnterSecureBootForm) {
+if (GetBrowserDataResult) {
+  SecureBootExtractConfigFromVariable (Private, IfrNvData);
+}
 Value->u8 = SECURE_BOOT_MODE_STANDARD;
 Status= EFI_SUCCESS;
   }
@@ -5179,6 +5176,10 @@ SecureBootCallback (
 }
   }
 
+  if (GetBrowserDataResult) {
+SecureBootExtractConfigFromVariable (Private, IfrNvData);
+  }
+
 EXIT:
 
   if (!EFI_ERROR (Status) && GetBrowserDataResult) {
-- 
2.31.1.windows.1



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




Re: [edk2-devel] [PATCH v3 6/6] UefiCpuPkg/MpInitLib: return early in GetBspNumber()

2024-02-26 Thread Laszlo Ersek
On 2/22/24 17:01, Gerd Hoffmann wrote:
> After finding the BSP Number return the result instead of
> continuing to loop over the remaining processors.
> 
> Suggested-by: Laszlo Ersek 
> Signed-off-by: Gerd Hoffmann 
> ---
>  UefiCpuPkg/Library/MpInitLib/MpLib.c | 11 ---
>  1 file changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c 
> b/UefiCpuPkg/Library/MpInitLib/MpLib.c
> index 4b6d6d02b027..2051554207dc 100644
> --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
> +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
> @@ -1903,15 +1903,13 @@ GetBspNumber (
>)
>  {
>UINT32 ApicId;
> -  UINT32 BspNumber;
>UINT32 Index;
>CONST MP_HAND_OFF  *MpHandOff;
>  
>//
>// Get the processor number for the BSP
>//
> -  BspNumber = MAX_UINT32;
> -  ApicId= GetInitialApicId ();
> +  ApicId = GetInitialApicId ();
>  
>for (MpHandOff = FirstMpHandOff;
> MpHandOff != NULL;
> @@ -1919,14 +1917,13 @@ GetBspNumber (
>{
>  for (Index = 0; Index < MpHandOff->CpuCount; Index++) {
>if (MpHandOff->Info[Index].ApicId == ApicId) {
> -BspNumber = MpHandOff->ProcessorIndex + Index;
> +return MpHandOff->ProcessorIndex + Index;
>}
>  }
>}
>  
> -  ASSERT (BspNumber != MAX_UINT32);
> -
> -  return BspNumber;
> +  ASSERT (FALSE);
> +  return 0;
>  }
>  
>  /**

There's a somewhat sneaky change in here: if we fail to find the BSP,
then (beyond tripping an assert like before) we now return 0, rather
than MAX_UINT32.

However, that's arguably more sensible, even.

Reviewed-by: Laszlo Ersek 

Laszlo



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




Re: [edk2-devel] [PATCH v3 6/6] UefiCpuPkg/MpInitLib: return early in GetBspNumber()

2024-02-26 Thread Laszlo Ersek
On 2/23/24 03:33, Ni, Ray wrote:
>> +  ASSERT (FALSE);
> 
> How about ASSERT (EFI_NOT_FOUND)? Which is more meaningful than FALSE.

I'll edit the patch -- assuming you mean

  ASSERT_EFI_ERROR (EFI_NOT_FOUND);

Laszlo

> 
> No matter you change or not, Reviewed-by: Ray Ni 
> 
>> +  return 0;
>>  }
>>
>>  /**
>> --
>> 2.43.2
> 
> 
> 
> 
> 
> 



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




Re: [edk2-devel] [PATCH v3 5/6] UefiCpuPkg/MpInitLib: Add support for multiple HOBs to SaveCpuMpData()

2024-02-26 Thread Laszlo Ersek
On 2/23/24 03:16, Ni, Ray wrote:
> 
> 
> Thanks,
> Ray
>> -Original Message-
>> From: Gerd Hoffmann 
>> Sent: Friday, February 23, 2024 12:01 AM
>> To: devel@edk2.groups.io
>> Cc: Laszlo Ersek ; Ni, Ray ; Kumar,
>> Rahul R ; Oliver Steffen ;
>> Gerd Hoffmann 
>> Subject: [PATCH v3 5/6] UefiCpuPkg/MpInitLib: Add support for multiple
>> HOBs to SaveCpuMpData()
>>
>> Add support for splitting Hand-Off data into multiple HOBs.
>> This is required for VMs with thousands of CPUs.
>>
>> Signed-off-by: Gerd Hoffmann 
>> ---
>>  UefiCpuPkg/Library/MpInitLib/PeiMpLib.c | 44 +++--
>>  1 file changed, 27 insertions(+), 17 deletions(-)
>>
>> diff --git a/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c
>> b/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c
>> index f80e00edcff3..00d48c2ab531 100644
>> --- a/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c
>> +++ b/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c
>> @@ -126,35 +126,45 @@ SaveCpuMpData (
>>IN CPU_MP_DATA  *CpuMpData
>>)
>>  {
>> +  UINT32   MaxCpusPerHob, CpusInHob;
>>UINT64   Data64;
>> -  UINTNIndex;
>> +  UINT32   Index, HobBase;
> 
> Can you please split the local variable declarations in multiple lines?
> With that, Reviewed-by: Ray Ni 

I'll edit the patch just before merging the series.

Laszlo

> 
> 
> 
> 
> 
> 



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




Re: [edk2-devel] [PATCH v3 5/6] UefiCpuPkg/MpInitLib: Add support for multiple HOBs to SaveCpuMpData()

2024-02-26 Thread Laszlo Ersek
On 2/22/24 17:01, Gerd Hoffmann wrote:
> Add support for splitting Hand-Off data into multiple HOBs.
> This is required for VMs with thousands of CPUs.
> 
> Signed-off-by: Gerd Hoffmann 
> ---
>  UefiCpuPkg/Library/MpInitLib/PeiMpLib.c | 44 +++--
>  1 file changed, 27 insertions(+), 17 deletions(-)
> 
> diff --git a/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c 
> b/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c
> index f80e00edcff3..00d48c2ab531 100644
> --- a/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c
> +++ b/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c
> @@ -126,35 +126,45 @@ SaveCpuMpData (
>IN CPU_MP_DATA  *CpuMpData
>)
>  {
> +  UINT32   MaxCpusPerHob, CpusInHob;
>UINT64   Data64;
> -  UINTNIndex;
> +  UINT32   Index, HobBase;
>CPU_INFO_IN_HOB  *CpuInfoInHob;
>MP_HAND_OFF  *MpHandOff;
>UINTNMpHandOffSize;
>  
> +  MaxCpusPerHob = (0xFFF8 - sizeof (EFI_HOB_GUID_TYPE) - sizeof 
> (MP_HAND_OFF)) / sizeof (PROCESSOR_HAND_OFF);
> +
>//
>// When APs are in a state that can be waken up by a store operation to a 
> memory address,
>// report the MP_HAND_OFF data for DXE to use.
>//
> -  CpuInfoInHob  = (CPU_INFO_IN_HOB *)(UINTN)CpuMpData->CpuInfoInHob;
> -  MpHandOffSize = sizeof (MP_HAND_OFF) + sizeof (PROCESSOR_HAND_OFF) * 
> CpuMpData->CpuCount;
> -  MpHandOff = (MP_HAND_OFF *)BuildGuidHob (, 
> MpHandOffSize);
> -  ASSERT (MpHandOff != NULL);
> -  ZeroMem (MpHandOff, MpHandOffSize);
> -  MpHandOff->ProcessorIndex = 0;
> +  CpuInfoInHob = (CPU_INFO_IN_HOB *)(UINTN)CpuMpData->CpuInfoInHob;
>  
> -  MpHandOff->CpuCount = CpuMpData->CpuCount;
> -  if (CpuMpData->ApLoopMode != ApInHltLoop) {
> -MpHandOff->StartupSignalValue= MP_HAND_OFF_SIGNAL;
> -MpHandOff->WaitLoopExecutionMode = sizeof (VOID *);
> -  }
> +  for (Index = 0; Index < CpuMpData->CpuCount; Index++) {
> +if (Index % MaxCpusPerHob == 0) {
> +  HobBase   = Index;
> +  CpusInHob = MIN (CpuMpData->CpuCount - HobBase, MaxCpusPerHob);
>  
> -  for (Index = 0; Index < MpHandOff->CpuCount; Index++) {
> -MpHandOff->Info[Index].ApicId = CpuInfoInHob[Index].ApicId;
> -MpHandOff->Info[Index].Health = CpuInfoInHob[Index].Health;
> +  MpHandOffSize = sizeof (MP_HAND_OFF) + sizeof (PROCESSOR_HAND_OFF) * 
> CpusInHob;
> +  MpHandOff = (MP_HAND_OFF *)BuildGuidHob (, 
> MpHandOffSize);
> +  ASSERT (MpHandOff != NULL);
> +  ZeroMem (MpHandOff, MpHandOffSize);
> +
> +  MpHandOff->ProcessorIndex = HobBase;
> +  MpHandOff->CpuCount   = CpusInHob;
> +
> +  if (CpuMpData->ApLoopMode != ApInHltLoop) {
> +MpHandOff->StartupSignalValue= MP_HAND_OFF_SIGNAL;
> +MpHandOff->WaitLoopExecutionMode = sizeof (VOID *);
> +  }
> +}
> +
> +MpHandOff->Info[Index-HobBase].ApicId = CpuInfoInHob[Index].ApicId;
> +MpHandOff->Info[Index-HobBase].Health = CpuInfoInHob[Index].Health;
>  if (CpuMpData->ApLoopMode != ApInHltLoop) {
> -  MpHandOff->Info[Index].StartupSignalAddress= 
> (UINT64)(UINTN)CpuMpData->CpuData[Index].StartupApSignal;
> -  MpHandOff->Info[Index].StartupProcedureAddress = 
> (UINT64)(UINTN)>CpuData[Index].ApFunction;
> +  MpHandOff->Info[Index-HobBase].StartupSignalAddress= 
> (UINT64)(UINTN)CpuMpData->CpuData[Index].StartupApSignal;
> +  MpHandOff->Info[Index-HobBase].StartupProcedureAddress = 
> (UINT64)(UINTN)>CpuData[Index].ApFunction;
>  }
>}
>  

Reviewed-by: Laszlo Ersek 



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




Re: [edk2-devel] [PATCH v3 4/6] UefiCpuPkg/MpInitLib: Add support for multiple HOBs to MpInitLibInitialize

2024-02-26 Thread Laszlo Ersek
On 2/22/24 17:01, Gerd Hoffmann wrote:
> Loop over all MP_HAND_OFF HOBs instead of expecting a single HOB
> covering all CPUs in the system.
> 
> Add a new FirstMpHandOff variable, which caches the first HOB body for
> faster lookups.  It is also used to check whenever MP_HAND_OFF HOBs are
> present.  Using the MpHandOff pointer for that does not work any more
> because the variable will be NULL at the end of HOB loops.
> 
> Signed-off-by: Gerd Hoffmann 
> Reviewed-by: Ray Ni 
> ---
>  UefiCpuPkg/Library/MpInitLib/MpLib.c | 68 +++-
>  1 file changed, 47 insertions(+), 21 deletions(-)

Based on comparison against v2 (commit message update, plus plan to
extract WaitLoopExecutionMode and StartupSignalValue to a new,
library-internal, HOB):

Reviewed-by: Laszlo Ersek 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115961): https://edk2.groups.io/g/devel/message/115961
Mute This Topic: https://groups.io/mt/104510909/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] edk2-Redfish-client: Clarify HTTP method used for provisioning

2024-02-26 Thread Nickle Wang via groups.io


Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: abner.ch...@amd.com 
> Sent: Monday, February 26, 2024 12:55 PM
> To: devel@edk2.groups.io
> Cc: Nickle Wang ; Igor Kulchytskyy ;
> Mike Maslenkin 
> Subject: [edk2-redfish-client][PATCH] edk2-Redfish-client: Clarify HTTP method
> used for provisioning
> 
> External email: Use caution opening links or attachments
> 
> 
> From: Abner Chang 
> 
> Clarify the HTTP method that is used to provision BIOS managed Redfish
> resource.
> 
> Signed-off-by: Abner Chang 
> Cc: Nickle Wang 
> Cc: Igor Kulchytskyy 
> Cc: Mike Maslenkin 
> ---
>  RedfishClientPkg/Readme.md| 35 ---
>  .../Media/redfish-call-flow-provisioning.svg  |  2 +-  .../Media/redfish-
> synchronization-design.svg  |  4 +--
>  3 files changed, 26 insertions(+), 15 deletions(-)
> 
> diff --git a/RedfishClientPkg/Readme.md b/RedfishClientPkg/Readme.md index
> 82cb9c8c99..1789dff6f8 100644
> --- a/RedfishClientPkg/Readme.md
> +++ b/RedfishClientPkg/Readme.md
> @@ -310,21 +310,32 @@ job.
> 
>  Several interfaces defined in EDKII Redfish Resource Config Protocol work
> together to support Redfish synchronization:
>  - Identify()
> -  - This function is used to check if the given Redfish resource is the one 
> the
> feature driver wants to manage. A platform
> -library `RedfishResourceIdentifyLib` is introduced for platform to 
> implement its
> own policy to identify Redfish resource.
> +  - This function is used to check if the given Redfish resource is the one 
> the
> feature driver
> +wants to manage. A platform library `RedfishResourceIdentifyLib` is
> introduced for
> +platform to implement its own policy to identify Redfish resource.
>  - Check()
> -  - This function is used to check the attribute status on Redfish service. 
> If all
> attributes the feature driver manages
> -are presented in Redfish service, feature driver must provision them 
> already.
> Otherwise, Provisioning() will be called
> -to perform resource provisioning job.
> +  - This function is used to check the attribute status on Redfish service. 
> If all
> attributes
> +the feature driver manages are presented in Redfish service, feature 
> driver
> must provision
> +them already. Otherwise, Provisioning() will be called to perform 
> resource
> provisioning
> +job.
>  - Provisioning()
> -  - When this function is called, feature driver will provision all 
> attributes that it
> managed to Redfish service. This
> -operation usually create new resource at Redfish service and require 
> different
> operation that specified by Redfish service.
> +  - When this function is called, feature driver will provision all 
> attributes that it
> managed
> +to Redfish service. This operation usually creates the new Redfish 
> properties
> at the
> +existing URI in Redfish service. Use HTTP PATCH to provision Redfish
> properties as BIOS
> +may only manage some but not all of the properties of the resource. See
> [Redfish-edk2 implementation](#Redfish-Service-Implementation-that-
> Incorporates-with-EDK2-Redfish) for
> +the details. HTTP POST is still used for creating a collection member, 
> such as
> the
> +collection member of processor or memory for the Redfish inventory
> management.
> +However, HTTP PUT to overwrite an entire Redfish resource is not used in
> edk2 Redfish
> +implementation as edk2 Redfish implementation has no idea of whether the
> Redfish resource
> +is entirely managed by BIOS or not.
>  - Consume()
> -  - When there is pending settings in Redfish service, this function is 
> called for
> feature driver to consume pending settings
> -requested by user.
> +  - When there is pending settings in Redfish service, this function is 
> called for
> feature
> +driver to consume pending settings requested by user. HTTP GET is the 
> method
> used
> +to retrieve Redfish properties.
>  - Update()
> -  - When platform configuration is updated, this function is called to update
> configuration changes to Redfish service and
> -Redfish service can show the latest settings on platform.
> +  - When platform configuration is updated, this function is called to update
> configuration
> +changes to Redfish service and Redfish service can show the latest 
> settings on
> platform.
> +HTTP PATCH is the method used to update the properties of Redfish 
> resource.
> 
>  The EDKII Redfish Resource Addendum Protocol is introduced to provide 
> platform
> addendum data that Redfish service requires.
>  This protocol will be called at Provisioning() and Update() functions so 
> platform
> can add OEM attribute or any other attribute @@ -338,7 +349,7 @@ struct
> _EDKII_REDFISH_RESOURCE_ADDENDUM_PROTOCOL {  };  ```
> 
> -### Redfish Service Implementation that Incorporates with EDK2 Redfish
> +###  +name="Redfish-Service-Implementation-that-Incorporates-with-EDK2-Redfis
> +h">Redfish 

Re: [edk2-devel] [PATCH] RedfishPkg/RestJsonStructureDxe: Refine REST JSON C Structure DXE driver

2024-02-26 Thread Nickle Wang via groups.io
Hi @abner.ch...@amd.com,



RestJsonStructureDxe is a driver in RedfishPkg. May I know why we can not have 
dependency to RedfishPkg? Do we need to move it to MdeModulePkg for this goal 
(removing dependency to RedfishPkg)?



Regards,

Nickle



> -Original Message-

> From: abner.ch...@amd.com 

> Sent: Monday, February 26, 2024 10:44 AM

> To: devel@edk2.groups.io

> Cc: Nickle Wang ; Igor Kulchytskyy 

> Subject: [PATCH] RedfishPkg/RestJsonStructureDxe: Refine REST JSON C Structure

> DXE driver

>

> External email: Use caution opening links or attachments

>

>

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

>

> BZ #: 4711

> - Add mode debug messages.

> - This driver shouldn't have a dependency on Redfish package and

>   the references of "Redfish" terminology.

>   Remove the references of "Redfish" from this driver.

> - Fix the missing parameter of DEBUG macros used in this

>   driver.

>

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

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

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

> ---

>  .../RestJsonStructureDxe.inf  |  3 +-

>  .../RestJsonStructureInternal.h   |  3 +-

>  .../RestJsonStructureDxe.c| 96 ++-

>  3 files changed, 96 insertions(+), 6 deletions(-)

>

> diff --git a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf

> b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf

> index 61e6253d318..e74c9dfd38b 100644

> --- a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf

> +++ b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf

> @@ -2,6 +2,7 @@

>  # Implementation of EFI REST JSON Structure Protocol.

>  #

>  #  (C) Copyright 2020 Hewlett Packard Enterprise Development LP

> +#  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights

> +reserved.

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

>

> @@ -17,7 +18,6 @@

>  [Packages]

>MdePkg/MdePkg.dec

>MdeModulePkg/MdeModulePkg.dec

> -  RedfishPkg/RedfishPkg.dec

>

>  [Sources]

>RestJsonStructureDxe.c

> @@ -26,6 +26,7 @@

>  [LibraryClasses]

>BaseLib

>BaseMemoryLib

> +  DebugLib

>MemoryAllocationLib

>UefiBootServicesTableLib

>UefiDriverEntryPoint

> diff --git a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureInternal.h

> b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureInternal.h

> index 8d7175125c1..04be5cc80b5 100644

> --- a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureInternal.h

> +++ b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureInternal.h

> @@ -3,6 +3,7 @@

>Protocol.

>

>(C) Copyright 2020 Hewlett Packard Enterprise Development LP

> +  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights

> + reserved.

>

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

>

> @@ -25,7 +26,7 @@

>  typedef struct _REST_JSON_STRUCTURE_INSTANCE {

>LIST_ENTRY   
> NextRestJsonStructureInstance; ///< Next

> convertor instance

>UINTNNumberOfNameSpaceToConvert;   
>  ///< Number

> of resource type this convertor supports.

> -  EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER   *SupportedRsrcIndentifier;

> ///< The resource type linklist

> +  EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER   *SupportedRsrcIndentifier;

> ///< The supported resource type array.

>EFI_REST_JSON_STRUCTURE_TO_STRUCTURE JsonToStructure;

> ///< JSON to C structure function

>EFI_REST_JSON_STRUCTURE_TO_JSON  StructureToJson;  
>  ///< C

> structure to JSON function

>EFI_REST_JSON_STRUCTURE_DESTORY_STRUCTUREDestroyStructure;

> ///< Destory C struture function.

> diff --git a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.c

> b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.c

> index 404866fb319..0da5132e5ae 100644

> --- a/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.c

> +++ b/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.c

> @@ -4,12 +4,14 @@

>Protocol.

>

>(C) Copyright 2020 Hewlett Packard Enterprise Development LP

> +  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights

> + reserved.

>

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

>

>  **/

>

>  #include 

> +#include 

>  #include   #include 
> "RestJsonStructureInternal.h"

>

> @@ -72,6 +74,8 @@ RestJsonStructureRegister (

>  }

>}

>

> +  DEBUG ((DEBUG_MANAGEABILITY, "%a: %d REST JSON-C interpreter(s) to

> + register for the name spaces.\n", __func__, NumberOfNS));

> +

>Instance =

>  (REST_JSON_STRUCTURE_INSTANCE *)AllocateZeroPool (sizeof

> (REST_JSON_STRUCTURE_INSTANCE) + NumberOfNS * sizeof

> (EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER));

>if (Instance == NULL) {

> @@ -88,6 +92,10 @@ RestJsonStructureRegister (

>ThisSupportedInterp= JsonStructureSupported;

>for (Index = 0; Index < NumberOfNS; Index++) {

> 

Re: [edk2-devel] [PATCH v3 1/6] UefiCpuPkg/MpInitLib: Add support for multiple HOBs to GetMpHandOffHob

2024-02-26 Thread Laszlo Ersek
Hi Ray,

On 2/23/24 03:35, Ni, Ray wrote:
>> +  @param[in] MpHandOff  Previous HOB body.  Pass NULL to get the
>> first HOB.
> 
> Can you replace "...HOB Body.  Pass NULL..." with "...HOB Body. Pass NULL..."?
> Your current comments contain two spaces.
> 
> With that, Reviewed-by: Ray Ni 

The two spaces after the dot are valid English -- it's called "English
spacing after a full stop":

https://en.wikipedia.org/wiki/Full_stop#Spacing_after_a_full_stop

Some projects use English spacing in comments and documentation, so a
developer working on multiple projects may not find it easy to switch
between French and English spacing. (If you check Gerd's commit messages
in this series, those also use English spacing.)

I could edit out the second spaces before merging this series, but I
think that wouldn't be right; again, it's valid English. (E.g., we also
don't try to enforce American vs. British English spelling in comments,
even though the American one is much more common in the codebase.)

Reviewed-by: Laszlo Ersek 




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




[edk2-devel] 回复: [PATCH v4 2/2] ShellPkg/SmbiosView: Support New ProcessorFamily for SMBIOS Type4

2024-02-26 Thread gaoliming via groups.io
Reviewed-by: Liming Gao 

> -邮件原件-
> 发件人: Jason 
> 发送时间: 2024年2月25日 17:06
> 收件人: devel@edk2.groups.io
> 抄送: Jason Lou ; Liming Gao
> ; Zhichao Gao 
> 主题: [PATCH v4 2/2] ShellPkg/SmbiosView: Support New ProcessorFamily for
> SMBIOS Type4
> 
> From: Jason Lou 
> 
> The patch updates SmbiosView to support new ProcessorFamily for SMBIOS
> Type4 based on SMBIOS 3.8.0.
> 
> Signed-off-by: Jason Lou 
> Cc: Liming Gao 
> Cc: Zhichao Gao 
> ---
>  ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c |
> 34 +++-
>  1 file changed, 33 insertions(+), 1 deletion(-)
> 
> diff --git
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
> index 4f29eedc58..f96317b314 100644
> --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
> +++
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
> @@ -1,7 +1,7 @@
>  /** @file
> 
>Module for clarifying the content of the smbios structure element
> information.
> 
> 
> 
> -  Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
> 
> +  Copyright (c) 2005 - 2024, Intel Corporation. All rights reserved.
> 
>Copyright (c) 1985 - 2022, American Megatrends International LLC.
> 
>(C) Copyright 2014 Hewlett-Packard Development Company, L.P.
> 
>(C) Copyright 2015-2019 Hewlett Packard Enterprise Development
> LP
> 
> @@ -2678,6 +2678,38 @@ DisplayProcessorFamily2 (
>Print (L"MultiCoreLoongson3D\n");
> 
>break;
> 
> 
> 
> +case 0x300:
> 
> +  Print (L"IntelCore3\n");
> 
> +  break;
> 
> +
> 
> +case 0x301:
> 
> +  Print (L"IntelCore5\n");
> 
> +  break;
> 
> +
> 
> +case 0x302:
> 
> +  Print (L"IntelCore7\n");
> 
> +  break;
> 
> +
> 
> +case 0x303:
> 
> +  Print (L"IntelCore9\n");
> 
> +  break;
> 
> +
> 
> +case 0x304:
> 
> +  Print (L"IntelCoreUltra3\n");
> 
> +  break;
> 
> +
> 
> +case 0x305:
> 
> +  Print (L"IntelCoreUltra5\n");
> 
> +  break;
> 
> +
> 
> +case 0x306:
> 
> +  Print (L"IntelCoreUltra7\n");
> 
> +  break;
> 
> +
> 
> +case 0x307:
> 
> +  Print (L"IntelCoreUltra9\n");
> 
> +  break;
> 
> +
> 
>  default:
> 
>ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN
> (STR_SMBIOSVIEW_PRINTINFO_UNDEFINED_PROC_FAMILY),
> gShellDebug1HiiHandle);
> 
>}
> 
> --
> 2.39.1.windows.1





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




回复: [edk2-devel] [PATCH v4 1/2] MdePkg/SmBios.h: Add New ProcessorFamily definitions for SMBIOS Type4

2024-02-26 Thread gaoliming via groups.io
Reviewed-by: Liming Gao 

> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Jason Lou
> 发送时间: 2024年2月25日 17:06
> 收件人: devel@edk2.groups.io
> 抄送: Jason Lou ; Zhiguang Liu
;
> Dandan Bi ; Star Zeng ; Zhichao
> Gao ; Benny Lin ; Gua Guo
> ; Michael D Kinney ;
> Liming Gao 
> 主题: [edk2-devel] [PATCH v4 1/2] MdePkg/SmBios.h: Add New
> ProcessorFamily definitions for SMBIOS Type4
> 
> From: Jason Lou 
> 
> The patch adds new ProcessorFamily definitions for SMBIOS Type4 based on
> SMBIOS 3.8.0.
> 
> Signed-off-by: Jason Lou 
> Cc: Zhiguang Liu 
> Cc: Dandan Bi 
> Cc: Star Zeng 
> Cc: Zhichao Gao 
> Cc: Benny Lin 
> Cc: Gua Guo 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> ---
>  MdePkg/Include/IndustryStandard/SmBios.h | 14 +++---
>  1 file changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/MdePkg/Include/IndustryStandard/SmBios.h
> b/MdePkg/Include/IndustryStandard/SmBios.h
> index 56cec615a0..bdb28fc3a3 100644
> --- a/MdePkg/Include/IndustryStandard/SmBios.h
> +++ b/MdePkg/Include/IndustryStandard/SmBios.h
> @@ -1,7 +1,7 @@
>  /** @file
> 
> -  Industry Standard Definitions of SMBIOS Table Specification v3.7.0.
> 
> +  Industry Standard Definitions of SMBIOS Table Specification v3.8.0.
> 
> 
> 
> -Copyright (c) 2006 - 2023, Intel Corporation. All rights reserved.
> 
> +Copyright (c) 2006 - 2024, Intel Corporation. All rights reserved.
> 
>  (C) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
> 
>  (C) Copyright 2015 - 2019 Hewlett Packard Enterprise Development LP
> 
>  Copyright (c) 2022, AMD Incorporated. All rights reserved.
> 
> @@ -774,7 +774,15 @@ typedef enum {
>ProcessorFamilyQuadCoreLoongson3B  = 0x026E,
> 
>ProcessorFamilyMultiCoreLoongson3B = 0x026F,
> 
>ProcessorFamilyMultiCoreLoongson3C = 0x0270,
> 
> -  ProcessorFamilyMultiCoreLoongson3D = 0x0271
> 
> +  ProcessorFamilyMultiCoreLoongson3D = 0x0271,
> 
> +  ProcessorFamilyIntelCore3  = 0x0300,
> 
> +  ProcessorFamilyIntelCore5  = 0x0301,
> 
> +  ProcessorFamilyIntelCore7  = 0x0302,
> 
> +  ProcessorFamilyIntelCore9  = 0x0303,
> 
> +  ProcessorFamilyIntelCoreUltra3 = 0x0304,
> 
> +  ProcessorFamilyIntelCoreUltra5 = 0x0305,
> 
> +  ProcessorFamilyIntelCoreUltra7 = 0x0306,
> 
> +  ProcessorFamilyIntelCoreUltra9 = 0x0307
> 
>  } PROCESSOR_FAMILY2_DATA;
> 
> 
> 
>  ///
> 
> --
> 2.39.1.windows.1
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#115921):
> https://edk2.groups.io/g/devel/message/115921
> Mute This Topic: https://groups.io/mt/104560570/4905953
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub
> [gaolim...@byosoft.com.cn]
> -=-=-=-=-=-=
> 





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




[edk2-devel] [PATCH v4 3/3] SecurityPkg: Update ReceiveData and SendData function description

2024-02-26 Thread Qingyu
Refer to Uefi spec 2.10 section 13.14, update the parameter 'MediaId'
description for EFI_STORAGE_SECURITY_COMMAND_PROTOCOL function ReceiveData
and SendData.

Cc: Jiewen Yao 
Signed-off-by: Qingyu 
---
 SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.c 
b/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.c
index 0fb6b1bf41d5..1ee55105e435 100644
--- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.c
+++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.c
@@ -49,7 +49,9 @@ EFI_GUID  mOpalDeviceLockBoxGuid = OPAL_DEVICE_LOCKBOX_GUID;
   function shall return EFI_DEVICE_ERROR.
 
   @param  This Indicates a pointer to the calling 
context.
-  @param  MediaId  ID of the medium to receive data from.
+  @param  MediaId  ID of the medium to receive data from. 
If there is no
+   block IO protocol supported by the 
physical device, the
+   value of MediaId is undefined.
   @param  Timeout  The timeout, in 100ns units, to use for 
the execution
of the security protocol command. A 
Timeout value of 0
means that this function will wait 
indefinitely for the
@@ -148,7 +150,9 @@ SecurityReceiveData (
   shall return EFI_DEVICE_ERROR.
 
   @param  This Indicates a pointer to the calling 
context.
-  @param  MediaId  ID of the medium to receive data from.
+  @param  MediaId  ID of the medium to receive data from. 
If there is no
+   block IO protocol supported by the 
physical device, the
+   value of MediaId is undefined.
   @param  Timeout  The timeout, in 100ns units, to use for 
the execution
of the security protocol command. A 
Timeout value of 0
means that this function will wait 
indefinitely for the
-- 
2.39.1.windows.1



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




[edk2-devel] [PATCH v4 2/3] MdeModulePkg: Update ReceiveData and SendData function description

2024-02-26 Thread Qingyu
AtaBusDxe, NvmExpressDxe, ScsiDiskDxe and EmmcDxe is used to back the
EFI_STORAGE_SECURITY_COMMAND_PROTOCOL, update the parameter 'MediaId'
description for the protocal function ReceiveData and SendData as described
in Uefi spec 2.10 section 13.14.

Cc: Liming Gao 
Cc: Michael D Kinney 
Signed-off-by: Qingyu 
---
 MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c  |  8 ++--
 MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h  |  8 ++--
 .../Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c|  8 ++--
 .../Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.h|  8 ++--
 MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c |  8 ++--
 MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h |  8 ++--
 MdeModulePkg/Bus/Sd/EmmcDxe/EmmcBlockIo.c| 12 +---
 MdeModulePkg/Bus/Sd/EmmcDxe/EmmcBlockIo.h| 12 +---
 8 files changed, 54 insertions(+), 18 deletions(-)

diff --git a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c 
b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c
index a729c087ff5a..67c6389bb8b3 100644
--- a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c
+++ b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c
@@ -1483,7 +1483,9 @@ AtaDiskInfoWhichIde (
   function shall return EFI_DEVICE_ERROR.
 
   @param  This Indicates a pointer to the calling 
context.
-  @param  MediaId  ID of the medium to receive data from.
+  @param  MediaId  ID of the medium to receive data from. 
If there is no
+   block IO protocol supported by the 
physical device, the
+   value of MediaId is undefined.
   @param  Timeout  The timeout, in 100ns units, to use for 
the execution
of the security protocol command. A 
Timeout value of 0
means that this function will wait 
indefinitely for the
@@ -1600,7 +1602,9 @@ AtaStorageSecurityReceiveData (
   shall return EFI_DEVICE_ERROR.
 
   @param  This Indicates a pointer to the calling 
context.
-  @param  MediaId  ID of the medium to receive data from.
+  @param  MediaId  ID of the medium to receive data from. 
If there is no
+   block IO protocol supported by the 
physical device, the
+   value of MediaId is undefined.
   @param  Timeout  The timeout, in 100ns units, to use for 
the execution
of the security protocol command. A 
Timeout value of 0
means that this function will wait 
indefinitely for the
diff --git a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h 
b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h
index 6bc345f7e777..8906947e28b3 100644
--- a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h
+++ b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h
@@ -927,7 +927,9 @@ AtaDiskInfoWhichIde (
   function shall return EFI_DEVICE_ERROR.
 
   @param  This Indicates a pointer to the calling 
context.
-  @param  MediaId  ID of the medium to receive data from.
+  @param  MediaId  ID of the medium to receive data from. 
If there is no
+   block IO protocol supported by the 
physical device, the
+   value of MediaId is undefined.
   @param  Timeout  The timeout, in 100ns units, to use for 
the execution
of the security protocol command. A 
Timeout value of 0
means that this function will wait 
indefinitely for the
@@ -1007,7 +1009,9 @@ AtaStorageSecurityReceiveData (
   shall return EFI_DEVICE_ERROR.
 
   @param  This Indicates a pointer to the calling 
context.
-  @param  MediaId  ID of the medium to receive data from.
+  @param  MediaId  ID of the medium to receive data from. 
If there is no
+   block IO protocol supported by the 
physical device, the
+   value of MediaId is undefined.
   @param  Timeout  The timeout, in 100ns units, to use for 
the execution
of the security protocol command. A 
Timeout value of 0
means that this function will wait 
indefinitely for the
diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c 
b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c
index b6ed7f7031b3..e0a85c1cb34e 100644
--- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c
+++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c
@@ -1699,7 +1699,9 @@ TrustTransferNvmeDevice (
   function shall return EFI_DEVICE_ERROR.
 
   @param  This   

[edk2-devel] Introduction OSFF ByteTalks Vol.1 - Webinar Series about Open-Source Firmware

2024-02-26 Thread Christian Walter

Dear EDKII-Community,

The Open-Source Firmware Foundation (OSFF) is pleased to announce 
ByteTalks, a new series of online webinars focused on the open-source 
firmware community. ByteTalks aims to provide a platform for learning, 
sharing, and discussing the latest developments in open-source firmware. 
Each session features talks by experienced professionals, practical 
tutorials, and a chance for participants to ask questions and engage 
with the speakers. Whether you're deeply involved in firmware 
development or just interested in learning more about the field, 
ByteTalks offers valuable insights and connections to help you grow. 
Join us to explore the evolving world of open-source firmware together.


Announcing OSFF ByteTalks Vol. 1: “*FSP Customization - Remove 
non-mandatory components in the Intel FSP*”


In the realm of open-source firmware, creating a custom Firmware Support 
Package (FSP) binary is a pivotal step for developers aiming to enhance 
hardware compatibility and performance. The process involves 
understanding the hardware's initialization requirements, integrating 
coreboot or similar open-source firmware solutions, and customizing the 
FSP to meet specific system needs. Our guests Subrata and Vincent will 
talk about the process on customizing the Intel FSP and removing 
non-mandatory components.


For more information, check out the event page here: 
https://osfw.foundation/events/bytetalks-vol.-1/


In case you have any questions, feel free to reach out to me. In case 
you are also interested in joining the ByteTalks series as a speaker, 
feel free to reach out to me as well :)


Best,

Chris

--
*Christian Walter*



Open-Source Firmware Foundation
Email: christian.walter@osfw.foundation


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




[edk2-devel] [PATCH v4 0/3] Update ReceiveData and SendData function description

2024-02-26 Thread Qingyu
Refer to Uefi spec 2.10 section 13.14, update the parameter 'MediaId'
description for EFI_STORAGE_SECURITY_COMMAND_PROTOCOL function ReceiveData
and SendData.

V4:
Split patch so there is one patch per package

V3:
Add maintainer to CC list.

V2:
Update some functions description in C and H header files in MdeModulePkg and 
SecurityPkg.

V1:
update the parameter description in 
MdePkg/Include/Protocol/StorageSecurityCommand.h.

Qingyu (3):
  MdePkg: Update ReceiveData and SendData function description
  MdeModulePkg: Update ReceiveData and SendData function description
  SecurityPkg: Update ReceiveData and SendData function description

 MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c  |  8 ++--
 MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h  |  8 ++--
 .../Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c|  8 ++--
 .../Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.h|  8 ++--
 MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c |  8 ++--
 MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h |  8 ++--
 MdeModulePkg/Bus/Sd/EmmcDxe/EmmcBlockIo.c| 12 +---
 MdeModulePkg/Bus/Sd/EmmcDxe/EmmcBlockIo.h| 12 +---
 MdePkg/Include/Protocol/StorageSecurityCommand.h |  8 ++--
 SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.c  |  8 ++--
 10 files changed, 66 insertions(+), 22 deletions(-)

-- 
2.39.1.windows.1



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




[edk2-devel] [PATCH v4 1/3] MdePkg: Update ReceiveData and SendData function description

2024-02-26 Thread Qingyu
Refer to Uefi spec 2.10 section 13.14, update the parameter 'MediaId'
description for EFI_STORAGE_SECURITY_COMMAND_PROTOCOL function ReceiveData
and SendData.

Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Signed-off-by: Qingyu 
---
 MdePkg/Include/Protocol/StorageSecurityCommand.h | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/MdePkg/Include/Protocol/StorageSecurityCommand.h 
b/MdePkg/Include/Protocol/StorageSecurityCommand.h
index 810af59b85c3..206ae79aff8d 100644
--- a/MdePkg/Include/Protocol/StorageSecurityCommand.h
+++ b/MdePkg/Include/Protocol/StorageSecurityCommand.h
@@ -59,7 +59,9 @@ typedef struct _EFI_STORAGE_SECURITY_COMMAND_PROTOCOL 
EFI_STORAGE_SECURITY_COMMA
   function shall return EFI_DEVICE_ERROR.
 
   @param  This Indicates a pointer to the calling 
context.
-  @param  MediaId  ID of the medium to receive data from.
+  @param  MediaId  ID of the medium to receive data from. 
If there is no
+   block IO protocol supported by the 
physical device, the
+   value of MediaId is undefined.
   @param  Timeout  The timeout, in 100ns units, to use for 
the execution
of the security protocol command. A 
Timeout value of 0
means that this function will wait 
indefinitely for the
@@ -138,7 +140,9 @@ EFI_STATUS
   shall return EFI_DEVICE_ERROR.
 
   @param  This Indicates a pointer to the calling 
context.
-  @param  MediaId  ID of the medium to receive data from.
+  @param  MediaId  ID of the medium to receive data from. 
If there is no
+   block IO protocol supported by the 
physical device, the
+   value of MediaId is undefined.
   @param  Timeout  The timeout, in 100ns units, to use for 
the execution
of the security protocol command. A 
Timeout value of 0
means that this function will wait 
indefinitely for the
-- 
2.39.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115951): https://edk2.groups.io/g/devel/message/115951
Mute This Topic: https://groups.io/mt/104581209/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] SctPkg: Fixed a pinter error in DevicePathFromTextBBTestCoverage.c

2024-02-26 Thread Heinrich Schuchardt

On 26.02.24 11:17, Chao Li wrote:

DevicePathFromTextBBTextCoverage.c function CreateDNSDeviceNode has a
bug, code:

SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH)));

DNS is a pointer, which is increased by a structure size and converted
to EFI_IPv4_ADDRESS*, which will point to an unknown address. So fix it.


Hello Chao,

thanks for diving into this.

Please, add

Fixes: 847e0363e846 ("SctPkg: Fix the UefiSct 
-Wincompatible-pointer-types warnings")




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

Cc: G Edhaya Chandran 
Cc: Barton Gao 
Cc: Carolyn Gjertsen 
Signed-off-by: Chao Li 
---
  .../BlackBoxTest/DevicePathFromTextBBTestCoverage.c   | 8 
  1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c
index c96ee246..bd11c25a 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c
@@ -1734,13 +1734,13 @@ CreateDNSDeviceNode (
}

if (DNS->IsIPv6 == 0) {
-SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH)));
-SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS)));
+SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)((UINT8 *)DNS + sizeof 
(DNS_DEVICE_PATH)));
+SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)((UINT8 *)DNS + sizeof 
(DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS)));
}

if (DNS->IsIPv6 == 1) {
-SctStrToIPv6Addr (, (EFI_IPv6_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH)));
-SctStrToIPv6Addr (, (EFI_IPv6_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS)));
+SctStrToIPv6Addr (, (EFI_IPv6_ADDRESS *)((UINT8 *)DNS + sizeof 
(DNS_DEVICE_PATH)));
+SctStrToIPv6Addr (, (EFI_IPv6_ADDRESS *)((UINT8 *)DNS + sizeof 
(DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS)));


The change looks correct.

I would prefer using the fields of the DNS_DEVICE_PATH typedef from 
MdePkg/Include/Protocol/DevicePath.h to avoid the conversions:


> +SctStrToIPv4Addr (, >DnsServerIp[0].v4)
> +SctStrToIPv4Addr (, >DnsServerIp[1].v4)

> +SctStrToIPv6Addr (, >DnsServerIp[0].v6)
> +SctStrToIPv6Addr (, >DnsServerIp[1].v6)

Best regards

Heinrich


}

return (EFI_DEVICE_PATH_PROTOCOL *) DNS;
--
2.27.0




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




Re: [edk2-devel] [PATCH] NetworkPkg:Resolved Consecutive Pxe-Http Boot Issue

2024-02-26 Thread Sivaraman Nainar via groups.io
@Saloni Kasbekar, @Zachary Clark-williams,

Could you please add your feedback on the changes proposed?

Thanks
Siva
-Original Message-
From: devel@edk2.groups.io  On Behalf Of Sivaraman Nainar 
via groups.io
Sent: Thursday, February 22, 2024 7:33 AM
To: Laszlo Ersek ; devel@edk2.groups.io; Santhosh Kumar V 
; Saloni Kasbekar ; Zachary 
Clark-williams 
Cc: Raj V Akilan ; Soundharia R 
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH] NetworkPkg:Resolved Consecutive 
Pxe-Http Boot Issue


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

Laszlo:

Thanks for the detailed feedback on the changes for this issue. Since we are 
not sure if this change are valid / violate some purpose of SNP driver, it 
mentioned as Workaround.

@Saloni Kasbekar and @Clark-williams, Zachary can add more on these changes.

As you recommended, we can have PCD which controls these changes till the 
changes are addressed in grub.

@Santhosh Kumar V is this issue can be seen only in SLES 15 or it can be found 
in any OS having Grub 2.x?

Thanks
Siva
-Original Message-
From: Laszlo Ersek 
Sent: Thursday, February 22, 2024 5:15 AM
To: devel@edk2.groups.io; Santhosh Kumar V 
Cc: Sivaraman Nainar ; Raj V Akilan ; 
Soundharia R ; Saloni Kasbekar 
; Zachary Clark-williams 

Subject: [EXTERNAL] Re: [edk2-devel] [PATCH] NetworkPkg:Resolved Consecutive 
Pxe-Http Boot Issue


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

On 2/21/24 18:15, Santhosh Kumar V via groups.io wrote:
> The customer has a server environment where PXE and HTTP service run in same 
> Linux Server. In this environment a SUT trying to boot to SLES 15 OS via PXE 
> from the Boot Menu. After PXE Boot file downloaded and grub Loaded without 
> continuing for installation Exit is pressed and control back to Setup.
> Now the HTTP boot to SLES 15 OS tried in the same environment and failed to 
> download the file. If there is a reconnect -r performed before this HTTP Boot 
> then boot file download and installation is getting success.
> Root cause of the issue is, when Exit from grub performed, boot Loader Stops 
> the SNP Driver and starts the same.

This sentence feels like the key one.

Are you saying that grub calls Snp->Start() just before it exits?

If so, am I right to suspect that that's a grub bug? It sounds like a resource 
leak, after all.

Can you perhaps include a grub source code location / pointer in the commit 
message?

> During this process SNP is in Initialized State. When HTTP boot is performed 
> immediately after PXE Failure, the MNP configure method initiates the SNP 
> Start again. Since the SNP already started by grub it returns 
> EFI_ALREADY_STARTED and none of the upper Layer drivers are getting started.
> As a work around in MNPConfigure(), if the SNP Start failed with Already 
> Started and in Initialized state we can return success so that rest of the 
> drivers can be loaded and HTTP boot can work.
>
>
> Cc: Saloni Kasbekar 
> Cc: Zachary Clark-williams 
>
> Signed-off-by: SanthoshKumar 
> ---
>  NetworkPkg/MnpDxe/MnpConfig.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/NetworkPkg/MnpDxe/MnpConfig.c
> b/NetworkPkg/MnpDxe/MnpConfig.c index 93587d53aa..0f2df28d73 100644
> --- a/NetworkPkg/MnpDxe/MnpConfig.c
> +++ b/NetworkPkg/MnpDxe/MnpConfig.c
> @@ -1120,7 +1120,9 @@ MnpStartSnp (
>// Start the simple network.
>
>//
>
>Status = Snp->Start (Snp);
>
> -
>
> +  if ((Status == EFI_ALREADY_STARTED ) && (Snp->Mode->State ==
> + EfiSimpleNetworkInitialized)) {
>
> +  return EFI_SUCCESS;
>
> +  }
>
>if (!EFI_ERROR (Status)) {
>
>  //
>
>  // Initialize the simple network.
>

The commit message does say this is a workaround, and I don't immediately any 
see why this workaround (in the code) would be problematic in practice, but it 
still leaves a bad taste in my mouth.

Consider: the call path is the following:

MnpConfigure()   [NetworkPkg/MnpDxe/MnpConfig.c] -- public .Configure() 
protocol member function
  MnpConfigureInstance() [NetworkPkg/MnpDxe/MnpConfig.c]
MnpStart()   [NetworkPkg/MnpDxe/MnpConfig.c]
  // see notes!
  MnpStartSnp()  [NetworkPkg/MnpDxe/MnpConfig.c]

Notes: the MnpStartSnp() call in MnpStart() is conditional on two circumstances 
(at the same time):
- "If it's not a configuration update, increase the configured children number."
- "It's the first configured child, start the simple network."

In other words, the MNP driver has just bound SNP "BY_DRIVER" (i.e., 
exclusively), installed the MNP service binding protocol for each vlan (IIUC), 
and one of those SB instances is now being used to create the first MNP 
instance. I think that under these circumstances, it is reasonable for the MNP 
driver to expect that the underlying SNP be 

[edk2-devel] [PATCH v1] SctPkg: Fixed a pinter error in DevicePathFromTextBBTestCoverage.c

2024-02-26 Thread Chao Li
DevicePathFromTextBBTextCoverage.c function CreateDNSDeviceNode has a
bug, code:

SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH)));

DNS is a pointer, which is increased by a structure size and converted
to EFI_IPv4_ADDRESS*, which will point to an unknown address. So fix it.

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

Cc: G Edhaya Chandran 
Cc: Barton Gao 
Cc: Carolyn Gjertsen 
Signed-off-by: Chao Li 
---
 .../BlackBoxTest/DevicePathFromTextBBTestCoverage.c   | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c
index c96ee246..bd11c25a 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c
@@ -1734,13 +1734,13 @@ CreateDNSDeviceNode (
   }
 
   if (DNS->IsIPv6 == 0) {
-SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH)));
-SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS)));
+SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)((UINT8 *)DNS + sizeof 
(DNS_DEVICE_PATH)));
+SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)((UINT8 *)DNS + sizeof 
(DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS)));
   }
 
   if (DNS->IsIPv6 == 1) {
-SctStrToIPv6Addr (, (EFI_IPv6_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH)));
-SctStrToIPv6Addr (, (EFI_IPv6_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS)));
+SctStrToIPv6Addr (, (EFI_IPv6_ADDRESS *)((UINT8 *)DNS + sizeof 
(DNS_DEVICE_PATH)));
+SctStrToIPv6Addr (, (EFI_IPv6_ADDRESS *)((UINT8 *)DNS + sizeof 
(DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS)));
   }
 
   return (EFI_DEVICE_PATH_PROTOCOL *) DNS;
-- 
2.27.0



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




[edk2-devel] [PATCH v3] IntelFsp2Pkg: Fsp 2.x Changes

2024-02-26 Thread cbduggap
Changes to support spec changes

1. Remove usage of Pcd.
2. Change code to validate the Temporary Ram size input.
3. Consume the input saved in YMM Register

Cc: Sai Chaganty 
Cc: Nate DeSimone 
Cc: Chiu Chasel 
Cc: Duggapu Chinni B 


Signed-off-by: Duggapu Chinni B 
---
 IntelFsp2Pkg/FspSecCore/Fsp24SecCoreM.inf |  2 +-
 IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf   |  2 +-
 IntelFsp2Pkg/FspSecCore/FspSecCoreT.inf   |  1 +
 .../FspSecCore/Ia32/Fsp24ApiEntryM.nasm   |  1 -
 .../FspSecCore/Ia32/FspApiEntryM.nasm |  1 -
 .../FspSecCore/Ia32/FspApiEntryT.nasm | 71 ++---
 .../FspSecCore/Ia32/SaveRestoreSseNasm.inc| 11 +++
 IntelFsp2Pkg/FspSecCore/SecFsp.c  | 23 --
 IntelFsp2Pkg/FspSecCore/SecFspApiChk.c|  4 +-
 IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm | 78 +++
 IntelFsp2Pkg/Include/FspEas/FspApi.h  |  5 +-
 .../Include/SaveRestoreSseAvxNasm.inc | 21 +
 IntelFsp2Pkg/IntelFsp2Pkg.dec |  4 +
 .../SecRamInitData.c  |  3 +-
 14 files changed, 186 insertions(+), 41 deletions(-)

diff --git a/IntelFsp2Pkg/FspSecCore/Fsp24SecCoreM.inf 
b/IntelFsp2Pkg/FspSecCore/Fsp24SecCoreM.inf
index cb011f99f9..cf8cb2eda9 100644
--- a/IntelFsp2Pkg/FspSecCore/Fsp24SecCoreM.inf
+++ b/IntelFsp2Pkg/FspSecCore/Fsp24SecCoreM.inf
@@ -63,11 +63,11 @@
 
 [Pcd]
   gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase  ## CONSUMES
-  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamSize  ## CONSUMES
   gIntelFsp2PkgTokenSpaceGuid.PcdFspTemporaryRamSize   ## CONSUMES
   gIntelFsp2PkgTokenSpaceGuid.PcdFspHeapSizePercentage ## CONSUMES
   gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxInterruptSupported  ## CONSUMES
   gIntelFsp2PkgTokenSpaceGuid.PcdFspPrivateTemporaryRamSize## CONSUMES
+  gIntelFsp2PkgTokenSpaceGuid.PcdGlobalDataPointerAddress  ## CONSUMES
 
 [Ppis]
   gEfiTemporaryRamSupportPpiGuid  ## PRODUCES
diff --git a/IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf 
b/IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf
index 8029832235..717941c33f 100644
--- a/IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf
+++ b/IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf
@@ -62,11 +62,11 @@
 
 [Pcd]
   gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase  ## CONSUMES
-  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamSize  ## CONSUMES
   gIntelFsp2PkgTokenSpaceGuid.PcdFspTemporaryRamSize   ## CONSUMES
   gIntelFsp2PkgTokenSpaceGuid.PcdFspHeapSizePercentage ## CONSUMES
   gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxInterruptSupported  ## CONSUMES
   gIntelFsp2PkgTokenSpaceGuid.PcdFspPrivateTemporaryRamSize## CONSUMES
+  gIntelFsp2PkgTokenSpaceGuid.PcdGlobalDataPointerAddress  ## CONSUMES
 
 [Ppis]
   gEfiTemporaryRamSupportPpiGuid  ## PRODUCES
diff --git a/IntelFsp2Pkg/FspSecCore/FspSecCoreT.inf 
b/IntelFsp2Pkg/FspSecCore/FspSecCoreT.inf
index e5a6eaa164..05c0d5f48b 100644
--- a/IntelFsp2Pkg/FspSecCore/FspSecCoreT.inf
+++ b/IntelFsp2Pkg/FspSecCore/FspSecCoreT.inf
@@ -51,6 +51,7 @@
   gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase  ## CONSUMES
   gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamSize  ## CONSUMES
   gIntelFsp2PkgTokenSpaceGuid.PcdFspReservedBufferSize ## CONSUMES
+  gIntelFsp2PkgTokenSpaceGuid.PcdGlobalDataPointerAddress  ## CONSUMES
 
 [Ppis]
   gEfiTemporaryRamSupportPpiGuid  ## PRODUCES
diff --git a/IntelFsp2Pkg/FspSecCore/Ia32/Fsp24ApiEntryM.nasm 
b/IntelFsp2Pkg/FspSecCore/Ia32/Fsp24ApiEntryM.nasm
index 15f8ecea83..5fa5c03569 100644
--- a/IntelFsp2Pkg/FspSecCore/Ia32/Fsp24ApiEntryM.nasm
+++ b/IntelFsp2Pkg/FspSecCore/Ia32/Fsp24ApiEntryM.nasm
@@ -11,7 +11,6 @@
 ; Following are fixed PCDs
 ;
 extern   ASM_PFX(PcdGet32(PcdTemporaryRamBase))
-extern   ASM_PFX(PcdGet32(PcdTemporaryRamSize))
 extern   ASM_PFX(PcdGet32(PcdFspTemporaryRamSize))
 extern   ASM_PFX(PcdGet8 (PcdFspHeapSizePercentage))
 
diff --git a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryM.nasm 
b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryM.nasm
index 61ab4612a3..861cce4d01 100644
--- a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryM.nasm
+++ b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryM.nasm
@@ -11,7 +11,6 @@
 ; Following are fixed PCDs
 ;
 extern   ASM_PFX(PcdGet32(PcdTemporaryRamBase))
-extern   ASM_PFX(PcdGet32(PcdTemporaryRamSize))
 extern   ASM_PFX(PcdGet32(PcdFspTemporaryRamSize))
 extern   ASM_PFX(PcdGet8 (PcdFspHeapSizePercentage))
 
diff --git a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryT.nasm 
b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryT.nasm
index 900126b93b..fd08b01839 100644
--- a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryT.nasm
+++ b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryT.nasm
@@ -16,6 +16,7 @@
 extern   ASM_PFX(PcdGet32 (PcdTemporaryRamBase))
 extern   ASM_PFX(PcdGet32 (PcdTemporaryRamSize))
 extern   ASM_PFX(PcdGet32 (PcdFspReservedBufferSize))
+extern   ASM_PFX(PcdGet32