Re: [edk2-devel] [PATCH v2] Pyrite support - Secure erase is only available if encryption is supported.

2023-09-11 Thread Linus Liu
Hi Ard 
V3 patch has updated.
Please help to check it.
Thanks.

-Original Message-
From: Ard Biesheuvel  
Sent: Monday, September 11, 2023 9:14 PM
To: devel@edk2.groups.io; Liu, Linus 
Cc: Zhang, Qi1 ; Kumar, Rahul R ; 
Yao, Jiewen ; Chen, Tina ; Chen, 
Xiao X 
Subject: Re: [edk2-devel] [PATCH v2] Pyrite support - Secure erase is only 
available if encryption is supported.

On Thu, 7 Sept 2023 at 11:02, Linus Liu  wrote:
>
> From: Linus Liu 
>
> https://bugzilla.tianocore.org/show_bug.cgi?id=3004
>
> Cc: Qi Zhang
> Cc: Rahul Kumar 
> Cc: Jiewen Yao  
> Cc: Tina Chen   
> Cc: Xiao X Chen 

This patch is missing a signed-off-by line

> ---
>  SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c 
> b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
> index e2e77cbc24..ba9fa66c60 100644
> --- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
> +++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
> @@ -87,7 +87,11 @@ OpalSupportGetAvailableActions (
>  // Secure erase is performed by generating a new encryption key
>  // this is only available if encryption is supported
>  //
> -AvalDiskActions->SecureErase = 1;
> +if (SupportedAttributes->MediaEncryption) {
> +  AvalDiskActions->SecureErase = 1;
> +} else {
> +  AvalDiskActions->SecureErase = 0;
> +}
>} else {
>  AvalDiskActions->PsidRevert  = 0;
>  AvalDiskActions->SecureErase = 0;
> --
> 2.39.2.windows.1
>
>
>
> 
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#108368): https://edk2.groups.io/g/devel/message/108368
> Mute This Topic: https://groups.io/mt/101210886/1131722
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [a...@kernel.org]
> 
>
>


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


--- Begin Message ---
From: Linus Liu 

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

Cc: Qi Zhang
Cc: Rahul Kumar 
Cc: Jiewen Yao  
Cc: Tina Chen   
Cc: Xiao X Chen 
Signed-off-by: Linus Liu 
---
 SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c 
b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
index e2e77cbc24..ba9fa66c60 100644
--- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
+++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
@@ -87,7 +87,11 @@ OpalSupportGetAvailableActions (
 // Secure erase is performed by generating a new encryption key

 // this is only available if encryption is supported

 //

-AvalDiskActions->SecureErase = 1;

+if (SupportedAttributes->MediaEncryption) {

+  AvalDiskActions->SecureErase = 1;

+} else {

+  AvalDiskActions->SecureErase = 0;

+}

   } else {

 AvalDiskActions->PsidRevert  = 0;

 AvalDiskActions->SecureErase = 0;

--
2.39.2.windows.1



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


--- End Message ---


Re: [edk2-devel] [PATCH edk2-platforms 1/1] Platform/Ampere: Update Readme.md

2023-09-11 Thread Nhi Pham via groups.io

Reviewed-by: Nhi Pham 

Thanks,

Nhi

On 9/12/2023 12:44 AM, Rebecca Cran wrote:

Improve the Readme.md in Platform/Ampere:

- At this point eMAG is irrelevant, and most people are likely
   using Altra systems. Drop mention of it.
- Instead of mentioning the 'latest' versions of CentOS and Ubuntu
   (which will by definition change over time), specify Ubuntu 22.04
   and CentOS 7.
- Fix the link to the acpica download, since content has been moved from
   acpica.org to intel.com.
- Assuming the build is being done on Linux, acpica shouldn't be built
   with a CYGWIN definition.
- To avoid making people wait ages for acpica to build, add `-j8` as an
   example of building in parallel.

Signed-off-by: Rebecca Cran 
---
  Platform/Ampere/Readme.md | 8 
  1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Platform/Ampere/Readme.md b/Platform/Ampere/Readme.md
index 894bad3437b8..066876dab4b5 100644
--- a/Platform/Ampere/Readme.md
+++ b/Platform/Ampere/Readme.md
@@ -8,8 +8,8 @@ Silicon code is located under Silicon/Ampere/Ampere{SoC 
Name}Pkg.
  
  # Build machines
  
-- x86 Linux host machines running latest Ubuntu or CentOS releases.

-- Arm64 Linux host machines if native compiling. This has been tested on 
Ampere's eMAG and Altra hardware platforms with latest AArch64 CentOS or Ubuntu 
releases.
+- x86 Linux host machines running Ubuntu 22.04 or CentOS 7 releases.
+- Arm64 Linux host machines if native compiling. This has been tested on 
Ampere's Altra hardware platforms with AArch64 CentOS 7 or Ubuntu 22.04 
releases.
  
  # How to build (Linux Environment)
  
@@ -32,8 +32,8 @@ If you run into any build issue with the Intel ASL+ Optimizing Compiler/Disassem

  download and install the IASL compiler from https://acpica.org/. At the time 
of this write-up, we have tested with version 20200110.
  
  ```bash

-$ wget https://acpica.org/sites/acpica/files/acpica-unix2-20200110.tar.gz
+$ wget https://downloadmirror.intel.com/774850/acpica-unix2-20200110.tar.gz
  $ tar xzf acpica-unix2-20200110.tar.gz
  $ cd acpica-unix2-20200110
-$ make HOST=_CYGWIN && sudo make install
+$ make -j8 && sudo make install
  ```



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




[edk2-devel] [PATCH v3] Pyrite support - Secure erase is only available if encryption is supported.

2023-09-11 Thread Linus Liu
From: Linus Liu 

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

Cc: Qi Zhang
Cc: Rahul Kumar 
Cc: Jiewen Yao  
Cc: Tina Chen   
Cc: Xiao X Chen 
Signed-off-by: Linus Liu 
---
 SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c 
b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
index e2e77cbc24..ba9fa66c60 100644
--- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
+++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
@@ -87,7 +87,11 @@ OpalSupportGetAvailableActions (
 // Secure erase is performed by generating a new encryption key
 // this is only available if encryption is supported
 //
-AvalDiskActions->SecureErase = 1;
+if (SupportedAttributes->MediaEncryption) {
+  AvalDiskActions->SecureErase = 1;
+} else {
+  AvalDiskActions->SecureErase = 0;
+}
   } else {
 AvalDiskActions->PsidRevert  = 0;
 AvalDiskActions->SecureErase = 0;
-- 
2.39.2.windows.1



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




[edk2-devel] Event: TianoCore Bug Triage - APAC / NAMO - Tuesday, September 12, 2023 #cal-reminder

2023-09-11 Thread Group Notification
*Reminder: TianoCore Bug Triage - APAC / NAMO*

*When:*
Tuesday, September 12, 2023
6:30pm to 7:30pm
(UTC-07:00) America/Los Angeles

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

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

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

*Description:*

TianoCore Bug Triage - APAC / NAMO

Hosted by Liming Gao



Microsoft Teams meeting

*Join on your computer or mobile app*

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

*Join with a video conferencing device*

te...@conf.intel.com

Video Conference ID: 116 062 094 0

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

*Or call in (audio only)*

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

Phone Conference ID: 774 638 21#

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

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


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




回复: [edk2-devel] [PATCH v2 0/7] Uncrustify GoogleTest update

2023-09-11 Thread gaoliming via groups.io
For this patch set, Acked-by: Liming Gao 

> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 VivianNK
> 发送时间: 2023年8月17日 5:15
> 收件人: devel@edk2.groups.io
> 主题: [edk2-devel] [PATCH v2 0/7] Uncrustify GoogleTest update
> 
> v1 -> v2:
>  - Update commit message to explain the audit only mode change is
>temporary to prevent intermediate CI failures.
>  - Format patch Cc's correctly
> 
> v1 archive:https://edk2.groups.io/g/devel/message/107665
> 
> VivianNK (7):
>   .pytool: Set uncrustify check to audit only (temporary)
>   .pytool: Add cpp support to uncrustify plugin
>   MdeModulePkg: Apply uncrustify formatting to relevant files.
>   MdePkg: Apply uncrustify formatting to relevant files
>   SecurityPkg: Apply uncrustify formatting to relevant files
>   UnitTestFrameworkPkg: Apply uncrustify formatting to relevant files
>   .pytool: Undo uncrustify check change
> 
>  .pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py
> |   2 +-
>  .pytool/Plugin/UncrustifyCheck/uncrustify.cfg
> |   4 +-
>  MdeModulePkg/Library/UefiSortLib/GoogleTest/UefiSortLibGoogleTest.cpp
> |  37 +-
> 
> MdeModulePkg/Test/Mock/Include/GoogleTest/Library/MockPciHostBridgeLi
> b.h|   4 +-
> 
> MdeModulePkg/Test/Mock/Library/GoogleTest/MockPciHostBridgeLib/Mock
> PciHostBridgeLib.cpp |   8 +-
> 
> MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/SafeIntLibUintnIntnUnitTest
> s32.cpp| 114 ++--
> 
> MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/SafeIntLibUintnIntnUnitTest
> s64.cpp| 114 ++--
>  MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/TestBaseSafeIntLib.cpp
> | 563 ++--
>  MdePkg/Test/Mock/Include/GoogleTest/Library/MockHobLib.h
> |   6 +-
>  MdePkg/Test/Mock/Include/GoogleTest/Library/MockPeiServicesLib.h
> |   6 +-
>  MdePkg/Test/Mock/Include/GoogleTest/Library/MockUefiLib.h
> |   4 +-
> 
> MdePkg/Test/Mock/Include/GoogleTest/Library/MockUefiRuntimeServicesTa
> bleLib.h   |   4 +-
>  MdePkg/Test/Mock/Library/GoogleTest/MockHobLib/MockHobLib.cpp
> |  40 +-
> 
> MdePkg/Test/Mock/Library/GoogleTest/MockPeiServicesLib/MockPeiService
> sLib.cpp   |  52 +-
>  MdePkg/Test/Mock/Library/GoogleTest/MockUefiLib/MockUefiLib.cpp
> |   6 +-
> 
> MdePkg/Test/Mock/Library/GoogleTest/MockUefiRuntimeServicesTableLib/
> MockUefiRuntimeServicesTableLib.cpp |  12 +-
> 
> SecurityPkg/Library/SecureBootVariableLib/GoogleTest/SecureBootVariableLi
> bGoogleTest.cpp| 205 ---
> 
> SecurityPkg/Test/Mock/Include/GoogleTest/Library/MockPlatformPKProtecti
> onLib.h  |   4 +-
> 
> SecurityPkg/Test/Mock/Library/GoogleTest/MockPlatformPKProtectionLib/M
> ockPlatformPKProtectionLib.cpp|   4 +-
>  UnitTestFrameworkPkg/Include/Library/GoogleTestLib.h
> |   2 +-
> 
> UnitTestFrameworkPkg/Test/GoogleTest/Sample/SampleGoogleTest/SampleG
> oogleTest.cpp   |  76 +--
>  21 files changed, 664 insertions(+), 603 deletions(-)
> 
> --
> 2.41.0.windows.3
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#107809):
> https://edk2.groups.io/g/devel/message/107809
> Mute This Topic: https://groups.io/mt/100788665/4905953
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub
> [gaolim...@byosoft.com.cn]
> -=-=-=-=-=-=
> 





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




[edk2-devel] [PATCH 0/2] Add support for PCI IO using Qword resources

2023-09-11 Thread Jeff Brasen via groups.io
Use AmlCodeGenRdQWordIo() to generate the I/O range in _CRS instead of
AmlCodeGenRdDWordIo() to cater to the scenarios where 64-bit addresses
can be used to generate I/O packets over the PCIe bus.

Vidya Sagar (2):
  DynamicTablesPkg: AML Code generation for I/O ranges
  DynamicTablesPkg: AcpiSsdtPcieLibArm: Use QWord to describe I/O range

 .../Include/Library/AmlLib/AmlLib.h   | 67 ++
 .../AcpiSsdtPcieLibArm/SsdtPcieGenerator.c|  2 +-
 .../AmlLib/CodeGen/AmlResourceDataCodeGen.c   | 90 +++
 3 files changed, 158 insertions(+), 1 deletion(-)

-- 
2.25.1



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




[edk2-devel] [PATCH 2/2] DynamicTablesPkg: AcpiSsdtPcieLibArm: Use QWord to describe I/O range

2023-09-11 Thread Jeff Brasen via groups.io
From: Vidya Sagar 

Use AmlCodeGenRdQWordIo() to generate the I/O range in _CRS instead of
AmlCodeGenRdDWordIo() to cater to the scenarios where 64-bit addresses
can be used to generate I/O packets over the PCIe bus.

Reviewed-by: Shanker Donthineni 
Signed-off-by: Vidya Sagar 
Signed-off-by: Jeff Brasen 
---
 .../Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
index c54ae6f551f6..9ddaddc198fa 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
@@ -540,7 +540,7 @@ GeneratePciCrs (
 
 switch (AddrMapInfo->SpaceCode) {
   case PCI_SS_IO:
-Status = AmlCodeGenRdDWordIo (
+Status = AmlCodeGenRdQWordIo (
FALSE,
TRUE,
TRUE,
-- 
2.25.1



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




[edk2-devel] [PATCH 1/2] DynamicTablesPkg: AML Code generation for I/O ranges

2023-09-11 Thread Jeff Brasen via groups.io
From: Vidya Sagar 

Add helper functions to generate AML Resource Data describing I/O
ranges of four words long. API AmlCodeGenRdQWordIo () is exposed.

Reviewed-by: Shanker Donthineni 
Signed-off-by: Vidya Sagar 
Signed-off-by: Jeff Brasen 
---
 .../Include/Library/AmlLib/AmlLib.h   | 67 ++
 .../AmlLib/CodeGen/AmlResourceDataCodeGen.c   | 90 +++
 2 files changed, 157 insertions(+)

diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h 
b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
index 9210c5091548..8e24cecdd77b 100644
--- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
+++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
@@ -683,6 +683,73 @@ AmlCodeGenRdWordBusNumber (
   OUT   AML_DATA_NODE_HANDLE*NewRdNode  OPTIONAL
   );
 
+/** Code generation for the "QWordIO ()" ASL function.
+
+  The Resource Data effectively created is a QWord Address Space Resource
+  Data. Cf ACPI 6.4:
+   - s6.4.3.5.1 "QWord Address Space Descriptor".
+   - s19.6.109 "QWordIO".
+
+  The created resource data node can be:
+   - appended to the list of resource data elements of the NameOpNode.
+ In such case NameOpNode must be defined by a the "Name ()" ASL statement
+ and initially contain a "ResourceTemplate ()".
+   - returned through the NewRdNode parameter.
+
+  See ACPI 6.4 spec, s19.6.109 for more.
+
+  @param [in]  IsResourceConsumer   ResourceUsage parameter.
+  @param [in]  IsMinFixed   Minimum address is fixed.
+  @param [in]  IsMaxFixed   Maximum address is fixed.
+  @param [in]  IsPosDecode  Decode parameter
+  @param [in]  IsaRangesPossible values are:
+ 0-Reserved
+ 1-NonISAOnly
+ 2-ISAOnly
+ 3-EntireRange
+  @param [in]  AddressGranularity   Address granularity.
+  @param [in]  AddressMinimum   Minimum address.
+  @param [in]  AddressMaximum   Maximum address.
+  @param [in]  AddressTranslation   Address translation.
+  @param [in]  RangeLength  Range length.
+  @param [in]  ResourceSourceIndex  Resource Source index.
+Unused. Must be 0.
+  @param [in]  ResourceSource   Resource Source.
+Unused. Must be NULL.
+  @param [in]  IsDenseTranslation   TranslationDensity parameter.
+  @param [in]  IsTypeStatic TranslationType parameter.
+  @param [in]  NameOpNode   NameOp object node defining a named object.
+If provided, append the new resource data
+node to the list of resource data elements
+of this node.
+  @param [out] NewRdNodeIf provided and success,
+contain the created node.
+
+  @retval EFI_SUCCESS The function completed successfully.
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.
+  @retval EFI_OUT_OF_RESOURCESCould not allocate memory.
+**/
+EFI_STATUS
+EFIAPI
+AmlCodeGenRdQWordIo (
+  INBOOLEAN IsResourceConsumer,
+  INBOOLEAN IsMinFixed,
+  INBOOLEAN IsMaxFixed,
+  INBOOLEAN IsPosDecode,
+  INUINT8 IsaRanges,
+  INUINT64 AddressGranularity,
+  INUINT64 AddressMinimum,
+  INUINT64 AddressMaximum,
+  INUINT64 AddressTranslation,
+  INUINT64 RangeLength,
+  INUINT8 ResourceSourceIndex,
+  IN  CONST CHAR8 *ResourceSource,
+  INBOOLEAN IsDenseTranslation,
+  INBOOLEAN IsTypeStatic,
+  INAML_OBJECT_NODE_HANDLE NameOpNode, OPTIONAL
+  OUT   AML_DATA_NODE_HANDLE*NewRdNode  OPTIONAL
+  );
+
 /** Code generation for the "QWordMemory ()" ASL function.
 
   The Resource Data effectively created is a QWord Address Space Resource
diff --git 
a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c 
b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c
index 4ca63ccd2396..9c6700b9e08c 100644
--- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c
+++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c
@@ -1012,6 +1012,96 @@ AmlCodeGenRdQWordSpace (
   return LinkRdNode (RdNode, NameOpNode, NewRdNode);
 }
 
+/** Code generation for the "QWordIO ()" ASL function.
+
+  The Resource Data effectively created is a QWord Address Space Resource
+  Data. Cf ACPI 6.4:
+   - s6.4.3.5.1 "QWord Address Space Descriptor".
+   - s19.6.109 "QWordIO".
+
+  The created resource data node can be:
+   - appended to the list of resource data elements of the NameOpNode.
+ In such case NameOpNode must be defined by a the "Name ()" ASL statement
+ and initially contain a "ResourceTemplate ()".
+   - returned through the NewRdNode parameter.
+
+  See ACPI 6.4 spec, s19.6.109 for more.
+
+  @param [in]  

[edk2-devel] Now: Tools, CI, Code base construction meeting series - Monday, September 11, 2023 #cal-notice

2023-09-11 Thread Group Notification
*Tools, CI, Code base construction meeting series*

*When:*
Monday, September 11, 2023
4:30pm to 5:30pm
(UTC-07:00) America/Los Angeles

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

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

*Description:*

TianoCore community,

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

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

Anyone is welcome to join.

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

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


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




[edk2-devel] Event: Tools, CI, Code base construction meeting series - Monday, September 11, 2023 #cal-reminder

2023-09-11 Thread Group Notification
*Reminder: Tools, CI, Code base construction meeting series*

*When:*
Monday, September 11, 2023
4:30pm to 5:30pm
(UTC-07:00) America/Los Angeles

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

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

*Description:*

TianoCore community,

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

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

Anyone is welcome to join.

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

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


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




[edk2-devel] [PATCH v3 1/4] DynamicTablesPkg: Add ThermalZone CodeGen function

2023-09-11 Thread Jeff Brasen via groups.io
Add API to generate a ThermalZone object to AmlLib.



Bug 4063340



Signed-off-by: Jeff Brasen 

Reviewed-by: Swatisri Kantamsetti 

Reviewed-by: Ashish Singhal 

---

 .../Include/Library/AmlLib/AmlLib.h   |  28 +

 .../Common/AmlLib/CodeGen/AmlCodeGen.c| 116 ++

 2 files changed, 144 insertions(+)



diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h 
b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h

index 9210c50915..d201ae9499 100644

--- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h

+++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h

@@ -1038,6 +1038,34 @@ AmlCodeGenDevice (

   OUT   AML_OBJECT_NODE_HANDLE  *NewObjectNode   OPTIONAL

   );

 

+/** AML code generation for a ThermalZone object node.

+

+  AmlCodeGenThermalZone ("TZ00", ParentNode, NewObjectNode) is

+  equivalent of the following ASL code:

+ThermalZone(TZ00) {}

+

+  @ingroup CodeGenApis

+

+  @param  [in] NameString The new ThermalZone's name.

+  Must be a NULL-terminated ASL NameString

+  e.g.: "DEV0", "DV15.DEV0", etc.

+  The input string is copied.

+  @param [in]  ParentNode If provided, set ParentNode as the parent

+  of the node created.

+  @param [out] NewObjectNode  If success, contains the created node.

+

+  @retval EFI_SUCCESS Success.

+  @retval EFI_INVALID_PARAMETER   Invalid parameter.

+  @retval EFI_OUT_OF_RESOURCESFailed to allocate memory.

+**/

+EFI_STATUS

+EFIAPI

+AmlCodeGenThermalZone (

+  IN  CONST CHAR8   *NameString,

+  INAML_NODE_HANDLE ParentNode  OPTIONAL,

+  OUT   AML_OBJECT_NODE_HANDLE  *NewObjectNode   OPTIONAL

+  );

+

 /** AML code generation for a Scope object node.

 

   AmlCodeGenScope ("_SB", ParentNode, NewObjectNode) is

diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c 
b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c

index 0b223379fa..88537b7e2d 100644

--- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c

+++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c

@@ -1218,6 +1218,122 @@ error_handler1:

   return Status;

 }

 

+/** AML code generation for a ThermalZone object node.

+

+  AmlCodeGenThermalZone ("TZ00", ParentNode, NewObjectNode) is

+  equivalent of the following ASL code:

+ThermalZone(TZ00) {}

+

+  @ingroup CodeGenApis

+

+  @param  [in] NameString The new ThermalZone's name.

+  Must be a NULL-terminated ASL NameString

+  e.g.: "DEV0", "DV15.DEV0", etc.

+  The input string is copied.

+  @param [in]  ParentNode If provided, set ParentNode as the parent

+  of the node created.

+  @param [out] NewObjectNode  If success, contains the created node.

+

+  @retval EFI_SUCCESS Success.

+  @retval EFI_INVALID_PARAMETER   Invalid parameter.

+  @retval EFI_OUT_OF_RESOURCESFailed to allocate memory.

+**/

+EFI_STATUS

+EFIAPI

+AmlCodeGenThermalZone (

+  IN  CONST CHAR8   *NameString,

+  INAML_NODE_HANDLE ParentNode  OPTIONAL,

+  OUT   AML_OBJECT_NODE_HANDLE  *NewObjectNode   OPTIONAL

+  )

+{

+  EFI_STATUS   Status;

+  AML_OBJECT_NODE  *ObjectNode;

+  AML_DATA_NODE*DataNode;

+  CHAR8*AmlNameString;

+  UINT32   AmlNameStringSize;

+

+  if ((NameString == NULL)  ||

+  ((ParentNode == NULL) && (NewObjectNode == NULL)))

+  {

+ASSERT (0);

+return EFI_INVALID_PARAMETER;

+  }

+

+  ObjectNode= NULL;

+  DataNode  = NULL;

+  AmlNameString = NULL;

+

+  Status = ConvertAslNameToAmlName (NameString, );

+  if (EFI_ERROR (Status)) {

+ASSERT (0);

+return Status;

+  }

+

+  Status = AmlGetNameStringSize (AmlNameString, );

+  if (EFI_ERROR (Status)) {

+ASSERT (0);

+goto error_handler1;

+  }

+

+  Status = AmlCreateObjectNode (

+ AmlGetByteEncodingByOpCode (AML_EXT_OP, AML_EXT_THERMAL_ZONE_OP),

+ AmlNameStringSize + AmlComputePkgLengthWidth (AmlNameStringSize),

+ 

+ );

+  if (EFI_ERROR (Status)) {

+ASSERT (0);

+goto error_handler1;

+  }

+

+  Status = AmlCreateDataNode (

+ EAmlNodeDataTypeNameString,

+ (UINT8 *)AmlNameString,

+ AmlNameStringSize,

+ 

+ );

+  if (EFI_ERROR (Status)) {

+ASSERT (0);

+goto error_handler2;

+  }

+

+  Status = AmlSetFixedArgument (

+ ObjectNode,

+ EAmlParseIndexTerm0,

+ (AML_NODE_HEADER *)DataNode

+ );

+  if (EFI_ERROR (Status)) {

+ASSERT (0);

+AmlDeleteTree ((AML_NODE_HEADER *)DataNode);

+goto error_handler2;

+  }

+

+  Status = LinkNode (

+ ObjectNode,

[edk2-devel] [PATCH v3 2/4] DynamicTablesPkg: Add support for simple method invocation.

2023-09-11 Thread Jeff Brasen via groups.io
Add support to add Return objects via AML that pass a single integer

argument to the named method.



Bug 4063340



Signed-off-by: Jeff Brasen 

Reviewed-by: Swatisri Kantamsetti 

Reviewed-by: Ashish Singhal 

---

 .../Include/Library/AmlLib/AmlLib.h   |  54 

 .../Common/AmlLib/CodeGen/AmlCodeGen.c| 236 ++

 2 files changed, 290 insertions(+)



diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h 
b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h

index d201ae9499..b82c7a3ce8 100644

--- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h

+++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h

@@ -1194,6 +1194,60 @@ AmlCodeGenMethodRetInteger (

   OUT   AML_OBJECT_NODE_HANDLE  *NewObjectNodeOPTIONAL

   );

 

+/** AML code generation for a method returning a NameString that takes an

+integer argument.

+

+  AmlCodeGenMethodRetNameStringIntegerArgument (

+"MET0", "MET1", 1, TRUE, 3, 5, ParentNode, NewObjectNode

+);

+  is equivalent of the following ASL code:

+Method(MET0, 1, Serialized, 3) {

+  Return (MET1 (5))

+}

+

+  The ASL parameters "ReturnType" and "ParameterTypes" are not asked

+  in this function. They are optional parameters in ASL.

+

+  @param [in]  MethodNameString The new Method's name.

+Must be a NULL-terminated ASL NameString

+e.g.: "MET0", "_SB.MET0", etc.

+The input string is copied.

+  @param [in]  ReturnedNameString   The name of the object returned by the

+method. Optional parameter, can be:

+ - NULL (ignored).

+ - A NULL-terminated ASL NameString.

+   e.g.: "MET0", "_SB.MET0", etc.

+   The input string is copied.

+  @param [in]  NumArgs  Number of arguments.

+Must be 0 <= NumArgs <= 6.

+  @param [in]  IsSerialized TRUE is equivalent to Serialized.

+FALSE is equivalent to NotSerialized.

+Default is NotSerialized in ASL spec.

+  @param [in]  SyncLevelSynchronization level for the method.

+Must be 0 <= SyncLevel <= 15.

+Default is 0 in ASL.

+  @param [in]  IntegerArgument  Argument to pass to the NameString.

+  @param [in]  ParentNode   If provided, set ParentNode as the parent

+of the node created.

+  @param [out] NewObjectNodeIf success, contains the created node.

+

+  @retval EFI_SUCCESS Success.

+  @retval EFI_INVALID_PARAMETER   Invalid parameter.

+  @retval EFI_OUT_OF_RESOURCESFailed to allocate memory.

+**/

+EFI_STATUS

+EFIAPI

+AmlCodeGenMethodRetNameStringIntegerArgument (

+  IN  CONST CHAR8   *MethodNameString,

+  IN  CONST CHAR8   *ReturnedNameString   OPTIONAL,

+  INUINT8   NumArgs,

+  INBOOLEAN IsSerialized,

+  INUINT8   SyncLevel,

+  INUINT64  IntegerArgument,

+  INAML_NODE_HANDLE ParentNode   OPTIONAL,

+  OUT   AML_OBJECT_NODE_HANDLE  *NewObjectNodeOPTIONAL

+  );

+

 /** Create a _LPI name.

 

   AmlCreateLpiNode ("_LPI", 0, 1, ParentNode, ) is

diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c 
b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c

index 88537b7e2d..53c537e2d3 100644

--- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c

+++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c

@@ -1881,6 +1881,130 @@ AmlCodeGenReturnInteger (

   return Status;

 }

 

+/** AML code generation for a Return object node,

+returning the object as an input NameString with a integer argument.

+

+  AmlCodeGenReturn ("NAM1", 6, ParentNode, NewObjectNode) is

+  equivalent of the following ASL code:

+Return(NAM1 (6))

+

+  The ACPI 6.3 specification, s20.2.5.3 "Type 1 Opcodes Encoding" states:

+DefReturn := ReturnOp ArgObject

+ReturnOp := 0xA4

+ArgObject := TermArg => DataRefObject

+

+  Thus, the ReturnNode must be evaluated as a DataRefObject. It can

+  be a NameString referencing an object. As this CodeGen Api doesn't

+  do semantic checking, it is strongly advised to check the AML bytecode

+  generated by this function against an ASL compiler.

+

+  The ReturnNode must be generated inside a Method body scope.

+

+  @param [in]  NameString The object referenced by this NameString

+  is returned by the Return ASL statement.

+  Must be a NULL-terminated ASL NameString

[edk2-devel] [PATCH v3 3/4] DynamicTablesPkg: Add support to add Strings to package

2023-09-11 Thread Jeff Brasen via groups.io
Add API to add a String to a package created with NamedPackage API.



Bug 4063340



Signed-off-by: Jeff Brasen 

Reviewed-by: Swatisri Kantamsetti 

Reviewed-by: Ashish Singhal 

---

 .../Include/Library/AmlLib/AmlLib.h   | 17 

 .../Common/AmlLib/CodeGen/AmlCodeGen.c| 88 +++

 2 files changed, 105 insertions(+)



diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h 
b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h

index b82c7a3ce8..f4a4908753 100644

--- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h

+++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h

@@ -1472,4 +1472,21 @@ AmlCreateCpcNode (

   OUT AML_OBJECT_NODE_HANDLE  *NewCpcNode   OPTIONAL

   );

 

+/** AML code generation to add a NameString to the package in a named node.

+

+

+  @param [in]  NameString NameString to add

+  @param [in]  NamedNode  Node to add the string to the included package.

+

+  @retval EFI_SUCCESS Success.

+  @retval EFI_INVALID_PARAMETER   Invalid parameter.

+  @retval EFI_OUT_OF_RESOURCESFailed to allocate memory.

+**/

+EFI_STATUS

+EFIAPI

+AmlAddNameStringToNamedPackage (

+  IN CHAR8   *NameString,

+  IN AML_OBJECT_NODE_HANDLE  NamedNode

+  );

+

 #endif // AML_LIB_H_

diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c 
b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c

index 53c537e2d3..d7fec859ef 100644

--- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c

+++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c

@@ -3677,3 +3677,91 @@ error_handler:

   AmlDeleteTree ((AML_NODE_HANDLE)CpcNode);

   return Status;

 }

+

+/** AML code generation to add a NameString to the package in a named node.

+

+

+  @param [in]  NameString NameString to add

+  @param [in]  NamedNode  Node to add the string to the included package.

+

+  @retval EFI_SUCCESS Success.

+  @retval EFI_INVALID_PARAMETER   Invalid parameter.

+  @retval EFI_OUT_OF_RESOURCESFailed to allocate memory.

+**/

+EFI_STATUS

+EFIAPI

+AmlAddNameStringToNamedPackage (

+  IN CHAR8   *NameString,

+  IN AML_OBJECT_NODE_HANDLE  NamedNode

+  )

+{

+  EFI_STATUS  Status;

+  AML_DATA_NODE   *DataNode;

+  CHAR8   *AmlNameString;

+  UINT32  AmlNameStringSize;

+  AML_OBJECT_NODE_HANDLE  PackageNode;

+

+  DataNode = NULL;

+

+  if ((NamedNode == NULL)  ||

+  (AmlGetNodeType ((AML_NODE_HANDLE)NamedNode) != EAmlNodeObject)  ||

+  (!AmlNodeHasOpCode (NamedNode, AML_NAME_OP, 0)))

+  {

+ASSERT (0);

+return EFI_INVALID_PARAMETER;

+  }

+

+  PackageNode = (AML_OBJECT_NODE_HANDLE)AmlGetFixedArgument (

+  NamedNode,

+  EAmlParseIndexTerm1

+  );

+  if ((PackageNode == NULL) ||

+  (AmlGetNodeType ((AML_NODE_HANDLE)PackageNode) != EAmlNodeObject) ||

+  (!AmlNodeHasOpCode (PackageNode, AML_PACKAGE_OP, 0)))

+  {

+ASSERT (0);

+return EFI_INVALID_PARAMETER;

+  }

+

+  Status = ConvertAslNameToAmlName (NameString, );

+  if (EFI_ERROR (Status)) {

+ASSERT (0);

+return Status;

+  }

+

+  Status = AmlGetNameStringSize (AmlNameString, );

+  if (EFI_ERROR (Status)) {

+ASSERT (0);

+goto exit_handler;

+  }

+

+  Status = AmlCreateDataNode (

+ EAmlNodeDataTypeNameString,

+ (UINT8 *)AmlNameString,

+ AmlNameStringSize,

+ 

+ );

+  if (EFI_ERROR (Status)) {

+ASSERT (0);

+goto exit_handler;

+  }

+

+  Status = AmlVarListAddTail (

+ (AML_NODE_HANDLE)PackageNode,

+ (AML_NODE_HANDLE)DataNode

+ );

+  ASSERT_EFI_ERROR (Status);

+

+exit_handler:

+  if (AmlNameString != NULL) {

+FreePool (AmlNameString);

+  }

+

+  if (EFI_ERROR (Status)) {

+if (DataNode != NULL) {

+  AmlDeleteTree ((AML_NODE_HANDLE)DataNode);

+}

+  }

+

+  return Status;

+}

-- 

2.25.1





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




[edk2-devel] [PATCH v3 4/4] DynamicTablesPkg: Add Aml NameUnicodeString API

2023-09-11 Thread Jeff Brasen via groups.io
Add API to generate a Name that contains a Unicode string buffer.



Bug 4063340



Signed-off-by: Jeff Brasen 

Reviewed-by: Swatisri Kantamsetti 

Reviewed-by: Ashish Singhal 

---

 .../Include/Library/AmlLib/AmlLib.h   | 31 +++

 .../Common/AmlLib/CodeGen/AmlCodeGen.c| 86 +++

 2 files changed, 117 insertions(+)



diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h 
b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h

index f4a4908753..e0dc1340ab 100644

--- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h

+++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h

@@ -958,6 +958,37 @@ AmlCodeGenNameResourceTemplate (

   OUT   AML_OBJECT_NODE_HANDLE  *NewObjectNode   OPTIONAL

   );

 

+/** AML code generation for a Name object node, containing a String.

+

+  AmlCodeGenNameUnicodeString ("_STR", L"String", ParentNode, NewObjectNode) is

+  equivalent of the following ASL code:

+Name(_STR, Unicode ("String"))

+

+  @ingroup CodeGenApis

+

+  @param  [in] NameString The new variable name.

+  Must be a NULL-terminated ASL NameString

+  e.g.: "DEV0", "DV15.DEV0", etc.

+  The input string is copied.

+  @param [in]  String NULL terminated Unicode String to associate to 
the

+  NameString.

+  @param [in]  ParentNode If provided, set ParentNode as the parent

+  of the node created.

+  @param [out] NewObjectNode  If success, contains the created node.

+

+  @retval EFI_SUCCESS Success.

+  @retval EFI_INVALID_PARAMETER   Invalid parameter.

+  @retval EFI_OUT_OF_RESOURCESFailed to allocate memory.

+**/

+EFI_STATUS

+EFIAPI

+AmlCodeGenNameUnicodeString (

+  IN  CONST CHAR8   *NameString,

+  INCHAR16  *String,

+  INAML_NODE_HANDLE ParentNode  OPTIONAL,

+  OUT   AML_OBJECT_NODE_HANDLE  *NewObjectNode   OPTIONAL

+  );

+

 /** Add a _PRT entry.

 

   AmlCodeGenPrtEntry (0x0, 0, "LNKA", 0, PrtNameNode) is

diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c 
b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c

index d7fec859ef..0eba254193 100644

--- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c

+++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c

@@ -869,6 +869,92 @@ AmlCodeGenNameResourceTemplate (

   return Status;

 }

 

+/** AML code generation for a Name object node, containing a String.

+

+ AmlCodeGenNameUnicodeString ("_STR", L"String", ParentNode, NewObjectNode) is

+ equivalent of the following ASL code:

+   Name(_STR, Unicode ("String"))

+

+ @ingroup CodeGenApis

+

+ @param  [in] NameString The new variable name.

+ Must be a NULL-terminated ASL NameString

+ e.g.: "DEV0", "DV15.DEV0", etc.

+ The input string is copied.

+ @param [in]  String NULL terminated Unicode String to associate to the

+ NameString.

+ @param [in]  ParentNode If provided, set ParentNode as the parent

+ of the node created.

+ @param [out] NewObjectNode  If success, contains the created node.

+

+ @retval EFI_SUCCESS Success.

+ @retval EFI_INVALID_PARAMETER   Invalid parameter.

+ @retval EFI_OUT_OF_RESOURCESFailed to allocate memory.

+**/

+EFI_STATUS

+EFIAPI

+AmlCodeGenNameUnicodeString (

+  IN  CONST CHAR8   *NameString,

+  INCHAR16  *String,

+  INAML_NODE_HANDLE ParentNode  OPTIONAL,

+  OUT   AML_OBJECT_NODE_HANDLE  *NewObjectNode   OPTIONAL

+  )

+{

+  EFI_STATUS   Status;

+  AML_OBJECT_NODE  *ObjectNode;

+  AML_DATA_NODE*DataNode;

+

+  if ((NameString == NULL)  ||

+  (String == NULL)  ||

+  ((ParentNode == NULL) && (NewObjectNode == NULL)))

+  {

+ASSERT (0);

+return EFI_INVALID_PARAMETER;

+  }

+

+  Status = AmlCodeGenBuffer (NULL, 0, );

+  if (EFI_ERROR (Status)) {

+ASSERT_EFI_ERROR (Status);

+return Status;

+  }

+

+  Status = AmlCreateDataNode (

+ EAmlNodeDataTypeRaw,

+ (CONST UINT8 *)String,

+ StrSize (String),

+ 

+ );

+  if (EFI_ERROR (Status)) {

+ASSERT_EFI_ERROR (Status);

+AmlDeleteTree ((AML_NODE_HEADER *)ObjectNode);

+return Status;

+  }

+

+  Status = AmlVarListAddTail (

+ (AML_NODE_HEADER *)ObjectNode,

+ (AML_NODE_HEADER *)DataNode

+ );

+  if (EFI_ERROR (Status)) {

+ASSERT_EFI_ERROR (Status);

+AmlDeleteTree ((AML_NODE_HEADER *)ObjectNode);

+AmlDeleteTree ((AML_NODE_HANDLE)DataNode);

+return Status;

+  }

+

+  Status = AmlCodeGenName (

+ NameString,

+ ObjectNode,

+   

[edk2-devel] [PATCH v3 0/4] Add support for generating ACPI ThermalZones

2023-09-11 Thread Jeff Brasen via groups.io
Add APIs needed to create thermal zones dynamically.
Does not add a generator for this as creating the TMP method generically may
be difficult.

Change log:

v3 - Fixed a couple error handling paths
v2 - renamed NameString function and added goto dones in a couple error cases

Jeff Brasen (4):
  DynamicTablesPkg: Add ThermalZone CodeGen function
  DynamicTablesPkg: Add support for simple method invocation.
  DynamicTablesPkg: Add support to add Strings to package
  DynamicTablesPkg: Add Aml NameUnicodeString API

 .../Include/Library/AmlLib/AmlLib.h   | 130 +
 .../Common/AmlLib/CodeGen/AmlCodeGen.c| 526 ++
 2 files changed, 656 insertions(+)

-- 
2.25.1



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




Re: [edk2-devel] [PATCH v2 0/2] dp command without ACPI

2023-09-11 Thread Jeff Brasen via groups.io


Any additional thoughts/feedback on this patch series?

Thanks,
Jeff


> -Original Message-
> From: Jeff Brasen 
> Sent: Friday, June 30, 2023 11:30 AM
> To: devel@edk2.groups.io
> Cc: jian.j.w...@intel.com; gaolim...@byosoft.com.cn; dandan...@intel.com;
> zhichao@intel.com; Jeff Brasen 
> Subject: [PATCH v2 0/2] dp command without ACPI
> 
> Systems that do not boot with ACPI (system that use device tree for example)
> can not use the shell dp command. This patch adds this to the configuration
> table so that dp command can get this without the FPDT table.
> 
> I am open to other ways for this to be passed if desired (Installed protocol,
> handler of the status code, etc) but wanted to post this to at least get
> thoughts on this.
> 
> Change Log
> v2 - Fix missing cast for IA32 builds
> 
> -Jeff
> 
> Jeff Brasen (2):
>   MdeModulePkg/DxeCorePerformanceLib: Install BPDT in config table
>   ShellPkg/Dp: Allow dp command to work without ACPI
> 
>  ShellPkg/DynamicCommand/DpDynamicCommand/DpApp.inf|  1 +
>  .../DpDynamicCommand/DpDynamicCommand.inf |  1 +
>  .../DxeCorePerformanceLib/DxeCorePerformanceLib.c |  2 ++
>  ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c | 11 -
> --
>  4 files changed, 12 insertions(+), 3 deletions(-)
> 
> --
> 2.25.1



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




Re: [edk2-devel] [PATCH] MdeModulePkg/DxeCore: Allow relocation of images with large address

2023-09-11 Thread Jeff Brasen via groups.io
Any  thoughts/feedback on this patch?

Thanks,
Jeff


> -Original Message-
> From: Jeff Brasen 
> Sent: Monday, May 15, 2023 5:49 PM
> To: devel@edk2.groups.io
> Cc: jian.j.w...@intel.com; gaolim...@byosoft.com.cn; dandan...@intel.com;
> Jeff Brasen ; Ashish Singhal
> 
> Subject: [PATCH] MdeModulePkg/DxeCore: Allow relocation of images with
> large address
> 
> Add PCD to control if modules with start addresses in PE/COFF > 0x10
> attempt to load at specified address.
> If a module has an address in this range and there is untested memory
> DxeCore will attempt to promote all memory to tested which bypasses any
> memory testing that would occur later in boot.
> 
> There are several existing AARCH64 option roms that have base addresses of
> 0x18000.
> 
> Signed-off-by: Jeff Brasen 
> Reviewed-by: Ashish Singhal 
> ---
>  MdeModulePkg/Core/Dxe/DxeMain.inf   | 1 +
>  MdeModulePkg/Core/Dxe/Image/Image.c | 4 +++-
>  MdeModulePkg/MdeModulePkg.dec   | 7 +++
>  3 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/MdeModulePkg/Core/Dxe/DxeMain.inf
> b/MdeModulePkg/Core/Dxe/DxeMain.inf
> index 35d5bf0dee..16871f2021 100644
> --- a/MdeModulePkg/Core/Dxe/DxeMain.inf
> +++ b/MdeModulePkg/Core/Dxe/DxeMain.inf
> @@ -187,6 +187,7 @@
>gEfiMdeModulePkgTokenSpaceGuid.PcdHeapGuardPropertyMask
> ## CONSUMES
>gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard   
> ##
> CONSUMES
>gEfiMdeModulePkgTokenSpaceGuid.PcdFwVolDxeMaxEncapsulationDepth
> ## CONSUMES
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdImageLargeAddressLoad
> ## CONSUMES
> 
>  # [Hob]
>  # RESOURCE_DESCRIPTOR   ## CONSUMES
> diff --git a/MdeModulePkg/Core/Dxe/Image/Image.c
> b/MdeModulePkg/Core/Dxe/Image/Image.c
> index 9dbfb2a1fa..6bc3a549ae 100644
> --- a/MdeModulePkg/Core/Dxe/Image/Image.c
> +++ b/MdeModulePkg/Core/Dxe/Image/Image.c
> @@ -680,7 +680,9 @@ CoreLoadPeImage (
> );
>}
>  } else {
> -  if ((Image->ImageContext.ImageAddress >= 0x10) || Image-
> >ImageContext.RelocationsStripped) {
> +  if ((PcdGetBool (PcdImageLargeAddressLoad) && ((Image-
> >ImageContext.ImageAddress) >= 0x10)) ||
> +  Image->ImageContext.RelocationsStripped)
> +  {
>  Status = CoreAllocatePages (
> AllocateAddress,
> (EFI_MEMORY_TYPE)(Image-
> >ImageContext.ImageCodeMemoryType),
> diff --git a/MdeModulePkg/MdeModulePkg.dec
> b/MdeModulePkg/MdeModulePkg.dec index 95dd077e19..6fd1bd7b8f
> 100644
> --- a/MdeModulePkg/MdeModulePkg.dec
> +++ b/MdeModulePkg/MdeModulePkg.dec
> @@ -1116,6 +1116,13 @@
># @Prompt Output MMIO address of Trace Hub message.
> 
> gEfiMdeModulePkgTokenSpaceGuid.PcdTraceHubDebugMmioAddress|0|UIN
> T64|0x30001058
> 
> +  ## Indicates if images with large load address (>0x10) should
> attempted to load at specified location.
> +  #  If enabled, attempt to allocate at specfied location will be attempted 
> with
> a fall back to any address.
> +  #   TRUE  - UEFI will attempt to load at specified location.
> +  #   FALSE - UEFI will load at any address
> +  # @Prompt Enable large address image loading.
> +
> +
> gEfiMdeModulePkgTokenSpaceGuid.PcdImageLargeAddressLoad|TRUE|BOOL
> EAN|0
> + x30001059
> +
>  [PcdsFixedAtBuild, PcdsPatchableInModule]
>## Dynamic type PCD can be registered callback function for Pcd setting
> action.
>#  PcdMaxPeiPcdCallBackNumberPerPcdEntry indicates the maximum
> number of callback function
> --
> 2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108497): https://edk2.groups.io/g/devel/message/108497
Mute This Topic: https://groups.io/mt/98916659/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/11] DynamicTablesPkg: Update MADT generator for ACPI 6.5

2023-09-11 Thread Sami Mujawar
Hi Jeshua,

Apologies, I was busy with some other tasks. I will pick this up in this week.

Regards,

Sami Mujawar

From: Jeshua Smith 
Date: Monday, 11 September 2023 at 17:58
To: Sami Mujawar , "devel@edk2.groups.io" 

Subject: RE: [edk2-devel] [PATCH v1 05/11] DynamicTablesPkg: Update MADT 
generator for ACPI 6.5

Hi Sami,

What is the status of getting this series updated, reviewed, and merged?

From: Sami Mujawar 
Sent: Thursday, August 3, 2023 1:08 AM
To: Jeshua Smith ; devel@edk2.groups.io
Subject: Re: [edk2-devel] [PATCH v1 05/11] DynamicTablesPkg: Update MADT 
generator for ACPI 6.5

External email: Use caution opening links or attachments

Hi Jeshua,

Thank you for the feedback.

On Tue, Aug 1, 2023 at 08:44 AM, Jeshua Smith wrote:
It looks like you are setting the wrong field here (should be TrbeInterrupt, 
not SpeOverflowInterrupt):
+ // Setting TrbeInterrupt to 0 ensures backward compatibility with
+ // ACPI 6.4
+ Gicc->SpeOverflowInterrupt = 0;
Indeed this is a bug. I will address this in the v2 series.

Regards,

Sami Mujawar
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.
View/Reply Online (#108496): https://edk2.groups.io/g/devel/message/108496
Mute This Topic: https://groups.io/mt/100347387/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] How i can fix this build error VariableRuntimeDxe.inf

2023-09-11 Thread Andrew Fish via groups.io
Well NintendoSwitchPkg is a project we are not involved in….

Looks like you are missing a line in your DSC file:
VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf

The build failure is VariableRuntimeDxe.inf has a dependency on on a 
VariableFlashInfoLib instance and the DSC does not have a mapping for one. The 
VariableFlashInfoLib is just the library class just implies the library API, it 
does not imply which library to link against. The DSC file picks the correct 
library instance for your platforms build. 

My guess is your edk2 version is newer and you need to sync with some changes. 
Here is an example of the fix you need for the OVMF project. Basically an extra 
dependency got added to the Variable driver so you need to update the DSC.

commit a7d3d4e7c4343c478ec8a57c6ae1ae64286d866b
Author: Michael Kubacki 
Date:   Fri Apr 8 16:05:38 2022 -0400

OvmfPkg: Add VariableFlashInfoLib

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

Adds an instance of VariableFlashInfoLib to the platform build as
it is a new library class introduced in MdeModulePkg.

Cc: Anthony Perard 
Cc: Ard Biesheuvel 
Cc: Brijesh Singh 
Cc: Erdem Aktas 
Cc: Gerd Hoffmann 
Cc: James Bottomley 
Cc: Jiewen Yao 
Cc: Jordan Justen 
Cc: Julien Grall 
Cc: Min Xu 
Cc: Peter Grehan 
Cc: Rebecca Cran 
Cc: Sebastien Boeuf 
Cc: Tom Lendacky 
Signed-off-by: Michael Kubacki 
Acked-by: Ard Biesheuvel 
Reviewed-by: Liming Gao 
Reviewed-by: Rebecca Cran 
Reviewed-by: Jiewen Yao 

diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc
index f0700035c1..bead9722ea 100644
--- a/OvmfPkg/AmdSev/AmdSevX64.dsc
+++ b/OvmfPkg/AmdSev/AmdSevX64.dsc
@@ -196,6 +196,7 @@
   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
   
VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf
   
VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf
+  
VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf
 
 !if $(BUILD_SHELL) == TRUE
   ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc
index 002cef32a3..f0166e136c 100644
--- a/OvmfPkg/Bhyve/BhyveX64.dsc
+++ b/OvmfPkg/Bhyve/BhyveX64.dsc
@@ -206,6 +206,7 @@
   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
   
VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf
   
VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf
+  
VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf
 
   #
   # Network libraries
diff --git a/OvmfPkg/CloudHv/CloudHvX64.dsc b/OvmfPkg/CloudHv/CloudHvX64.dsc
index d1c85f60c7..92664f319b 100644
--- a/OvmfPkg/CloudHv/CloudHvX64.dsc
+++ b/OvmfPkg/CloudHv/CloudHvX64.dsc
@@ -217,6 +217,7 @@
   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
   
VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf
   
VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf
+  
VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf
 
 
   #
diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.dsc b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
index 80c331ea23..00bc1255bc 100644
--- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc
+++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
@@ -190,6 +190,7 @@
   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
   
VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf
   
VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf
+  
VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf
 
   ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
   ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf
diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc b/OvmfPkg/Microvm/MicrovmX64.dsc
index 20c3c9c4d8..f8fc977cb2 100644
--- a/OvmfPkg/Microvm/MicrovmX64.dsc
+++ b/OvmfPkg/Microvm/MicrovmX64.dsc
@@ -207,6 +207,7 @@
   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
   
VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf
   
VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf
+  
VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf
 
 
   #
diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
index 533bbdb435..c16a840fff 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -214,6 +214,7 @@
   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
   
VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf
   

[edk2-devel] [PATCH edk2-platforms 1/1] Platform/Ampere: Update Readme.md

2023-09-11 Thread Rebecca Cran via groups.io
Improve the Readme.md in Platform/Ampere:

- At this point eMAG is irrelevant, and most people are likely
  using Altra systems. Drop mention of it.
- Instead of mentioning the 'latest' versions of CentOS and Ubuntu
  (which will by definition change over time), specify Ubuntu 22.04
  and CentOS 7.
- Fix the link to the acpica download, since content has been moved from
  acpica.org to intel.com.
- Assuming the build is being done on Linux, acpica shouldn't be built
  with a CYGWIN definition.
- To avoid making people wait ages for acpica to build, add `-j8` as an
  example of building in parallel.

Signed-off-by: Rebecca Cran 
---
 Platform/Ampere/Readme.md | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Platform/Ampere/Readme.md b/Platform/Ampere/Readme.md
index 894bad3437b8..066876dab4b5 100644
--- a/Platform/Ampere/Readme.md
+++ b/Platform/Ampere/Readme.md
@@ -8,8 +8,8 @@ Silicon code is located under Silicon/Ampere/Ampere{SoC 
Name}Pkg.
 
 # Build machines
 
-- x86 Linux host machines running latest Ubuntu or CentOS releases.
-- Arm64 Linux host machines if native compiling. This has been tested on 
Ampere's eMAG and Altra hardware platforms with latest AArch64 CentOS or Ubuntu 
releases.
+- x86 Linux host machines running Ubuntu 22.04 or CentOS 7 releases.
+- Arm64 Linux host machines if native compiling. This has been tested on 
Ampere's Altra hardware platforms with AArch64 CentOS 7 or Ubuntu 22.04 
releases.
 
 # How to build (Linux Environment)
 
@@ -32,8 +32,8 @@ If you run into any build issue with the Intel ASL+ 
Optimizing Compiler/Disassem
 download and install the IASL compiler from https://acpica.org/. At the time 
of this write-up, we have tested with version 20200110.
 
 ```bash
-$ wget https://acpica.org/sites/acpica/files/acpica-unix2-20200110.tar.gz
+$ wget https://downloadmirror.intel.com/774850/acpica-unix2-20200110.tar.gz
 $ tar xzf acpica-unix2-20200110.tar.gz
 $ cd acpica-unix2-20200110
-$ make HOST=_CYGWIN && sudo make install
+$ make -j8 && sudo make install
 ```
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108494): https://edk2.groups.io/g/devel/message/108494
Mute This Topic: https://groups.io/mt/101298216/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/11] DynamicTablesPkg: Update MADT generator for ACPI 6.5

2023-09-11 Thread Jeshua Smith via groups.io
Hi Sami,

What is the status of getting this series updated, reviewed, and merged?

From: Sami Mujawar 
Sent: Thursday, August 3, 2023 1:08 AM
To: Jeshua Smith ; devel@edk2.groups.io
Subject: Re: [edk2-devel] [PATCH v1 05/11] DynamicTablesPkg: Update MADT 
generator for ACPI 6.5

External email: Use caution opening links or attachments

Hi Jeshua,

Thank you for the feedback.

On Tue, Aug 1, 2023 at 08:44 AM, Jeshua Smith wrote:
It looks like you are setting the wrong field here (should be TrbeInterrupt, 
not SpeOverflowInterrupt):
+ // Setting TrbeInterrupt to 0 ensures backward compatibility with
+ // ACPI 6.4
+ Gicc->SpeOverflowInterrupt = 0;
Indeed this is a bug. I will address this in the v2 series.

Regards,

Sami Mujawar


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




[edk2-devel] How i can fix this build error

2023-09-11 Thread Im from ohio
I want build edk2 for aarch64 but i got this error:
---

[Builder] Configure environment.
Using EDK2 in-source Basetools
WORKSPACE: /mnt/c/Users/ximi/Downloads/exploit/edk2
EDK_TOOLS_PATH: /mnt/c/Users/ximi/Downloads/exploit/edk2/BaseTools
CONF_PATH: /mnt/c/Users/ximi/Downloads/exploit/edk2/Conf
Copying $EDK_TOOLS_PATH/Conf/build_rule.template
 to /mnt/c/Users/ximi/Downloads/exploit/edk2/Conf/build_rule.txt
Copying $EDK_TOOLS_PATH/Conf/tools_def.template
 to /mnt/c/Users/ximi/Downloads/exploit/edk2/Conf/tools_def.txt
Copying $EDK_TOOLS_PATH/Conf/target.template
 to /mnt/c/Users/ximi/Downloads/exploit/edk2/Conf/target.txt
Task: EDK2 build
Use GCC at /usr/bin/aarch64-linux-gnu- to run builds.
Stamp build.
fatal: not a git repository (or any parent up to mount point /mnt)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Build NintendoSwitchPkg for NintendoSwitch (DEBUG).
Build environment:
Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.35
Build start time: 13:58:23, Sep.11 2023

WORKSPACE= /mnt/c/Users/ximi/Downloads/exploit/edk2
EDK_TOOLS_PATH   = /mnt/c/Users/ximi/Downloads/exploit/edk2/BaseTools
CONF_PATH= /mnt/c/Users/ximi/Downloads/exploit/edk2/Conf


Processing meta-data .
Architecture(s)  = AARCH64
Build target = DEBUG
Toolchain= GCC5

Active Platform  =
/mnt/c/Users/ximi/Downloads/exploit/edk2/NintendoSwitchPkg/NintendoSwitch.dsc
.

build.py...
/mnt/c/Users/ximi/Downloads/exploit/edk2/NintendoSwitchPkg/NintendoSwitch.dsc(...):
error 4000: Instance of library class [VariableFlashInfoLib] is not found
in
[/mnt/c/Users/ximi/Downloads/exploit/edk2/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf]
[AARCH64]
consumed by module
[/mnt/c/Users/ximi/Downloads/exploit/edk2/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf]


- Failed -
Build end time: 13:58:29, Sep.11 2023
Build total time: 00:00:06

Write-Error: Build target NintendoSwitch failed.
False

---

How i can fix this


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




Re: [edk2-devel] Possibility of working on task - "Add Network Block Device support"

2023-09-11 Thread Sahil
On Wednesday, September 6, 2023 11:51:31 PM IST Pedro Falcato wrote:
> On Wed, Sep 6, 2023 at 7:14 PM Sahil  wrote:
> > Hi,
> > 
> > I have never contributed to Tianocore. While I am comfortable with C and
> > Python, I don't have much experience with firmware development and UEFI.
> > However, I wish to learn and gain exposure in these areas. I was going
> > through the list of tasks[1] and I came across the "Network Block Device
> > Client" project[2]. I am currently going through the related resources
> > and sub-goals[3], and it seems to be very exciting.
> > 
> > Is this project still open for development? If so, I would like to work on
> > it.
> Sure, I don't think anyone's working on it. While those tasks are
> "more destined" towards GSoC, we didn't even have GSoC this past
> summer (no idea about further summers?) so you should be all clear to
> work on that.

Hi,

Thank you for the prompt reply. I'll continue reading through the related 
resources
and will plan out a roadmap for the project.

I will keep the community posted in case I have questions or there are 
developments.

Thanks,
Sahil




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




[edk2-devel] Building UEFI firmware for Elkhart Lake

2023-09-11 Thread hafiedh hafedh
Hello!

I'm trying to build a UEFI firmware for Elkhart lake processor. I find only
open platforms for other boards. I didn't find a way how to do a
porting from OpenBoardPkg to ElkartLakeOpenBoardPkg.

Could you please provide me docs or links how to generate a uefi firmware
for elkhart lake board?

I want to convert the FSPRef.bin in Elkhart lake FSP folder to Fsp.fd:
could you please guide me how to do that?

I see after building firmware for some boards, there is only .fd output
firmware. How can I get the .bin firmware for those boards?

Best regards!
Hafedh Hafiedh


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




Re: [edk2-devel] [PATCH] OvmfPkg/OvmfXen: Fix S3

2023-09-11 Thread Anthony PERARD via groups.io
Hi Xenia,

On Thu, Jul 13, 2023 at 01:47:12PM +0300, Xenia Ragiadakou wrote:
> Currently, resuming an S3 suspended guest results in the following
> assertion failure:
> ASSERT 
> MdePkg/Library/PeiResourcePublicationLib/PeiResourcePublicationLib.c(41): 
> MemoryLength > 0
> This happens because some parts of the S3 suspend and resume paths
> are missing in order for S3 to work. For instance, the variables
> mS3AcpiReservedMemoryBase and mS3AcpiReservedMemoryBase are not
> initialized, regions that are used on S3 resume are either missing
> or not marked as ACPI NVS memory and can be corrupted by the OS.
> This patch adds the missing parts based heavily on the existing S3
> implementation of other virtual platforms.
> 
> For S3 support, the provision of fw_cfg is required in order for
> suspend states to be retrieved.

Is it possible to have S3 work without fw_cfg? We normally disable
fw_cfg in QEMU when using it to start a Xen guest. We only enable fw_cfg
if we want to boot a kernel directly in HVM (like PV guest, called
Direct Kernel Boot in xl.cfg(5)).

But even trying the direct kernel boot method, I've got issue trying to
resume a suspended guest. I ran into:
ASSERT /root/build/ovmf/UefiCpuPkg/Library/MpInitLib/MpLib.c(2093): 
(LibPcdGet64(9U) & (0x0001 | 0x0002)) == (0x0001 | 0x0002)

By the way, I'm using `xl` to boot a guest to test this patch.

So, I've got some question, which version of QEMU do you use, which work
with this patch?
What toolstack do you use to boot a guest?


Thanks,

-- 
Anthony PERARD


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




Re: [edk2-devel] [PATCH 1/1] OvmfPkg/RiscVVirt/README.md: bring your own OpenSBI

2023-09-11 Thread Sunil V L
On Thu, Sep 07, 2023 at 04:58:25PM +0200, Laszlo Ersek wrote:
> Explain how users can compose their pre-OS environment purely from
> binaries they've built themselves.
> 
> Cc: Andrei Warkentin 
> Cc: Ard Biesheuvel 
> Cc: Gerd Hoffmann 
> Cc: Jiewen Yao 
> Cc: Jordan Justen 
> Cc: Sunil V L 
> Signed-off-by: Laszlo Ersek 
> ---
> 
> Notes:
> rendered version:
> 
> 
> https://github.com/lersek/edk2/tree/bring-your-own-opensbi/OvmfPkg/RiscVVirt#test-with-your-own-opensbi-binary
> 
>  OvmfPkg/RiscVVirt/README.md | 17 +
>  1 file changed, 17 insertions(+)
> 
> diff --git a/OvmfPkg/RiscVVirt/README.md b/OvmfPkg/RiscVVirt/README.md
> index 8c3ac37b802a..dbb40bbe89b0 100644
> --- a/OvmfPkg/RiscVVirt/README.md
> +++ b/OvmfPkg/RiscVVirt/README.md
> @@ -69,3 +69,20 @@ Below example shows how to boot openSUSE Tumbleweed E20.
>  -device virtio-net-pci,netdev=net0 \
>  -device virtio-blk-device,drive=hd0 \
>  -drive 
> file=openSUSE-Tumbleweed-RISC-V-E20-efi.riscv64.raw,format=raw,id=hd0
> +
> +## Test with your own OpenSBI binary
> +Using the above QEMU command line, **RISCV_VIRT_CODE.fd** is launched by the
> +OpenSBI binary that is bundled with QEMU. You can build your own OpenSBI 
> binary
> +as well:
> +
> +OPENSBI_DIR=...
> +git clone https://github.com/riscv/opensbi.git $OPENSBI_DIR
> +make -C $OPENSBI_DIR \
> +-j $(getconf _NPROCESSORS_ONLN) \
> +CROSS_COMPILE=riscv64-linux-gnu- \
> +PLATFORM=generic
> +
> +then specify that binary for QEMU, with the following additional command line
> +option:
> +
> +-bios $OPENSBI_DIR/build/platform/generic/firmware/fw_dynamic.bin

Reviewed-by: Sunil V L 

Thanks!
Sunil


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




Re: [edk2-devel] [PATCH 1/1] OvmfPkg/RiscVVirt/README.md: bring your own OpenSBI

2023-09-11 Thread Laszlo Ersek
On 9/11/23 12:15, Sunil V L wrote:
> On Mon, Sep 11, 2023 at 09:07:46AM +0200, Laszlo Ersek wrote:
>> On 9/11/23 08:22, Sunil V L wrote:
>>> On Mon, Sep 11, 2023 at 08:15:26AM +0200, Laszlo Ersek wrote:
 On 9/11/23 07:32, Laszlo Ersek wrote:
> On 9/8/23 08:13, Sunil V L wrote:
>> Hi Laszlo,
>>
>> On Thu, Sep 07, 2023 at 04:58:25PM +0200, Laszlo Ersek wrote:
>>> Explain how users can compose their pre-OS environment purely from
>>> binaries they've built themselves.
>>>
>>> Cc: Andrei Warkentin 
>>> Cc: Ard Biesheuvel 
>>> Cc: Gerd Hoffmann 
>>> Cc: Jiewen Yao 
>>> Cc: Jordan Justen 
>>> Cc: Sunil V L 
>>> Signed-off-by: Laszlo Ersek 
>>> ---
>>>
>>> Notes:
>>> rendered version:
>>> 
>>> 
>>> https://github.com/lersek/edk2/tree/bring-your-own-opensbi/OvmfPkg/RiscVVirt#test-with-your-own-opensbi-binary
>>>
>>>  OvmfPkg/RiscVVirt/README.md | 17 +
>>>  1 file changed, 17 insertions(+)
>>>
>>> diff --git a/OvmfPkg/RiscVVirt/README.md b/OvmfPkg/RiscVVirt/README.md
>>> index 8c3ac37b802a..dbb40bbe89b0 100644
>>> --- a/OvmfPkg/RiscVVirt/README.md
>>> +++ b/OvmfPkg/RiscVVirt/README.md
>>> @@ -69,3 +69,20 @@ Below example shows how to boot openSUSE Tumbleweed 
>>> E20.
>>>  -device virtio-net-pci,netdev=net0 \
>>>  -device virtio-blk-device,drive=hd0 \
>>>  -drive 
>>> file=openSUSE-Tumbleweed-RISC-V-E20-efi.riscv64.raw,format=raw,id=hd0
>>> +
>>> +## Test with your own OpenSBI binary
>>> +Using the above QEMU command line, **RISCV_VIRT_CODE.fd** is launched 
>>> by the
>>> +OpenSBI binary that is bundled with QEMU. You can build your own 
>>> OpenSBI binary
>>> +as well:
>>> +
>>> +OPENSBI_DIR=...
>>> +git clone https://github.com/riscv/opensbi.git $OPENSBI_DIR
>>> +make -C $OPENSBI_DIR \
>>> +-j $(getconf _NPROCESSORS_ONLN) \
>>> +CROSS_COMPILE=riscv64-linux-gnu- \
>>> +PLATFORM=generic
>>> +
>> Do we need to duplicate these OpenSBI build instructions in EDK2? IMO,
>> we should just document how to use -bios to use custom OpenSBI image.
>> The build instructions for other software repos can change at any
>> time.
>
> Can we include the opensbi project URL at least?

 BTW, I disagree with your larger message (as I perceive it).

 While it's true that build instructions may change at any time, that's
 just a generic statement about any software and any documentation in
 existence. All documentation goes stale at some point.

>>> Agreed. But my point is, this documentation which provides build
>>> instructions of opensbi doesn't belong to edk2 but opensbi. If something
>>> is missing in the opensbi build instructions like you mentioned, it
>>> should be submitted as a patch to opensbi repo rather edk2, right?
>>
>> I don't know.
>>
>> If two projects are used in conjunction, which project's documentation
>> should cover the combined use?
>>
> Okay, fair enough. Let's add it. It appears to be very useful for any
> one new to RISC-V+edk2 and OpenSBI. Do you want to update the -kernel
> option also in v2 or will it be separate patch?

I think I'd like -kernel etc to be an incremental (= separate) patch,
because first I need to test it.

Thanks!
Laszlo

> 
> Thanks,
> Sunil
>> Laszlo
>>
>>>
>>> -Sunil
>>>
 And in this particular case, I needed to fish out the build commands,
 and the resultant "fw_dynamic.bin" filename, from the QEMU tree, not the
 OpenSBI tree. I'm not aware of any documentation that makes a dedicated
 statement about building OpenSBI *for* running edk2.

 The OpenSBI root "README.md" @ b20bd479eff1 only says "For example, to
 compile the platform library and the firmware examples for the QEMU
 RISC-V *virt* machine, ** should be *generic*". It does
 not mention the build output pathname
 "build/platform/generic/firmware/fw_dynamic.bin".

 Laszlo

>>>
>>
> 



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




Re: [edk2-devel] [PATCH v2] Pyrite support - Secure erase is only available if encryption is supported.

2023-09-11 Thread Ard Biesheuvel
On Thu, 7 Sept 2023 at 11:02, Linus Liu  wrote:
>
> From: Linus Liu 
>
> https://bugzilla.tianocore.org/show_bug.cgi?id=3004
>
> Cc: Qi Zhang
> Cc: Rahul Kumar 
> Cc: Jiewen Yao  
> Cc: Tina Chen   
> Cc: Xiao X Chen 

This patch is missing a signed-off-by line

> ---
>  SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c 
> b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
> index e2e77cbc24..ba9fa66c60 100644
> --- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
> +++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
> @@ -87,7 +87,11 @@ OpalSupportGetAvailableActions (
>  // Secure erase is performed by generating a new encryption key
>  // this is only available if encryption is supported
>  //
> -AvalDiskActions->SecureErase = 1;
> +if (SupportedAttributes->MediaEncryption) {
> +  AvalDiskActions->SecureErase = 1;
> +} else {
> +  AvalDiskActions->SecureErase = 0;
> +}
>} else {
>  AvalDiskActions->PsidRevert  = 0;
>  AvalDiskActions->SecureErase = 0;
> --
> 2.39.2.windows.1
>
>
>
> 
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#108368): https://edk2.groups.io/g/devel/message/108368
> Mute This Topic: https://groups.io/mt/101210886/1131722
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [a...@kernel.org]
> 
>
>


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




Re: [edk2-devel] [PATCH v2] Pyrite support - Secure erase is only available if encryption is supported.

2023-09-11 Thread Yao, Jiewen
Reviewed-by: Jiewen Yao 

> -Original Message-
> From: Liu, Linus 
> Sent: Thursday, September 7, 2023 5:02 PM
> To: devel@edk2.groups.io
> Cc: Liu, Linus ; Zhang, Qi1 ; Kumar,
> Rahul R ; Yao, Jiewen ; Chen,
> Tina ; Chen, Xiao X 
> Subject: [PATCH v2] Pyrite support - Secure erase is only available if 
> encryption is
> supported.
> 
> From: Linus Liu 
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=3004
> 
> Cc: Qi Zhang
> Cc: Rahul Kumar 
> Cc: Jiewen Yao  
> Cc: Tina Chen   
> Cc: Xiao X Chen 
> ---
>  SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
> b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
> index e2e77cbc24..ba9fa66c60 100644
> --- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
> +++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
> @@ -87,7 +87,11 @@ OpalSupportGetAvailableActions (
>  // Secure erase is performed by generating a new encryption key
> 
>  // this is only available if encryption is supported
> 
>  //
> 
> -AvalDiskActions->SecureErase = 1;
> 
> +if (SupportedAttributes->MediaEncryption) {
> 
> +  AvalDiskActions->SecureErase = 1;
> 
> +} else {
> 
> +  AvalDiskActions->SecureErase = 0;
> 
> +}
> 
>} else {
> 
>  AvalDiskActions->PsidRevert  = 0;
> 
>  AvalDiskActions->SecureErase = 0;
> 
> --
> 2.39.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108485): https://edk2.groups.io/g/devel/message/108485
Mute This Topic: https://groups.io/mt/101210886/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 21/26] OvmfPkg: Enable Choosing Memory Protection Profile via QemuCfg

2023-09-11 Thread Gerd Hoffmann
  Hi,

>  .../PeilessStartupLib/PeilessStartup.c| 60 +--
>  OvmfPkg/PlatformPei/Platform.c| 74 +--

Can we move that code to a library so we don't add it twice to the code
base and also make it easier to reuse it for ArmVirtQemu?

See OvmfPkg/Library/TlsAuthConfigLib for example.

> +RETURN_STATUS
> +EFIAPI
> +QemuFwCfgParseString (
> +  IN CONST CHAR8  *FileName,
> +  IN OUT UINTN*BufferSize,
> +  OUTCHAR8*Buffer
> +  )
> +{
> +  return QemuFwCfgGetAsString (FileName, BufferSize, Buffer);
> +}

Separate patch please.

> -  gEfiMdeModulePkgTokenSpaceGuid.PcdSetNxForStack

Dropping that PCD can also go to a separate patch.

take care,
  Gerd



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




Re: [edk2-devel] [PATCH 1/1] OvmfPkg/RiscVVirt/README.md: bring your own OpenSBI

2023-09-11 Thread Sunil V L
On Mon, Sep 11, 2023 at 09:07:46AM +0200, Laszlo Ersek wrote:
> On 9/11/23 08:22, Sunil V L wrote:
> > On Mon, Sep 11, 2023 at 08:15:26AM +0200, Laszlo Ersek wrote:
> >> On 9/11/23 07:32, Laszlo Ersek wrote:
> >>> On 9/8/23 08:13, Sunil V L wrote:
>  Hi Laszlo,
> 
>  On Thu, Sep 07, 2023 at 04:58:25PM +0200, Laszlo Ersek wrote:
> > Explain how users can compose their pre-OS environment purely from
> > binaries they've built themselves.
> >
> > Cc: Andrei Warkentin 
> > Cc: Ard Biesheuvel 
> > Cc: Gerd Hoffmann 
> > Cc: Jiewen Yao 
> > Cc: Jordan Justen 
> > Cc: Sunil V L 
> > Signed-off-by: Laszlo Ersek 
> > ---
> >
> > Notes:
> > rendered version:
> > 
> > 
> > https://github.com/lersek/edk2/tree/bring-your-own-opensbi/OvmfPkg/RiscVVirt#test-with-your-own-opensbi-binary
> >
> >  OvmfPkg/RiscVVirt/README.md | 17 +
> >  1 file changed, 17 insertions(+)
> >
> > diff --git a/OvmfPkg/RiscVVirt/README.md b/OvmfPkg/RiscVVirt/README.md
> > index 8c3ac37b802a..dbb40bbe89b0 100644
> > --- a/OvmfPkg/RiscVVirt/README.md
> > +++ b/OvmfPkg/RiscVVirt/README.md
> > @@ -69,3 +69,20 @@ Below example shows how to boot openSUSE Tumbleweed 
> > E20.
> >  -device virtio-net-pci,netdev=net0 \
> >  -device virtio-blk-device,drive=hd0 \
> >  -drive 
> > file=openSUSE-Tumbleweed-RISC-V-E20-efi.riscv64.raw,format=raw,id=hd0
> > +
> > +## Test with your own OpenSBI binary
> > +Using the above QEMU command line, **RISCV_VIRT_CODE.fd** is launched 
> > by the
> > +OpenSBI binary that is bundled with QEMU. You can build your own 
> > OpenSBI binary
> > +as well:
> > +
> > +OPENSBI_DIR=...
> > +git clone https://github.com/riscv/opensbi.git $OPENSBI_DIR
> > +make -C $OPENSBI_DIR \
> > +-j $(getconf _NPROCESSORS_ONLN) \
> > +CROSS_COMPILE=riscv64-linux-gnu- \
> > +PLATFORM=generic
> > +
>  Do we need to duplicate these OpenSBI build instructions in EDK2? IMO,
>  we should just document how to use -bios to use custom OpenSBI image.
>  The build instructions for other software repos can change at any
>  time.
> >>>
> >>> Can we include the opensbi project URL at least?
> >>
> >> BTW, I disagree with your larger message (as I perceive it).
> >>
> >> While it's true that build instructions may change at any time, that's
> >> just a generic statement about any software and any documentation in
> >> existence. All documentation goes stale at some point.
> >>
> > Agreed. But my point is, this documentation which provides build
> > instructions of opensbi doesn't belong to edk2 but opensbi. If something
> > is missing in the opensbi build instructions like you mentioned, it
> > should be submitted as a patch to opensbi repo rather edk2, right?
> 
> I don't know.
> 
> If two projects are used in conjunction, which project's documentation
> should cover the combined use?
> 
Okay, fair enough. Let's add it. It appears to be very useful for any
one new to RISC-V+edk2 and OpenSBI. Do you want to update the -kernel
option also in v2 or will it be separate patch?

Thanks,
Sunil
> Laszlo
> 
> > 
> > -Sunil
> > 
> >> And in this particular case, I needed to fish out the build commands,
> >> and the resultant "fw_dynamic.bin" filename, from the QEMU tree, not the
> >> OpenSBI tree. I'm not aware of any documentation that makes a dedicated
> >> statement about building OpenSBI *for* running edk2.
> >>
> >> The OpenSBI root "README.md" @ b20bd479eff1 only says "For example, to
> >> compile the platform library and the firmware examples for the QEMU
> >> RISC-V *virt* machine, ** should be *generic*". It does
> >> not mention the build output pathname
> >> "build/platform/generic/firmware/fw_dynamic.bin".
> >>
> >> Laszlo
> >>
> > 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108483): https://edk2.groups.io/g/devel/message/108483
Mute This Topic: https://groups.io/mt/101216052/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/1] MdeModulePkg: Support customized FV Migration Information

2023-09-11 Thread Wang Fan
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4533

There are use cases which not all FVs need be migrated from TempRam to
permanent memory before TempRam tears down. This new guid is introduced
to avoid unnecessary FV migration to improve boot performance. Platform
can publish ToMigrateFvInfo hob with this guid to customize FV migration
info, and PeiCore will only migrate FVs indicated by this Hob info.

This is a backwards compatible change, PeiCore will check ToMigrateFvInfo
hob before migration. If ToMigrateFvInfo hobs exists, only migrate FVs
recorded by hobs. If ToMigrateFvInfo hobs not exists, migrate all FVs to
permanent memory.

Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Guomin Jiang 
Cc: Dandan Bi 
Signed-off-by: Wang Fan 
---
 MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 82 +--
 MdeModulePkg/Core/Pei/PeiMain.inf |  1 +
 MdeModulePkg/Include/Guid/MigratedFvInfo.h| 19 +
 MdeModulePkg/MdeModulePkg.dec |  3 +-
 4 files changed, 79 insertions(+), 26 deletions(-)

diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c 
b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
index 5f32ebb560ae..e84849ec6db1 100644
--- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
+++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
@@ -1184,7 +1184,11 @@ EvacuateTempRam (
 
   PEI_CORE_FV_HANDLEPeiCoreFvHandle;
   EFI_PEI_CORE_FV_LOCATION_PPI  *PeiCoreFvLocationPpi;
+  EDKII_TO_MIGRATE_FV_INFO  *ToMigrateFvInfo;
   EDKII_MIGRATED_FV_INFOMigratedFvInfo;
+  EFI_PEI_HOB_POINTERS  Hob;
+  BOOLEAN   MigrateAllFvs;
+  UINT32MigrationFlags;
 
   ASSERT (Private->PeiMemoryInstalled);
 
@@ -1211,6 +1215,17 @@ EvacuateTempRam (
 
   ConvertPeiCorePpiPointers (Private, );
 
+  //
+  // Check if platform defined hobs to indicate which FVs are expected to 
migrate or keep raw data.
+  // If ToMigrateFvInfo hobs exists, only migrate FVs recorded by hobs.
+  // If ToMigrateFvInfo hobs not exists, migrate all FVs to permanent memory.
+  //
+  MigrateAllFvs = TRUE;
+  Hob.Raw   = GetFirstGuidHob ();
+  if (Hob.Raw != NULL) {
+MigrateAllFvs = FALSE;
+  }
+
   for (FvIndex = 0; FvIndex < Private->FvCount; FvIndex++) {
 FvHeader = Private->Fv[FvIndex].FvHeader;
 ASSERT (FvHeader != NULL);
@@ -1224,6 +1239,25 @@ EvacuateTempRam (
   )
 )
 {
+  if (MigrateAllFvs) {
+MigrationFlags = 0;
+  } else {
+MigrationFlags = FLAGS_SKIP_FV_MIGRATION | FLAGS_SKIP_FV_RAW_DATA_COPY;
+Hob.Raw = GetFirstGuidHob ();
+while (Hob.Raw != NULL) {
+  ToMigrateFvInfo = GET_GUID_HOB_DATA (Hob);
+  if (ToMigrateFvInfo->FvOrgBase == (UINT32)(UINTN)FvHeader) {
+MigrationFlags = ToMigrateFvInfo->MigrationFlags;
+break;
+  }
+  Hob.Raw = GET_NEXT_HOB (Hob);
+  Hob.Raw = GetNextGuidHob (, Hob.Raw);
+}
+  }
+  if (MigrationFlags & FLAGS_SKIP_FV_MIGRATION) {
+continue;
+  }
+
   //
   // Allocate page to save the rebased PEIMs, the PEIMs will get 
dispatched later.
   //
@@ -1234,18 +1268,7 @@ EvacuateTempRam (
   );
   ASSERT_EFI_ERROR (Status);
   MigratedFvHeader = (EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)FvHeaderAddress;
-
-  //
-  // Allocate pool to save the raw PEIMs, which is used to keep consistent 
context across
-  // multiple boot and PCR0 will keep the same no matter if the address of 
allocated page is changed.
-  //
-  Status =  PeiServicesAllocatePages (
-  EfiBootServicesCode,
-  EFI_SIZE_TO_PAGES ((UINTN)FvHeader->FvLength),
-  
-  );
-  ASSERT_EFI_ERROR (Status);
-  RawDataFvHeader = (EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)FvHeaderAddress;
+  CopyMem (MigratedFvHeader, FvHeader, (UINTN)FvHeader->FvLength);
 
   DEBUG ((
 DEBUG_VERBOSE,
@@ -1256,18 +1279,29 @@ EvacuateTempRam (
 ));
 
   //
-  // Copy the context to the rebased pages and raw pages, and create hob 
to save the
-  // information. The MigratedFvInfo HOB will never be produced when
-  // PcdMigrateTemporaryRamFirmwareVolumes is FALSE, because the PCD 
control the
-  // feature.
+  // Copy the context to the raw pages, and create hob to save the 
information. The MigratedFvInfo
+  // HOB will never be produced when PcdMigrateTemporaryRamFirmwareVolumes 
is FALSE, because the PCD
+  // controls the feature.
   //
-  CopyMem (MigratedFvHeader, FvHeader, (UINTN)FvHeader->FvLength);
-  CopyMem (RawDataFvHeader, MigratedFvHeader, (UINTN)FvHeader->FvLength);
-  MigratedFvInfo.FvOrgBase  = (UINT32)(UINTN)FvHeader;
-  MigratedFvInfo.FvNewBase  = (UINT32)(UINTN)MigratedFvHeader;
-  MigratedFvInfo.FvDataBase = (UINT32)(UINTN)RawDataFvHeader;
-  MigratedFvInfo.FvLength   = 

Re: [edk2-devel] [PATCH v1 1/1] ArmVirtPkg: Enable Early Serial For DxeCore

2023-09-11 Thread Ard Biesheuvel
On Mon, 11 Sept 2023 at 07:30, Laszlo Ersek  wrote:
>
> On 9/8/23 01:58, Sean Brogan wrote:
> >
> > On 9/7/2023 1:54 PM, Laszlo Ersek wrote:
> >> On 9/7/23 19:50, Sean Brogan wrote:
> >>> I would argue that by declaring that your library class supports type
> >>> DXE_CORE (or any core type) that you have declared you understand the
> >>> uniqueness of the environment and have accounted for it.
> >>>
> >>> For instances that support DXE_CORE or MM_CORE module types we often use
> >>> a global variable (to the library) to determine if the init routine has
> >>> been completed.  This does require a single byte check on each serial
> >>> message write (hot path) but given all the code on that path this is not
> >>> noticeable in performance measurements.   In the case below this pattern
> >>> could be used by the FdtPL011SerialPortLib to detect if it's init
> >>> routine has been called.
> >> Good point, but then I still claim that the "init check in each API"
> >> should be done in a dedicated "DxeCoreDebugLibSerialPort" instance, and
> >> not in a SerialPortLib instance. Here's why:
> >>
> >> (1) The SerialPortLib *class* requires SerialPortInitialize() to be
> >> called before the other APIs.
> >
> > Where do you see this? Looking at the file here:
> > edk2/MdePkg/Include/Library/SerialPortLib.h at master · tianocore/edk2
> > (github.com)
> > 
> >  I don't see that.  I don't necessarily disagree with you but I am just 
> > trying to find out where this is documented.
>
> I consider this an implicit requirement, from the first two sentences
> (and from the fact that the function is declared at the top of the
> header) -- "Initialize the serial device hardware. If no initialization
> is required, then return RETURN_SUCCESS."
>

Agreed. Even if the header file does not spell it out literally, it is
implied: SerialPortInitialize() needs to be implemented even if no
initialization is required, in which case the routine does nothing
before returning SUCCESS. So the caller cannot distinguish a library
class implementation that requires initialization from one that does
not, and it can only assume that calling SerialPortInitialize() is
needed before using any other part of the API.


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




Re: [edk2-devel] [PATCH 1/1] OvmfPkg/RiscVVirt/README.md: bring your own OpenSBI

2023-09-11 Thread Laszlo Ersek
On 9/11/23 08:22, Sunil V L wrote:
> On Mon, Sep 11, 2023 at 08:15:26AM +0200, Laszlo Ersek wrote:
>> On 9/11/23 07:32, Laszlo Ersek wrote:
>>> On 9/8/23 08:13, Sunil V L wrote:
 Hi Laszlo,

 On Thu, Sep 07, 2023 at 04:58:25PM +0200, Laszlo Ersek wrote:
> Explain how users can compose their pre-OS environment purely from
> binaries they've built themselves.
>
> Cc: Andrei Warkentin 
> Cc: Ard Biesheuvel 
> Cc: Gerd Hoffmann 
> Cc: Jiewen Yao 
> Cc: Jordan Justen 
> Cc: Sunil V L 
> Signed-off-by: Laszlo Ersek 
> ---
>
> Notes:
> rendered version:
> 
> 
> https://github.com/lersek/edk2/tree/bring-your-own-opensbi/OvmfPkg/RiscVVirt#test-with-your-own-opensbi-binary
>
>  OvmfPkg/RiscVVirt/README.md | 17 +
>  1 file changed, 17 insertions(+)
>
> diff --git a/OvmfPkg/RiscVVirt/README.md b/OvmfPkg/RiscVVirt/README.md
> index 8c3ac37b802a..dbb40bbe89b0 100644
> --- a/OvmfPkg/RiscVVirt/README.md
> +++ b/OvmfPkg/RiscVVirt/README.md
> @@ -69,3 +69,20 @@ Below example shows how to boot openSUSE Tumbleweed 
> E20.
>  -device virtio-net-pci,netdev=net0 \
>  -device virtio-blk-device,drive=hd0 \
>  -drive 
> file=openSUSE-Tumbleweed-RISC-V-E20-efi.riscv64.raw,format=raw,id=hd0
> +
> +## Test with your own OpenSBI binary
> +Using the above QEMU command line, **RISCV_VIRT_CODE.fd** is launched by 
> the
> +OpenSBI binary that is bundled with QEMU. You can build your own OpenSBI 
> binary
> +as well:
> +
> +OPENSBI_DIR=...
> +git clone https://github.com/riscv/opensbi.git $OPENSBI_DIR
> +make -C $OPENSBI_DIR \
> +-j $(getconf _NPROCESSORS_ONLN) \
> +CROSS_COMPILE=riscv64-linux-gnu- \
> +PLATFORM=generic
> +
 Do we need to duplicate these OpenSBI build instructions in EDK2? IMO,
 we should just document how to use -bios to use custom OpenSBI image.
 The build instructions for other software repos can change at any
 time.
>>>
>>> Can we include the opensbi project URL at least?
>>
>> BTW, I disagree with your larger message (as I perceive it).
>>
>> While it's true that build instructions may change at any time, that's
>> just a generic statement about any software and any documentation in
>> existence. All documentation goes stale at some point.
>>
> Agreed. But my point is, this documentation which provides build
> instructions of opensbi doesn't belong to edk2 but opensbi. If something
> is missing in the opensbi build instructions like you mentioned, it
> should be submitted as a patch to opensbi repo rather edk2, right?

I don't know.

If two projects are used in conjunction, which project's documentation
should cover the combined use?

Laszlo

> 
> -Sunil
> 
>> And in this particular case, I needed to fish out the build commands,
>> and the resultant "fw_dynamic.bin" filename, from the QEMU tree, not the
>> OpenSBI tree. I'm not aware of any documentation that makes a dedicated
>> statement about building OpenSBI *for* running edk2.
>>
>> The OpenSBI root "README.md" @ b20bd479eff1 only says "For example, to
>> compile the platform library and the firmware examples for the QEMU
>> RISC-V *virt* machine, ** should be *generic*". It does
>> not mention the build output pathname
>> "build/platform/generic/firmware/fw_dynamic.bin".
>>
>> Laszlo
>>
> 



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




Re: [edk2-devel] [PATCH 1/1] OvmfPkg/RiscVVirt/README.md: bring your own OpenSBI

2023-09-11 Thread Sunil V L
On Mon, Sep 11, 2023 at 08:15:26AM +0200, Laszlo Ersek wrote:
> On 9/11/23 07:32, Laszlo Ersek wrote:
> > On 9/8/23 08:13, Sunil V L wrote:
> >> Hi Laszlo,
> >>
> >> On Thu, Sep 07, 2023 at 04:58:25PM +0200, Laszlo Ersek wrote:
> >>> Explain how users can compose their pre-OS environment purely from
> >>> binaries they've built themselves.
> >>>
> >>> Cc: Andrei Warkentin 
> >>> Cc: Ard Biesheuvel 
> >>> Cc: Gerd Hoffmann 
> >>> Cc: Jiewen Yao 
> >>> Cc: Jordan Justen 
> >>> Cc: Sunil V L 
> >>> Signed-off-by: Laszlo Ersek 
> >>> ---
> >>>
> >>> Notes:
> >>> rendered version:
> >>> 
> >>> 
> >>> https://github.com/lersek/edk2/tree/bring-your-own-opensbi/OvmfPkg/RiscVVirt#test-with-your-own-opensbi-binary
> >>>
> >>>  OvmfPkg/RiscVVirt/README.md | 17 +
> >>>  1 file changed, 17 insertions(+)
> >>>
> >>> diff --git a/OvmfPkg/RiscVVirt/README.md b/OvmfPkg/RiscVVirt/README.md
> >>> index 8c3ac37b802a..dbb40bbe89b0 100644
> >>> --- a/OvmfPkg/RiscVVirt/README.md
> >>> +++ b/OvmfPkg/RiscVVirt/README.md
> >>> @@ -69,3 +69,20 @@ Below example shows how to boot openSUSE Tumbleweed 
> >>> E20.
> >>>  -device virtio-net-pci,netdev=net0 \
> >>>  -device virtio-blk-device,drive=hd0 \
> >>>  -drive 
> >>> file=openSUSE-Tumbleweed-RISC-V-E20-efi.riscv64.raw,format=raw,id=hd0
> >>> +
> >>> +## Test with your own OpenSBI binary
> >>> +Using the above QEMU command line, **RISCV_VIRT_CODE.fd** is launched by 
> >>> the
> >>> +OpenSBI binary that is bundled with QEMU. You can build your own OpenSBI 
> >>> binary
> >>> +as well:
> >>> +
> >>> +OPENSBI_DIR=...
> >>> +git clone https://github.com/riscv/opensbi.git $OPENSBI_DIR
> >>> +make -C $OPENSBI_DIR \
> >>> +-j $(getconf _NPROCESSORS_ONLN) \
> >>> +CROSS_COMPILE=riscv64-linux-gnu- \
> >>> +PLATFORM=generic
> >>> +
> >> Do we need to duplicate these OpenSBI build instructions in EDK2? IMO,
> >> we should just document how to use -bios to use custom OpenSBI image.
> >> The build instructions for other software repos can change at any
> >> time.
> > 
> > Can we include the opensbi project URL at least?
> 
> BTW, I disagree with your larger message (as I perceive it).
> 
> While it's true that build instructions may change at any time, that's
> just a generic statement about any software and any documentation in
> existence. All documentation goes stale at some point.
> 
Agreed. But my point is, this documentation which provides build
instructions of opensbi doesn't belong to edk2 but opensbi. If something
is missing in the opensbi build instructions like you mentioned, it
should be submitted as a patch to opensbi repo rather edk2, right?

-Sunil

> And in this particular case, I needed to fish out the build commands,
> and the resultant "fw_dynamic.bin" filename, from the QEMU tree, not the
> OpenSBI tree. I'm not aware of any documentation that makes a dedicated
> statement about building OpenSBI *for* running edk2.
> 
> The OpenSBI root "README.md" @ b20bd479eff1 only says "For example, to
> compile the platform library and the firmware examples for the QEMU
> RISC-V *virt* machine, ** should be *generic*". It does
> not mention the build output pathname
> "build/platform/generic/firmware/fw_dynamic.bin".
> 
> Laszlo
> 


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




Re: [edk2-devel] [PATCH 1/1] OvmfPkg/RiscVVirt/README.md: bring your own OpenSBI

2023-09-11 Thread Laszlo Ersek
On 9/11/23 07:32, Laszlo Ersek wrote:
> On 9/8/23 08:13, Sunil V L wrote:
>> Hi Laszlo,
>>
>> On Thu, Sep 07, 2023 at 04:58:25PM +0200, Laszlo Ersek wrote:
>>> Explain how users can compose their pre-OS environment purely from
>>> binaries they've built themselves.
>>>
>>> Cc: Andrei Warkentin 
>>> Cc: Ard Biesheuvel 
>>> Cc: Gerd Hoffmann 
>>> Cc: Jiewen Yao 
>>> Cc: Jordan Justen 
>>> Cc: Sunil V L 
>>> Signed-off-by: Laszlo Ersek 
>>> ---
>>>
>>> Notes:
>>> rendered version:
>>> 
>>> 
>>> https://github.com/lersek/edk2/tree/bring-your-own-opensbi/OvmfPkg/RiscVVirt#test-with-your-own-opensbi-binary
>>>
>>>  OvmfPkg/RiscVVirt/README.md | 17 +
>>>  1 file changed, 17 insertions(+)
>>>
>>> diff --git a/OvmfPkg/RiscVVirt/README.md b/OvmfPkg/RiscVVirt/README.md
>>> index 8c3ac37b802a..dbb40bbe89b0 100644
>>> --- a/OvmfPkg/RiscVVirt/README.md
>>> +++ b/OvmfPkg/RiscVVirt/README.md
>>> @@ -69,3 +69,20 @@ Below example shows how to boot openSUSE Tumbleweed E20.
>>>  -device virtio-net-pci,netdev=net0 \
>>>  -device virtio-blk-device,drive=hd0 \
>>>  -drive 
>>> file=openSUSE-Tumbleweed-RISC-V-E20-efi.riscv64.raw,format=raw,id=hd0
>>> +
>>> +## Test with your own OpenSBI binary
>>> +Using the above QEMU command line, **RISCV_VIRT_CODE.fd** is launched by 
>>> the
>>> +OpenSBI binary that is bundled with QEMU. You can build your own OpenSBI 
>>> binary
>>> +as well:
>>> +
>>> +OPENSBI_DIR=...
>>> +git clone https://github.com/riscv/opensbi.git $OPENSBI_DIR
>>> +make -C $OPENSBI_DIR \
>>> +-j $(getconf _NPROCESSORS_ONLN) \
>>> +CROSS_COMPILE=riscv64-linux-gnu- \
>>> +PLATFORM=generic
>>> +
>> Do we need to duplicate these OpenSBI build instructions in EDK2? IMO,
>> we should just document how to use -bios to use custom OpenSBI image.
>> The build instructions for other software repos can change at any
>> time.
> 
> Can we include the opensbi project URL at least?

BTW, I disagree with your larger message (as I perceive it).

While it's true that build instructions may change at any time, that's
just a generic statement about any software and any documentation in
existence. All documentation goes stale at some point.

And in this particular case, I needed to fish out the build commands,
and the resultant "fw_dynamic.bin" filename, from the QEMU tree, not the
OpenSBI tree. I'm not aware of any documentation that makes a dedicated
statement about building OpenSBI *for* running edk2.

The OpenSBI root "README.md" @ b20bd479eff1 only says "For example, to
compile the platform library and the firmware examples for the QEMU
RISC-V *virt* machine, ** should be *generic*". It does
not mention the build output pathname
"build/platform/generic/firmware/fw_dynamic.bin".

Laszlo



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