Re: [edk2-devel] [edk2-libc Patch 1/1] AppPkg/Applications/Python/Python3.6.8: add IA32 support for py3 package creation batch script

2021-09-22 Thread Jayaprakash, N
Thank you Rebecca.
I have submitted the updated patch for review.

Regards,
JP

-Original Message-
From: Rebecca Cran  
Sent: 23 September 2021 06:59
To: Jayaprakash, N ; devel@edk2.groups.io
Cc: Kinney, Michael D 
Subject: Re: [edk2-devel] [edk2-libc Patch 1/1] 
AppPkg/Applications/Python/Python3.6.8: add IA32 support for py3 package 
creation batch script

You should be able to use the same branch.


-- 
Rebecca Cran


On 9/21/21 8:33 PM, Jayaprakash, N wrote:
> Hi Rebecca,
>
> Can I resubmit the patch after making these changes in the same development 
> branch or does it require creating a new branch?
>
> Regards,
> JP
>
> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Rebecca Cran
> Sent: 21 September 2021 22:05
> To: Jayaprakash, N ; devel@edk2.groups.io
> Cc: Kinney, Michael D 
> Subject: Re: [edk2-devel] [edk2-libc Patch 1/1] 
> AppPkg/Applications/Python/Python3.6.8: add IA32 support for py3 package 
> creation batch script
>
> There are several lines with trailing whitespace. Could you fix them please?
>
>
>   > git diff | grep " $"
>
>
> +echo Invalid command line arguments passed, please see the below usage
> instructions
>
>
>
> +   mkdir %OUT_FOLDER%\EFI\Tools
> +)
>
> +if not exist %OUT_FOLDER%\EFI\StdLib\lib\python36.8 (
>
> +    echo Python EFI package available at %OUT_FOLDER%
>
> +echo Then use this script to create a Python EFI package
>
>
>
> On 9/19/21 6:25 AM, Jayaprakash Nevara wrote:
>> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3638
>>
>> This change is to add IA32 support into py3 EFI package
>> creation batch script. Enhanced the script take Architecture
>> as an additional parameter. With this the script can be used
>> to create deployable Python 3.6.8 EFI package from X64 and IA32 builds
>> as required by the user
>>
>> Cc: Rebecca Cran 
>> Cc: Michael D Kinney 
>> Signed-off-by: Jayaprakash N 
>> ---
>>.../Python/Python-3.6.8/Py368ReadMe.txt   |  4 +-
>>.../Python-3.6.8/create_python368_pkg.bat | 62 ---
>>2 files changed, 41 insertions(+), 25 deletions(-)
>>
>> diff --git a/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt 
>> b/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt
>> index 94dbccc..8f4fdc6 100644
>> --- a/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt
>> +++ b/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt
>> @@ -118,11 +118,11 @@ system as follows:
>>  A script, create_python368_pkg.bat , is provided which facilitates the 
>> population
>>  of the target EFI package.  Execute this script from within the
>>  AppPkg/Applications/Python/Python-3.6.8 directory, providing the Tool 
>> Chain, Target
>> -  Build and destination directory which is the path to the destination 
>> directory.
>> +  Build, Architecture and Directory path to the destination directory.
>>  The appropriate contents of the 
>> AppPkg/Applications/Python/Python-3.6.8/Lib and
>>  Python368.efi Application from Build/AppPkg/RELEASE_VS2017/X64/ will be
>>  ^^
>> -  copied into the specified destination directory.
>> +  copied into the specified Destination directory.
>>
>>  Replace "RELEASE_VS2017", in the source path, with values appropriate 
>> for your tool chain.
>>
>> diff --git 
>> a/AppPkg/Applications/Python/Python-3.6.8/create_python368_pkg.bat 
>> b/AppPkg/Applications/Python/Python-3.6.8/create_python368_pkg.bat
>> index 6bbdbd9..2bb62b6 100644
>> --- a/AppPkg/Applications/Python/Python-3.6.8/create_python368_pkg.bat
>> +++ b/AppPkg/Applications/Python/Python-3.6.8/create_python368_pkg.bat
>> @@ -2,47 +2,63 @@
>>
>>set TOOL_CHAIN_TAG=%1
>>set TARGET=%2
>> -set OUT_FOLDER=%3
>> +set ARCH=%3
>> +set OUT_FOLDER=%4
>>if "%TOOL_CHAIN_TAG%"=="" goto usage
>>if "%TARGET%"=="" goto usage
>> +if "%ARCH%"=="" goto usage
>>if "%OUT_FOLDER%"=="" goto usage
>>goto continue
>>
>>:usage
>>echo.
>> +echo Batch Script to create Python EFI Package.
>>echo.
>> +echo Invalid command line arguments passed, please see the below usage 
>> instructions
>>echo.
>> -echo Creates Python EFI Package.
>> -echo.
>> -echo "Usage: %0   "
>> -echo.
>> -echoToolChain  = one of VS2013x86, VS2015x86, VS2017, VS2019
>> -echoTarget = one of RELEASE, DEBUG
>> -echoOutFolder  = Target folder where package needs to create
>> -echo.
>> +echo "Usage: %0"
>>echo.
>> +echoToolChain = one of VS2013x86, VS2015x86, VS2017, VS2019
>> +echoTarget= one of RELEASE, DEBUG
>> +echoArchitecture  = one of IA32, X64
>> +echoOutFolder = Output directory for creating the package
>>echo.
>>
>>goto :eof
>>
>>:continue
>>cd ..\..\..\..\
>> -IF NOT EXIST Build\AppPkg\%TARGET%_%TOOL_CHAIN_TAG%\X64\Python368.efi goto 
>> error
>> -mkdir %OUT_FOLDER%\EFI\Tools
>> -xcopy Build\AppPkg\%TARGET%_%TOOL_CHAIN_TAG%\X64\Python368.efi 
>> %

Re: [edk2-devel] [PATCH V2] MdeModulePkg/BootManagerMenuApp: Limit string drawing within one line

2021-09-22 Thread Gao, Zhichao
Hi Liming,

Yes. Because the design of the BM app is not aimed to display the boot option 
over one line. And it is not using the setup browser engine.
That would cause the difference.
If we want to make them align, there are two options:
1. BM app to use the setup browser engine
2. add scroll bar logic for the boot item

Both above change is not simple and may cause new issues. It would be a new 
design other than a bug fix.

Another solution is the patch V1 to limit the boot option description within 72 
characters. Ray pointed out it is not a good solution.

BTW, I would remove the change-id in next patch.

Thanks,
Zhichao

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of
> gaoliming
> Sent: Thursday, September 23, 2021 10:59 AM
> To: devel@edk2.groups.io; Gao, Zhichao ; Ni, Ray
> 
> Cc: Wang, Jian J 
> Subject: 回复: [edk2-devel] [PATCH V2]
> MdeModulePkg/BootManagerMenuApp: Limit string drawing within one line
> 
> Zhichao:
>   With this change, the same boot option will be displayed differently in
> BootManagerApp and BootManager Page. Is it the designed behavior?
> 
>   Besides, please remove change-id from the commit message.
> 
> Thanks
> Liming
> > -邮件原件-
> > 发件人: devel@edk2.groups.io  代表 Gao,
> Zhichao
> > 发送时间: 2021年9月22日 12:50
> > 收件人: Ni, Ray ; devel@edk2.groups.io; Liming Gao
> > 
> > 抄送: Wang, Jian J 
> > 主题: Re: [edk2-devel] [PATCH V2]
> MdeModulePkg/BootManagerMenuApp:
> > Limit string drawing within one line
> >
> > Hi Liming,
> >
> > The solution is different with the first time we discussed on the
> Bugzilla. Can
> > you review if it is OK to you?
> >
> > Thanks,
> > Zhichao
> >
> > > -Original Message-
> > > From: Ni, Ray 
> > > Sent: Wednesday, September 22, 2021 11:28 AM
> > > To: Gao, Zhichao ; devel@edk2.groups.io
> > > Cc: Wang, Jian J ; Liming Gao
> > > 
> > > Subject: RE: [PATCH V2] MdeModulePkg/BootManagerMenuApp: Limit
> > > string drawing within one line
> > >
> > > Reviewed-by: Ray Ni 
> > >
> > > -Original Message-
> > > From: Gao, Zhichao 
> > > Sent: Thursday, September 9, 2021 3:26 PM
> > > To: devel@edk2.groups.io
> > > Cc: Wang, Jian J ; Liming Gao
> > > ; Ni, Ray 
> > > Subject: [PATCH V2] MdeModulePkg/BootManagerMenuApp: Limit
> string
> > > drawing within one line
> > >
> > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3590
> > >
> > > Limit the draw box always within the screen's column and row.
> > > Limit the string drawing within one line.
> > >
> > > Change-Id: Ib7bd63cb07b23875a1e4f37ae80a422e1d5ed54f
> > > Cc: Jian J Wang 
> > > Cc: Liming Gao 
> > > Cc: Ray Ni 
> > > Signed-off-by: Zhichao Gao 
> > > ---
> > >
> > > V2:
> > >
> > > Drop the change in UefiBootManagerLib in V1.
> > >
> > > Add the limitation in BootManagerMenuApp instead.
> > >
> > >
> > >  .../BootManagerMenuApp/BootManagerMenu.c  | 72
> > > ++-
> > >  1 file changed, 69 insertions(+), 3 deletions(-)
> > >
> > > diff --git
> > >
> a/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.
> > > c
> > >
> b/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.
> > > c
> > > index 9e729074ec..d4bdeba073 100644
> > > ---
> > >
> a/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.
> > > c
> > > +++
> > >
> b/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.
> > > c
> > > @@ -1,7 +1,7 @@
> > >  /** @file
> > >
> > >The application to show the Boot Manager Menu.
> > >
> > >
> > >
> > > -Copyright (c) 2011 - 2018, Intel Corporation. All rights
> > > reserved.
> > >
> > > +Copyright (c) 2011 - 2021, Intel Corporation. All rights
> > > +reserved.
> > >
> > >  SPDX-License-Identifier: BSD-2-Clause-Patent
> > >
> > >
> > >
> > >  **/
> > >
> > > @@ -45,9 +45,56 @@ PrintStringAt (
> > >IN CHAR16*String
> > >
> > >)
> > >
> > >  {
> > >
> > > +  UINTN ScreenWidth;
> > >
> > > +  UINTN ScreenRows;
> > >
> > > +  CHAR16*TurncateString;
> > >
> > > +  EFI_STATUSStatus;
> > >
> > > +  UINTN ShowingLength;
> > >
> > >
> > >
> > >gST->ConOut->SetCursorPosition (gST->ConOut, Column, Row);
> > >
> > > -  return Print (L"%s", String);
> > >
> > > +
> > >
> > > +  gST->ConOut->QueryMode (
> > >
> > > + gST->ConOut,
> > >
> > > + gST->ConOut->Mode->Mode,
> > >
> > > + &ScreenWidth,
> > >
> > > + &ScreenRows
> > >
> > > + );
> > >
> > > +
> > >
> > > +  if (Column > (ScreenWidth - 1) || Row > (ScreenRows - 1)) {
> > >
> > > +return 0;
> > >
> > > +  }
> > >
> > > +
> > >
> > > +  if ((StrLen (String) + Column) > (ScreenWidth - 1)) {
> > >
> > > +//
> > >
> > > +// |  - ScreenWidth -   |
> > >
> > > +// ...Column.
> > >
> > > +// TurncateString length should leave one character for draw
> > > + box
> and
> > >
> > > +// require one character for string end.
> > >
> > > +//
> > >
> > > +ShowingLength = ScreenWidth - Colum

[edk2-devel] [PATCH EDK2 v1 1/1] UefiCpuPkg/CpuMpPei: Remove MigrateGdt declaration

2021-09-22 Thread wenyi,xie via groups.io
The definition of MigrateGdt has been moved to SecMain since
commit f6ec1dd3, so also remove declaration of MigrateGdt left
in CpuMpPei.

Cc: Eric Dong 
Cc: Ray Ni 
Cc: Rahul Kumar 
Signed-off-by: Wenyi Xie 
---
 UefiCpuPkg/CpuMpPei/CpuMpPei.h | 12 
 1 file changed, 12 deletions(-)

diff --git a/UefiCpuPkg/CpuMpPei/CpuMpPei.h b/UefiCpuPkg/CpuMpPei/CpuMpPei.h
index c6870656ca64..1dac4e2eb8b1 100644
--- a/UefiCpuPkg/CpuMpPei/CpuMpPei.h
+++ b/UefiCpuPkg/CpuMpPei/CpuMpPei.h
@@ -398,18 +398,6 @@ SecPlatformInformation2 (
  OUT EFI_SEC_PLATFORM_INFORMATION_RECORD2 *PlatformInformationRecord2
   );
 
-/**
-  Migrates the Global Descriptor Table (GDT) to permanent memory.
-
-  @retval   EFI_SUCCESS   The GDT was migrated successfully.
-  @retval   EFI_OUT_OF_RESOURCES  The GDT could not be migrated due to lack of 
available memory.
-
-**/
-EFI_STATUS
-MigrateGdt (
-  VOID
-  );
-
 /**
   Initializes MP and exceptions handlers.
 
-- 
2.20.1.windows.1



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




[edk2-devel] [PATCH EDK2 v1 0/1] UefiCpuPkg/CpuMpPei: Remove MigrateGdt declaration

2021-09-22 Thread wenyi,xie via groups.io
Main Changes :
1.remove declaration of MigrateGdt

Wenyi Xie (1):
  UefiCpuPkg/CpuMpPei: Remove MigrateGdt declaration

 UefiCpuPkg/CpuMpPei/CpuMpPei.h | 12 
 1 file changed, 12 deletions(-)

-- 
2.20.1.windows.1



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




Re: [edk2-devel] [PATCH] ArmPkg/ArmMmuLib AARCH64: avoid EL0 accessible mappings

2021-09-22 Thread Alexander Graf


On 22.09.21 18:19, Ard Biesheuvel wrote:
> We never run any code at EL0, and so it would seem that any access
> permissions set for EL0 (via the AP[1] attribute in the page tables) are
> irrelevant. We currently set EL0 and EL1 permissions to the same value
> arbitrarily.
>
> However, this causes problems on hardware like the Apple M1 running the
> hypervisor framework, which enters EL1 with SCTLR_EL1.SPAN enabled,
> which causes the Privileged Access Never (PAN) feature to be enabled on
> any exception taken to EL1, including the IRQ exceptions that handle our
> timer interrupt. When PAN is enabled, EL1 has no access to any mappings
> that are also accessible to EL0, causing the firmware to crash if it
> attempts to access such a mapping.
>
> Even though it is debatable whether or not SCTLR_EL1.SPAN should be
> disabled at entry or whether the firmware should put all UNKNOWN bits in
> all system registers in a consistent state (which it should), using EL0
> permissions serves no purpose whatsoever so let's fix that regardless.
>
> Signed-off-by: Ard Biesheuvel 


I can confirm that this unbreaks HVF guests running on M1 with
SCTLR_EL1.SPAN=0 as reset state.


Tested-by: Alexander Graf 

Alex





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




[edk2-devel] [PATCH 1/1] MdePkg: Fix DEVICE_SECURITY_EVENT_DATA_HEADER version definition

2021-09-22 Thread yi1 li
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3646

According to latest TCG PFP spec 1.05 revision 23,
(https://trustedcomputinggroup.org/resource/pc-client-specific
-platform-firmware-profile-specification/),
10.2.7 DEVICE_SECURITY_EVENT_DATA Structure,
the version should be 1.

Signed-off-by: yi1 li 
---
 MdePkg/Include/IndustryStandard/UefiTcgPlatform.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdePkg/Include/IndustryStandard/UefiTcgPlatform.h 
b/MdePkg/Include/IndustryStandard/UefiTcgPlatform.h
index 84023c434762..d5bc78611704 100644
--- a/MdePkg/Include/IndustryStandard/UefiTcgPlatform.h
+++ b/MdePkg/Include/IndustryStandard/UefiTcgPlatform.h
@@ -275,7 +275,7 @@ typedef struct tdUEFI_GPT_DATA {
 } UEFI_GPT_DATA;
 
 #define TCG_DEVICE_SECURITY_EVENT_DATA_SIGNATURE "SPDM Device Sec"
-#define TCG_DEVICE_SECURITY_EVENT_DATA_VERSION   0
+#define TCG_DEVICE_SECURITY_EVENT_DATA_VERSION   1
 
 #define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_TYPE_NULL  0
 #define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_TYPE_PCI   1
-- 
2.33.0.windows.2



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




Re: [edk2-devel] [PATCH v8 08/32] OvmfPkg/ResetVector: use SEV-SNP-validated CPUID values

2021-09-22 Thread Michael Roth via groups.io
On Wed, Sep 22, 2021 at 09:55:58AM +0200, Gerd Hoffmann wrote:
>   Hi,
> 
> > +; If SEV-SNP is enabled, use the CPUID page to handle the CPUID
> > +; instruction.
> > +mov ecx, SEV_STATUS_MSR
> > +rdmsr
> > +bt  eax, 2
> > +jc  SnpCpuidLookup
> 
> Maybe check SNP_CPUID_COUNT instead, so the cpuid page can also be used
> without SEV-SNP ?

One issue with that is that the contents of the CPUID page are not part
of guest measurement that will be checked later during attestation (only
the metadata such as page type/location is recorded in the measurement).

So if someone on the host slipped in, say, a malicious QEMU, and modified
it to zero out the CPUID page prior to launching the guest, it would end up
being accepted by firmware as legitimate CPUID table encoding 0 entries. So
implementing the check based on SNP_CPUID_COUNT would make it easy to bypass
the CPUID page in such a scenario, and even worse, they'd be able to get
all the way past attestation, since the CPUID metadata is the same, it's
only the contents that have changed.

Since the CPUID page is required by SNP, the approach taken here is to
always utilize it when SNP is enabled. In that case, if someone were to
maliciously zero out the CPUID page, it would still get used by the
guest, rather than bypassed, in which case the guest would never make it
to attestation since bits that get checked for early like
SEV/SEV-ES/SEV-SNP flags in 0x801F would all be 0.

That said, for the !SNP case, additional handling *could* be added to make
use of the CPUID page, but in that case it wouldn't be validated by firmware,
so isn't much better security-wise than asking KVM. It might be possible to
bake the CPUID page into the measurement to ensure integrity, but that
requires accounting for the CPUID page along with all the other elements of
the initial payload (like OVMF), and unlike with OVMF, the CPUID values
will vary often depending on guest configuration, and so cloud providers
would need to provide some sort of tooling to export this CPUID page to the
guest owner so it can be verified and accounted for in attestation, which
doesn't seem likely to get much uptake (and is probably at least partly why
the CPUID page contents aren't included in the measurement for SNP).

> 
> take care,
>   Gerd
> 


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




回复: [edk2-devel] [PATCH V2] MdeModulePkg/BootManagerMenuApp: Limit string drawing within one line

2021-09-22 Thread gaoliming
Zhichao:
  With this change, the same boot option will be displayed differently in
BootManagerApp and BootManager Page. Is it the designed behavior?

  Besides, please remove change-id from the commit message. 

Thanks
Liming
> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Gao, Zhichao
> 发送时间: 2021年9月22日 12:50
> 收件人: Ni, Ray ; devel@edk2.groups.io; Liming Gao
> 
> 抄送: Wang, Jian J 
> 主题: Re: [edk2-devel] [PATCH V2] MdeModulePkg/BootManagerMenuApp:
> Limit string drawing within one line
> 
> Hi Liming,
> 
> The solution is different with the first time we discussed on the
Bugzilla. Can
> you review if it is OK to you?
> 
> Thanks,
> Zhichao
> 
> > -Original Message-
> > From: Ni, Ray 
> > Sent: Wednesday, September 22, 2021 11:28 AM
> > To: Gao, Zhichao ; devel@edk2.groups.io
> > Cc: Wang, Jian J ; Liming Gao
> > 
> > Subject: RE: [PATCH V2] MdeModulePkg/BootManagerMenuApp: Limit
> > string drawing within one line
> >
> > Reviewed-by: Ray Ni 
> >
> > -Original Message-
> > From: Gao, Zhichao 
> > Sent: Thursday, September 9, 2021 3:26 PM
> > To: devel@edk2.groups.io
> > Cc: Wang, Jian J ; Liming Gao
> > ; Ni, Ray 
> > Subject: [PATCH V2] MdeModulePkg/BootManagerMenuApp: Limit string
> > drawing within one line
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3590
> >
> > Limit the draw box always within the screen's column and row.
> > Limit the string drawing within one line.
> >
> > Change-Id: Ib7bd63cb07b23875a1e4f37ae80a422e1d5ed54f
> > Cc: Jian J Wang 
> > Cc: Liming Gao 
> > Cc: Ray Ni 
> > Signed-off-by: Zhichao Gao 
> > ---
> >
> > V2:
> >
> > Drop the change in UefiBootManagerLib in V1.
> >
> > Add the limitation in BootManagerMenuApp instead.
> >
> >
> >  .../BootManagerMenuApp/BootManagerMenu.c  | 72
> > ++-
> >  1 file changed, 69 insertions(+), 3 deletions(-)
> >
> > diff --git
> > a/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.
> > c
> > b/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.
> > c
> > index 9e729074ec..d4bdeba073 100644
> > ---
> > a/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.
> > c
> > +++
> > b/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.
> > c
> > @@ -1,7 +1,7 @@
> >  /** @file
> >
> >The application to show the Boot Manager Menu.
> >
> >
> >
> > -Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
> >
> > +Copyright (c) 2011 - 2021, Intel Corporation. All rights reserved.
> >
> >  SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> >
> >
> >  **/
> >
> > @@ -45,9 +45,56 @@ PrintStringAt (
> >IN CHAR16*String
> >
> >)
> >
> >  {
> >
> > +  UINTN ScreenWidth;
> >
> > +  UINTN ScreenRows;
> >
> > +  CHAR16*TurncateString;
> >
> > +  EFI_STATUSStatus;
> >
> > +  UINTN ShowingLength;
> >
> >
> >
> >gST->ConOut->SetCursorPosition (gST->ConOut, Column, Row);
> >
> > -  return Print (L"%s", String);
> >
> > +
> >
> > +  gST->ConOut->QueryMode (
> >
> > + gST->ConOut,
> >
> > + gST->ConOut->Mode->Mode,
> >
> > + &ScreenWidth,
> >
> > + &ScreenRows
> >
> > + );
> >
> > +
> >
> > +  if (Column > (ScreenWidth - 1) || Row > (ScreenRows - 1)) {
> >
> > +return 0;
> >
> > +  }
> >
> > +
> >
> > +  if ((StrLen (String) + Column) > (ScreenWidth - 1)) {
> >
> > +//
> >
> > +// |  - ScreenWidth -   |
> >
> > +// ...Column.
> >
> > +// TurncateString length should leave one character for draw box
and
> >
> > +// require one character for string end.
> >
> > +//
> >
> > +ShowingLength = ScreenWidth - Column - 1;
> >
> > +TurncateString = AllocatePool ((ShowingLength + 1) * sizeof
(CHAR16));
> >
> > +
> >
> > +if (TurncateString == NULL) {
> >
> > +  return 0;
> >
> > +}
> >
> > +
> >
> > +Status = StrnCpyS (TurncateString, ShowingLength + 1, String,
> > ShowingLength - 3);
> >
> > +
> >
> > +if (EFI_ERROR (Status)) {
> >
> > +  FreePool (TurncateString);
> >
> > +  return 0;
> >
> > +}
> >
> > +
> >
> > +*(TurncateString + ShowingLength - 3) = L'.';
> >
> > +*(TurncateString + ShowingLength - 2) = L'.';
> >
> > +*(TurncateString + ShowingLength - 1) = L'.';
> >
> > +*(TurncateString + ShowingLength) = L'\0';
> >
> > +ShowingLength = Print (L"%s", TurncateString);
> >
> > +FreePool (TurncateString);
> >
> > +return ShowingLength;
> >
> > +  } else {
> >
> > +return Print (L"%s", String);
> >
> > +  }
> >
> >  }
> >
> >
> >
> >  /**
> >
> > @@ -68,7 +115,22 @@ PrintCharAt (
> >CHAR16   Character
> >
> >)
> >
> >  {
> >
> > +  UINTN ScreenWidth;
> >
> > +  UINTN ScreenRows;
> >
> > +
> >
> >gST->ConOut->SetCursorPosition (gST->ConOut, Column, Row);
> >
> > +
> >
> > +  gST->ConOut->QueryMode (
> >
> > + gST->ConOut,
> >
> > + gST->ConOut->Mode->Mode,
> >

[edk2-devel] 回复: [PATCH V2] On branch PCIBus dulePkg/PciBusDxe: PciTestSupportedAttribute logic should be changed.

2021-09-22 Thread gaoliming
Shengfeng: 
  Please update the patch title as PackageName ModuleName: Description. 
  And, please run BaseTools\Scripts\PatchCheck.py to check the patch format.

  
  For this patch, I don't review the code change. Please remove my
reviewed-by. 

Thanks
Liming
> -邮件原件-
> 发件人: xueshengfeng 
> 发送时间: 2021年9月22日 18:10
> 收件人: devel@edk2.groups.io; gaolim...@byosoft.com.cn;
> hao.a...@intel.com; ray...@intel.com
> 抄送: shengfengx@intel.com; panlingx.li...@intel.com
> 主题: [PATCH V2] On branch PCIBus dulePkg/PciBusDxe:
> PciTestSupportedAttribute logic should be changed.
> 
>  REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3635
> 
>  Currently, PciTestSupportedAttribute() set the bits
>  (EFI_PCI_COMMAND_IO_SPACE,
>   EFI_PCI_COMMAND_MEMORY_SPACE,
> EFI_PCI_COMMAND_BUS_MASTER,
>EFI_PCI_COMMAND_VGA_PALETTE_SNOOP) firstly,
>and then read back to check whethers these attributes are set
>successfully in the device.
>The flow is below:
>1), read the original register value
>2), set to the input register value
>3), read back the register value, return this value as output 4),
>  restore the original value.
> 
>This flow will cause the other enabled bits (other than
>EFI_PCI_COMMAND_IO_SPACE, EFI_PCI_COMMAND_MEMORY_SPACE,
>EFI_PCI_COMMAND_BUS_MASTER,
> EFI_PCI_COMMAND_VGA_PALETTE_SNOOP) be
>cleared for a short of time.
>Below are the new suggested flow:
>1), read the original register value.
>2), set to input register value OR(|) the original register value.
>3), read back the register value, return the value AND(&) the input
>  command value as output.
>4), restore the original value
> 
>  This flow can keep the enabled bits unchanged, and keep the
>  original function feature.
> 
>  Signed-off-by: shengfengx@intel.com
>  Reviewed-by: gaolim...@byosoft.com.cn
> ---
>  MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
> b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
> index db1b35f8ef..542e84424b 100644
> --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
> +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
> @@ -933,6 +933,7 @@ PciTestSupportedAttribute (
>)
>  {
>EFI_TPL OldTpl;
> +  UINT16  CommandTemp;
> 
>//
>// Preserve the original value
> @@ -944,9 +945,10 @@ PciTestSupportedAttribute (
>//
>OldTpl = gBS->RaiseTPL (TPL_HIGH_LEVEL);
> 
> -  PCI_SET_COMMAND_REGISTER (PciIoDevice, *Command);
> -  PCI_READ_COMMAND_REGISTER (PciIoDevice, Command);
> +  PCI_SET_COMMAND_REGISTER (PciIoDevice, (*Command |
> *OldCommand));
> +  PCI_READ_COMMAND_REGISTER (PciIoDevice, &CommandTemp);
> 
> +  *Command = (*Command) & CommandTemp;
>//
>// Write back the original value
>//
> --
> 2.31.1.windows.1





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




[edk2-devel] 回复: [PATCH 1/1] MdePkg: Fix DEVICE_SECURITY_EVENT_DATA_HEADER version definition

2021-09-22 Thread gaoliming
Reviewed-by: Liming Gao 

> -邮件原件-
> 发件人: yi1 li 
> 发送时间: 2021年9月23日 10:03
> 收件人: devel@edk2.groups.io
> 抄送: yi1 li ; Jiewen Yao ;
Michael
> D Kinney ; Liming Gao
> ; Zhiguang Liu 
> 主题: [PATCH 1/1] MdePkg: Fix DEVICE_SECURITY_EVENT_DATA_HEADER
> version definition
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3646
> 
> According to latest TCG PFP spec 1.05 revision 23,
> (https://trustedcomputinggroup.org/resource/pc-client-specific
> -platform-firmware-profile-specification/),
> 10.2.7 DEVICE_SECURITY_EVENT_DATA Structure,
> the version should be 1.
> 
> Cc: Jiewen Yao 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> 
> Signed-off-by: yi1 li 
> ---
>  MdePkg/Include/IndustryStandard/UefiTcgPlatform.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/MdePkg/Include/IndustryStandard/UefiTcgPlatform.h
> b/MdePkg/Include/IndustryStandard/UefiTcgPlatform.h
> index 84023c434762..d5bc78611704 100644
> --- a/MdePkg/Include/IndustryStandard/UefiTcgPlatform.h
> +++ b/MdePkg/Include/IndustryStandard/UefiTcgPlatform.h
> @@ -275,7 +275,7 @@ typedef struct tdUEFI_GPT_DATA {
>  } UEFI_GPT_DATA;
> 
>  #define TCG_DEVICE_SECURITY_EVENT_DATA_SIGNATURE "SPDM Device
> Sec"
> -#define TCG_DEVICE_SECURITY_EVENT_DATA_VERSION   0
> +#define TCG_DEVICE_SECURITY_EVENT_DATA_VERSION   1
> 
>  #define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_TYPE_NULL  0
>  #define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_TYPE_PCI   1
> --
> 2.33.0.windows.2





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




Re: [edk2-devel] [PATCH 1/1] MdePkg: Fix DEVICE_SECURITY_EVENT_DATA_HEADER version definition

2021-09-22 Thread Yao, Jiewen
Reviewed-by: Jiewen Yao 

> -Original Message-
> From: Li, Yi1 
> Sent: Thursday, September 23, 2021 10:03 AM
> To: devel@edk2.groups.io
> Cc: Li, Yi1 ; Yao, Jiewen ; Kinney,
> Michael D ; Liming Gao
> ; Liu, Zhiguang 
> Subject: [PATCH 1/1] MdePkg: Fix DEVICE_SECURITY_EVENT_DATA_HEADER
> version definition
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3646
> 
> According to latest TCG PFP spec 1.05 revision 23,
> (https://trustedcomputinggroup.org/resource/pc-client-specific
> -platform-firmware-profile-specification/),
> 10.2.7 DEVICE_SECURITY_EVENT_DATA Structure,
> the version should be 1.
> 
> Cc: Jiewen Yao 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> 
> Signed-off-by: yi1 li 
> ---
>  MdePkg/Include/IndustryStandard/UefiTcgPlatform.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/MdePkg/Include/IndustryStandard/UefiTcgPlatform.h
> b/MdePkg/Include/IndustryStandard/UefiTcgPlatform.h
> index 84023c434762..d5bc78611704 100644
> --- a/MdePkg/Include/IndustryStandard/UefiTcgPlatform.h
> +++ b/MdePkg/Include/IndustryStandard/UefiTcgPlatform.h
> @@ -275,7 +275,7 @@ typedef struct tdUEFI_GPT_DATA {
>  } UEFI_GPT_DATA;
> 
>  #define TCG_DEVICE_SECURITY_EVENT_DATA_SIGNATURE "SPDM Device Sec"
> -#define TCG_DEVICE_SECURITY_EVENT_DATA_VERSION   0
> +#define TCG_DEVICE_SECURITY_EVENT_DATA_VERSION   1
> 
>  #define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_TYPE_NULL  0
>  #define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_TYPE_PCI   1
> --
> 2.33.0.windows.2



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




Re: [edk2-devel] [edk2-libc Patch 1/1] AppPkg/Applications/Python/Python3.6.8: add IA32 support for py3 package creation batch script

2021-09-22 Thread Rebecca Cran

You should be able to use the same branch.


--
Rebecca Cran


On 9/21/21 8:33 PM, Jayaprakash, N wrote:

Hi Rebecca,

Can I resubmit the patch after making these changes in the same development 
branch or does it require creating a new branch?

Regards,
JP

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Rebecca Cran
Sent: 21 September 2021 22:05
To: Jayaprakash, N ; devel@edk2.groups.io
Cc: Kinney, Michael D 
Subject: Re: [edk2-devel] [edk2-libc Patch 1/1] 
AppPkg/Applications/Python/Python3.6.8: add IA32 support for py3 package 
creation batch script

There are several lines with trailing whitespace. Could you fix them please?


  > git diff | grep " $"


+echo Invalid command line arguments passed, please see the below usage
instructions



+   mkdir %OUT_FOLDER%\EFI\Tools
+)

+if not exist %OUT_FOLDER%\EFI\StdLib\lib\python36.8 (

+    echo Python EFI package available at %OUT_FOLDER%

+echo Then use this script to create a Python EFI package



On 9/19/21 6:25 AM, Jayaprakash Nevara wrote:

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

This change is to add IA32 support into py3 EFI package
creation batch script. Enhanced the script take Architecture
as an additional parameter. With this the script can be used
to create deployable Python 3.6.8 EFI package from X64 and IA32 builds
as required by the user

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Signed-off-by: Jayaprakash N 
---
   .../Python/Python-3.6.8/Py368ReadMe.txt   |  4 +-
   .../Python-3.6.8/create_python368_pkg.bat | 62 ---
   2 files changed, 41 insertions(+), 25 deletions(-)

diff --git a/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt 
b/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt
index 94dbccc..8f4fdc6 100644
--- a/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt
+++ b/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt
@@ -118,11 +118,11 @@ system as follows:
 A script, create_python368_pkg.bat , is provided which facilitates the 
population
 of the target EFI package.  Execute this script from within the
 AppPkg/Applications/Python/Python-3.6.8 directory, providing the Tool 
Chain, Target
-  Build and destination directory which is the path to the destination 
directory.
+  Build, Architecture and Directory path to the destination directory.
 The appropriate contents of the 
AppPkg/Applications/Python/Python-3.6.8/Lib and
 Python368.efi Application from Build/AppPkg/RELEASE_VS2017/X64/ will be
 ^^
-  copied into the specified destination directory.
+  copied into the specified Destination directory.
   
 Replace "RELEASE_VS2017", in the source path, with values appropriate for your tool chain.
   
diff --git a/AppPkg/Applications/Python/Python-3.6.8/create_python368_pkg.bat b/AppPkg/Applications/Python/Python-3.6.8/create_python368_pkg.bat

index 6bbdbd9..2bb62b6 100644
--- a/AppPkg/Applications/Python/Python-3.6.8/create_python368_pkg.bat
+++ b/AppPkg/Applications/Python/Python-3.6.8/create_python368_pkg.bat
@@ -2,47 +2,63 @@
   
   set TOOL_CHAIN_TAG=%1

   set TARGET=%2
-set OUT_FOLDER=%3
+set ARCH=%3
+set OUT_FOLDER=%4
   if "%TOOL_CHAIN_TAG%"=="" goto usage
   if "%TARGET%"=="" goto usage
+if "%ARCH%"=="" goto usage
   if "%OUT_FOLDER%"=="" goto usage
   goto continue
   
   :usage

   echo.
+echo Batch Script to create Python EFI Package.
   echo.
+echo Invalid command line arguments passed, please see the below usage 
instructions
   echo.
-echo Creates Python EFI Package.
-echo.
-echo "Usage: %0   "
-echo.
-echoToolChain  = one of VS2013x86, VS2015x86, VS2017, VS2019
-echoTarget = one of RELEASE, DEBUG
-echoOutFolder  = Target folder where package needs to create
-echo.
+echo "Usage: %0"
   echo.
+echoToolChain = one of VS2013x86, VS2015x86, VS2017, VS2019
+echoTarget= one of RELEASE, DEBUG
+echoArchitecture  = one of IA32, X64
+echoOutFolder = Output directory for creating the package
   echo.
   
   goto :eof
   
   :continue

   cd ..\..\..\..\
-IF NOT EXIST Build\AppPkg\%TARGET%_%TOOL_CHAIN_TAG%\X64\Python368.efi goto 
error
-mkdir %OUT_FOLDER%\EFI\Tools
-xcopy Build\AppPkg\%TARGET%_%TOOL_CHAIN_TAG%\X64\Python368.efi 
%OUT_FOLDER%\EFI\Tools\ /y
-mkdir %OUT_FOLDER%\EFI\StdLib\lib\python36.8
-mkdir %OUT_FOLDER%\EFI\StdLib\etc
-xcopy AppPkg\Applications\Python\Python-3.6.8\Lib\*
%OUT_FOLDER%\EFI\StdLib\lib\python36.8\  /Y /S /I
-xcopy StdLib\Efi\StdLib\etc\*%OUT_FOLDER%\EFI\StdLib\etc\  /Y /S /I
-goto all_done
-
-:error
-echo Failed to Create Python 3.6.8 Package, Python368.efi is not available on 
build location Build\AppPkg\%TARGET%_%TOOL_CHAIN_TAG%\X64\
+if not exist Build\AppPkg\%TARGET%_%TOOL_CHAIN_TAG%\%ARCH%\Python368.efi (
+goto error
+)
   
+if not exist %OUT_FOLDER%\EFI\Tools (

+   mkdir %OUT_FOLDER%\EFI\Tools
+)
+xcopy Build\AppPkg\%TARGET%_%TOOL_CHAIN_TAG%\%ARCH%\Python368.ef

[edk2-devel] [PATCH v2 2/2] BaseTools: Switch to downloading the AARCH64 compiler from Arm's site

2021-09-22 Thread Rebecca Cran
From: Rebecca Cran 

Linaro no longer do gcc releases - they're done by Arm now.

Update gcc_aarch64_linux_ext_dep.yaml to fetch the latest AARCH64 gcc
release (10.3-2021.07) from their site.

Signed-off-by: Rebecca Cran 
---
 BaseTools/Bin/gcc_aarch64_linux_ext_dep.yaml  | 10 +-
 BaseTools/Plugin/LinuxGcc5ToolChain/LinuxGcc5ToolChain.py |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/BaseTools/Bin/gcc_aarch64_linux_ext_dep.yaml 
b/BaseTools/Bin/gcc_aarch64_linux_ext_dep.yaml
index e81223fd9ad1..de7682b5521f 100644
--- a/BaseTools/Bin/gcc_aarch64_linux_ext_dep.yaml
+++ b/BaseTools/Bin/gcc_aarch64_linux_ext_dep.yaml
@@ -1,5 +1,5 @@
 ## @file
-# Download GCC AARCH64 compiler from Linaro's release site
+# Download GCC AARCH64 compiler from Arm's release site
 # Set shell variable GCC5_AARCH64_INSTALL to this folder
 #
 # This is only downloaded when a build activates scope gcc_aarch64_linux
@@ -11,11 +11,11 @@
   "scope": "gcc_aarch64_linux",
   "type": "web",
   "name": "gcc_aarch64_linux",
-  "source": 
"http://releases.linaro.org/components/toolchain/binaries/7.4-2019.02/aarch64-linux-gnu/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu.tar.xz";,
-  "version": "7.4.1",
-  "sha256": "27f1dc2c491ed61ae8f0d4b0c11de59cd2f7dd9c94761ee7153006fcac1bf9ab",
+  "source": 
"https://developer.arm.com/-/media/Files/downloads/gnu-a/10.3-2021.07/binrel/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu.tar.xz";,
+  "version": "10.3-2021.07",
+  "sha256": "1e33d53dea59c8de823bbdfe0798280bdcd138636c7060da9d77a97ded095a84",
   "compression_type": "tar",
-  "internal_path": "/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/",
+  "internal_path": "/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/",
   "flags": ["set_shell_var", ],
   "var_name": "GCC5_AARCH64_INSTALL"
 }
diff --git a/BaseTools/Plugin/LinuxGcc5ToolChain/LinuxGcc5ToolChain.py 
b/BaseTools/Plugin/LinuxGcc5ToolChain/LinuxGcc5ToolChain.py
index a695fc328565..f0685d804029 100644
--- a/BaseTools/Plugin/LinuxGcc5ToolChain/LinuxGcc5ToolChain.py
+++ b/BaseTools/Plugin/LinuxGcc5ToolChain/LinuxGcc5ToolChain.py
@@ -80,7 +80,7 @@ class LinuxGcc5ToolChain(IUefiBuildPlugin):
 return 0
 
 # make GCC5_AARCH64_PREFIX to align with tools_def.txt
-prefix = os.path.join(install_path, "bin", "aarch64-linux-gnu-")
+prefix = os.path.join(install_path, "bin", 
"aarch64-none-linux-gnu-")
 
shell_environment.GetEnvironment().set_shell_var("GCC5_AARCH64_PREFIX", prefix)
 
 # now confirm it exists
-- 
2.31.1



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




[edk2-devel] [PATCH v2 1/2] BaseTools: Switch to downloading the ARM compiler from Arm's site

2021-09-22 Thread Rebecca Cran
From: Rebecca Cran 

Linaro no longer do gcc releases - they're done by Arm now.
Update gcc_arm_linux_ext_dep.yaml to fetch the latest ARM gcc release
(10.3-2021.07) from their site.

Signed-off-by: Rebecca Cran 
---
 BaseTools/Bin/gcc_arm_linux_ext_dep.yaml  | 10 +-
 BaseTools/Plugin/LinuxGcc5ToolChain/LinuxGcc5ToolChain.py |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/BaseTools/Bin/gcc_arm_linux_ext_dep.yaml 
b/BaseTools/Bin/gcc_arm_linux_ext_dep.yaml
index 09481ceae05f..9b3c4e394fa1 100644
--- a/BaseTools/Bin/gcc_arm_linux_ext_dep.yaml
+++ b/BaseTools/Bin/gcc_arm_linux_ext_dep.yaml
@@ -1,5 +1,5 @@
 ## @file
-# Download GCC ARM compiler from Linaro's release site
+# Download GCC ARM compiler from Arm's release site
 # Set shell variable GCC5_ARM_INSTALL to this folder
 #
 # This is only downloaded when a build activates scope gcc_arm_linux
@@ -11,11 +11,11 @@
   "scope": "gcc_arm_linux",
   "type": "web",
   "name": "gcc_arm_linux",
-  "source": 
"https://releases.linaro.org/components/toolchain/binaries/7.4-2019.02/arm-linux-gnueabihf/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf.tar.xz";,
-  "version": "7.4.1",
-  "sha256": "3C951CF1941D0FA06D64CC0D5E88612B209D8123B273FA26C16D70BD7BC6B163",
+  "source": 
"https://developer.arm.com/-/media/Files/downloads/gnu-a/10.3-2021.07/binrel/gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf.tar.asc";,
+  "version": "10.3-2021.07",
+  "sha256": "aa074fa8371a4f73fecbd16bd62c8b1945f23289e26414794f130d6ccdf8e39c",
   "compression_type": "tar",
-  "internal_path": "/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/",
+  "internal_path": "/gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf/",
   "flags": ["set_shell_var", ],
   "var_name": "GCC5_ARM_INSTALL"
 }
diff --git a/BaseTools/Plugin/LinuxGcc5ToolChain/LinuxGcc5ToolChain.py 
b/BaseTools/Plugin/LinuxGcc5ToolChain/LinuxGcc5ToolChain.py
index 81075438d2e8..a695fc328565 100644
--- a/BaseTools/Plugin/LinuxGcc5ToolChain/LinuxGcc5ToolChain.py
+++ b/BaseTools/Plugin/LinuxGcc5ToolChain/LinuxGcc5ToolChain.py
@@ -57,7 +57,7 @@ class LinuxGcc5ToolChain(IUefiBuildPlugin):
 return 0
 
 # make GCC5_ARM_PREFIX to align with tools_def.txt
-prefix = os.path.join(install_path, "bin", "arm-linux-gnueabihf-")
+prefix = os.path.join(install_path, "bin", 
"arm-none-linux-gnueabihf-")
 
shell_environment.GetEnvironment().set_shell_var("GCC5_ARM_PREFIX", prefix)
 
 # now confirm it exists
-- 
2.31.1



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




[edk2-devel] [PATCH v2 0/2] BaseTools: Switch ARM/AARCH64 CI gcc from Linaro to Arm

2021-09-22 Thread Rebecca Cran
BaseTools/Bin/gcc_[arm,aarch64]_linux_ext_dep.yaml downloads GCC releases
from https://releases.linaro.org/components/toolchain/binaries/7.4-2019.02 . 

As indicated in the URL, those builds are from 2019 because Linaro no
longer do GCC releases, with that task having moved to Arm. 

The Arm GCC page is 
https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-a/downloads,
with the latest release being 10.3-2021.07.

gcc_aarch64_linux_ext_dep.yaml is used when setting up a CI
environment using the stuart tools.

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3594
PR: https://github.com/tianocore/edk2/pull/1909

Changes from v1 to v2:

Updated LinuxGcc5ToolChain.py to fix the toolchain prefix.


Rebecca Cran (2):
  BaseTools: Switch to downloading the ARM compiler from Arm's site
  BaseTools: Switch to downloading the AARCH64 compiler from Arm's site

 BaseTools/Bin/gcc_aarch64_linux_ext_dep.yaml  | 10 +-
 BaseTools/Bin/gcc_arm_linux_ext_dep.yaml  | 10 +-
 BaseTools/Plugin/LinuxGcc5ToolChain/LinuxGcc5ToolChain.py |  4 ++--
 3 files changed, 12 insertions(+), 12 deletions(-)

-- 
2.31.1



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




Re: [edk2-devel] [PATCH V7 1/1] OvmfPkg: Enable TDX in ResetVector

2021-09-22 Thread Min Xu
On September 22, 2021 3:49 PM, Gerd Hoffmann wrote:
>   Hi,
> 
> > +%ifdef ARCH_X64
> > +;
> > +; TDX Metadata offset block
> > +;
> > +; TdxMetadata.asm is included in ARCH_X64 because Inte TDX is only ;
> > +available in ARCH_X64. Below block describes the offset of ;
> > +TdxMetadata block in Ovmf image ; ; GUID :
> > +e47a6535-984a-4798-865e-4685a7bf8ec2
> > +;
> > +tdxMetadataOffsetStart:
> > +DD  tdxMetadataOffsetStart - TdxMetadataGuid - 16
> > +DW  tdxMetadataOffsetEnd - tdxMetadataOffsetStart
> > +DB  0x35, 0x65, 0x7a, 0xe4, 0x4a, 0x98, 0x98, 0x47
> > +DB  0x86, 0x5e, 0x46, 0x85, 0xa7, 0xbf, 0x8e, 0xc2
> > +tdxMetadataOffsetEnd:
> > +
> > +%endif
> 
> This should be switched to common ovmf metadata (see patches 4-7 of the
> SEV-SNP series).
> 
> Min: please have a look at these patches.
>
Hi, Gerd
I checked the patches 4-7 of the SEV-SNP series. The common OvmfMetadata is 
designed for both SEV and TDX, right? 
If so, then it means the SEV and TDX metadata will be mixed in this 
OvmfMetadata. I am thinking there will always be different fields for SEV and 
TDX. For example, SEV has PcdOvmfSecGhcbPageTable but TDX doesn't need that 
page. If the common OvmfMetadata is consumed by TDX-QEMU, then 
PcdOvmfSecGhcbPageTableBase will be initialized too. That doesn't make sense.
I am thinking that SEV and TDX can keep their own Metadata (in separate files, 
SevMetadata.asm and TdxMetadata.asm) which are pointed by the SEV or TDX 
offsets in the GUID-ed chain in ResetVector. In this case, SEV and TDX can 
design their own metadata flexibly, for example, the attribute, the item 
structure, add/remove/update the items, etc. And it will be more friendly to 
the reviewer for the Metadata, at least from the name of the items.
> 
> Brijesh: It might be useful to post the metadata patches as separate series.
> 
> > +; Load the GDT and set the CR0, then jump to Flat 32 protected mode.
> 
> That comment isn't correct, you are already in 32-bit mode.
Thanks. It will be updated in the next version.
> 
> > +; Modified:  EAX, EBX, CR0, CR4, DS, ES, FS, GS, SS
> 
> CS too ...
It will be fixed in the next version.
> 
> > +jmp LINEAR_CODE_SEL:dword
> ADDR_OF(jumpToFlat32BitAndLandHere)
> > +jumpToFlat32BitAndLandHere:
> 
> ... right here.
> 
> > --- /dev/null
> > +++ b/OvmfPkg/ResetVector/Main.asm
> 
> Can you add a separate patch for "copy Main.asm from UefiCpuPkg
> unmodified" please?  Having the changes for TDX separately is helpful for
> review.
Sure. It will be separated in the next version.
> 

Thanks!
Min


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




[edk2-devel] [PATCH 1/5] FmpDevicePkg/FmpDeviceLibNull: Add DXE_RUNTIME_DRIVER support

2021-09-22 Thread Bob Morgan via groups.io
Add DXE_RUNTIME_DRIVER to the list of module types supported.

Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Guomin Jiang 
Cc: Wei6 Xu 
Signed-off-by: Bob Morgan 
---
 FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLibNull.inf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLibNull.inf 
b/FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLibNull.inf
index 9c77e5bde0..bc9df06492 100644
--- a/FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLibNull.inf
+++ b/FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLibNull.inf
@@ -15,7 +15,7 @@
   FILE_GUID   = 8507642B-AE92-4664-B713-807F7774A96D
   MODULE_TYPE = DXE_DRIVER
   VERSION_STRING  = 1.0
-  LIBRARY_CLASS   = FmpDeviceLib|DXE_DRIVER UEFI_DRIVER
+  LIBRARY_CLASS   = FmpDeviceLib|DXE_DRIVER UEFI_DRIVER DXE_RUNTIME_DRIVER
 
 #
 # The following information is for reference only and not required by the 
build tools.
-- 
2.17.1



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




[edk2-devel] [PATCH 0/5] FmpDevicePkg: Add support for runtime FmpDxe driver

2021-09-22 Thread Bob Morgan via groups.io
Adds a runtime version of FmpDxe driver to allow firmware updates
after ExitBootServices() is called and enables DXE_RUNTIME_DRIVER
module type for associated FMP libraries.

Bob Morgan (5):
  FmpDevicePkg/FmpDeviceLibNull: Add DXE_RUNTIME_DRIVER support
  FmpDevicePkg/FmpPayloadHeaderLibV1: Add DXE_RUNTIME_DRIVER support
  FmpDevicePkg/FmpDependencyCheckLibNull: Add DXE_RUNTIME_DRIVER support
  FmpDevicePkg/FmpDependencyDeviceLibNull: Add DXE_RUNTIME_DRIVER
support
  FmpDevicePkg/FmpDxe: Add runtime FmpDxe driver

 FmpDevicePkg/FmpDevicePkg.dsc |  29 +++
 FmpDevicePkg/FmpDxe/FmpDxe.c  |  34 +++-
 FmpDevicePkg/FmpDxe/FmpRuntimeDxe.c   | 185 ++
 FmpDevicePkg/FmpDxe/FmpRuntimeDxe.inf |  87 
 FmpDevicePkg/FmpDxe/VariableSupport.c |   7 +
 .../FmpDependencyCheckLibNull.inf |   2 +-
 .../FmpDependencyDeviceLibNull.inf|   2 +-
 .../FmpDeviceLibNull/FmpDeviceLibNull.inf |   2 +-
 .../FmpPayloadHeaderLibV1.inf |   2 +-
 9 files changed, 336 insertions(+), 14 deletions(-)
 create mode 100644 FmpDevicePkg/FmpDxe/FmpRuntimeDxe.c
 create mode 100644 FmpDevicePkg/FmpDxe/FmpRuntimeDxe.inf

-- 
2.17.1



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




[edk2-devel] [PATCH 3/5] FmpDevicePkg/FmpDependencyCheckLibNull: Add DXE_RUNTIME_DRIVER support

2021-09-22 Thread Bob Morgan via groups.io
Add DXE_RUNTIME_DRIVER to the list of module types supported.

Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Guomin Jiang 
Cc: Wei6 Xu 
Signed-off-by: Bob Morgan 
---
 .../FmpDependencyCheckLibNull/FmpDependencyCheckLibNull.inf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/FmpDevicePkg/Library/FmpDependencyCheckLibNull/FmpDependencyCheckLibNull.inf 
b/FmpDevicePkg/Library/FmpDependencyCheckLibNull/FmpDependencyCheckLibNull.inf
index 5794d89191..c3962d7381 100644
--- 
a/FmpDevicePkg/Library/FmpDependencyCheckLibNull/FmpDependencyCheckLibNull.inf
+++ 
b/FmpDevicePkg/Library/FmpDependencyCheckLibNull/FmpDependencyCheckLibNull.inf
@@ -14,7 +14,7 @@
   FILE_GUID   = D63F3166-9CBC-4AC2-8F23-8818E42EA2BD
   MODULE_TYPE = DXE_DRIVER
   VERSION_STRING  = 1.0
-  LIBRARY_CLASS   = FmpDependencyCheckLib|DXE_DRIVER UEFI_DRIVER 
UEFI_APPLICATION
+  LIBRARY_CLASS   = FmpDependencyCheckLib|DXE_DRIVER UEFI_DRIVER 
UEFI_APPLICATION DXE_RUNTIME_DRIVER
 
 #
 # The following information is for reference only and not required by the 
build tools.
-- 
2.17.1



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




[edk2-devel] [PATCH 5/5] FmpDevicePkg/FmpDxe: Add runtime FmpDxe driver

2021-09-22 Thread Bob Morgan via groups.io
Adds a runtime version of FmpDxe driver to allow firmware updates after
ExitBootServices() is called.

Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Guomin Jiang 
Cc: Wei6 Xu 
Signed-off-by: Bob Morgan 
---
 FmpDevicePkg/FmpDevicePkg.dsc |  29 
 FmpDevicePkg/FmpDxe/FmpDxe.c  |  34 +++--
 FmpDevicePkg/FmpDxe/FmpRuntimeDxe.c   | 185 ++
 FmpDevicePkg/FmpDxe/FmpRuntimeDxe.inf |  87 
 FmpDevicePkg/FmpDxe/VariableSupport.c |   7 +
 5 files changed, 332 insertions(+), 10 deletions(-)
 create mode 100644 FmpDevicePkg/FmpDxe/FmpRuntimeDxe.c
 create mode 100644 FmpDevicePkg/FmpDxe/FmpRuntimeDxe.inf

diff --git a/FmpDevicePkg/FmpDevicePkg.dsc b/FmpDevicePkg/FmpDevicePkg.dsc
index b420f52a08..0f38e47ae4 100644
--- a/FmpDevicePkg/FmpDevicePkg.dsc
+++ b/FmpDevicePkg/FmpDevicePkg.dsc
@@ -29,6 +29,7 @@
   #
   DEFINE SYSTEM_FMP_ESRT_GUID   = B461B3BD-E62A-4A71-841C-50BA4E500267
   DEFINE DEVICE_FMP_ESRT_GUID   = 226034C4-8B67-4536-8653-D6EE7CE5A316
+  DEFINE RUNTIME_FMP_ESRT_GUID  = DECC975F-135A-426F-B667-ACA49E8CEF2A
 
   #
   # TRUE  - Build FmpDxe module for with storage access enabled
@@ -173,6 +174,34 @@
   
CapsuleUpdatePolicyLib|FmpDevicePkg/Library/CapsuleUpdatePolicyLibNull/CapsuleUpdatePolicyLibNull.inf
   }
 
+  FmpDevicePkg/FmpDxe/FmpRuntimeDxe.inf {
+
+  #
+  # FILE_GUID is used as ESRT GUID
+  #
+  FILE_GUID = $(RUNTIME_FMP_ESRT_GUID)
+
+  #
+  # Unicode name string that is used to populate FMP Image Descriptor for 
this capsule update module
+  #
+  gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName|L"Sample Firmware 
Device"
+  #
+  # Certificates used to authenticate capsule update image
+  #
+  !include 
BaseTools/Source/Python/Pkcs7Sign/TestRoot.cer.gFmpDevicePkgTokenSpaceGuid.PcdFmpDevicePkcs7CertBufferXdr.inc
+
+  
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageTypeIdGuid|{GUID("$(RUNTIME_FMP_ESRT_GUID)")}
+
+  UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
+
+  #
+  # Directly use a platform specific CapsuleUpdatePolicyLib instance.
+  # Only works for FmpDxe modules that are build from sources and included
+  # in a system firmware image.
+  #
+  
CapsuleUpdatePolicyLib|FmpDevicePkg/Library/CapsuleUpdatePolicyLibNull/CapsuleUpdatePolicyLibNull.inf
+  }
+
   #
   # Add UEFI Target Based Unit Tests
   #
diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c b/FmpDevicePkg/FmpDxe/FmpDxe.c
index 6b0675ea38..2ebf99d68b 100644
--- a/FmpDevicePkg/FmpDxe/FmpDxe.c
+++ b/FmpDevicePkg/FmpDxe/FmpDxe.c
@@ -84,6 +84,8 @@ const FIRMWARE_MANAGEMENT_PRIVATE_DATA  
mFirmwareManagementPrivateDataTemplate =
   TRUE // DependenciesSatisfied
 };
 
+FIRMWARE_MANAGEMENT_PRIVATE_DATA*mPrivate = NULL;
+
 ///
 /// GUID that is used to create event used to lock the firmware storage device.
 ///
@@ -99,6 +101,11 @@ EFI_FIRMWARE_MANAGEMENT_UPDATE_IMAGE_PROGRESS  
mProgressFunc = NULL;
 ///
 CHAR16  *mImageIdName = NULL;
 
+///
+/// Optional function to determine if we're executing after ExitBootServices().
+///
+BOOLEAN (EFIAPI *mFmpAtRuntimeFunction) (VOID) = NULL;
+
 /**
   Callback function to report the process of the firmware updating.
 
@@ -1451,8 +1458,10 @@ cleanup:
   //
   // Need repopulate after SetImage is called to
   // update LastAttemptVersion and LastAttemptStatus.
+  // But don't force repopulate if executing at runtime.
   //
-  if (Private != NULL) {
+  if ((Private != NULL) &&
+  ((mFmpAtRuntimeFunction == NULL) || !mFmpAtRuntimeFunction ())) {
 Private->DescriptorPopulated = FALSE;
   }
 
@@ -1628,16 +1637,21 @@ InstallFmpInstance (
   }
 
   //
-  // Allocate FMP Protocol instance
+  // Allocate FMP Protocol instance if FmpRuntimeDxe didn't already do it
   //
-  Private = AllocateCopyPool (
-  sizeof (mFirmwareManagementPrivateDataTemplate),
-  &mFirmwareManagementPrivateDataTemplate
-  );
-  if (Private == NULL) {
-DEBUG ((DEBUG_ERROR, "FmpDxe(%s): Failed to allocate memory for private 
structure.\n", mImageIdName));
-Status = EFI_OUT_OF_RESOURCES;
-goto cleanup;
+  if (mPrivate == NULL) {
+Private = AllocateCopyPool (
+sizeof (mFirmwareManagementPrivateDataTemplate),
+&mFirmwareManagementPrivateDataTemplate
+);
+if (Private == NULL) {
+  DEBUG ((DEBUG_ERROR, "FmpDxe(%s): Failed to allocate memory for private 
structure.\n", mImageIdName));
+  Status = EFI_OUT_OF_RESOURCES;
+  goto cleanup;
+}
+mPrivate = Private;
+  } else {
+Private = mPrivate;
   }
 
   //
diff --git a/FmpDevicePkg/FmpDxe/FmpRuntimeDxe.c 
b/FmpDevicePkg/FmpDxe/FmpRuntimeDxe.c
new file mode 100644
index 00..d7e0a988d6
--- /dev/null
+++ b/FmpDevicePkg/FmpDxe/FmpRuntimeDxe.c
@@ -0,0 +1,185 @@
+/** @file
+  Support for runtime Firmware Management Protocol
+
+  Copyright (c) 2021, NVIDIA CORPORATION. 

[edk2-devel] [PATCH 4/5] FmpDevicePkg/FmpDependencyDeviceLibNull: Add DXE_RUNTIME_DRIVER support

2021-09-22 Thread Bob Morgan via groups.io
Add DXE_RUNTIME_DRIVER to the list of module types supported.

Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Guomin Jiang 
Cc: Wei6 Xu 
Signed-off-by: Bob Morgan 
---
 .../FmpDependencyDeviceLibNull/FmpDependencyDeviceLibNull.inf   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/FmpDevicePkg/Library/FmpDependencyDeviceLibNull/FmpDependencyDeviceLibNull.inf
 
b/FmpDevicePkg/Library/FmpDependencyDeviceLibNull/FmpDependencyDeviceLibNull.inf
index d318cc9a67..6f87a487c4 100644
--- 
a/FmpDevicePkg/Library/FmpDependencyDeviceLibNull/FmpDependencyDeviceLibNull.inf
+++ 
b/FmpDevicePkg/Library/FmpDependencyDeviceLibNull/FmpDependencyDeviceLibNull.inf
@@ -13,7 +13,7 @@
   FILE_GUID   = 05BE67B1-0748-4022-97E6-7C0D2F992AA6
   MODULE_TYPE = DXE_DRIVER
   VERSION_STRING  = 1.0
-  LIBRARY_CLASS   = FmpDependencyDeviceLib|DXE_DRIVER UEFI_DRIVER
+  LIBRARY_CLASS   = FmpDependencyDeviceLib|DXE_DRIVER UEFI_DRIVER 
DXE_RUNTIME_DRIVER
 
 #
 # The following information is for reference only and not required by the 
build tools.
-- 
2.17.1



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




[edk2-devel] [PATCH 2/5] FmpDevicePkg/FmpPayloadHeaderLibV1: Add DXE_RUNTIME_DRIVER support

2021-09-22 Thread Bob Morgan via groups.io
Add DXE_RUNTIME_DRIVER to the list of module types supported.

Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Guomin Jiang 
Cc: Wei6 Xu 
Signed-off-by: Bob Morgan 
---
 .../Library/FmpPayloadHeaderLibV1/FmpPayloadHeaderLibV1.inf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/FmpDevicePkg/Library/FmpPayloadHeaderLibV1/FmpPayloadHeaderLibV1.inf 
b/FmpDevicePkg/Library/FmpPayloadHeaderLibV1/FmpPayloadHeaderLibV1.inf
index 0d6692dcec..7023631a74 100644
--- a/FmpDevicePkg/Library/FmpPayloadHeaderLibV1/FmpPayloadHeaderLibV1.inf
+++ b/FmpDevicePkg/Library/FmpPayloadHeaderLibV1/FmpPayloadHeaderLibV1.inf
@@ -17,7 +17,7 @@
   FILE_GUID  = 98A79A6C-513C-4E72-8375-39C0A7244C4B
   MODULE_TYPE= DXE_DRIVER
   VERSION_STRING = 1.0
-  LIBRARY_CLASS  = FmpPayloadHeaderLib|DXE_DRIVER UEFI_DRIVER 
UEFI_APPLICATION
+  LIBRARY_CLASS  = FmpPayloadHeaderLib|DXE_DRIVER UEFI_DRIVER 
UEFI_APPLICATION DXE_RUNTIME_DRIVER
 
 #
 #  VALID_ARCHITECTURES   = IA32 X64 ARM AARCH64
-- 
2.17.1



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




[edk2-devel] [PATCH 1/1] Qemu: SbsaQemu: Set the DSDT revision value to 2 to use 64-bit math

2021-09-22 Thread Rebecca Cran
Set the DSDT revision value to 2 by using the define from Acpi60.h
EFI_ACPI_6_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_REVISION. This
causes the AML interpreter to use full 64-bit integers and math.

Signed-off-by: Rebecca Cran 
---
 Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl 
b/Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl
index e056d6cdb02e..1bf9fbb99e75 100644
--- a/Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl
+++ b/Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl
@@ -6,6 +6,7 @@
 *  SPDX-License-Identifier: BSD-2-Clause-Patent
 **/
 
+#include 
 #include 
 
 #define LINK_DEVICE(Uid, LinkName, Irq)
\
@@ -25,8 +26,9 @@
 Address, Pin, Link, Zero   
\
   }
 
-DefinitionBlock ("DsdtTable.aml", "DSDT", 1, "LINARO", "SBSAQEMU",
- FixedPcdGet32 (PcdAcpiDefaultOemRevision)) {
+DefinitionBlock ("DsdtTable.aml", "DSDT",
+ EFI_ACPI_6_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_REVISION,
+ "LINARO", "SBSAQEMU", FixedPcdGet32 
(PcdAcpiDefaultOemRevision)) {
   Scope (_SB) {
 // UART PL011
 Device (COM0) {
-- 
2.31.1



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




[edk2-devel][edk2-platforms][PATCH V1 1/1] WhitleyOpenBoardPkg: Enable VT-D support

2021-09-22 Thread Oram, Isaac W
Implements VT-D DMAR table functionality.
VT-D is currently implemented as an OpenBoardPkg feature.
More work would be needed to promote to an Advanced Feature.
Specifically reducing dependencies and improving API and integration
with OpenBoardPkg ACPI implementation.

Cc: Nate DeSimone 
Cc: Chasel Chiu 
Signed-off-by: Isaac Oram 
---
 Platform/Intel/WhitleyOpenBoardPkg/Features/AcpiVtd/AcpiVTD.c   | 604 

 Platform/Intel/WhitleyOpenBoardPkg/Features/AcpiVtd/AcpiVTD.inf |  66 +++
 Platform/Intel/WhitleyOpenBoardPkg/Include/AcpiVTD.h|  53 ++
 Platform/Intel/WhitleyOpenBoardPkg/Include/Protocol/DmaRemap.h  | 108 
 Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dec  |   4 +
 Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc  |   2 +
 Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.fdf  |   2 +-
 Silicon/Intel/WhitleySiliconPkg/Include/IioSetupDefinitions.h   |   4 +
 8 files changed, 842 insertions(+), 1 deletion(-)

diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Features/AcpiVtd/AcpiVTD.c 
b/Platform/Intel/WhitleyOpenBoardPkg/Features/AcpiVtd/AcpiVTD.c
new file mode 100644
index 00..310d15b9ad
--- /dev/null
+++ b/Platform/Intel/WhitleyOpenBoardPkg/Features/AcpiVtd/AcpiVTD.c
@@ -0,0 +1,604 @@
+/** @file AcpiVtd.c
+
+  @copyright
+  Copyright 1996 - 2021 Intel Corporation. 
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+//
+// Statements that include other files
+//
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+VTD_SUPPORT_INSTANCE mPrivateData;
+
+#define MAX_BUS_ADDR_WIDTH 45
+
+/**
+
+  Add DMAR entry
+
+  @param This- DMA Remap protocol pointer
+  @param RemapType   - Type of DMA remapping structure to add
+  @param RemapEntry  - Entry to add
+
+  @retval EFI_INVALID_PARAMETER - DMA remapping support not initialized or 
entry is malformed
+  @retval EFI_UNSUPPORTED   - Adding entries is not supported
+  @retval EFI_SUCCESS   - The entry was inserted successfully.
+
+**/
+EFI_STATUS
+EFIAPI
+InsertDmaRemap (
+  IN  DMA_REMAP_PROTOCOL*This,
+  IN  REMAP_TYPERemapType,
+  IN  VOID  *RemapEntry
+  )
+{
+  UINTN   DevIndex;
+  EFI_ACPI_DMAR_HEADER*Dmar;
+  EFI_ACPI_DMAR_DRHD_HEADER   *Drhd;
+  EFI_ACPI_DMAR_RMRR_HEADER   *Rmrr;
+  EFI_ACPI_DMAR_SATC_HEADER   *Atsr;
+  EFI_ACPI_DMAR_RHSA_HEADER   *Rhsa;
+  EFI_ACPI_DMAR_DEVICE_SCOPE_STRUCTURE_HEADER *DevScope;
+  DMAR_DRHD   *DmaRemap;
+  DMAR_RMRR   *RevMemRegion;
+  DMAR_ATSR   *AtsrRegion;
+  DMAR_RHSA   *RhsaRegion;
+  EFI_ACPI_DMAR_PCI_PATH  *PciPath;
+  EFI_ACPI_DMAR_PCI_PATH  *PciInputPath;
+
+  if (mPrivateData.Dmar == NULL) {
+  ASSERT (FALSE);
+  return EFI_INVALID_PARAMETER;
+  }
+
+  Dmar = mPrivateData.Dmar;
+  if (((UINT8 *) Dmar + Dmar->Header.Length) == NULL) {
+  ASSERT (FALSE);
+  return EFI_INVALID_PARAMETER;
+  }
+
+  if (RemapType == DrhdType) {
+DmaRemap = (DMAR_DRHD *) RemapEntry;
+ASSERT (DmaRemap->Signature == DRHD_SIGNATURE);
+Drhd = (EFI_ACPI_DMAR_DRHD_HEADER *) ((UINT8 *) Dmar + 
Dmar->Header.Length);
+if (Drhd == NULL) {
+  ASSERT (FALSE);
+  return EFI_INVALID_PARAMETER;
+}
+
+if (DmaRemap->RegisterBase == 0) {
+  return EFI_UNSUPPORTED;
+}
+
+Drhd->Header.Type = EFI_ACPI_DMAR_TYPE_DRHD;
+Drhd->Header.Length   = sizeof (EFI_ACPI_DMAR_DRHD_HEADER);
+Drhd->Flags   = DmaRemap->Flags;
+Drhd->SegmentNumber   = DmaRemap->SegmentNumber;
+Drhd->RegisterBaseAddress = DmaRemap->RegisterBase;
+DevScope  = NULL;
+
+for (DevIndex = 0; DevIndex < DmaRemap->DeviceScopeNumber; DevIndex++) {
+  if (((UINT8 *) Drhd + Drhd->Header.Length) == NULL) {
+  ASSERT (FALSE);
+  return EFI_INVALID_PARAMETER;
+  }
+
+  DevScope = (EFI_ACPI_DMAR_DEVICE_SCOPE_STRUCTURE_HEADER *) ((UINT8 *) 
Drhd + Drhd->Header.Length);
+  if (DevScope != NULL) {
+DevScope->Type  = 
DmaRemap->DeviceScope[DevIndex].DeviceType;
+DevScope->Length= sizeof 
(EFI_ACPI_DMAR_DEVICE_SCOPE_STRUCTURE_HEADER);
+DevScope->EnumerationId = 
DmaRemap->DeviceScope[DevIndex].EnumerationID;
+DevScope->StartBusNumber= 
DmaRemap->DeviceScope[DevIndex].StartBusNumber;
+if (((UINT8 *) DevScope + DevScope->Length) == NULL) {
+  ASSERT (FALSE);
+  return EFI_INVALID_PARAM

[edk2-devel][edk2-platforms][PATCH V1 1/1] WhitleyOpenBoardPkg/PlatformHooksLib: Fix eSPI serial debug

2021-09-22 Thread Oram, Isaac W
Fix issue with missing debug messages on ESPI_ENABLE configuration.

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Signed-off-by: Isaac Oram 
---
 Platform/Intel/WhitleyOpenBoardPkg/Library/PlatformHooksLib/PlatformHooks.c | 
8 
 1 file changed, 8 insertions(+)

diff --git 
a/Platform/Intel/WhitleyOpenBoardPkg/Library/PlatformHooksLib/PlatformHooks.c 
b/Platform/Intel/WhitleyOpenBoardPkg/Library/PlatformHooksLib/PlatformHooks.c
index fa695358bf..8a93f41678 100644
--- 
a/Platform/Intel/WhitleyOpenBoardPkg/Library/PlatformHooksLib/PlatformHooks.c
+++ 
b/Platform/Intel/WhitleyOpenBoardPkg/Library/PlatformHooksLib/PlatformHooks.c
@@ -116,6 +116,13 @@ IsAspeedPresent (
  IoWrite8 (ASPEED2500_SIO_INDEX_PORT, REG_LOGICAL_DEVICE);
  IoWrite8 (ASPEED2500_SIO_DATA_PORT, ASPEED2500_SIO_UART1);
  if (IoRead8 (ASPEED2500_SIO_DATA_PORT) == ASPEED2500_SIO_UART1) {
+  //
+  // In ESPI mode, assume this SIO logic device always present.
+  //
+#ifdef ESPI_ENABLE
+  DeviceID = 0;
+  PresenceStatus = TRUE;
+#else
   //
   //right now, maybe it is ASPEED. to detect the  device ID.
   //
@@ -143,6 +150,7 @@ IsAspeedPresent (
   if ((DeviceID & 0xffff) == 0x0403) {
PresenceStatus = TRUE;
   }
+#endif
  }
  IoWrite8 (ASPEED2500_SIO_INDEX_PORT, ASPEED2500_SIO_LOCK);
  return PresenceStatus;
-- 
2.27.0.windows.1



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




Re: [edk2-devel] [PATCH] ArmPkg/ArmMmuLib AARCH64: avoid EL0 accessible mappings

2021-09-22 Thread Leif Lindholm
On Wed, Sep 22, 2021 at 18:19:54 +0200, Ard Biesheuvel wrote:
> We never run any code at EL0, and so it would seem that any access
> permissions set for EL0 (via the AP[1] attribute in the page tables) are
> irrelevant. We currently set EL0 and EL1 permissions to the same value
> arbitrarily.
> 
> However, this causes problems on hardware like the Apple M1 running the
> hypervisor framework, which enters EL1 with SCTLR_EL1.SPAN enabled,
> which causes the Privileged Access Never (PAN) feature to be enabled on
> any exception taken to EL1, including the IRQ exceptions that handle our
> timer interrupt. When PAN is enabled, EL1 has no access to any mappings
> that are also accessible to EL0, causing the firmware to crash if it
> attempts to access such a mapping.
> 
> Even though it is debatable whether or not SCTLR_EL1.SPAN should be
> disabled at entry or whether the firmware should put all UNKNOWN bits in
> all system registers in a consistent state (which it should), using EL0
> permissions serves no purpose whatsoever so let's fix that regardless.
> 
> Signed-off-by: Ard Biesheuvel 

Acked-by: Leif Lindholm 

Do we want to mirror this for (ARMv8) AArch32?

/
Leif

> ---
>  ArmPkg/Drivers/CpuDxe/AArch64/Mmu.c  | 2 +-
>  ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c | 6 +++---
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/ArmPkg/Drivers/CpuDxe/AArch64/Mmu.c 
> b/ArmPkg/Drivers/CpuDxe/AArch64/Mmu.c
> index 838803aa9b44..56ce84f37e8a 100644
> --- a/ArmPkg/Drivers/CpuDxe/AArch64/Mmu.c
> +++ b/ArmPkg/Drivers/CpuDxe/AArch64/Mmu.c
> @@ -283,7 +283,7 @@ EfiAttributeToArmAttribute (
>  
>// Determine protection attributes
>if ((EfiAttributes & EFI_MEMORY_RO) != 0) {
> -ArmAttributes |= TT_AP_RO_RO;
> +ArmAttributes |= TT_AP_NO_RO;
>}
>  
>// Process eXecute Never attribute
> diff --git a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c 
> b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c
> index 8c736d25bb80..512801c88638 100644
> --- a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c
> +++ b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c
> @@ -356,7 +356,7 @@ GcdAttributeToPageAttribute (
>}
>  
>if ((GcdAttributes & EFI_MEMORY_RO) != 0) {
> -PageAttributes |= TT_AP_RO_RO;
> +PageAttributes |= TT_AP_NO_RO;
>}
>  
>return PageAttributes | TT_AF;
> @@ -449,7 +449,7 @@ ArmSetMemoryRegionReadOnly (
>return SetMemoryRegionAttribute (
> BaseAddress,
> Length,
> -   TT_AP_RO_RO,
> +   TT_AP_NO_RO,
> ~TT_ADDRESS_MASK_BLOCK_ENTRY);
>  }
>  
> @@ -462,7 +462,7 @@ ArmClearMemoryRegionReadOnly (
>return SetMemoryRegionAttribute (
> BaseAddress,
> Length,
> -   TT_AP_RW_RW,
> +   TT_AP_NO_RW,
> ~(TT_ADDRESS_MASK_BLOCK_ENTRY | TT_AP_MASK));
>  }
>  
> -- 
> 2.30.2
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#80988): https://edk2.groups.io/g/devel/message/80988
Mute This Topic: https://groups.io/mt/85793856/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] IntelFsp2WrapperPkg: Make PcdFspModeSelection dynamic and set it accordingly

2021-09-22 Thread Zhang, Xiaoqiang
Thanks Chasel!

Best Regards,
Xiaoqiang Zhang

-Original Message-
From: Chiu, Chasel  
Sent: Wednesday, September 22, 2021 4:39 PM
To: Zhang, Xiaoqiang ; devel@edk2.groups.io
Cc: Desimone, Nathaniel L ; Zeng, Star 

Subject: RE: [PATCH v1] IntelFsp2WrapperPkg: Make PcdFspModeSelection dynamic 
and set it accordingly


Patch pushed: 
https://github.com/tianocore/edk2/commit/f334c5a41dc4702b1c767c6614025aa2f802f9a4

Thanks,
Chasel


> -Original Message-
> From: Zhang, Xiaoqiang 
> Sent: Thursday, September 16, 2021 11:45 AM
> To: devel@edk2.groups.io
> Cc: Zhang, Xiaoqiang ; Chiu, Chasel 
> ; Desimone, Nathaniel L 
> ; Zeng, Star 
> Subject: [PATCH v1] IntelFsp2WrapperPkg: Make PcdFspModeSelection 
> dynamic and set it accordingly
> 
> From: Zhang Xiaoqiang 
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3632
> 
> PcdFspModeSelection will be used to set FSP mode.
> Make PcdFspModeSelection dynamic and set it accordingly.
> 
> Signed-off-by: Zhang Xiaoqiang 
> Cc: Chasel Chiu 
> Cc: Nate DeSimone 
> Cc: Star Zeng 
> ---
>  IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec | 12 ++--
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> index a3b9363779..b8dac1b574 100644
> --- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> +++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> @@ -82,12 +82,6 @@
># @Prompt Skip FSP API from FSP wrapper.
> 
> 
> gIntelFsp2WrapperTokenSpaceGuid.PcdSkipFspApi|0x|UINT32|0x4
> 009
> 
> 
> 
> -  ## This PCD decides how Wrapper code utilizes FSP
> 
> -  # 0: DISPATCH mode (FSP Wrapper will load PeiCore from FSP without 
> calling FSP API)
> 
> -  # 1: API mode (FSP Wrapper will call FSP API)
> 
> -  #
> 
> -
> gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection|0x0001|UIN
> T8|0x400A
> 
> -
> 
>## This PCD decides how FSP is measured
> 
># 1) The BootGuard ACM may already measured the FSP component, such 
> as FSPT/FSPM.
> 
># We need a flag (PCD) to indicate if there is need to do such FSP 
> measurement or NOT.
> 
> @@ -106,6 +100,12 @@
> 
> gIntelFsp2WrapperTokenSpaceGuid.PcdFspMeasurementConfig|0x000
> 0|UINT32|0x400B
> 
> 
> 
>  [PcdsFixedAtBuild, PcdsPatchableInModule,PcdsDynamic,PcdsDynamicEx]
> 
> +  ## This PCD decides how Wrapper code utilizes FSP
> 
> +  # 0: DISPATCH mode (FSP Wrapper will load PeiCore from FSP without
> calling FSP API)
> 
> +  # 1: API mode (FSP Wrapper will call FSP API)
> 
> +  #
> 
> +
> gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection|0x0001|UIN
> T8|0x400A
> 
> +
> 
>#
> 
>## These are the base address of FSP-M/S
> 
>#
> 
> --
> 2.32.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#80987): https://edk2.groups.io/g/devel/message/80987
Mute This Topic: https://groups.io/mt/85644790/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/3] ArmVirtPkg: Disable the TPM2 platform hierarchy

2021-09-22 Thread Stefan Berger
From: Stefan Berger 

Disable the TPM2 platform hierarchy by directly calling
ConfigureTpmPlatformHierarchy().

Per the TCG firmware specification "TCG PC Client Platform Firmware Profile
Specification" the TPM 2 platform hierarchy needs to be disabled or a
random password set and discarded before the firmware passes control to the
next stage bootloader or kernel.

Current specs are here:
https://trustedcomputinggroup.org/wp-content/uploads/TCG_PCClient_PFP_r1p05_v23_pub.pdf

Section 11 states:
"Platform Firmware MUST protect access to the Platform Hierarchy
and prevent access to the platform hierarchy by non-manufacturer-
controlled components."

Link: https://bugzilla.tianocore.org/show_bug.cgi?id=3510
Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Sami Mujawar 
Cc: Gerd Hoffmann 
Signed-off-by: Stefan Berger 
Reviewed-by: Sami Mujawar 
---
 ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c  | 6 ++
 .../PlatformBootManagerLib/PlatformBootManagerLib.inf   | 1 +
 2 files changed, 7 insertions(+)

diff --git a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c 
b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c
index 69448ff65b..1848042f86 100644
--- a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c
+++ b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c
@@ -16,6 +16,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -696,6 +697,11 @@ PlatformBootManagerBeforeConsole (
   //
   EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid);
 
+  //
+  // Disable the TPM 2 platform hierarchy
+  //
+  ConfigureTpmPlatformHierarchy ();
+
   //
   // Dispatch deferred images after EndOfDxe event.
   //
diff --git 
a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf 
b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
index 9f54224d3e..997eb1a442 100644
--- a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+++ b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
@@ -48,6 +48,7 @@
   QemuBootOrderLib
   QemuLoadImageLib
   ReportStatusCodeLib
+  TpmPlatformHierarchyLib
   UefiBootManagerLib
   UefiBootServicesTableLib
   UefiLib
-- 
2.31.1



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




[edk2-devel] [PATCH v3 1/3] ArmVirtPkg/TPM: Add a NULL implementation of TpmPlatformHierarchyLib

2021-09-22 Thread Stefan Berger
From: Stefan Berger 

Add a NULL implementation of the library class TpmPlatformHierarchyLib.

Link: https://bugzilla.tianocore.org/show_bug.cgi?id=3510
Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Sami Mujawar 
Cc: Gerd Hoffmann 
Signed-off-by: Stefan Berger 
---
 .../PeiDxeTpmPlatformHierarchyLib.c   | 22 +
 .../PeiDxeTpmPlatformHierarchyLib.inf | 31 +++
 SecurityPkg/SecurityPkg.dsc   |  1 +
 3 files changed, 54 insertions(+)
 create mode 100644 
SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.c
 create mode 100644 
SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.inf

diff --git 
a/SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.c
 
b/SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.c
new file mode 100644
index 00..dfc8863830
--- /dev/null
+++ 
b/SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.c
@@ -0,0 +1,22 @@
+/** @file
+Null TPM Platform Hierarchy configuration library.
+
+This library provides stub functions for customizing the TPM's Platform 
Hierarchy.
+
+Copyright (c) 2021, IBM Corporation.
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+
+/**
+  A NULL implementation of ConfigureTpmPlatformHierarchy.
+**/
+VOID
+EFIAPI
+ConfigureTpmPlatformHierarchy (
+  )
+{
+  /* do nothing */
+}
diff --git 
a/SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.inf
 
b/SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.inf
new file mode 100644
index 00..1b1e9ad592
--- /dev/null
+++ 
b/SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.inf
@@ -0,0 +1,31 @@
+### @file
+#   NULL TPM Platform Hierarchy configuration library.
+#
+#   This library provides functions for customizing the TPM's Platform 
Hierarchy
+#   Authorization Value (platformAuth) and Platform Hierarchy Authorization
+#   Policy (platformPolicy) can be defined through this function.
+#
+# Copyright (c) 2019, Intel Corporation. All rights reserved.
+# Copyright (c) Microsoft Corporation.
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+###
+
+[Defines]
+  INF_VERSION= 1.27
+  BASE_NAME  = BasePlatform
+  FILE_GUID  = 8947A3F2-BfB4-45EF-968D-5C40C1CE6A58
+  MODULE_TYPE= BASE
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = TpmPlatformHierarchyLib|PEIM DXE_DRIVER
+
+[LibraryClasses]
+  BaseLib
+
+[Packages]
+  MdePkg/MdePkg.dec
+  SecurityPkg/SecurityPkg.dec
+
+[Sources]
+  PeiDxeTpmPlatformHierarchyLib.c
diff --git a/SecurityPkg/SecurityPkg.dsc b/SecurityPkg/SecurityPkg.dsc
index f1f678c492..37318c64c5 100644
--- a/SecurityPkg/SecurityPkg.dsc
+++ b/SecurityPkg/SecurityPkg.dsc
@@ -232,6 +232,7 @@
   SecurityPkg/Library/HashLibTpm2/HashLibTpm2.inf
 
   
SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.inf
+  
SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.inf
 
   #
   # TCG Storage.
-- 
2.31.1



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




[edk2-devel] [PATCH v3 2/3] ArmVirtPkg: Reference new TPM classes in the build system for compilation

2021-09-22 Thread Stefan Berger
From: Stefan Berger 

We just added the same functionality to the OvmfPkg. However, on x86, we
could use the notification mechanism around
gEfiDxeSmmReadyToLockProtocolGuid to indirectly invoke
ConfigureTpmPlatformHierarchy(). Since ARM does not have an SMM mode, we
have to use direct invocation of this function at the same place in
PlatformBootManagerBeforeConsole() as it is called on x86.

Link: https://bugzilla.tianocore.org/show_bug.cgi?id=3510
Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Sami Mujawar 
Cc: Gerd Hoffmann 
Signed-off-by: Stefan Berger 
Reviewed-by: Sami Mujawar 
---
 ArmVirtPkg/ArmVirtCloudHv.dsc   | 1 +
 ArmVirtPkg/ArmVirtQemu.dsc  | 2 ++
 ArmVirtPkg/ArmVirtQemuKernel.dsc| 1 +
 ArmVirtPkg/ArmVirtXen.dsc   | 1 +
 .../Library/PlatformBootManagerLib/PlatformBootManagerLib.inf   | 1 +
 5 files changed, 6 insertions(+)

diff --git a/ArmVirtPkg/ArmVirtCloudHv.dsc b/ArmVirtPkg/ArmVirtCloudHv.dsc
index f292ba6079..3475bb7f0d 100644
--- a/ArmVirtPkg/ArmVirtCloudHv.dsc
+++ b/ArmVirtPkg/ArmVirtCloudHv.dsc
@@ -55,6 +55,7 @@
   
PciHostBridgeUtilityLib|ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/ArmVirtPciHostBridgeUtilityLib.inf
 
   
TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
+  
TpmPlatformHierarchyLib|SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.inf
 
 !include MdePkg/MdeLibs.dsc.inc
 
diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
index 97539edef7..35aea68e02 100644
--- a/ArmVirtPkg/ArmVirtQemu.dsc
+++ b/ArmVirtPkg/ArmVirtQemu.dsc
@@ -86,8 +86,10 @@
   Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf
   
Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeTcg2PhysicalPresenceLib.inf
   
TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf
+  
TpmPlatformHierarchyLib|SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.inf
 !else
   
TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
+  
TpmPlatformHierarchyLib|SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.inf
 !endif
 
 [LibraryClasses.common.PEIM]
diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc
index 28064199c8..19c1908cd9 100644
--- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
+++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
@@ -80,6 +80,7 @@
   
PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
   
PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.inf
   
TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
+  
TpmPlatformHierarchyLib|SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.inf
 
 [LibraryClasses.common.DXE_DRIVER]
   
ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
diff --git a/ArmVirtPkg/ArmVirtXen.dsc b/ArmVirtPkg/ArmVirtXen.dsc
index 2b07a5ba19..dbc40e854b 100644
--- a/ArmVirtPkg/ArmVirtXen.dsc
+++ b/ArmVirtPkg/ArmVirtXen.dsc
@@ -50,6 +50,7 @@
   
PlatformBootManagerLib|ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
   
CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
   
TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
+  
TpmPlatformHierarchyLib|SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.inf
 
 [LibraryClasses.common.UEFI_DRIVER]
   UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
diff --git 
a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf 
b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
index 11f52e019b..9f54224d3e 100644
--- a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+++ b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
@@ -33,6 +33,7 @@
   MdeModulePkg/MdeModulePkg.dec
   MdePkg/MdePkg.dec
   OvmfPkg/OvmfPkg.dec
+  SecurityPkg/SecurityPkg.dec
   ShellPkg/ShellPkg.dec
 
 [LibraryClasses]
-- 
2.31.1



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




[edk2-devel] [PATCH v3 0/3] ArmVirtPkg: Disable the TPM 2 platform hierarchy

2021-09-22 Thread Stefan Berger
This series of patches disables the TPM 2 platform hierarchy.
We just added the same functionality to the OvmfPkg. However, on x86, we
could use the notification mechanism around gEfiDxeSmmReadyToLockProtocolGuid
to indirectly invoke ConfigureTpmPlatformHierarchy(). Since ARM does not
have an SMM mode this series now use direct invocation of this function
at the same place in PlatformBootManagerBeforeConsole() as it is done
on x86.

Regards,
   Stefan

v3:
  - Addressed Ard's comments on 1/3

v2:
  - Move Null implementation to SecurityPkg
  - Added suggested texts to commit messages and added Sami's R-b tags

Stefan Berger (3):
  ArmVirtPkg/TPM: Add a NULL implementation of TpmPlatformHierarchyLib
  ArmVirtPkg: Reference new TPM classes in the build system for
compilation
  ArmVirtPkg: Disable the TPM2 platform hierarchy

 ArmVirtPkg/ArmVirtCloudHv.dsc |  1 +
 ArmVirtPkg/ArmVirtQemu.dsc|  2 ++
 ArmVirtPkg/ArmVirtQemuKernel.dsc  |  1 +
 ArmVirtPkg/ArmVirtXen.dsc |  1 +
 .../PlatformBootManagerLib/PlatformBm.c   |  6 
 .../PlatformBootManagerLib.inf|  2 ++
 .../PeiDxeTpmPlatformHierarchyLib.c   | 22 +
 .../PeiDxeTpmPlatformHierarchyLib.inf | 31 +++
 SecurityPkg/SecurityPkg.dsc   |  1 +
 9 files changed, 67 insertions(+)
 create mode 100644 
SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.c
 create mode 100644 
SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.inf

-- 
2.31.1



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




Re: [edk2-devel] [RFC PATCH 1/3] ArmVirtPkg/TPM: Add a NULL implementation of TpmPlatformHierarchyLib

2021-09-22 Thread Stefan Berger

On 9/22/21 7:39 AM, Ard Biesheuvel wrote:




+[Defines]
+  INF_VERSION= 0x00010005

1.27

Originally all comes from this file here:
https://github.com/tianocore/edk2/blob/master/SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.inf#L16


Doesn't matter. New INFs use the latest version


+  BASE_NAME  = PeiDxeTpmPlatformHierarchyLibNull

Make this BasePlatform

Even though it will be different than here?
https://github.com/tianocore/edk2/blob/master/SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.inf#L17


Yes.




Fixed in upcoming v3.


   Stefan




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




[edk2-devel] [PATCH] ArmPkg/ArmMmuLib AARCH64: avoid EL0 accessible mappings

2021-09-22 Thread Ard Biesheuvel
We never run any code at EL0, and so it would seem that any access
permissions set for EL0 (via the AP[1] attribute in the page tables) are
irrelevant. We currently set EL0 and EL1 permissions to the same value
arbitrarily.

However, this causes problems on hardware like the Apple M1 running the
hypervisor framework, which enters EL1 with SCTLR_EL1.SPAN enabled,
which causes the Privileged Access Never (PAN) feature to be enabled on
any exception taken to EL1, including the IRQ exceptions that handle our
timer interrupt. When PAN is enabled, EL1 has no access to any mappings
that are also accessible to EL0, causing the firmware to crash if it
attempts to access such a mapping.

Even though it is debatable whether or not SCTLR_EL1.SPAN should be
disabled at entry or whether the firmware should put all UNKNOWN bits in
all system registers in a consistent state (which it should), using EL0
permissions serves no purpose whatsoever so let's fix that regardless.

Signed-off-by: Ard Biesheuvel 
---
 ArmPkg/Drivers/CpuDxe/AArch64/Mmu.c  | 2 +-
 ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/ArmPkg/Drivers/CpuDxe/AArch64/Mmu.c 
b/ArmPkg/Drivers/CpuDxe/AArch64/Mmu.c
index 838803aa9b44..56ce84f37e8a 100644
--- a/ArmPkg/Drivers/CpuDxe/AArch64/Mmu.c
+++ b/ArmPkg/Drivers/CpuDxe/AArch64/Mmu.c
@@ -283,7 +283,7 @@ EfiAttributeToArmAttribute (
 
   // Determine protection attributes
   if ((EfiAttributes & EFI_MEMORY_RO) != 0) {
-ArmAttributes |= TT_AP_RO_RO;
+ArmAttributes |= TT_AP_NO_RO;
   }
 
   // Process eXecute Never attribute
diff --git a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c 
b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c
index 8c736d25bb80..512801c88638 100644
--- a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c
+++ b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c
@@ -356,7 +356,7 @@ GcdAttributeToPageAttribute (
   }
 
   if ((GcdAttributes & EFI_MEMORY_RO) != 0) {
-PageAttributes |= TT_AP_RO_RO;
+PageAttributes |= TT_AP_NO_RO;
   }
 
   return PageAttributes | TT_AF;
@@ -449,7 +449,7 @@ ArmSetMemoryRegionReadOnly (
   return SetMemoryRegionAttribute (
BaseAddress,
Length,
-   TT_AP_RO_RO,
+   TT_AP_NO_RO,
~TT_ADDRESS_MASK_BLOCK_ENTRY);
 }
 
@@ -462,7 +462,7 @@ ArmClearMemoryRegionReadOnly (
   return SetMemoryRegionAttribute (
BaseAddress,
Length,
-   TT_AP_RW_RW,
+   TT_AP_NO_RW,
~(TT_ADDRESS_MASK_BLOCK_ENTRY | TT_AP_MASK));
 }
 
-- 
2.30.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#80981): https://edk2.groups.io/g/devel/message/80981
Mute This Topic: https://groups.io/mt/85793856/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 10/10] DynamicTablesPkg: Rework AmlResourceDataCodegen.c/h

2021-09-22 Thread Sami Mujawar
Hi Pierre,

Thank you for this patch.
These updates look good to me.

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#80980): https://edk2.groups.io/g/devel/message/80980
Mute This Topic: https://groups.io/mt/83735193/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 09/10] DynamicTablesPkg: Deprecate Crs specific methods in AmlLib

2021-09-22 Thread Sami Mujawar
Hi Pierre,

Thank you for this patch.

On Wed, Jun 23, 2021 at 04:05 AM, PierreGondois wrote:

> 
> - Create aliases having of the 'Crs' function prototypes. These
> aliases are available when DISABLE_NEW_DEPRECATED_INTERFACES
> is not defined. They will be deprecated in a near future.

Is it possible to list the deprecated APIs in the commit message, please?

Other than that this patch looks good to me.

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#80979): https://edk2.groups.io/g/devel/message/80979
Mute This Topic: https://groups.io/mt/83735192/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 08/10] DynamicTablesPkg: Update DynamicTablesPkg.ci.yaml

2021-09-22 Thread Sami Mujawar
Hi Pierre,

On Wed, Jun 23, 2021 at 04:05 AM, PierreGondois wrote:

> 
> 2- Disable the Ecc check 8003 for the following keyword:
> "DISABLE_NEW_DEPRECATED_INTERFACES"
> Indeed, this error has been corrected on the latest version of
> BaseTools, but is still triggered when using the older python
> packages containing the BaseTools.

Can you check if the 8003 error needs to be disabled with latest Basetools, 
please? If not can you drop this part from the patch.

Regards,

Sami Mujawar


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#80978): https://edk2.groups.io/g/devel/message/80978
Mute This Topic: https://groups.io/mt/83735191/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 07/10] DynamicTablesPkg: Use %a formatter in AmlDbgPrint

2021-09-22 Thread Sami Mujawar
Hi Pierre,

This change looks good to me.

Reviewed-by: Sami Mujawar 

Thanks,

Sami Mujawar


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#80977): https://edk2.groups.io/g/devel/message/80977
Mute This Topic: https://groups.io/mt/83735190/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 05/10] DynamicTablesPkg: Add AmlGetEisaIdFromString() to AcpiHelperLib

2021-09-22 Thread Sami Mujawar
Hi Pierre,

This patch looks good to me.

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#80976): https://edk2.groups.io/g/devel/message/80976
Mute This Topic: https://groups.io/mt/83735188/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 04/10] DynamicTablesPkg: Add HexFromAscii() to AcpiHelperLib

2021-09-22 Thread Sami Mujawar
Hi Pierre,

Thank you for this patch.

On Wed, Jun 23, 2021 at 04:05 AM, PierreGondois wrote:

> 
> + @return The corresponding integer (between 0-16).

I have a minor suggestion to update the documentation for the value returned in 
error scenario. Other than that this patch looks good to me.
With that changed,

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#80975): https://edk2.groups.io/g/devel/message/80975
Mute This Topic: https://groups.io/mt/83735187/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 03/10] DynamicTablesPkg: Rename single char input parameter

2021-09-22 Thread Sami Mujawar
Hi Pierre,

Thank you for this patch.

I have a minor comment.

On Wed, Jun 23, 2021 at 04:05 AM, PierreGondois wrote:

> 
> @return The ASCII code corresponding to x.

Can you update the documentation for the value returned, please? Also, describe 
the value that would be returned in an error scenario.

With that changed,
Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#80974): https://edk2.groups.io/g/devel/message/80974
Mute This Topic: https://groups.io/mt/83735186/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 02/10] DynamicTablesPkg: Update TableHelperLib.inf

2021-09-22 Thread Sami Mujawar
Hi Pierre,

Thank you for this patch.

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#80973): https://edk2.groups.io/g/devel/message/80973
Mute This Topic: https://groups.io/mt/83735184/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 01/10] DynamicTablesPkg: Extract AcpiTableHelperLib from TableHelperLib

2021-09-22 Thread Sami Mujawar
Hi Pierre,

Thank you for this patch.

On Wed, Jun 23, 2021 at 04:05 AM, PierreGondois wrote:

> 
> To allow using these generic functions without including
> DynamicTablesPkg definitions, move them to a new AcpiTableHelperLib
> library.

I think you mean AcpiHelperLib not AcpiTableHelperLib here, right?

With that changed,
Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar


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




[edk2-devel] [PATCH v5] IntelFsp2WrapperPkg : FSPM/S UPD data address based on Build Type

2021-09-22 Thread Ashraf Ali S
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3642
when the module is not building in IA32 mode which will lead to
building error. when a module built-in X64 function pointer will be the
size of 64bit width which cannot be fit in 32bit address which will lead
to error. to overcome this issue introducing the 2 new PCD's
for the 64bit modules can consume it.
Creating the API's to support different architecture

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Star Zeng 
Cc: Kuo Ted 
Cc: Duggapu Chinni B 
Cc: Rangasai V Chaganty 
Cc: Digant H Solanki 
Cc: Sangeetha V 
Cc: Ray Ni 
Signed-off-by: Ashraf Ali S 
---
 .../FspmWrapperPeim/FspmWrapperPeim.c |  8 +++---
 .../FspmWrapperPeim/FspmWrapperPeim.inf   | 16 ++--
 .../FspmWrapperPeim/IA32/FspmHelper.c | 26 +++
 .../FspmWrapperPeim/X64/FspmHelper.c  | 26 +++
 .../FspsWrapperPeim/FspsWrapperPeim.c |  6 ++---
 .../FspsWrapperPeim/FspsWrapperPeim.inf   | 14 +-
 .../FspsWrapperPeim/IA32/FspsHelper.c | 26 +++
 .../FspsWrapperPeim/X64/FspsHelper.c  | 26 +++
 .../Include/Library/FspWrapperPlatformLib.h   | 24 -
 IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec   |  2 ++
 10 files changed, 163 insertions(+), 11 deletions(-)
 create mode 100644 IntelFsp2WrapperPkg/FspmWrapperPeim/IA32/FspmHelper.c
 create mode 100644 IntelFsp2WrapperPkg/FspmWrapperPeim/X64/FspmHelper.c
 create mode 100644 IntelFsp2WrapperPkg/FspsWrapperPeim/IA32/FspsHelper.c
 create mode 100644 IntelFsp2WrapperPkg/FspsWrapperPeim/X64/FspsHelper.c

diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c 
b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
index 24ab534620..6f2f0018ac 100644
--- a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
+++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
@@ -3,7 +3,7 @@
   register TemporaryRamDonePpi to call TempRamExit API, and register 
MemoryDiscoveredPpi
   notify to call FspSiliconInit API.
 
-  Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.
+  Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -59,7 +59,7 @@ PeiFspMemoryInit (
 
   DEBUG ((DEBUG_INFO, "PeiFspMemoryInit enter\n"));
 
-  FspHobListPtr = NULL;
+  FspHobListPtr  = NULL;
   FspmUpdDataPtr = NULL;
 
   FspmHeaderPtr = (FSP_INFO_HEADER *) FspFindFspHeader (PcdGet32 
(PcdFspmBaseAddress));
@@ -68,7 +68,7 @@ PeiFspMemoryInit (
 return EFI_DEVICE_ERROR;
   }
 
-  if (PcdGet32 (PcdFspmUpdDataAddress) == 0 && (FspmHeaderPtr->CfgRegionSize 
!= 0) && (FspmHeaderPtr->CfgRegionOffset != 0)) {
+  if (GetFspmUpdDataAddress () == 0 && (FspmHeaderPtr->CfgRegionSize != 0) && 
(FspmHeaderPtr->CfgRegionOffset != 0)) {
 //
 // Copy default FSP-M UPD data from Flash
 //
@@ -80,7 +80,7 @@ PeiFspMemoryInit (
 //
 // External UPD is ready, get the buffer from PCD pointer.
 //
-FspmUpdDataPtr = (FSPM_UPD_COMMON *)PcdGet32 (PcdFspmUpdDataAddress);
+FspmUpdDataPtr = (FSPM_UPD_COMMON *) GetFspmUpdDataAddress ();
 ASSERT (FspmUpdDataPtr != NULL);
   }
 
diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf 
b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf
index 00166e56a0..5b4ad531e7 100644
--- a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf
+++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf
@@ -6,7 +6,7 @@
 # register TemporaryRamDonePpi to call TempRamExit API, and register 
MemoryDiscoveredPpi
 # notify to call FspSiliconInit API.
 #
-#  Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.
+#  Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -45,6 +45,7 @@
   FspWrapperApiLib
   FspWrapperApiTestLib
   FspMeasurementLib
+  PcdLib
 
 [Packages]
   MdePkg/MdePkg.dec
@@ -56,14 +57,25 @@
 
 [Pcd]
   gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress   ## CONSUMES
-  gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress## CONSUMES
   gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection  ## CONSUMES
   gIntelFsp2WrapperTokenSpaceGuid.PcdFsptBaseAddress   ## CONSUMES
   gIntelFsp2WrapperTokenSpaceGuid.PcdFspMeasurementConfig  ## CONSUMES
 
+[Pcd.IA32]
+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress## CONSUMES
+
+[Pcd.X64]
+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress64  ## CONSUMES
+
 [Sources]
   FspmWrapperPeim.c
 
+[Sources.IA32]
+  IA32/FspmHelper.c
+
+[Sources.X64]
+  X64/FspmHelper.c
+
 [Guids]
   gFspHobGuid   ## PRODUCES ## HOB
   gFspApiPerformanceGuid## SOMETIMES_CONSUMES ## GUID
diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/IA32/FspmHelper.c 
b/IntelFsp2WrapperPkg/FspmWrapperPeim/IA32/FspmHelper.c
new file mode 100644
index 00..cab11173cc
--- /dev/null
+++ b/IntelFsp2WrapperPkg/FspmWrapperPeim

[edk2-devel] [PATCH v4] IntelFsp2WrapperPkg : FSPM/S UPD data address based on Build Type

2021-09-22 Thread Ashraf Ali S
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3642
when the module is not building in IA32 mode which will lead to
building error. when a module built-in X64 function pointer will be the
size of 64bit width which cannot be fit in 32bit address which will lead
to error. to overcome this issue introducing the 2 new PCD's
for the 64bit modules can consume it.
Creating the API's to support different architecture

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Star Zeng 
Cc: Kuo Ted 
Cc: Duggapu Chinni B 
Cc: Rangasai V Chaganty 
Cc: Digant H Solanki 
Cc: Sangeetha V 
Cc: Ray Ni 
Signed-off-by: Ashraf Ali S 
---
 ...Pkg-FSPM-S-UPD-data-address-based-on.patch | 383 ++
 .../FspmWrapperPeim/FspmWrapperPeim.c |   8 +-
 .../FspmWrapperPeim/FspmWrapperPeim.inf   |  16 +-
 .../FspmWrapperPeim/IA32/FspmHelper.c |  26 ++
 .../FspmWrapperPeim/X64/FspmHelper.c  |  26 ++
 .../FspsWrapperPeim/FspsWrapperPeim.c |   6 +-
 .../FspsWrapperPeim/FspsWrapperPeim.inf   |  14 +-
 .../FspsWrapperPeim/IA32/FspsHelper.c |  26 ++
 .../FspsWrapperPeim/X64/FspsHelper.c  |  26 ++
 .../Include/Library/FspWrapperPlatformLib.h   |  24 +-
 IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec   |   2 +
 11 files changed, 546 insertions(+), 11 deletions(-)
 create mode 100644 
0001-IntelFsp2WrapperPkg-FSPM-S-UPD-data-address-based-on.patch
 create mode 100644 IntelFsp2WrapperPkg/FspmWrapperPeim/IA32/FspmHelper.c
 create mode 100644 IntelFsp2WrapperPkg/FspmWrapperPeim/X64/FspmHelper.c
 create mode 100644 IntelFsp2WrapperPkg/FspsWrapperPeim/IA32/FspsHelper.c
 create mode 100644 IntelFsp2WrapperPkg/FspsWrapperPeim/X64/FspsHelper.c

diff --git a/0001-IntelFsp2WrapperPkg-FSPM-S-UPD-data-address-based-on.patch 
b/0001-IntelFsp2WrapperPkg-FSPM-S-UPD-data-address-based-on.patch
new file mode 100644
index 00..abf76ebfc0
--- /dev/null
+++ b/0001-IntelFsp2WrapperPkg-FSPM-S-UPD-data-address-based-on.patch
@@ -0,0 +1,383 @@
+From d03b2a23908985d767a32592c9b4e4b4d0fa9e7d Mon Sep 17 00:00:00 2001
+Message-Id: 

+From: Ashraf Ali S 
+Date: Sun, 19 Sep 2021 23:10:18 +0530
+Subject: [PATCH v3] IntelFsp2WrapperPkg : FSPM/S UPD data address based on
+ Build Type
+
+REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3642
+when the module is not building in IA32 mode which will lead to
+building error. when a module built-in X64 function pointer will be the
+size of 64bit width which cannot be fit in 32bit address which will lead
+to error. to overcome this issue introducing the 2 new PCD's
+for the 64bit modules can consume it.
+Creating the API's to support different architecture
+
+Cc: Chasel Chiu 
+Cc: Nate DeSimone 
+Cc: Star Zeng 
+Cc: Kuo Ted 
+Cc: Duggapu Chinni B 
+Cc: Rangasai V Chaganty 
+Cc: Digant H Solanki 
+Cc: Sangeetha V 
+Cc: Ray Ni 
+Signed-off-by: Ashraf Ali S 
+---
+ .../FspmWrapperPeim/FspmWrapperPeim.c |  8 +++---
+ .../FspmWrapperPeim/FspmWrapperPeim.inf   | 16 ++--
+ .../FspmWrapperPeim/IA32/FspmHelper.c | 26 +++
+ .../FspmWrapperPeim/X64/FspmHelper.c  | 26 +++
+ .../FspsWrapperPeim/FspsWrapperPeim.c |  6 ++---
+ .../FspsWrapperPeim/FspsWrapperPeim.inf   | 14 +-
+ .../FspsWrapperPeim/IA32/FspsHelper.c | 26 +++
+ .../FspsWrapperPeim/X64/FspsHelper.c  | 26 +++
+ .../Include/Library/FspWrapperPlatformLib.h   | 24 -
+ IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec   |  2 ++
+ 10 files changed, 163 insertions(+), 11 deletions(-)
+ create mode 100644 IntelFsp2WrapperPkg/FspmWrapperPeim/IA32/FspmHelper.c
+ create mode 100644 IntelFsp2WrapperPkg/FspmWrapperPeim/X64/FspmHelper.c
+ create mode 100644 IntelFsp2WrapperPkg/FspsWrapperPeim/IA32/FspsHelper.c
+ create mode 100644 IntelFsp2WrapperPkg/FspsWrapperPeim/X64/FspsHelper.c
+
+diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c 
b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
+index 24ab534620..6f2f0018ac 100644
+--- a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
 b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
+@@ -3,7 +3,7 @@
+   register TemporaryRamDonePpi to call TempRamExit API, and register 
MemoryDiscoveredPpi
+   notify to call FspSiliconInit API.
+ 
+-  Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.
++  Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.
+   SPDX-License-Identifier: BSD-2-Clause-Patent
+ 
+ **/
+@@ -59,7 +59,7 @@ PeiFspMemoryInit (
+ 
+   DEBUG ((DEBUG_INFO, "PeiFspMemoryInit enter\n"));
+ 
+-  FspHobListPtr = NULL;
++  FspHobListPtr  = NULL;
+   FspmUpdDataPtr = NULL;
+ 
+   FspmHeaderPtr = (FSP_INFO_HEADER *) FspFindFspHeader (PcdGet32 
(PcdFspmBaseAddress));
+@@ -68,7 +68,7 @@ PeiFspMemoryInit (
+ return EFI_DEVICE_ERROR;
+   }
+ 
+-  if (PcdGet32 (PcdFspmUpdDataAddress) == 0 && (FspmHeaderPtr->CfgRegionSize 
!= 0) && (FspmHeaderPtr->CfgRegionOffset != 0)) {
++  if (GetFspmUp

[edk2-devel] [PATCH v3] IntelFsp2WrapperPkg : FSPM/S UPD data address based on Build Type

2021-09-22 Thread Ashraf Ali S
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3642
when the module is not building in IA32 mode which will lead to
building error. when a module built-in X64 function pointer will be the
size of 64bit width which cannot be fit in 32bit address which will lead
to error. to overcome this issue introducing the 2 new PCD's
for the 64bit modules can consume it.
Creating the API's to support different architecture

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Star Zeng 
Cc: Kuo Ted 
Cc: Duggapu Chinni B 
Cc: Rangasai V Chaganty 
Cc: Digant H Solanki 
Cc: Sangeetha V 
Cc: Ray Ni 
Signed-off-by: Ashraf Ali S 
---
 .../FspmWrapperPeim/FspmWrapperPeim.c |  8 +++---
 .../FspmWrapperPeim/FspmWrapperPeim.inf   | 16 ++--
 .../FspmWrapperPeim/IA32/FspmHelper.c | 26 +++
 .../FspmWrapperPeim/X64/FspmHelper.c  | 26 +++
 .../FspsWrapperPeim/FspsWrapperPeim.c |  6 ++---
 .../FspsWrapperPeim/FspsWrapperPeim.inf   | 14 +-
 .../FspsWrapperPeim/IA32/FspsHelper.c | 26 +++
 .../FspsWrapperPeim/X64/FspsHelper.c  | 26 +++
 .../Include/Library/FspWrapperPlatformLib.h   | 24 -
 IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec   |  2 ++
 10 files changed, 163 insertions(+), 11 deletions(-)
 create mode 100644 IntelFsp2WrapperPkg/FspmWrapperPeim/IA32/FspmHelper.c
 create mode 100644 IntelFsp2WrapperPkg/FspmWrapperPeim/X64/FspmHelper.c
 create mode 100644 IntelFsp2WrapperPkg/FspsWrapperPeim/IA32/FspsHelper.c
 create mode 100644 IntelFsp2WrapperPkg/FspsWrapperPeim/X64/FspsHelper.c

diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c 
b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
index 24ab534620..6f2f0018ac 100644
--- a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
+++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
@@ -3,7 +3,7 @@
   register TemporaryRamDonePpi to call TempRamExit API, and register 
MemoryDiscoveredPpi
   notify to call FspSiliconInit API.
 
-  Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.
+  Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -59,7 +59,7 @@ PeiFspMemoryInit (
 
   DEBUG ((DEBUG_INFO, "PeiFspMemoryInit enter\n"));
 
-  FspHobListPtr = NULL;
+  FspHobListPtr  = NULL;
   FspmUpdDataPtr = NULL;
 
   FspmHeaderPtr = (FSP_INFO_HEADER *) FspFindFspHeader (PcdGet32 
(PcdFspmBaseAddress));
@@ -68,7 +68,7 @@ PeiFspMemoryInit (
 return EFI_DEVICE_ERROR;
   }
 
-  if (PcdGet32 (PcdFspmUpdDataAddress) == 0 && (FspmHeaderPtr->CfgRegionSize 
!= 0) && (FspmHeaderPtr->CfgRegionOffset != 0)) {
+  if (GetFspmUpdDataAddress () == 0 && (FspmHeaderPtr->CfgRegionSize != 0) && 
(FspmHeaderPtr->CfgRegionOffset != 0)) {
 //
 // Copy default FSP-M UPD data from Flash
 //
@@ -80,7 +80,7 @@ PeiFspMemoryInit (
 //
 // External UPD is ready, get the buffer from PCD pointer.
 //
-FspmUpdDataPtr = (FSPM_UPD_COMMON *)PcdGet32 (PcdFspmUpdDataAddress);
+FspmUpdDataPtr = (FSPM_UPD_COMMON *) GetFspmUpdDataAddress ();
 ASSERT (FspmUpdDataPtr != NULL);
   }
 
diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf 
b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf
index 00166e56a0..e22eae4dd6 100644
--- a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf
+++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf
@@ -6,7 +6,7 @@
 # register TemporaryRamDonePpi to call TempRamExit API, and register 
MemoryDiscoveredPpi
 # notify to call FspSiliconInit API.
 #
-#  Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.
+#  Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -45,6 +45,7 @@
   FspWrapperApiLib
   FspWrapperApiTestLib
   FspMeasurementLib
+  PcdLib
 
 [Packages]
   MdePkg/MdePkg.dec
@@ -56,14 +57,25 @@
 
 [Pcd]
   gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress   ## CONSUMES
-  gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress## CONSUMES
   gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection  ## CONSUMES
   gIntelFsp2WrapperTokenSpaceGuid.PcdFsptBaseAddress   ## CONSUMES
   gIntelFsp2WrapperTokenSpaceGuid.PcdFspMeasurementConfig  ## CONSUMES
 
+[Pcd.IA32]
+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress## CONSUMES
+
+[Pcd.X64]
+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress64  ## CONSUMES
+
 [Sources]
   FspmWrapperPeim.c
 
+[Sources.IA32]
+  IA32/FspmHelper.c
+
+[Sources.X64]
+  IA32/FspmHelper.c
+
 [Guids]
   gFspHobGuid   ## PRODUCES ## HOB
   gFspApiPerformanceGuid## SOMETIMES_CONSUMES ## GUID
diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/IA32/FspmHelper.c 
b/IntelFsp2WrapperPkg/FspmWrapperPeim/IA32/FspmHelper.c
new file mode 100644
index 00..cab11173cc
--- /dev/null
+++ b/IntelFsp2WrapperPkg/FspmWrapperPei

Re: [edk2-devel] [edk2-libc Patch 1/1] AppPkg/Applications/Python/Python3.6.8: add IA32 support for py3 package creation batch script

2021-09-22 Thread Jayaprakash, N
Hi Rebecca,

I have resubmitted the patch with the changes suggested.

Thank you,
JP

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Jayaprakash, N
Sent: 22 September 2021 08:03
To: devel@edk2.groups.io; rebe...@nuviainc.com
Cc: Kinney, Michael D 
Subject: Re: [edk2-devel] [edk2-libc Patch 1/1] 
AppPkg/Applications/Python/Python3.6.8: add IA32 support for py3 package 
creation batch script

Hi Rebecca,

Can I resubmit the patch after making these changes in the same development 
branch or does it require creating a new branch?

Regards,
JP

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Rebecca Cran
Sent: 21 September 2021 22:05
To: Jayaprakash, N ; devel@edk2.groups.io
Cc: Kinney, Michael D 
Subject: Re: [edk2-devel] [edk2-libc Patch 1/1] 
AppPkg/Applications/Python/Python3.6.8: add IA32 support for py3 package 
creation batch script

There are several lines with trailing whitespace. Could you fix them please?


 > git diff | grep " $"


+echo Invalid command line arguments passed, please see the below usage 
instructions



+   mkdir %OUT_FOLDER%\EFI\Tools
+)

+if not exist %OUT_FOLDER%\EFI\StdLib\lib\python36.8 (

+    echo Python EFI package available at %OUT_FOLDER%

+echo Then use this script to create a Python EFI package



On 9/19/21 6:25 AM, Jayaprakash Nevara wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3638
>
> This change is to add IA32 support into py3 EFI package
> creation batch script. Enhanced the script take Architecture
> as an additional parameter. With this the script can be used
> to create deployable Python 3.6.8 EFI package from X64 and IA32 builds
> as required by the user
>
> Cc: Rebecca Cran 
> Cc: Michael D Kinney 
> Signed-off-by: Jayaprakash N 
> ---
>   .../Python/Python-3.6.8/Py368ReadMe.txt   |  4 +-
>   .../Python-3.6.8/create_python368_pkg.bat | 62 ---
>   2 files changed, 41 insertions(+), 25 deletions(-)
>
> diff --git a/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt 
> b/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt
> index 94dbccc..8f4fdc6 100644
> --- a/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt
> +++ b/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt
> @@ -118,11 +118,11 @@ system as follows:
> A script, create_python368_pkg.bat , is provided which facilitates the 
> population
> of the target EFI package.  Execute this script from within the
> AppPkg/Applications/Python/Python-3.6.8 directory, providing the Tool 
> Chain, Target
> -  Build and destination directory which is the path to the destination 
> directory.
> +  Build, Architecture and Directory path to the destination directory.
> The appropriate contents of the 
> AppPkg/Applications/Python/Python-3.6.8/Lib and
> Python368.efi Application from Build/AppPkg/RELEASE_VS2017/X64/ will be
> ^^
> -  copied into the specified destination directory.
> +  copied into the specified Destination directory.
>   
> Replace "RELEASE_VS2017", in the source path, with values appropriate for 
> your tool chain.
>   
> diff --git a/AppPkg/Applications/Python/Python-3.6.8/create_python368_pkg.bat 
> b/AppPkg/Applications/Python/Python-3.6.8/create_python368_pkg.bat
> index 6bbdbd9..2bb62b6 100644
> --- a/AppPkg/Applications/Python/Python-3.6.8/create_python368_pkg.bat
> +++ b/AppPkg/Applications/Python/Python-3.6.8/create_python368_pkg.bat
> @@ -2,47 +2,63 @@
>   
>   set TOOL_CHAIN_TAG=%1
>   set TARGET=%2
> -set OUT_FOLDER=%3
> +set ARCH=%3
> +set OUT_FOLDER=%4
>   if "%TOOL_CHAIN_TAG%"=="" goto usage
>   if "%TARGET%"=="" goto usage
> +if "%ARCH%"=="" goto usage
>   if "%OUT_FOLDER%"=="" goto usage
>   goto continue
>   
>   :usage
>   echo.
> +echo Batch Script to create Python EFI Package.
>   echo.
> +echo Invalid command line arguments passed, please see the below usage 
> instructions
>   echo.
> -echo Creates Python EFI Package.
> -echo.
> -echo "Usage: %0   "
> -echo.
> -echoToolChain  = one of VS2013x86, VS2015x86, VS2017, VS2019
> -echoTarget = one of RELEASE, DEBUG
> -echoOutFolder  = Target folder where package needs to create
> -echo.
> +echo "Usage: %0"
>   echo.
> +echoToolChain = one of VS2013x86, VS2015x86, VS2017, VS2019
> +echoTarget= one of RELEASE, DEBUG
> +echoArchitecture  = one of IA32, X64
> +echoOutFolder = Output directory for creating the package
>   echo.
>   
>   goto :eof
>   
>   :continue
>   cd ..\..\..\..\
> -IF NOT EXIST Build\AppPkg\%TARGET%_%TOOL_CHAIN_TAG%\X64\Python368.efi goto 
> error
> -mkdir %OUT_FOLDER%\EFI\Tools
> -xcopy Build\AppPkg\%TARGET%_%TOOL_CHAIN_TAG%\X64\Python368.efi 
> %OUT_FOLDER%\EFI\Tools\ /y
> -mkdir %OUT_FOLDER%\EFI\StdLib\lib\python36.8
> -mkdir %OUT_FOLDER%\EFI\StdLib\etc
> -xcopy AppPkg\Applications\Python\Python-3.6.8\Lib\*
> %OUT_FOLDER%\EFI\StdLib\lib\python36.8\  /Y /S /I
> -xcopy StdLib\Efi\St

[edk2-devel] [PATCH v2] IntelFsp2WrapperPkg : FSPM/S UPD data address based on Build Type

2021-09-22 Thread Ashraf Ali S
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3642
when the module is not building in IA32 mode which will lead to
building error. when a module built-in X64 function pointer will be the
size of 64bit width which cannot be fit in 32bit address which will lead
to error. to overcome this issue introducing the 2 new PCD's
for the 64bit modules can consume it.
Creating the API's to support different architecture

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Star Zeng 
Cc: Kuo Ted 
Cc: Duggapu Chinni B 
Cc: Rangasai V Chaganty 
Cc: Digant H Solanki 
Cc: Sangeetha V 
Cc: Ray Ni 
Signed-off-by: Ashraf Ali S 
---
 .../FspmWrapperPeim/FspmWrapperPeim.c |  8 +++---
 .../FspmWrapperPeim/FspmWrapperPeim.inf   | 10 +--
 .../FspmWrapperPeim/IA32/FspHelper.c  | 27 +++
 .../FspmWrapperPeim/X64/FspHelper.c   | 27 +++
 .../FspsWrapperPeim/FspsWrapperPeim.c |  6 ++---
 .../FspsWrapperPeim/FspsWrapperPeim.inf   |  8 +-
 .../FspsWrapperPeim/IA32/FspHelper.c  | 26 ++
 .../FspsWrapperPeim/X64/FspHelper.c   | 26 ++
 .../Include/Library/FspWrapperPlatformLib.h   | 24 -
 IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec   |  2 ++
 10 files changed, 153 insertions(+), 11 deletions(-)
 create mode 100644 IntelFsp2WrapperPkg/FspmWrapperPeim/IA32/FspHelper.c
 create mode 100644 IntelFsp2WrapperPkg/FspmWrapperPeim/X64/FspHelper.c
 create mode 100644 IntelFsp2WrapperPkg/FspsWrapperPeim/IA32/FspHelper.c
 create mode 100644 IntelFsp2WrapperPkg/FspsWrapperPeim/X64/FspHelper.c

diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c 
b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
index 24ab534620..6f2f0018ac 100644
--- a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
+++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
@@ -3,7 +3,7 @@
   register TemporaryRamDonePpi to call TempRamExit API, and register 
MemoryDiscoveredPpi
   notify to call FspSiliconInit API.
 
-  Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.
+  Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -59,7 +59,7 @@ PeiFspMemoryInit (
 
   DEBUG ((DEBUG_INFO, "PeiFspMemoryInit enter\n"));
 
-  FspHobListPtr = NULL;
+  FspHobListPtr  = NULL;
   FspmUpdDataPtr = NULL;
 
   FspmHeaderPtr = (FSP_INFO_HEADER *) FspFindFspHeader (PcdGet32 
(PcdFspmBaseAddress));
@@ -68,7 +68,7 @@ PeiFspMemoryInit (
 return EFI_DEVICE_ERROR;
   }
 
-  if (PcdGet32 (PcdFspmUpdDataAddress) == 0 && (FspmHeaderPtr->CfgRegionSize 
!= 0) && (FspmHeaderPtr->CfgRegionOffset != 0)) {
+  if (GetFspmUpdDataAddress () == 0 && (FspmHeaderPtr->CfgRegionSize != 0) && 
(FspmHeaderPtr->CfgRegionOffset != 0)) {
 //
 // Copy default FSP-M UPD data from Flash
 //
@@ -80,7 +80,7 @@ PeiFspMemoryInit (
 //
 // External UPD is ready, get the buffer from PCD pointer.
 //
-FspmUpdDataPtr = (FSPM_UPD_COMMON *)PcdGet32 (PcdFspmUpdDataAddress);
+FspmUpdDataPtr = (FSPM_UPD_COMMON *) GetFspmUpdDataAddress ();
 ASSERT (FspmUpdDataPtr != NULL);
   }
 
diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf 
b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf
index 00166e56a0..10f92e8a33 100644
--- a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf
+++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf
@@ -6,7 +6,7 @@
 # register TemporaryRamDonePpi to call TempRamExit API, and register 
MemoryDiscoveredPpi
 # notify to call FspSiliconInit API.
 #
-#  Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.
+#  Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -45,6 +45,7 @@
   FspWrapperApiLib
   FspWrapperApiTestLib
   FspMeasurementLib
+  PcdLib
 
 [Packages]
   MdePkg/MdePkg.dec
@@ -56,11 +57,16 @@
 
 [Pcd]
   gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress   ## CONSUMES
-  gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress## CONSUMES
   gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection  ## CONSUMES
   gIntelFsp2WrapperTokenSpaceGuid.PcdFsptBaseAddress   ## CONSUMES
   gIntelFsp2WrapperTokenSpaceGuid.PcdFspMeasurementConfig  ## CONSUMES
 
+[Pcd.IA32]
+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress## CONSUMES
+
+[Pcd.X64]
+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress64  ## CONSUMES
+
 [Sources]
   FspmWrapperPeim.c
 
diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/IA32/FspHelper.c 
b/IntelFsp2WrapperPkg/FspmWrapperPeim/IA32/FspHelper.c
new file mode 100644
index 00..3663a4aaad
--- /dev/null
+++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/IA32/FspHelper.c
@@ -0,0 +1,27 @@
+/** @file
+  Sample to provide FSP wrapper related function.
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+
+#include 
+

[edk2-devel] [edk2-libc Patch 1/1] AppPkg/Applications/Python/Python3.6.8: add IA32 support for py3 package creation batch script

2021-09-22 Thread Jayaprakash, N
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3638

This change is to add IA32 support into py3 EFI package
creation batch script. Enhanced the script take Architecture
as an additional parameter. With this the script can be used
to create deployable Python 3.6.8 EFI package from X64 and IA32 builds
as required by the user

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Signed-off-by: Jayaprakash N 
---
 .../Python-3.6.8/create_python368_pkg.bat | 62 ---
 1 file changed, 39 insertions(+), 23 deletions(-)

diff --git a/AppPkg/Applications/Python/Python-3.6.8/create_python368_pkg.bat 
b/AppPkg/Applications/Python/Python-3.6.8/create_python368_pkg.bat
index 6bbdbd9..b48f83e 100644
--- a/AppPkg/Applications/Python/Python-3.6.8/create_python368_pkg.bat
+++ b/AppPkg/Applications/Python/Python-3.6.8/create_python368_pkg.bat
@@ -2,47 +2,63 @@
 
 set TOOL_CHAIN_TAG=%1
 set TARGET=%2
-set OUT_FOLDER=%3
+set ARCH=%3
+set OUT_FOLDER=%4
 if "%TOOL_CHAIN_TAG%"=="" goto usage
 if "%TARGET%"=="" goto usage
+if "%ARCH%"=="" goto usage
 if "%OUT_FOLDER%"=="" goto usage
 goto continue
 
 :usage
 echo.
+echo Batch Script to create Python EFI Package.
 echo.
+echo Invalid command line arguments passed, please see the below usage 
instructions
 echo.
-echo Creates Python EFI Package. 
-echo.
-echo "Usage: %0   "
-echo.
-echoToolChain  = one of VS2013x86, VS2015x86, VS2017, VS2019
-echoTarget = one of RELEASE, DEBUG
-echoOutFolder  = Target folder where package needs to create
-echo.
+echo "Usage: %0"
 echo.
+echoToolChain = one of VS2013x86, VS2015x86, VS2017, VS2019
+echoTarget= one of RELEASE, DEBUG
+echoArchitecture  = one of IA32, X64
+echoOutFolder = Output directory for creating the package
 echo.
 
 goto :eof
 
 :continue
 cd ..\..\..\..\
-IF NOT EXIST Build\AppPkg\%TARGET%_%TOOL_CHAIN_TAG%\X64\Python368.efi goto 
error
-mkdir %OUT_FOLDER%\EFI\Tools
-xcopy Build\AppPkg\%TARGET%_%TOOL_CHAIN_TAG%\X64\Python368.efi 
%OUT_FOLDER%\EFI\Tools\ /y
-mkdir %OUT_FOLDER%\EFI\StdLib\lib\python36.8
-mkdir %OUT_FOLDER%\EFI\StdLib\etc
-xcopy AppPkg\Applications\Python\Python-3.6.8\Lib\*
%OUT_FOLDER%\EFI\StdLib\lib\python36.8\  /Y /S /I
-xcopy StdLib\Efi\StdLib\etc\*%OUT_FOLDER%\EFI\StdLib\etc\  /Y /S /I
-goto all_done
-
-:error
-echo Failed to Create Python 3.6.8 Package, Python368.efi is not available on 
build location Build\AppPkg\%TARGET%_%TOOL_CHAIN_TAG%\X64\
+if not exist Build\AppPkg\%TARGET%_%TOOL_CHAIN_TAG%\%ARCH%\Python368.efi (
+goto error
+)
 
+if not exist %OUT_FOLDER%\EFI\Tools (
+   mkdir %OUT_FOLDER%\EFI\Tools
+)
+xcopy Build\AppPkg\%TARGET%_%TOOL_CHAIN_TAG%\%ARCH%\Python368.efi 
%OUT_FOLDER%\EFI\Tools\ /y
 
-:all_done
-exit /b %ec%
-
+if not exist %OUT_FOLDER%\EFI\StdLib\lib\python36.8 (
+mkdir %OUT_FOLDER%\EFI\StdLib\lib\python36.8
+)
+if not exist %OUT_FOLDER%\EFI\StdLib\etc (
+   mkdir %OUT_FOLDER%\EFI\StdLib\etc
+)
+xcopy AppPkg\Applications\Python\Python-3.6.8\Lib\*  
%OUT_FOLDER%\EFI\StdLib\lib\python36.8\/Y /S /I
+xcopy StdLib\Efi\StdLib\etc\*  %OUT_FOLDER%\EFI\StdLib\etc\  /Y /S /I
+echo.
 
+if not x%OUT_FOLDER::=%==x%OUT_FOLDER% (
+echo Python EFI package available at %OUT_FOLDER%
+) else (
+echo Python EFI package available at %CD%\%OUT_FOLDER%
+)
+goto all_done
 
+:error
+echo Failed to Create Python EFI Package
+echo Python368.efi is not available at 
Build\AppPkg\%TARGET%_%TOOL_CHAIN_TAG%\%ARCH%\
+echo Follow the instructions in Py368ReadMe.txt to build Python interpreter
+echo Then use this script to create a Python EFI package
 
+:all_done
+exit /b %ERRORLEVEL%
-- 
2.32.0.windows.2



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




[edk2-devel] [edk2-libc Patch 0/1] AppPkg/Applications/Python/Python3.6.8: add IA32 support for py3 package creation batch script

2021-09-22 Thread Jayaprakash, N


Jayaprakash Nevara (1):
  AppPkg/Applications/Python/Python3.6.8: add IA32 support for py3
package creation batch script

 .../Python-3.6.8/create_python368_pkg.bat | 62 ---
 1 file changed, 39 insertions(+), 23 deletions(-)

-- 
2.32.0.windows.2



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




Re: [edk2-devel] [edk2-platforms PATCH 0/4] Marvell readmes

2021-09-22 Thread Leif Lindholm
On Wed, Sep 22, 2021 at 14:20:31 +0200, Ard Biesheuvel wrote:
> On Wed, 22 Sept 2021 at 14:14, Leif Lindholm  wrote:
> >
> > On Wed, Sep 22, 2021 at 13:24:07 +0200, Ard Biesheuvel wrote:
> > > On Tue, 21 Sept 2021 at 13:02, Marcin Wojtas  wrote:
> > > >
> > > > Hi,
> > > >
> > > > This short patchset adds README files for the platforms
> > > > based on Marvell SoC's, which have already been
> > > > SystemReady ES certified. It also bumps the firmware
> > > > revision after the PCI / IcuLib rework and addition of
> > > > the CN913x CEx7 Evaluation Board support.
> > > >
> > > > The patches are available on a public branch:
> > > > https://github.com/semihalf-wojtas-marcin/edk2-platforms/commits/marvell-howtos-upstream-r20210921
> > > >
> > >
> > > Thanks
> > >
> > > Pushed as 64394fd2b48f..d1d4dd2c39e7
> >
> > Ugh, wish I'd taken the time to respond yesterday.
> >
> > This is more proliferation of "include all very specific build
> > steps for a very specific target and build environment" documentation.
> >
> > I don't see this as an improvement.
> >
> > Platform docs should document what one needs to know specific to the
> > platform. If a vendor wishes to provide full recipes, they should host
> > that on a wiki somewhere.
> >
> 
> Fair point.
> 
> Marcin, when you find the time, could you please do a pass over these
> files with Leif's critique in mind?

Some suggestions/requests:

The top-level Readme.md should contain all relevant build system and
cross compilation information, so please refer to that instead of
duplicating information. If it is missing some generically useful
information, please add it.
(That file, for example, points out the appropriate location to get
arm cross-toolchains from if your distro doesn't provide them, and
Linaro stopped working on GCC years ago.)

Please *do* document the repositories required to build (and hence
need to specify in PACKAGES_PATH). The example build command line for
CN913x CEx7 requires edk2-non-osi.

Please don't document the inclusion of the Shell TFTP command by
default. Mention it as an option if you must.

Document the builds in chronological order, don't interleave TF-A and
EDK2 instructions. Ideally, cut TF-A instructions down to a bare
minimum (e.g. "pass the generated EDK2 image to the TF-A build with
`$ export BL33=...`) and link to aforementioned wiki page for the full
recipe.

Best Regards,

Leif


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




Re: [edk2-devel] [edk2-platforms PATCH 0/4] Marvell readmes

2021-09-22 Thread Marcin Wojtas
Hi Ard, Leif,

śr., 22 wrz 2021 o 14:20 Ard Biesheuvel  napisał(a):
>
> On Wed, 22 Sept 2021 at 14:14, Leif Lindholm  wrote:
> >
> > On Wed, Sep 22, 2021 at 13:24:07 +0200, Ard Biesheuvel wrote:
> > > On Tue, 21 Sept 2021 at 13:02, Marcin Wojtas  wrote:
> > > >
> > > > Hi,
> > > >
> > > > This short patchset adds README files for the platforms
> > > > based on Marvell SoC's, which have already been
> > > > SystemReady ES certified. It also bumps the firmware
> > > > revision after the PCI / IcuLib rework and addition of
> > > > the CN913x CEx7 Evaluation Board support.
> > > >
> > > > The patches are available on a public branch:
> > > > https://github.com/semihalf-wojtas-marcin/edk2-platforms/commits/marvell-howtos-upstream-r20210921
> > > >
> > >
> > > Thanks
> > >
> > > Pushed as 64394fd2b48f..d1d4dd2c39e7
> >
> > Ugh, wish I'd taken the time to respond yesterday.
> >
> > This is more proliferation of "include all very specific build
> > steps for a very specific target and build environment" documentation.
> >
> > I don't see this as an improvement.
> >
> > Platform docs should document what one needs to know specific to the
> > platform. If a vendor wishes to provide full recipes, they should host
> > that on a wiki somewhere.
> >
>
> Fair point.
>
> Marcin, when you find the time, could you please do a pass over these
> files with Leif's critique in mind?


For all 3 platforms, how about the following update:
- extend the "Summary" section with supported features or interfaces
(or add an extra heading for that).
- "Build" section -> add link to external wiki/.md file
- "ARM System Ready certification." - leave intact

Please let me know if that will work for you.

Best regards1,
Marcin


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




Re: [edk2-devel] [edk2-platforms PATCH 0/4] Marvell readmes

2021-09-22 Thread Ard Biesheuvel
On Wed, 22 Sept 2021 at 14:14, Leif Lindholm  wrote:
>
> On Wed, Sep 22, 2021 at 13:24:07 +0200, Ard Biesheuvel wrote:
> > On Tue, 21 Sept 2021 at 13:02, Marcin Wojtas  wrote:
> > >
> > > Hi,
> > >
> > > This short patchset adds README files for the platforms
> > > based on Marvell SoC's, which have already been
> > > SystemReady ES certified. It also bumps the firmware
> > > revision after the PCI / IcuLib rework and addition of
> > > the CN913x CEx7 Evaluation Board support.
> > >
> > > The patches are available on a public branch:
> > > https://github.com/semihalf-wojtas-marcin/edk2-platforms/commits/marvell-howtos-upstream-r20210921
> > >
> >
> > Thanks
> >
> > Pushed as 64394fd2b48f..d1d4dd2c39e7
>
> Ugh, wish I'd taken the time to respond yesterday.
>
> This is more proliferation of "include all very specific build
> steps for a very specific target and build environment" documentation.
>
> I don't see this as an improvement.
>
> Platform docs should document what one needs to know specific to the
> platform. If a vendor wishes to provide full recipes, they should host
> that on a wiki somewhere.
>

Fair point.

Marcin, when you find the time, could you please do a pass over these
files with Leif's critique in mind?


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




Re: [edk2-devel] [edk2-platforms PATCH 0/4] Marvell readmes

2021-09-22 Thread Leif Lindholm
On Wed, Sep 22, 2021 at 13:24:07 +0200, Ard Biesheuvel wrote:
> On Tue, 21 Sept 2021 at 13:02, Marcin Wojtas  wrote:
> >
> > Hi,
> >
> > This short patchset adds README files for the platforms
> > based on Marvell SoC's, which have already been
> > SystemReady ES certified. It also bumps the firmware
> > revision after the PCI / IcuLib rework and addition of
> > the CN913x CEx7 Evaluation Board support.
> >
> > The patches are available on a public branch:
> > https://github.com/semihalf-wojtas-marcin/edk2-platforms/commits/marvell-howtos-upstream-r20210921
> >
> 
> Thanks
> 
> Pushed as 64394fd2b48f..d1d4dd2c39e7

Ugh, wish I'd taken the time to respond yesterday.

This is more proliferation of "include all very specific build
steps for a very specific target and build environment" documentation.

I don't see this as an improvement.

Platform docs should document what one needs to know specific to the
platform. If a vendor wishes to provide full recipes, they should host
that on a wiki somewhere.

/
Leif


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




Re: [edk2-devel] [edk2-platforms][PATCH v3 0/5] Platform/Sgi: Add platform support for firmware first error handling

2021-09-22 Thread Sami Mujawar
Hi Ard,

I will review the series this week.

Regards,

Sami Mujawar

On 22/09/2021, 12:47, "Ard Biesheuvel"  wrote:

On Fri, 3 Sept 2021 at 15:39, Omkar Kulkarni  wrote:
>
> Gentle reminder, to review this patch series.
>

Sami, would you mind taking this one?


>
> > On August 24, 2021 11:30 AM, Omkar Kulkarni wrote:
> > Changes since v2:
> > - Rebased to the latest upstream code.
> >
> > This patch series introduces platform support for RAS using Firmware 
First
> > error handling. Firmware first error handling on ARM Neoverse reference
> > design platforms is achieved using HEST[1] and SDEI[2] ACPI tables.
> >
> > For doing so the Platform Error handler DXE driver is introduced. This 
driver
> > is integral part of the firmware first error handling framework in 
EDK2. SDEI
> > being the notification mechanism used to communicate the platform errors
> > to OSPM, it builds and installs the SDEI ACPI table. Also installs the 
HEST table
> > which is already created as part of firmware first framework in EDK2.
> >
> > This series does provide a reference implementation to leverage the
> > firmware first framework by implementing a platform MM driver for
> > Dynamic Memory Controller DMC[3] that has RAS feature enabled. This
> > driver mainly handles
> > following:
> > - Implements the Hest Error Source Descriptor protocol introduced as 
part of
> >   firmware first framework in EDK2. Publishes the 1-bit ECC DRAM error
> > sources
> >   as GHESv2[4] type error source descriptors.
> > - For any 1-bit CE that occurs on DRAM it reads DMC error record 
registers
> > and
> >   populates a error status block (CPER)[5] of Memory Type error[6].
> >
> > References:
> > [1] : ACPI 6.3, Table 18-382, Hardware Error Source Table [2] : SDEI 
Platform
> > Design Document, revision b, 10 Appendix C, ACPI table
> >   definitions for SDEI
> > [3] : DMC620 Dynamic Memory Controller, revision r1p0 [4] : ACPI 
Reference
> > Specification 6.3, Table 18-393 GHESv2 Structure [5] : UEFI Reference
> > Specification 2.8, Appendix N - Common Platform Error
> >   Record
> > [6] : UEFI Reference Specification 2.8, Section N.2.5 Memory Error 
Section
> >
> > This patch series is dependent on the edk2 patch series
> > https://edk2.groups.io/g/devel/message/79741
> >
> > Link to github branch with the patches in this series -
> > https://github.com/omkkul01/edk2-platforms/tree/ras_firware_first_edk2-
> > platforms_v3
> >
> > Omkar Anand Kulkarni (5):
> >   Platform/ARM: Add DMC-620 ECC error handling driver
> >   Platform/Sgi: dmc-620 firmware-first error handling
> >   Platform/Sgi: define memory region for GHES error status block
> >   Platform/Sgi: Define values for ACPI table header
> >   Platform/Sgi: Add platform error handling driver
> >
> >  Platform/ARM/Drivers/Dmc620Mm/Dmc620Mm.dec|  30 ++
> >  Platform/ARM/SgiPkg/SgiPlatform.dec   |   1 +
> >  Platform/ARM/SgiPkg/SgiPlatform.dsc.inc   |  38 ++
> >  Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc |  30 ++
> >  Platform/ARM/SgiPkg/PlatformStandaloneMm.fdf  |   6 +
> >  Platform/ARM/SgiPkg/SgiPlatform.fdf   |  13 +
> >  Platform/ARM/Drivers/Dmc620Mm/Dmc620Mm.inf|  61 +++
> >  .../PlatformErrorHandlerDxe.inf   |  51 +++
> >  .../Library/PlatformLib/PlatformLib.inf   |   6 +
> >  Platform/ARM/Drivers/Dmc620Mm/Dmc620Mm.h  | 174 +
> >  Platform/ARM/Drivers/Dmc620Mm/Dmc620Mm.c  | 362
> > ++
> >  .../Dmc620Mm/Dmc620MmErrorSourceInfo.c| 194 ++
> >  .../PlatformErrorHandlerDxe.c | 171 +
> >  .../Library/PlatformLib/PlatformLibMem.c  |  13 +-
> >  14 files changed, 1148 insertions(+), 2 deletions(-)  create mode 
100644
> > Platform/ARM/Drivers/Dmc620Mm/Dmc620Mm.dec
> >  create mode 100644 Platform/ARM/Drivers/Dmc620Mm/Dmc620Mm.inf
> >  create mode 100644
> > Platform/ARM/SgiPkg/Drivers/PlatformErrorHandlerDxe/PlatformErrorHandl
> > erDxe.inf
> >  create mode 100644 Platform/ARM/Drivers/Dmc620Mm/Dmc620Mm.h
> >  create mode 100644 Platform/ARM/Drivers/Dmc620Mm/Dmc620Mm.c
> >  create mode 100644
> > Platform/ARM/Drivers/Dmc620Mm/Dmc620MmErrorSourceInfo.c
> >  create mode 100644
> > Platform/ARM/SgiPkg/Drivers/PlatformErrorHandlerDxe/PlatformErrorHandl
> > erDxe.c
> >
> > --
> > 2.17.1
> >
> >
> >
> > -=-=-=-=-=-=
> > Groups.io Links: You receive all messages sent to this group.
> > View/Reply Online (#79749): https://edk2.groups.io/g/devel/message/79749
> > Mute This Topic: https://groups.io/mt/85104844/4857533
> > Group Owner: devel+ow...@edk2.groups.io
> > Unsubscribe: https://edk2.gr

Re: [edk2-devel] [PATCH v2 1/1] ArmPkg: Implement PlatformBootManagerLib for LinuxBoot

2021-09-22 Thread Ard Biesheuvel
On Tue, 7 Sept 2021 at 05:40, Nhi Pham  wrote:
>
> LinuxBoot is a firmware that replaces specific firmware functionality
> like the UEFI DXE phase with a Linux kernel and runtime. It is built-in
> UEFI image like an application, which is executed at the end of DXE
> phase.
>
> To achieve the LinuxBoot boot flow "SEC->PEI->DXE->BDS->LinuxBoot",
> today we use the common well-known GUID of UEFI Shell for LinuxBoot
> payload, so LinuxBoot developers can effortlessly find the UEFI Shell
> Application and replace it with the LinuxBoot payload without
> recompiling platform EDK2 (There might be an issue with a few systems
> that don't have a UEFI Shell). Also, we have a hard requirement to force
> the BDS to boot into the LinuxBoot as it is essentially required that
> only the LinuxBoot boot option is permissible and UEFI is an
> intermediate bootstrap phase. Considering all the above, it is
> reasonable to just have a new GUID for LinuxBoot and require a LinuxBoot
> specific BDS implementation. In addition, with making the BDS
> implementation simpler, we can reduce many DXE drivers which we think it
> is not necessary for LinuxBoot booting.
>
> This patch adds a new PlatformBootManagerLib implementation which
> registers only the gArmTokenSpaceGuid.PcdLinuxBootFileGuid for LinuxBoot
> payload as an active boot option. It allows BDS to jump to the LinuxBoot
> quickly by skipping the UiApp and UEFI Shell.
>
> The PlatformBootManagerLib library derived from
> ArmPkg/Library/PlatformBootManagerLib.
>
> Cc: Leif Lindholm 
> Cc: Ard Biesheuvel 
>
> Signed-off-by: Nhi Pham 

Acked-by: Ard Biesheuvel 

> ---
>  ArmPkg/ArmPkg.dec  |   8 +
>  ArmPkg/ArmPkg.dsc  |   2 +
>  ArmPkg/Library/LinuxBootBootManagerLib/LinuxBootBootManagerLib.inf |  58 
> +++
>  ArmPkg/Library/LinuxBootBootManagerLib/LinuxBootBm.c   | 178 
> 
>  4 files changed, 246 insertions(+)
>
> diff --git a/ArmPkg/ArmPkg.dec b/ArmPkg/ArmPkg.dec
> index 214b2f589217..f68e6ee00860 100644
> --- a/ArmPkg/ArmPkg.dec
> +++ b/ArmPkg/ArmPkg.dec
> @@ -3,6 +3,7 @@
>  #
>  # Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.
>  # Copyright (c) 2011 - 2021, ARM Limited. All rights reserved.
> +# Copyright (c) 2021, Ampere Computing LLC. All rights reserved.
>  #
>  #SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
> @@ -382,3 +383,10 @@ [PcdsFixedAtBuild.common, PcdsDynamic.common]
>#
>gArmTokenSpaceGuid.PcdPciBusMin|0x0|UINT32|0x0059
>gArmTokenSpaceGuid.PcdPciBusMax|0x0|UINT32|0x005A
> +
> +[PcdsDynamicEx]
> +  #
> +  # This dynamic PCD hold the GUID of a firmware FFS which contains
> +  # the LinuxBoot payload.
> +  #
> +  gArmTokenSpaceGuid.PcdLinuxBootFileGuid|{0x0}|VOID*|0x005C
> diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc
> index 926986cf7fbb..ffb1c261861e 100644
> --- a/ArmPkg/ArmPkg.dsc
> +++ b/ArmPkg/ArmPkg.dsc
> @@ -5,6 +5,7 @@
>  # Copyright (c) 2011 - 2021, Arm Limited. All rights reserved.
>  # Copyright (c) 2016, Linaro Ltd. All rights reserved.
>  # Copyright (c) Microsoft Corporation.
> +# Copyright (c) 2021, Ampere Computing LLC. All rights reserved.
>  #
>  #SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
> @@ -150,6 +151,7 @@ [Components.common]
>ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.inf
>ArmPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
>ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
> +  ArmPkg/Library/LinuxBootBootManagerLib/LinuxBootBootManagerLib.inf
>
>ArmPkg/Drivers/ArmCrashDumpDxe/ArmCrashDumpDxe.inf
>ArmPkg/Drivers/ArmScmiDxe/ArmScmiDxe.inf
> diff --git 
> a/ArmPkg/Library/LinuxBootBootManagerLib/LinuxBootBootManagerLib.inf 
> b/ArmPkg/Library/LinuxBootBootManagerLib/LinuxBootBootManagerLib.inf
> new file mode 100644
> index ..139b6171990a
> --- /dev/null
> +++ b/ArmPkg/Library/LinuxBootBootManagerLib/LinuxBootBootManagerLib.inf
> @@ -0,0 +1,58 @@
> +## @file
> +#  Implementation for PlatformBootManagerLib library class interfaces.
> +#
> +#  Copyright (C) 2015-2016, Red Hat, Inc.
> +#  Copyright (c) 2014, ARM Ltd. All rights reserved.
> +#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
> +#  Copyright (c) 2016, Linaro Ltd. All rights reserved.
> +#  Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved.
> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +##
> +
> +[Defines]
> +  INF_VERSION= 0x0001001B
> +  BASE_NAME  = LinuxBootBootManagerLib
> +  FILE_GUID  = 1FA91547-DB23-4F6A-8AF8-3B9782A7F917
> +  MODULE_TYPE= DXE_DRIVER
> +  VERSION_STRING = 1.0
> +  LIBRARY_CLASS  = PlatformBootManagerLib|DXE_DRIVER
> +
> +#
> +# The following information is for reference only and not required by the 
> build tools.

Re: [edk2-devel] [edk2-platforms][PATCH v3 0/5] Platform/Sgi: Add platform support for firmware first error handling

2021-09-22 Thread Ard Biesheuvel
On Fri, 3 Sept 2021 at 15:39, Omkar Kulkarni  wrote:
>
> Gentle reminder, to review this patch series.
>

Sami, would you mind taking this one?


>
> > On August 24, 2021 11:30 AM, Omkar Kulkarni wrote:
> > Changes since v2:
> > - Rebased to the latest upstream code.
> >
> > This patch series introduces platform support for RAS using Firmware First
> > error handling. Firmware first error handling on ARM Neoverse reference
> > design platforms is achieved using HEST[1] and SDEI[2] ACPI tables.
> >
> > For doing so the Platform Error handler DXE driver is introduced. This 
> > driver
> > is integral part of the firmware first error handling framework in EDK2. 
> > SDEI
> > being the notification mechanism used to communicate the platform errors
> > to OSPM, it builds and installs the SDEI ACPI table. Also installs the HEST 
> > table
> > which is already created as part of firmware first framework in EDK2.
> >
> > This series does provide a reference implementation to leverage the
> > firmware first framework by implementing a platform MM driver for
> > Dynamic Memory Controller DMC[3] that has RAS feature enabled. This
> > driver mainly handles
> > following:
> > - Implements the Hest Error Source Descriptor protocol introduced as part of
> >   firmware first framework in EDK2. Publishes the 1-bit ECC DRAM error
> > sources
> >   as GHESv2[4] type error source descriptors.
> > - For any 1-bit CE that occurs on DRAM it reads DMC error record registers
> > and
> >   populates a error status block (CPER)[5] of Memory Type error[6].
> >
> > References:
> > [1] : ACPI 6.3, Table 18-382, Hardware Error Source Table [2] : SDEI 
> > Platform
> > Design Document, revision b, 10 Appendix C, ACPI table
> >   definitions for SDEI
> > [3] : DMC620 Dynamic Memory Controller, revision r1p0 [4] : ACPI Reference
> > Specification 6.3, Table 18-393 GHESv2 Structure [5] : UEFI Reference
> > Specification 2.8, Appendix N - Common Platform Error
> >   Record
> > [6] : UEFI Reference Specification 2.8, Section N.2.5 Memory Error Section
> >
> > This patch series is dependent on the edk2 patch series
> > https://edk2.groups.io/g/devel/message/79741
> >
> > Link to github branch with the patches in this series -
> > https://github.com/omkkul01/edk2-platforms/tree/ras_firware_first_edk2-
> > platforms_v3
> >
> > Omkar Anand Kulkarni (5):
> >   Platform/ARM: Add DMC-620 ECC error handling driver
> >   Platform/Sgi: dmc-620 firmware-first error handling
> >   Platform/Sgi: define memory region for GHES error status block
> >   Platform/Sgi: Define values for ACPI table header
> >   Platform/Sgi: Add platform error handling driver
> >
> >  Platform/ARM/Drivers/Dmc620Mm/Dmc620Mm.dec|  30 ++
> >  Platform/ARM/SgiPkg/SgiPlatform.dec   |   1 +
> >  Platform/ARM/SgiPkg/SgiPlatform.dsc.inc   |  38 ++
> >  Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc |  30 ++
> >  Platform/ARM/SgiPkg/PlatformStandaloneMm.fdf  |   6 +
> >  Platform/ARM/SgiPkg/SgiPlatform.fdf   |  13 +
> >  Platform/ARM/Drivers/Dmc620Mm/Dmc620Mm.inf|  61 +++
> >  .../PlatformErrorHandlerDxe.inf   |  51 +++
> >  .../Library/PlatformLib/PlatformLib.inf   |   6 +
> >  Platform/ARM/Drivers/Dmc620Mm/Dmc620Mm.h  | 174 +
> >  Platform/ARM/Drivers/Dmc620Mm/Dmc620Mm.c  | 362
> > ++
> >  .../Dmc620Mm/Dmc620MmErrorSourceInfo.c| 194 ++
> >  .../PlatformErrorHandlerDxe.c | 171 +
> >  .../Library/PlatformLib/PlatformLibMem.c  |  13 +-
> >  14 files changed, 1148 insertions(+), 2 deletions(-)  create mode 100644
> > Platform/ARM/Drivers/Dmc620Mm/Dmc620Mm.dec
> >  create mode 100644 Platform/ARM/Drivers/Dmc620Mm/Dmc620Mm.inf
> >  create mode 100644
> > Platform/ARM/SgiPkg/Drivers/PlatformErrorHandlerDxe/PlatformErrorHandl
> > erDxe.inf
> >  create mode 100644 Platform/ARM/Drivers/Dmc620Mm/Dmc620Mm.h
> >  create mode 100644 Platform/ARM/Drivers/Dmc620Mm/Dmc620Mm.c
> >  create mode 100644
> > Platform/ARM/Drivers/Dmc620Mm/Dmc620MmErrorSourceInfo.c
> >  create mode 100644
> > Platform/ARM/SgiPkg/Drivers/PlatformErrorHandlerDxe/PlatformErrorHandl
> > erDxe.c
> >
> > --
> > 2.17.1
> >
> >
> >
> > -=-=-=-=-=-=
> > Groups.io Links: You receive all messages sent to this group.
> > View/Reply Online (#79749): https://edk2.groups.io/g/devel/message/79749
> > Mute This Topic: https://groups.io/mt/85104844/4857533
> > Group Owner: devel+ow...@edk2.groups.io
> > Unsubscribe: https://edk2.groups.io/g/devel/unsub
> > [omkar.kulka...@arm.com]
> > -=-=-=-=-=-=
> >
>
> IMPORTANT NOTICE: The contents of this email and any attachments are 
> confidential and may also be privileged. If you are not the intended 
> recipient, please notify the sender immediately and do not disclose the 
> contents to any other person, use it for any purpose, or store or copy the 
> information in any medium. Thank you.


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

Re: [edk2-devel] [RFC PATCH 1/3] ArmVirtPkg/TPM: Add a NULL implementation of TpmPlatformHierarchyLib

2021-09-22 Thread Ard Biesheuvel
On Sat, 18 Sept 2021 at 13:54, Stefan Berger  wrote:
>
>
> On 9/18/21 3:55 AM, Ard Biesheuvel wrote:
> > On Thu, 16 Sept 2021 at 23:18, Stefan Berger  wrote:
> >> From: Stefan Berger 
> >>
> >> Add a NULL implementation of the library class TpmPlatformHierarchyLib.
> >>
> > This patch introduces both the library class and the NULL
> > implementation, right?
>
> No, we already added the library class when adding the 'foundation' for
> x86 support:
> https://github.com/tianocore/edk2/tree/master/SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib
>
>
> >
> >> Cc: Ard Biesheuvel 
> >> Cc: Leif Lindholm 
> >> Cc: Sami Mujawar 
> >> Cc: Gerd Hoffmann 
> >> Signed-off-by: Stefan Berger 
> >> ---
> >>   ArmVirtPkg/ArmVirtPkg.dec |  1 +
> >>   .../Include/Library/TpmPlatformHierarchyLib.h | 27 +
> >>   .../PeiDxeTpmPlatformHierarchyLib.c   | 22 ++
> >>   .../PeiDxeTpmPlatformHierarchyLib.inf | 30 +++
> >>   4 files changed, 80 insertions(+)
> >>   create mode 100644 ArmVirtPkg/Include/Library/TpmPlatformHierarchyLib.h
> >>   create mode 100644 
> >> ArmVirtPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.c
> >>   create mode 100644 
> >> ArmVirtPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.inf
> >>
> >> diff --git a/ArmVirtPkg/ArmVirtPkg.dec b/ArmVirtPkg/ArmVirtPkg.dec
> >> index 4e4d758015..f3bdca118b 100644
> >> --- a/ArmVirtPkg/ArmVirtPkg.dec
> >> +++ b/ArmVirtPkg/ArmVirtPkg.dec
> >> @@ -27,6 +27,7 @@
> >>
> >>   [LibraryClasses]
> >> ArmVirtMemInfoLib|Include/Library/ArmVirtMemInfoLib.h
> >> +  TpmPlatformHierarchyLib|Include/Library/TpmPlatformHierarchyLib.h
> >>
> >>   [Guids.common]
> >> gArmVirtTokenSpaceGuid = { 0x0B6F5CA7, 0x4F53, 0x445A, { 0xB7, 0x6E, 
> >> 0x2E, 0x36, 0x5B, 0x80, 0x63, 0x66 } }
> >> diff --git a/ArmVirtPkg/Include/Library/TpmPlatformHierarchyLib.h 
> >> b/ArmVirtPkg/Include/Library/TpmPlatformHierarchyLib.h
> >> new file mode 100644
> >> index 00..8d61a4867b
> >> --- /dev/null
> >> +++ b/ArmVirtPkg/Include/Library/TpmPlatformHierarchyLib.h
> >> @@ -0,0 +1,27 @@
> >> +/** @file
> >> +TPM Platform Hierarchy configuration library.
> >> +
> >> +This library provides functions for customizing the TPM's Platform 
> >> Hierarchy
> >> +Authorization Value (platformAuth) and Platform Hierarchy 
> >> Authorization
> >> +Policy (platformPolicy) can be defined through this function.
> >> +
> >> +Copyright (c) 2019, Intel Corporation. All rights reserved.
> >> +Copyright (c) Microsoft Corporation.
> >> +SPDX-License-Identifier: BSD-2-Clause-Patent
> >> +
> >> +**/
> >> +
> >> +#ifndef TPM_PLATFORM_HIERARCHY_LIB_H_
> >> +#define TPM_PLATFORM_HIERARCHY_LIB_H_
> >> +
> >> +/**
> >> +   This service will perform the TPM Platform Hierarchy configuration at 
> >> the SmmReadyToLock event.
> >> +
> >> +**/
> >> +VOID
> >> +EFIAPI
> >> +ConfigureTpmPlatformHierarchy (
> >> +  VOID
> >> +  );
> >> +
> >> +#endif
> >> diff --git 
> >> a/ArmVirtPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.c
> >>  
> >> b/ArmVirtPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.c
> >> new file mode 100644
> >> index 00..bac1efda63
> >> --- /dev/null
> >> +++ 
> >> b/ArmVirtPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.c
> >> @@ -0,0 +1,22 @@
> >> +/** @file
> >> +Null TPM Platform Hierarchy configuration library.
> >> +
> >> +This library provides stub functions for customizing the TPM's 
> >> Platform Hierarchy.
> >> +
> >> +Copyright (c) 2021, IBM Corporation.
> >> +SPDX-License-Identifier: BSD-2-Clause-Patent
> >> +
> >> +**/
> >> +
> >> +#include 
> >> +
> >> +/**
> >> +  A NULL implementation of ConfigureTpmPlatformHierarchy.
> >> +**/
> >> +VOID
> >> +EFIAPI
> >> +ConfigureTpmPlatformHierarchy (
> > VOID
> Ok , had copied signature 1:1 from here:
> https://github.com/tianocore/edk2/blob/master/SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.c#L239
> >
> >> +  )
> >> +{
> >> +  /* no nothing */
> > double negative :-)
>
>
> Typo. Will fix.
>
> >
> >> +}
> >> diff --git 
> >> a/ArmVirtPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.inf
> >>  
> >> b/ArmVirtPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.inf
> >> new file mode 100644
> >> index 00..4f02818bbc
> >> --- /dev/null
> >> +++ 
> >> b/ArmVirtPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.inf
> >> @@ -0,0 +1,30 @@
> >> +### @file
> >> +#   NULL TPM Platform Hierarchy configuration library.
> >> +#
> >> +#   This library provides functions for customizing the TPM's Platform 
> >> Hierarchy
> >> +#   Authorization Value (platformAuth) and Platform Hierarchy 
> >> Authorization
> >> +#   Policy (platformPolicy) can be defined through this function.
> >> +#
> >> +# Copyrigh

Re: [edk2-devel] [edk2-platforms PATCH 0/4] Marvell readmes

2021-09-22 Thread Ard Biesheuvel
On Tue, 21 Sept 2021 at 13:02, Marcin Wojtas  wrote:
>
> Hi,
>
> This short patchset adds README files for the platforms
> based on Marvell SoC's, which have already been
> SystemReady ES certified. It also bumps the firmware
> revision after the PCI / IcuLib rework and addition of
> the CN913x CEx7 Evaluation Board support.
>
> The patches are available on a public branch:
> https://github.com/semihalf-wojtas-marcin/edk2-platforms/commits/marvell-howtos-upstream-r20210921
>

Thanks

Pushed as 64394fd2b48f..d1d4dd2c39e7


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




Re: [edk2-devel] [edk2-platforms PATCH 1/4] BeagleBoardPkg: Remove the configuration and image headers from flash

2021-09-22 Thread Ard Biesheuvel
On Wed, 22 Sept 2021 at 13:20, Ard Biesheuvel  wrote:
>
> On Tue, 14 Sept 2021 at 16:39, Leif Lindholm  wrote:
> >
> > Ard, I think you were the one who converted the old crazy header stuff
> > to what we have now. Do you remember how this all fits together?
> >
>
> I had to page it in (edk2:a1123292a80608a69df89b6dd264c4656b618aec)
> but given that I never used a BeagleBoard in my life, I'm sure this
> was a theoretical exercise mostly, and I just compared the resulting
> images before and after.
>
> So this looks fine to me - if don't have a use for the configuration
> header we should just remove it.
>

... which you can take as a

Reviewed-by: Ard Biesheuvel 

for the series.

> > For the *other* 3 patches, but not this one:
> > Reviewed-by: Leif Lindholm 
> >
> >
> > On Fri, Sep 10, 2021 at 20:57:11 -0600, Rebecca Cran wrote:
> > > Remove the configuration and image headers from the flash image.
> > > This was likely intended for the UEFI firmware to be loaded by the ROM
> > > code, but the BeagleBoard only has 64KB SRAM and so EDK2 needs to be
> > > executed as a second stage loader.
> > >
> > > Signed-off-by: Rebecca Cran 
> > > ---
> > >  Platform/BeagleBoard/BeagleBoardPkg/BeagleBoardPkg.fdf | 13 ++---
> > >  1 file changed, 2 insertions(+), 11 deletions(-)
> > >
> > > diff --git a/Platform/BeagleBoard/BeagleBoardPkg/BeagleBoardPkg.fdf 
> > > b/Platform/BeagleBoard/BeagleBoardPkg/BeagleBoardPkg.fdf
> > > index a2cfeb3bc27b..dbae015ff382 100644
> > > --- a/Platform/BeagleBoard/BeagleBoardPkg/BeagleBoardPkg.fdf
> > > +++ b/Platform/BeagleBoard/BeagleBoardPkg/BeagleBoardPkg.fdf
> > > @@ -23,7 +23,7 @@
> > >
> > >
> > >  [FD.BeagleBoard_EFI]
> > > -BaseAddress   = 0x80007DF8|gArmTokenSpaceGuid.PcdFdBaseAddress  #The 
> > > base address of the FLASH Device.
> > > +BaseAddress   = 0x80008000|gArmTokenSpaceGuid.PcdFdBaseAddress  #The 
> > > base address of the FLASH Device.
> > >  Size  = 0x000B|gArmTokenSpaceGuid.PcdFdSize #The 
> > > size in bytes of the FLASH Device
> > >  ErasePolarity = 1
> > >  BlockSize = 0x1
> > > @@ -44,16 +44,7 @@ NumBlocks = 0xB
> > >  # RegionType 
> > >  #
> > >  
> > > 
> > > -0x|0x0200
> > > -FILE = Platform/BeagleBoard/BeagleBoardPkg/ConfigurationHeader.bin
> > > -
> > > -0x0200|0x0008
> > > -DATA = {
> > > -  0xF8, 0xFD, 0x0A, 0x00,   # image size:   0xB - 0x208 == 0xAFDF8
> > > -  0x00, 0x80, 0x00, 0x80# entry point:  0x80008000
> > > -}
> > > -
> > > -0x0208|0x000AFDF8
> > > +0x|0x000B
> > >  gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize
> > >  FV = FVMAIN_COMPACT
> > >
> > > --
> > > 2.31.1
> > >
> > >


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




Re: [edk2-devel] [edk2-platforms PATCH 1/4] BeagleBoardPkg: Remove the configuration and image headers from flash

2021-09-22 Thread Ard Biesheuvel
On Tue, 14 Sept 2021 at 16:39, Leif Lindholm  wrote:
>
> Ard, I think you were the one who converted the old crazy header stuff
> to what we have now. Do you remember how this all fits together?
>

I had to page it in (edk2:a1123292a80608a69df89b6dd264c4656b618aec)
but given that I never used a BeagleBoard in my life, I'm sure this
was a theoretical exercise mostly, and I just compared the resulting
images before and after.

So this looks fine to me - if don't have a use for the configuration
header we should just remove it.

> For the *other* 3 patches, but not this one:
> Reviewed-by: Leif Lindholm 
>
>
> On Fri, Sep 10, 2021 at 20:57:11 -0600, Rebecca Cran wrote:
> > Remove the configuration and image headers from the flash image.
> > This was likely intended for the UEFI firmware to be loaded by the ROM
> > code, but the BeagleBoard only has 64KB SRAM and so EDK2 needs to be
> > executed as a second stage loader.
> >
> > Signed-off-by: Rebecca Cran 
> > ---
> >  Platform/BeagleBoard/BeagleBoardPkg/BeagleBoardPkg.fdf | 13 ++---
> >  1 file changed, 2 insertions(+), 11 deletions(-)
> >
> > diff --git a/Platform/BeagleBoard/BeagleBoardPkg/BeagleBoardPkg.fdf 
> > b/Platform/BeagleBoard/BeagleBoardPkg/BeagleBoardPkg.fdf
> > index a2cfeb3bc27b..dbae015ff382 100644
> > --- a/Platform/BeagleBoard/BeagleBoardPkg/BeagleBoardPkg.fdf
> > +++ b/Platform/BeagleBoard/BeagleBoardPkg/BeagleBoardPkg.fdf
> > @@ -23,7 +23,7 @@
> >
> >
> >  [FD.BeagleBoard_EFI]
> > -BaseAddress   = 0x80007DF8|gArmTokenSpaceGuid.PcdFdBaseAddress  #The base 
> > address of the FLASH Device.
> > +BaseAddress   = 0x80008000|gArmTokenSpaceGuid.PcdFdBaseAddress  #The base 
> > address of the FLASH Device.
> >  Size  = 0x000B|gArmTokenSpaceGuid.PcdFdSize #The size 
> > in bytes of the FLASH Device
> >  ErasePolarity = 1
> >  BlockSize = 0x1
> > @@ -44,16 +44,7 @@ NumBlocks = 0xB
> >  # RegionType 
> >  #
> >  
> > 
> > -0x|0x0200
> > -FILE = Platform/BeagleBoard/BeagleBoardPkg/ConfigurationHeader.bin
> > -
> > -0x0200|0x0008
> > -DATA = {
> > -  0xF8, 0xFD, 0x0A, 0x00,   # image size:   0xB - 0x208 == 0xAFDF8
> > -  0x00, 0x80, 0x00, 0x80# entry point:  0x80008000
> > -}
> > -
> > -0x0208|0x000AFDF8
> > +0x|0x000B
> >  gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize
> >  FV = FVMAIN_COMPACT
> >
> > --
> > 2.31.1
> >
> >


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#80954): https://edk2.groups.io/g/devel/message/80954
Mute This Topic: https://groups.io/mt/85526129/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] IntelFsp2WrapperPkg: Make PcdFspModeSelection dynamic and set it accordingly

2021-09-22 Thread Chiu, Chasel


Patch pushed: 
https://github.com/tianocore/edk2/commit/f334c5a41dc4702b1c767c6614025aa2f802f9a4

Thanks,
Chasel


> -Original Message-
> From: Zhang, Xiaoqiang 
> Sent: Thursday, September 16, 2021 11:45 AM
> To: devel@edk2.groups.io
> Cc: Zhang, Xiaoqiang ; Chiu, Chasel
> ; Desimone, Nathaniel L
> ; Zeng, Star 
> Subject: [PATCH v1] IntelFsp2WrapperPkg: Make PcdFspModeSelection
> dynamic and set it accordingly
> 
> From: Zhang Xiaoqiang 
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3632
> 
> PcdFspModeSelection will be used to set FSP mode.
> Make PcdFspModeSelection dynamic and set it accordingly.
> 
> Signed-off-by: Zhang Xiaoqiang 
> Cc: Chasel Chiu 
> Cc: Nate DeSimone 
> Cc: Star Zeng 
> ---
>  IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec | 12 ++--
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> index a3b9363779..b8dac1b574 100644
> --- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> +++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> @@ -82,12 +82,6 @@
># @Prompt Skip FSP API from FSP wrapper.
> 
> 
> gIntelFsp2WrapperTokenSpaceGuid.PcdSkipFspApi|0x|UINT32|0x4
> 009
> 
> 
> 
> -  ## This PCD decides how Wrapper code utilizes FSP
> 
> -  # 0: DISPATCH mode (FSP Wrapper will load PeiCore from FSP without
> calling FSP API)
> 
> -  # 1: API mode (FSP Wrapper will call FSP API)
> 
> -  #
> 
> -
> gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection|0x0001|UIN
> T8|0x400A
> 
> -
> 
>## This PCD decides how FSP is measured
> 
># 1) The BootGuard ACM may already measured the FSP component, such
> as FSPT/FSPM.
> 
># We need a flag (PCD) to indicate if there is need to do such FSP
> measurement or NOT.
> 
> @@ -106,6 +100,12 @@
> 
> gIntelFsp2WrapperTokenSpaceGuid.PcdFspMeasurementConfig|0x000
> 0|UINT32|0x400B
> 
> 
> 
>  [PcdsFixedAtBuild, PcdsPatchableInModule,PcdsDynamic,PcdsDynamicEx]
> 
> +  ## This PCD decides how Wrapper code utilizes FSP
> 
> +  # 0: DISPATCH mode (FSP Wrapper will load PeiCore from FSP without
> calling FSP API)
> 
> +  # 1: API mode (FSP Wrapper will call FSP API)
> 
> +  #
> 
> +
> gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection|0x0001|UIN
> T8|0x400A
> 
> +
> 
>#
> 
>## These are the base address of FSP-M/S
> 
>#
> 
> --
> 2.32.0.windows.1



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




Re: [edk2-devel] [PATCH v8 17/32] OvmfPkg/MemEncryptSevLib: add support to validate > 4GB memory in PEI phase

2021-09-22 Thread Gerd Hoffmann
On Mon, Sep 20, 2021 at 01:45:49PM -0500, Brijesh Singh wrote:
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3275
> 
> The initial page built during the SEC phase is used by the
> MemEncryptSevSnpValidateSystemRam() for the system RAM validation. The
> page validation process requires using the PVALIDATE instruction;  the
> instruction accepts a virtual address of the memory region that needs
> to be validated. If hardware encounters a page table walk failure (due
> to page-not-present) then it raises #GP.
> 
> The initial page table built in SEC phase address up to 4GB. Add an
> internal function to extend the page table to cover > 4GB. The function
> builds 1GB entries in the page table for access > 4GB. This will provide
> the support to call PVALIDATE instruction for the virtual address >
> 4GB in PEI phase.

Hmm, well, playing with page tables like that in sev-specific code
instead of having memory core handle this properly is quite hackish.

What is the long-term plan with this?  I assume once support for lazy
acceptance/validation is merged we can simply delete this?

Assuming this is only a temporary solution I think we can tolerate the
hacks.

take care,
  Gerd



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




Re: [edk2-devel] [PATCH v8 09/32] OvmfPkg/MemEncryptSevLib: add MemEncryptSevSnpEnabled()

2021-09-22 Thread Gerd Hoffmann
  Hi,

>  STATIC BOOLEAN mSevStatus = FALSE;
>  STATIC BOOLEAN mSevEsStatus = FALSE;
> +STATIC BOOLEAN mSevSnpStatus = FALSE;
>  STATIC BOOLEAN mSevStatusChecked = FALSE;

Better use the new PcdConfidentialComputingAttr instead?
At least in Dxe Phase, maybe Pei too (not sure what the initialization
order is)?

take care,
  Gerd



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




Re: [edk2-devel] [PATCH v8 08/32] OvmfPkg/ResetVector: use SEV-SNP-validated CPUID values

2021-09-22 Thread Gerd Hoffmann
  Hi,

> +; If SEV-SNP is enabled, use the CPUID page to handle the CPUID
> +; instruction.
> +mov ecx, SEV_STATUS_MSR
> +rdmsr
> +bt  eax, 2
> +jc  SnpCpuidLookup

Maybe check SNP_CPUID_COUNT instead, so the cpuid page can also be used
without SEV-SNP ?

take care,
  Gerd



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




Re: [edk2-devel] [PATCH V7 1/1] OvmfPkg: Enable TDX in ResetVector

2021-09-22 Thread Gerd Hoffmann
  Hi,

> +%ifdef ARCH_X64
> +;
> +; TDX Metadata offset block
> +;
> +; TdxMetadata.asm is included in ARCH_X64 because Inte TDX is only
> +; available in ARCH_X64. Below block describes the offset of
> +; TdxMetadata block in Ovmf image
> +;
> +; GUID : e47a6535-984a-4798-865e-4685a7bf8ec2
> +;
> +tdxMetadataOffsetStart:
> +DD  tdxMetadataOffsetStart - TdxMetadataGuid - 16
> +DW  tdxMetadataOffsetEnd - tdxMetadataOffsetStart
> +DB  0x35, 0x65, 0x7a, 0xe4, 0x4a, 0x98, 0x98, 0x47
> +DB  0x86, 0x5e, 0x46, 0x85, 0xa7, 0xbf, 0x8e, 0xc2
> +tdxMetadataOffsetEnd:
> +
> +%endif

This should be switched to common ovmf metadata (see patches 4-7 of the
SEV-SNP series).

Min: please have a look at these patches.

Brijesh: It might be useful to post the metadata patches as separate
series.

> +; Load the GDT and set the CR0, then jump to Flat 32 protected mode.

That comment isn't correct, you are already in 32-bit mode.

> +; Modified:  EAX, EBX, CR0, CR4, DS, ES, FS, GS, SS

CS too ...

> +jmp LINEAR_CODE_SEL:dword ADDR_OF(jumpToFlat32BitAndLandHere)
> +jumpToFlat32BitAndLandHere:

... right here.

> --- /dev/null
> +++ b/OvmfPkg/ResetVector/Main.asm

Can you add a separate patch for "copy Main.asm from UefiCpuPkg
unmodified" please?  Having the changes for TDX separately is helpful
for review.

take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#80949): https://edk2.groups.io/g/devel/message/80949
Mute This Topic: https://groups.io/mt/85761661/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/4] AndroidBootImgLib improvements

2021-09-22 Thread Jun Nie
Hi Jeff,

I do not ever work on EDK soon after this patch set was merged.  It is
long time since then.
I am sorry that I have no comments other than no objections on your patch.

Regards,
Jun

Jeff Brasen  于2021年9月22日周三 上午12:33写道:
>
> Jun/Others,
>
>   Any additional comments on this patch series?
>
> Thanks,
>
> Jeff
>
> 
> From: Jeff Brasen 
> Sent: Tuesday, September 14, 2021 10:57 AM
> To: Leif Lindholm 
> Cc: devel@edk2.groups.io ; daniel.schae...@hpe.com 
> ; abner.ch...@hpe.com ; 
> ardb+tianoc...@kernel.org ; Jun Nie 
> 
> Subject: Re: [PATCH v3 0/4] AndroidBootImgLib improvements
>
> So for patch 3: This is only a change if mAndroidBootImg->UpdateDtb == NULL.
>
> This seemed like a bug as we would not add the initrd values nor would we use 
> the fdt from the BootImg if that is where the device tree was sourced from.
>
> It seems like either we should require UpdateDtb to be implemented (which 
> seems to cause greater compatibility issues) or we install the device tree we 
> have if that function isn't implemented.
>
> As far as merging goes I am fine either way. Our particular flow won't hit 
> this path as we don't have a device tree in the bootimg (use the system 
> config table) and we will have the new pcd set, but this seemed like a bug 
> while I looking at this code.
>
> Thanks,
>
> Jeff
>
> 
> From: Leif Lindholm 
> Sent: Tuesday, September 14, 2021 9:00 AM
> To: Jeff Brasen 
> Cc: devel@edk2.groups.io ; daniel.schae...@hpe.com 
> ; abner.ch...@hpe.com ; 
> ardb+tianoc...@kernel.org ; Jun Nie 
> 
> Subject: Re: [PATCH v3 0/4] AndroidBootImgLib improvements
>
> External email: Use caution opening links or attachments
>
>
> Hi Jeff,
>
> Thanks for this.
> This set looks good to me, with a slight question mark wrt behaviour
> compatibility with previous versions for 3/4.
> (I think it's fine, but I'm a bear of very little brain, and it's been
> several years since I reviewed this code, and even longer since I
> really interacted with Android.
> ^
> | shameless plug for more EmbeddedPkg reviewer volunteers.)
>
> I've added Jun Nie, who wrote the original version of this code, to
> see if he has any comments.
>
> 1-2/4 are obviously unproblematic, and I could merge those ahead of
> time if preferred. You can add
> Reviewed-by: Leif Lindholm 
> for those if there are any further revisions of the set.
>
> Best Regards,
>
> Leif
>
> On Mon, Sep 13, 2021 at 23:18:47 +, Jeff Brasen wrote:
> > Added support for using loadfile2 approach for passing ramdisk to linux.
> > Created patch series for general error handling improvments based on
> > review feedback.
> > If ACPI tables are in system table or PCD is defined the LoadFile2 method
> > of passing initrd will be used.
> >
> > [v3]
> > -Code review cleanup
> > -Removed duplicate header file
> > -Added change to allow FDT to install if UpdateDtb function is not defined
> > -Added specific ACPI check
> > -Moved install functions to subfunctions
> >
> > [v2]
> > -Added review feedback
> > -General improvements to error handling
> >
> > [v1]
> > - Intial revision
> >
> >
> > Jeff Brasen (4):
> >   EmbeddedPkg: Remove duplicate libfdt.h include
> >   EmbeddedPkg: AndroidBootImgBoot error handling updates
> >   EmbeddedPkg: Install FDT if UpdateDtb is not present
> >   EmbeddedPkg: Add LoadFile2 for linux initrd
> >
> >  EmbeddedPkg/EmbeddedPkg.dec   |   1 +
> >  .../AndroidBootImgLib/AndroidBootImgLib.inf   |   4 +
> >  .../AndroidBootImgLib/AndroidBootImgLib.c | 275 +++---
> >  3 files changed, 233 insertions(+), 47 deletions(-)
> >
> > --
> > 2.17.1
> >


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