Re: [edk2-devel] [PATCH 1/1] Add a .editorconfig file to tell editors basic formatting details

2023-02-27 Thread Ard Biesheuvel
On Mon, 27 Feb 2023 at 04:47, Rebecca Cran  wrote:
>
> Add a .editorconfig file which editors can use for basic formatting
> details of files, such as tabs/spaces, line endings etc.
>
> Signed-off-by: Rebecca Cran 

Thank you very much for this - this is very useful.

Acked-by: Ard Biesheuvel 

Could we add .dsc/.inf/.dec/etc files as well?

> ---
>  .editorconfig | 21 
>  1 file changed, 21 insertions(+)
>
> diff --git a/.editorconfig b/.editorconfig
> new file mode 100644
> index ..f2651d7ad871
> --- /dev/null
> +++ b/.editorconfig
> @@ -0,0 +1,21 @@
> +# EditorConfig file: https://EditorConfig.org
> +
> +root = true
> +
> +[*]
> +charset = latin1
> +end_of_line = crlf
> +insert_final_newline = true
> +trim_trailing_whitespace = true
> +
> +[*.py]
> +charset = utf-8
> +indent_style = space
> +indent_size = 4
> +
> +[Makefile,GNUmakefile]
> +indent_style = tab
> +
> +[*.{c,h,cpp,cc}]
> +indent_style = space
> +indent_size = 2
> --
> 2.37.1 (Apple Git-137.1)
>
>
>
> 
>
>


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




Re: [edk2-devel] [PATCH v4 0/9] merge UefiCpuPkg/UefiCpuLib to MdePkg/CpuLib

2023-02-27 Thread Gerd Hoffmann
On Mon, Feb 27, 2023 at 03:23:57PM +0800, Zhiguang Liu wrote:
> V4:
> This patch set has already gotten reviewed-by except OvmfPkg. Also V4 has a 
> little code change for OvmfPkg.
> So I only sent pathces about OvmfPkg (patch NO.1 and NO.4) to avoid 
> disturbing other Package Maintainers.
> Other patches can check the V3 version or check the PR link 
> https://github.com/tianocore/edk2/pull/4066

It is perfectly fine to repost the whole series, especially when v3 was
posted months ago.  It's good to add any review tags to the patches
though to make clear which are reviewed already and which are not.

> UefiCpuPkg which does not meet the design spec. So merge UefiCpuLib to
> CpuLib is a good way to sovle these problems. To minimize the
> impact,this change is carried out in four steps.

>  rename {UefiCpuPkg/Library/BaseUefiCpuLib => 
> MdePkg/Library/BaseCpuLib}/Ia32/InitializeFpu.nasm (100%)
>  rename {UefiCpuPkg/Library/BaseUefiCpuLib => 
> MdePkg/Library/BaseCpuLib}/X64/InitializeFpu.nasm (100%)
>  rename UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.c => 
> MdePkg/Library/BaseCpuLib/X86BaseCpuLib.c (93%)

So in essence this series moves the code unmodified (other than some
reaming due to the new location) and updates all references?

take care,
  Gerd



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




[edk2-devel] [PATCH 1/1] SecurityPkg/DxeImageVerificationLib: Check result of GetEfiGlobalVariable2

2023-02-27 Thread Gerd Hoffmann
Call gRT->GetVariable() directly to read the SecureBoot variable.  It is
one byte in size so we can easily place it on the stack instead of
having GetEfiGlobalVariable2() allocate it for us, which avoids a few
possible error cases.

Skip secure boot checks if (and only if):

 (a) the SecureBoot variable is not present (EFI_NOT_FOUND) according to
 the return value, or
 (b) the SecureBoot variable was read successfully and is set to
 SECURE_BOOT_MODE_DISABLE.

Previously the code skipped the secure boot checks on *any*
gRT->GetVariable() error (GetEfiGlobalVariable2 sets the variable
value to NULL in that case) and also on memory allocation failures.

Fixes: CVE-2019-14560
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=2167
Signed-off-by: Gerd Hoffmann 
---
 .../DxeImageVerificationLib.c  | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git 
a/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c 
b/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c
index 66e2f5eaa3c0..f29a27e5a053 100644
--- a/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c
+++ b/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c
@@ -1671,7 +1671,8 @@ DxeImageVerificationHandler (
   EFI_IMAGE_EXECUTION_ACTIONAction;
   WIN_CERTIFICATE   *WinCertificate;
   UINT32Policy;
-  UINT8 *SecureBoot;
+  UINT8 SecureBoot;
+  UINTN SecureBootSize;
   PE_COFF_LOADER_IMAGE_CONTEXT  ImageContext;
   UINT32NumberOfRvaAndSizes;
   WIN_CERTIFICATE_EFI_PKCS  *PkcsCertData;
@@ -1686,6 +1687,7 @@ DxeImageVerificationHandler (
   RETURN_STATUS PeCoffStatus;
   EFI_STATUSHashStatus;
   EFI_STATUSDbStatus;
+  EFI_STATUSVarStatus;
   BOOLEAN   IsFound;
 
   SignatureList = NULL;
@@ -1742,24 +1744,22 @@ DxeImageVerificationHandler (
 CpuDeadLoop ();
   }
 
-  GetEfiGlobalVariable2 (EFI_SECURE_BOOT_MODE_NAME, (VOID **)&SecureBoot, 
NULL);
+  SecureBootSize = sizeof (SecureBoot);
+  VarStatus  = gRT->GetVariable (EFI_SECURE_BOOT_MODE_NAME, 
&gEfiGlobalVariableGuid, NULL, &SecureBootSize, &SecureBoot);
   //
   // Skip verification if SecureBoot variable doesn't exist.
   //
-  if (SecureBoot == NULL) {
+  if (VarStatus == EFI_NOT_FOUND) {
 return EFI_SUCCESS;
   }
 
   //
   // Skip verification if SecureBoot is disabled but not AuditMode
   //
-  if (*SecureBoot == SECURE_BOOT_MODE_DISABLE) {
-FreePool (SecureBoot);
+  if ((VarStatus == EFI_SUCCESS) && (SecureBoot == SECURE_BOOT_MODE_DISABLE)) {
 return EFI_SUCCESS;
   }
 
-  FreePool (SecureBoot);
-
   //
   // Read the Dos header.
   //
-- 
2.39.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100510): https://edk2.groups.io/g/devel/message/100510
Mute This Topic: https://groups.io/mt/97265237/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] Add a .editorconfig file to tell editors basic formatting details

2023-02-27 Thread Rebecca Cran

On 2/27/23 1:04 AM, Ard Biesheuvel wrote:


On Mon, 27 Feb 2023 at 04:47, Rebecca Cran  wrote:

Add a .editorconfig file which editors can use for basic formatting
details of files, such as tabs/spaces, line endings etc.

Signed-off-by: Rebecca Cran 

Thank you very much for this - this is very useful.

Acked-by: Ard Biesheuvel 

Could we add .dsc/.inf/.dec/etc files as well?


I'll move the c/c++ indentation up to the [*] section so it applies to 
.dsc/.inf/etc too.



--
Rebecca Cran



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100511): https://edk2.groups.io/g/devel/message/100511
Mute This Topic: https://groups.io/mt/97259592/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] SecurityPkg/DxeImageVerificationLib: Check result of GetEfiGlobalVariable2

2023-02-27 Thread Marvin Häuser
*Thanks*, Gerd!

Two comments inline.

> On 27. Feb 2023, at 13:55, Gerd Hoffmann  wrote:
> 
> Call gRT->GetVariable() directly to read the SecureBoot variable.  It is
> one byte in size so we can easily place it on the stack instead of
> having GetEfiGlobalVariable2() allocate it for us, which avoids a few
> possible error cases.
> 
> Skip secure boot checks if (and only if):
> 
> (a) the SecureBoot variable is not present (EFI_NOT_FOUND) according to
> the return value, or

@Maintainers Would there be any objection to drop this and skip the SB checks 
only when explicitly disabled?
Please explicitly respond even if not, so we don't end up with everyone 
silently agreeing, but forgetting about the patch after. Thanks! :)

> (b) the SecureBoot variable was read successfully and is set to
> SECURE_BOOT_MODE_DISABLE.
> 
> Previously the code skipped the secure boot checks on *any*
> gRT->GetVariable() error (GetEfiGlobalVariable2 sets the variable
> value to NULL in that case) and also on memory allocation failures.
> 
> Fixes: CVE-2019-14560
> Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=2167
> Signed-off-by: Gerd Hoffmann 
> ---
> .../DxeImageVerificationLib.c  | 14 +++---
> 1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git 
> a/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c 
> b/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c
> index 66e2f5eaa3c0..f29a27e5a053 100644
> --- a/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c
> +++ b/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c
> @@ -1671,7 +1671,8 @@ DxeImageVerificationHandler (
>   EFI_IMAGE_EXECUTION_ACTIONAction;
>   WIN_CERTIFICATE   *WinCertificate;
>   UINT32Policy;
> -  UINT8 *SecureBoot;
> +  UINT8 SecureBoot;
> +  UINTN SecureBootSize;
>   PE_COFF_LOADER_IMAGE_CONTEXT  ImageContext;
>   UINT32NumberOfRvaAndSizes;
>   WIN_CERTIFICATE_EFI_PKCS  *PkcsCertData;
> @@ -1686,6 +1687,7 @@ DxeImageVerificationHandler (
>   RETURN_STATUS PeCoffStatus;
>   EFI_STATUSHashStatus;
>   EFI_STATUSDbStatus;
> +  EFI_STATUSVarStatus;
>   BOOLEAN   IsFound;
> 
>   SignatureList = NULL;
> @@ -1742,24 +1744,22 @@ DxeImageVerificationHandler (
> CpuDeadLoop ();
>   }
> 
> -  GetEfiGlobalVariable2 (EFI_SECURE_BOOT_MODE_NAME, (VOID **)&SecureBoot, 
> NULL);
> +  SecureBootSize = sizeof (SecureBoot);
> +  VarStatus  = gRT->GetVariable (EFI_SECURE_BOOT_MODE_NAME, 
> &gEfiGlobalVariableGuid, NULL, &SecureBootSize, &SecureBoot);
>   //
>   // Skip verification if SecureBoot variable doesn't exist.
>   //
> -  if (SecureBoot == NULL) {
> +  if (VarStatus == EFI_NOT_FOUND) {
> return EFI_SUCCESS;
>   }
> 
>   //
>   // Skip verification if SecureBoot is disabled but not AuditMode
>   //
> -  if (*SecureBoot == SECURE_BOOT_MODE_DISABLE) {
> -FreePool (SecureBoot);
> +  if ((VarStatus == EFI_SUCCESS) && (SecureBoot == 
> SECURE_BOOT_MODE_DISABLE)) {

I would check the attributes here as well. They should be BS | RT, but 
explicitly not NV. This would force the SB checks in case a malicious actor 
somehow managed to store a persistent disable-value variable (be that a bug, 
physical access, or other means).

Best regards,
Marvin

> return EFI_SUCCESS;
>   }
> 
> -  FreePool (SecureBoot);
> -
>   //
>   // Read the Dos header.
>   //
> -- 
> 2.39.2
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100512): https://edk2.groups.io/g/devel/message/100512
Mute This Topic: https://groups.io/mt/97265237/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] Add a .editorconfig file to tell editors basic formatting details

2023-02-27 Thread Michael D Kinney
There are a few file types that must be lf instead of crlf.  Can those be added 
as well?

Mike

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Rebecca Cran
> Sent: Monday, February 27, 2023 5:03 AM
> To: Ard Biesheuvel ; devel@edk2.groups.io
> Cc: Andrew Fish ; Leif Lindholm ; 
> Kinney, Michael D 
> Subject: Re: [edk2-devel] [PATCH 1/1] Add a .editorconfig file to tell 
> editors basic formatting details
> 
> On 2/27/23 1:04 AM, Ard Biesheuvel wrote:
> 
> > On Mon, 27 Feb 2023 at 04:47, Rebecca Cran  wrote:
> >> Add a .editorconfig file which editors can use for basic formatting
> >> details of files, such as tabs/spaces, line endings etc.
> >>
> >> Signed-off-by: Rebecca Cran 
> > Thank you very much for this - this is very useful.
> >
> > Acked-by: Ard Biesheuvel 
> >
> > Could we add .dsc/.inf/.dec/etc files as well?
> 
> I'll move the c/c++ indentation up to the [*] section so it applies to
> .dsc/.inf/etc too.
> 
> 
> --
> Rebecca Cran
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100513): https://edk2.groups.io/g/devel/message/100513
Mute This Topic: https://groups.io/mt/97259592/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] Add a .editorconfig file to tell editors basic formatting details

2023-02-27 Thread Rebecca Cran

Is it just .sh files that need lf endings, or are there others?


--
Rebecca Cran


On 2/27/23 9:14 AM, Michael D Kinney wrote:

There are a few file types that must be lf instead of crlf.  Can those be added 
as well?

Mike


-Original Message-
From: devel@edk2.groups.io  On Behalf Of Rebecca Cran
Sent: Monday, February 27, 2023 5:03 AM
To: Ard Biesheuvel ; devel@edk2.groups.io
Cc: Andrew Fish ; Leif Lindholm ; Kinney, 
Michael D 
Subject: Re: [edk2-devel] [PATCH 1/1] Add a .editorconfig file to tell editors 
basic formatting details

On 2/27/23 1:04 AM, Ard Biesheuvel wrote:


On Mon, 27 Feb 2023 at 04:47, Rebecca Cran  wrote:

Add a .editorconfig file which editors can use for basic formatting
details of files, such as tabs/spaces, line endings etc.

Signed-off-by: Rebecca Cran 

Thank you very much for this - this is very useful.

Acked-by: Ard Biesheuvel 

Could we add .dsc/.inf/.dec/etc files as well?

I'll move the c/c++ indentation up to the [*] section so it applies to
.dsc/.inf/etc too.


--
Rebecca Cran














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




Re: [edk2-devel] [PATCH V1 1/1] BaseTools: Generate compile information in build report

2023-02-27 Thread Guillermo Antonio Palomino Sosa
Hi. I have submitted a pull request to edk2-basetools repository: 
https://github.com/tianocore/edk2-basetools/pull/88
This is the feature request for it: 
https://github.com/tianocore/edk2-basetools/issues/87
I'm also attaching the patch here: ( 
0001-BaseTools-Generate-compile-information-in-build-repo.patch)

On a side note, seems like tip of edk2-basetools is broken due this commit ( 
https://github.com/tianocore/edk2-basetools/commit/8e6018d3ea4c1aae7185f589d129cea14a5d89fd
 ) that makes direct import of Common package:
edk2-basetools\edk2basetools\GenFds\SubTypeGuidSection.py:

> 
> import Common.LongFilePathOs as os


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


From ddb21cdaca196f740a50fdd6524730c3e2cb76fb Mon Sep 17 00:00:00 2001
From: Guillermo Antonio Palomino Sosa 
Date: Mon, 27 Feb 2023 10:29:53 -0600
Subject: [PATCH 1/1] BaseTools: Generate compile information in build report

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

Add "-Y REPORT_INFO" option to build command to generate compile
information as part of BuildReport.
This option generates files to be used by external tools as IDE's
to enhance functionality.
Files are created inside build folder:
///CompileInfo

Files created:
* compile_commands.json - Compilation Database. To be used by IDE's
  to enable advance features
* cscope.files - List of files used in compilation. Used by Cscope to parse
  C code and provide browse functionality.
* module_report.json - Module data form buildReport in Json format.

Signed-off-by: Guillermo Antonio Palomino Sosa 

---
 edk2basetools/build/BuildReport.py  | 138 
 edk2basetools/build/buildoptions.py |   4 +-
 2 files changed, 140 insertions(+), 2 deletions(-)

diff --git a/edk2basetools/build/BuildReport.py 
b/edk2basetools/build/BuildReport.py
index 553bfe5..9cfe9dc 100644
--- a/edk2basetools/build/BuildReport.py
+++ b/edk2basetools/build/BuildReport.py
@@ -21,6 +21,8 @@
 import hashlib
 import subprocess
 import threading
+import json
+from pathlib import Path
 from datetime import datetime
 from io import BytesIO
 from edk2basetools.Common import EdkLogger
@@ -41,6 +43,7 @@
 import collections
 from edk2basetools.Common.Expression import *
 from edk2basetools.GenFds.AprioriSection import DXE_APRIORI_GUID, 
PEI_APRIORI_GUID
+from edk2basetools.AutoGen.IncludesAutoGen import IncludesAutoGen
 
 ## Pattern to extract contents in EDK DXS files
 gDxsDependencyPattern = re.compile(r"DEPENDENCY_START(.+)DEPENDENCY_END", 
re.DOTALL)
@@ -2298,6 +2301,10 @@ def AddPlatformReport(self, Wa, MaList=None):
 def GenerateReport(self, BuildDuration, AutoGenTime, MakeTime, GenFdsTime):
 if self.ReportFile:
 try:
+
+if "COMPILE_INFO" in self.ReportType:
+self.GenerateCompileInfo()
+
 File = []
 for (Wa, MaList) in self.ReportList:
 PlatformReport(Wa, MaList, 
self.ReportType).GenerateReport(File, BuildDuration, AutoGenTime, MakeTime, 
GenFdsTime, self.ReportType)
@@ -2310,6 +2317,137 @@ def GenerateReport(self, BuildDuration, AutoGenTime, 
MakeTime, GenFdsTime):
 EdkLogger.error("BuildReport", CODE_ERROR, "Unknown fatal 
error when generating build report", ExtraData=self.ReportFile, 
RaiseError=False)
 EdkLogger.quiet("(Python %s on %s\n%s)" % 
(platform.python_version(), sys.platform, traceback.format_exc()))
 
+
+##
+# Generates compile data files to be used by external tools.
+# Compile information will be generated in 
///CompileInfo
+# Files generated: compile_commands.json, cscope.files, modules_report.json
+#
+# @param selfThe object pointer
+#
+def GenerateCompileInfo(self):
+try:
+# Lists for the output elements
+compile_commands = []
+used_files = set()
+module_report = []
+
+for (Wa, MaList) in self.ReportList:
+# Obtain list of all processed Workspace files
+for file_path in Wa._GetMetaFiles(Wa.BuildTarget, 
Wa.ToolChain):
+used_files.add(file_path)
+
+for autoGen in Wa.AutoGenObjectList:
+
+# Loop through all modules
+for module in (autoGen.LibraryAutoGenList + 
autoGen.ModuleAutoGenList):
+
+used_files.add(module.MetaFile.Path)
+
+# Main elements of module report
+module_report_data = {}
+module_report_data["Name"] = module.Name
+module_report_data["Arch"] = module.Arch
+ 

Re: [edk2-devel][PATCH V1 1/1] BaseTools: Generate compile information in build report

2023-02-27 Thread Guillermo Antonio Palomino Sosa
Hi. I have submitted a pull request to edk2-basetools repository: 
https://github.com/tianocore/edk2-basetools/pull/88
This is the feature request for it: 
https://github.com/tianocore/edk2-basetools/issues/87
I'm also attaching the patch here: 
(0001-BaseTools-Generate-compile-information-in-build-repo.patch)

On a side note, seems like tip of edk2-basetools is broken due this commit that 
makes direct import of Common package:
https://github.com/tianocore/edk2-basetools/commit/8e6018d3ea4c1aae7185f589d129cea14a5d89fd
edk2-basetools\edk2basetools\GenFds\SubTypeGuidSection.py:
import Common.LongFilePathOs as os


-Original Message-
From: Ni, Ray  
Sent: Wednesday, February 15, 2023 6:51 PM
To: Kinney, Michael D ; devel@edk2.groups.io; Chen, 
Christine ; Palomino Sosa, Guillermo A 

Cc: Feng, Bob C ; Gao, Liming 
Subject: RE: [edk2-devel][PATCH V1 1/1] BaseTools: Generate compile information 
in build report

Mike,
Thanks for the explanation of status and plan.

> -Original Message-
> From: Kinney, Michael D 
> Sent: Thursday, February 16, 2023 7:13 AM
> To: Ni, Ray ; devel@edk2.groups.io; Chen, Christine 
> ; Palomino Sosa, Guillermo A 
> 
> Cc: Feng, Bob C ; Gao, Liming 
> ; Kinney, Michael D 
> 
> Subject: RE: [edk2-devel][PATCH V1 1/1] BaseTools: Generate compile 
> information in build report
> 
> Hi Ray,
> 
> Right now we want the commit in both places.
> 
> The priority is edk2-basetools first.  It has more CI checks than edk2 
> repo for tools and packages up as a pip module.
> 
> As soon as edk2-basetools change is merged, the edk2 repo change can 
> be submitted and merged because the reviews have already been 
> completed by the BaseTools maintainers.
> 
> We do not like commit in 2 places.  As soon as possible, we would like 
> to see the python sources removed from edk2/BaseTools and all devs/CI 
> only use edk2- basetools for python based tools.
> 
> Mike
> 
> > -Original Message-
> > From: Ni, Ray 
> > Sent: Wednesday, February 15, 2023 12:17 AM
> > To: devel@edk2.groups.io; Chen, Christine ;
> Kinney, Michael D ; Palomino Sosa,
> > Guillermo A 
> > Cc: Feng, Bob C ; Gao, Liming
> 
> > Subject: RE: [edk2-devel][PATCH V1 1/1] BaseTools: Generate compile
> information in build report
> >
> > Christine,
> > If BaseTools related changes is implemented in edk2-basetools repo, 
> > does that mean if I only checkout edk2 repo, I am using an older 
> > version of
> BaseTools?
> >
> > Thanks,
> > Ray
> >
> > > -Original Message-
> > > From: devel@edk2.groups.io  On Behalf Of
> Yuwei
> > > Chen
> > > Sent: Wednesday, February 15, 2023 1:38 PM
> > > To: Kinney, Michael D ;
> devel@edk2.groups.io;
> > > Palomino Sosa, Guillermo A 
> > > Cc: Feng, Bob C ; Gao, Liming 
> > > 
> > > Subject: Re: [edk2-devel][PATCH V1 1/1] BaseTools: Generate 
> > > compile information in build report
> > >
> > > Hi Mike, thanks for reminder.
> > >
> > > Hi Willy, currently, BaseTools related changes will be implemented 
> > > on the edk2-basetools repo. Please send the patch based on the 
> > > edk2-basetools repo~
> > >
> > > Thanks,
> > > Christine
> > >
> > > > -Original Message-
> > > > From: Kinney, Michael D 
> > > > Sent: Wednesday, February 15, 2023 11:43 AM
> > > > To: devel@edk2.groups.io; Chen, Christine 
> > > > ; Palomino Sosa, Guillermo A 
> > > > 
> > > > Cc: Feng, Bob C ; Gao, Liming 
> > > > ; Kinney, Michael D 
> > > > 
> > > > Subject: RE: [edk2-devel][PATCH V1 1/1] BaseTools: Generate 
> > > > compile information in build report
> > > >
> > > > Has this been reviewed for edk2-basetools repo?
> > > >
> > > > Mike
> > > >
> > > > > -Original Message-
> > > > > From: devel@edk2.groups.io  On Behalf Of
> > > Yuwei
> > > > > Chen
> > > > > Sent: Tuesday, February 14, 2023 6:44 PM
> > > > > To: Palomino Sosa, Guillermo A
> ;
> > > > > devel@edk2.groups.io
> > > > > Cc: Feng, Bob C ; Gao, Liming 
> > > > > 
> > > > > Subject: Re: [edk2-devel][PATCH V1 1/1] BaseTools: Generate
> compile
> > > > > information in build report
> > > > >
> > > > > Reviewed-by: Yuwei Chen 
> > > > >
> > > > > > -Original Message-
> > > > > > From: Palomino Sosa, Guillermo A 
> > > > > > 
> > > > > > Sent: Tuesday, February 7, 2023 11:07 AM
> > > > > > To: devel@edk2.groups.io
> > > > > > Cc: Feng, Bob C ; Gao, Liming 
> > > > > > ; Chen, Christine
> 
> > > > > > Subject: [edk2-devel][PATCH V1 1/1] BaseTools: Generate 
> > > > > > compile information in build report
> > > > > >
> > > > > > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2850
> > > > > >
> > > > > > Add "-Y REPORT_INFO" option to build command to generate
> compile
> > > > > > information as part of BuildReport.
> > > > > > This option generates files to be used by external tools as 
> > > > > > IDE's to enhance functionality.
> > > > > > Files are created inside build folder:
> > > > > > ///CompileInfo
> > > > > >
> > > > > > Files created:
> > > > > > * compile_commands.json - Compilation Database. To be used

Re: [edk2-devel] [PATCH 1/1] Add a .editorconfig file to tell editors basic formatting details

2023-02-27 Thread Ard Biesheuvel
On Mon, 27 Feb 2023 at 17:35, Rebecca Cran  wrote:
>
> Is it just .sh files that need lf endings, or are there others?
>

I think this only applies to .sh files.

>
>
> On 2/27/23 9:14 AM, Michael D Kinney wrote:
> > There are a few file types that must be lf instead of crlf.  Can those be 
> > added as well?
> >
> > Mike
> >
> >> -Original Message-
> >> From: devel@edk2.groups.io  On Behalf Of Rebecca Cran
> >> Sent: Monday, February 27, 2023 5:03 AM
> >> To: Ard Biesheuvel ; devel@edk2.groups.io
> >> Cc: Andrew Fish ; Leif Lindholm 
> >> ; Kinney, Michael D 
> >> Subject: Re: [edk2-devel] [PATCH 1/1] Add a .editorconfig file to tell 
> >> editors basic formatting details
> >>
> >> On 2/27/23 1:04 AM, Ard Biesheuvel wrote:
> >>
> >>> On Mon, 27 Feb 2023 at 04:47, Rebecca Cran  wrote:
>  Add a .editorconfig file which editors can use for basic formatting
>  details of files, such as tabs/spaces, line endings etc.
> 
>  Signed-off-by: Rebecca Cran 
> >>> Thank you very much for this - this is very useful.
> >>>
> >>> Acked-by: Ard Biesheuvel 
> >>>
> >>> Could we add .dsc/.inf/.dec/etc files as well?
> >> I'll move the c/c++ indentation up to the [*] section so it applies to
> >> .dsc/.inf/etc too.
> >>
> >>
> >> --
> >> Rebecca Cran
> >>
> >>
> >>
> >>
> >>
> >
> >
> >
> >
> >
>
>
> 
>
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100517): https://edk2.groups.io/g/devel/message/100517
Mute This Topic: https://groups.io/mt/97259592/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] Add a .editorconfig file to tell editors basic formatting details

2023-02-27 Thread Michael D Kinney
.gitmodules also must also use tabs.

> -Original Message-
> From: Kinney, Michael D 
> Sent: Monday, February 27, 2023 10:22 AM
> To: Ard Biesheuvel ; devel@edk2.groups.io; rebe...@bsdio.com
> Cc: Andrew Fish ; Leif Lindholm ; 
> Kinney, Michael D 
> Subject: RE: [edk2-devel] [PATCH 1/1] Add a .editorconfig file to tell 
> editors basic formatting details
> 
> .gitmodules must be lf.  Not sure about other git config files.
> 
> Mike
> 
> > -Original Message-
> > From: Ard Biesheuvel 
> > Sent: Monday, February 27, 2023 10:18 AM
> > To: devel@edk2.groups.io; rebe...@bsdio.com
> > Cc: Kinney, Michael D ; Andrew Fish 
> > ; Leif Lindholm 
> > Subject: Re: [edk2-devel] [PATCH 1/1] Add a .editorconfig file to tell 
> > editors basic formatting details
> >
> > On Mon, 27 Feb 2023 at 17:35, Rebecca Cran  wrote:
> > >
> > > Is it just .sh files that need lf endings, or are there others?
> > >
> >
> > I think this only applies to .sh files.
> >
> > >
> > >
> > > On 2/27/23 9:14 AM, Michael D Kinney wrote:
> > > > There are a few file types that must be lf instead of crlf.  Can those 
> > > > be added as well?
> > > >
> > > > Mike
> > > >
> > > >> -Original Message-
> > > >> From: devel@edk2.groups.io  On Behalf Of Rebecca 
> > > >> Cran
> > > >> Sent: Monday, February 27, 2023 5:03 AM
> > > >> To: Ard Biesheuvel ; devel@edk2.groups.io
> > > >> Cc: Andrew Fish ; Leif Lindholm 
> > > >> ; Kinney, Michael D
> > 
> > > >> Subject: Re: [edk2-devel] [PATCH 1/1] Add a .editorconfig file to tell 
> > > >> editors basic formatting details
> > > >>
> > > >> On 2/27/23 1:04 AM, Ard Biesheuvel wrote:
> > > >>
> > > >>> On Mon, 27 Feb 2023 at 04:47, Rebecca Cran  wrote:
> > >  Add a .editorconfig file which editors can use for basic formatting
> > >  details of files, such as tabs/spaces, line endings etc.
> > > 
> > >  Signed-off-by: Rebecca Cran 
> > > >>> Thank you very much for this - this is very useful.
> > > >>>
> > > >>> Acked-by: Ard Biesheuvel 
> > > >>>
> > > >>> Could we add .dsc/.inf/.dec/etc files as well?
> > > >> I'll move the c/c++ indentation up to the [*] section so it applies to
> > > >> .dsc/.inf/etc too.
> > > >>
> > > >>
> > > >> --
> > > >> Rebecca Cran
> > > >>
> > > >>
> > > >>
> > > >>
> > > >>
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > > 
> > >
> > >


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100518): https://edk2.groups.io/g/devel/message/100518
Mute This Topic: https://groups.io/mt/97259592/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] Add a .editorconfig file to tell editors basic formatting details

2023-02-27 Thread Michael D Kinney
.gitmodules must be lf.  Not sure about other git config files.

Mike

> -Original Message-
> From: Ard Biesheuvel 
> Sent: Monday, February 27, 2023 10:18 AM
> To: devel@edk2.groups.io; rebe...@bsdio.com
> Cc: Kinney, Michael D ; Andrew Fish 
> ; Leif Lindholm 
> Subject: Re: [edk2-devel] [PATCH 1/1] Add a .editorconfig file to tell 
> editors basic formatting details
> 
> On Mon, 27 Feb 2023 at 17:35, Rebecca Cran  wrote:
> >
> > Is it just .sh files that need lf endings, or are there others?
> >
> 
> I think this only applies to .sh files.
> 
> >
> >
> > On 2/27/23 9:14 AM, Michael D Kinney wrote:
> > > There are a few file types that must be lf instead of crlf.  Can those be 
> > > added as well?
> > >
> > > Mike
> > >
> > >> -Original Message-
> > >> From: devel@edk2.groups.io  On Behalf Of Rebecca 
> > >> Cran
> > >> Sent: Monday, February 27, 2023 5:03 AM
> > >> To: Ard Biesheuvel ; devel@edk2.groups.io
> > >> Cc: Andrew Fish ; Leif Lindholm 
> > >> ; Kinney, Michael D
> 
> > >> Subject: Re: [edk2-devel] [PATCH 1/1] Add a .editorconfig file to tell 
> > >> editors basic formatting details
> > >>
> > >> On 2/27/23 1:04 AM, Ard Biesheuvel wrote:
> > >>
> > >>> On Mon, 27 Feb 2023 at 04:47, Rebecca Cran  wrote:
> >  Add a .editorconfig file which editors can use for basic formatting
> >  details of files, such as tabs/spaces, line endings etc.
> > 
> >  Signed-off-by: Rebecca Cran 
> > >>> Thank you very much for this - this is very useful.
> > >>>
> > >>> Acked-by: Ard Biesheuvel 
> > >>>
> > >>> Could we add .dsc/.inf/.dec/etc files as well?
> > >> I'll move the c/c++ indentation up to the [*] section so it applies to
> > >> .dsc/.inf/etc too.
> > >>
> > >>
> > >> --
> > >> Rebecca Cran
> > >>
> > >>
> > >>
> > >>
> > >>
> > >
> > >
> > >
> > >
> > >
> >
> >
> > 
> >
> >


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100519): https://edk2.groups.io/g/devel/message/100519
Mute This Topic: https://groups.io/mt/97259592/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] [RESEND] [PATCH v2 2/2] OvmfPkg/ResetVector: Exclude SEV launch secrets page from pre-validation

2023-02-27 Thread Lendacky, Thomas via groups.io

On 2/23/23 09:04, Dov Murik wrote:



On 23/02/2023 16:58, Dov Murik wrote:



On 21/02/2023 11:38, Gerd Hoffmann wrote:

On Mon, Feb 20, 2023 at 08:44:23AM -0600, Tom Lendacky wrote:

On 2/20/23 02:49, Dov Murik wrote:

In order to allow the VMM (such as QEMU) to add a page with hashes of
kernel/initrd/cmdline for measured direct boot on SNP, this page must
not be part of the SNP metadata list reported to the VMM.

Check if that page is defined; if it is, skip it in the metadata list.
In such case, VMM should fill the page with the hashes content, or
explicitly update it as a zero page (if kernel hashes are not used).


Would it be better to define a new section type (similar to what I did in
the SVSM PoC)? This way, it remains listed in the metadata and allows the
VMM to detect it and decide how to handle it.


Explicitly describing things sounds better to me too.



Thanks for the feedback Tom and Gerd.


I can define a new section type OVMF_SECTION_TYPE_KERNEL_HASHES. In the AmdSev
target it'll cover the single MEMFD page at 00F000 (after the CPUID page).
Now there's a question for the QEMU side -- should QEMU then fill the page
and encrypt it (launch_update type=NORMAL)? (currently the whole hashes table
creation and encryption is done elsewhere there)


Yes, I think that is the way to go. Allocate a page in Qemu, zero it out, 
fill in the hash values at the proper location and then do a launch update 
for type NORMAL page. You can use the section type to identify the data 
you need to retrieve and encrypt.




And on regular OvmfX64 builds - should that area should be with type
OVMF_SECTION_TYPE_SNP_SEC_MEM which is accepted as a type=ZERO page ?


Playing with this idea, the metadata list will add:


; Kernel hashes section for measured direct boot
%define OVMF_SECTION_TYPE_KERNEL_HASHES   0x5

...

; Kernel hashes for measured direct boot, or zero page if
; there are no kernel hashes / SEV secrets
SevSnpKernelHashes:
   DD  SEV_SNP_KERNEL_HASHES_BASE
   DD  SEV_SNP_KERNEL_HASHES_SIZE
   DD  SEV_SNP_KERNEL_HASHES_TYPE



Or maybe this metadata section ^ should be added only if the Pcd for
secrets+hashes page is defined?


That would be optimal if you could do that.

Thanks,
Tom



-Dov




and the base/size/type of that region are defined in an
%if statement in ResetVector.nasmb:


%if (FixedPcdGet32 (PcdSevLaunchSecretBase) > 0)
   ; There's a reserved page for SEV secrets and hashes; the VMM will fill and
   ; validate the page
   %define SEV_SNP_KERNEL_HASHES_TYPEOVMF_SECTION_TYPE_KERNEL_HASHES
   %define SEV_SNP_KERNEL_HASHES_BASE(FixedPcdGet32 
(PcdSevLaunchSecretBase))
%else
   ; No SEV secrets and hashes page; the VMM will validate it as another zero 
page
   %define SEV_SNP_KERNEL_HASHES_TYPEOVMF_SECTION_TYPE_SNP_SEC_MEM
   %define SEV_SNP_KERNEL_HASHES_BASE(CPUID_BASE + CPUID_SIZE)
%endif
%define SEV_SNP_KERNEL_HASHES_SIZE(FixedPcdGet32 (PcdOvmfSecPeiTempRamBase) 
- SEV_SNP_KERNEL_HASHES_BASE)


(I still need to figure out the point about QEMU above.)


Is that what you had in mind?

-Dov



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




Re: [edk2-devel][PATCH V1 1/1] BaseTools: Generate compile information in build report

2023-02-27 Thread Ard Biesheuvel
On Mon, 27 Feb 2023 at 18:40, Guillermo Antonio Palomino Sosa
 wrote:
>
> Hi. I have submitted a pull request to edk2-basetools repository: 
> https://github.com/tianocore/edk2-basetools/pull/88
> This is the feature request for it: 
> https://github.com/tianocore/edk2-basetools/issues/87
> I'm also attaching the patch here: 
> (0001-BaseTools-Generate-compile-information-in-build-repo.patch)
>
> On a side note, seems like tip of edk2-basetools is broken due this commit 
> that makes direct import of Common package:
> https://github.com/tianocore/edk2-basetools/commit/8e6018d3ea4c1aae7185f589d129cea14a5d89fd
> edk2-basetools\edk2basetools\GenFds\SubTypeGuidSection.py:
> import Common.LongFilePathOs as os
>
>

I sent a fix and a PR for this about a month ago:

https://github.com/tianocore/edk2-basetools/pull/86

but CodeCov seems to take issue with it, for reasons I don't
understand (and I can't be bothered to spend more time on yet another
CI automation pass that adds to my workload rather than reduce it)


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




Re: [edk2-devel][PATCH V1 1/1] BaseTools: Generate compile information in build report

2023-02-27 Thread Michael D Kinney
Hi Guillermo,

Can you please look at Ards PR and make sure his fix is included in your PR.

Also, please work with Christine and Bob to see what is going on with the
Code Coverage check.  We do want it to be easy for all community members to
submit change requests.  We may need support from the edk2-bastools maintainers
to help with CI issues and help with changes to address.

Thanks,

Mike

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Ard Biesheuvel
> Sent: Monday, February 27, 2023 10:58 AM
> To: devel@edk2.groups.io; Palomino Sosa, Guillermo A 
> 
> Cc: Ni, Ray ; Kinney, Michael D 
> ; Chen, Christine ; Feng,
> Bob C ; Gao, Liming ; Oram, 
> Isaac W ; Sean Brogan
> 
> Subject: Re: [edk2-devel][PATCH V1 1/1] BaseTools: Generate compile 
> information in build report
> 
> On Mon, 27 Feb 2023 at 18:40, Guillermo Antonio Palomino Sosa
>  wrote:
> >
> > Hi. I have submitted a pull request to edk2-basetools repository: 
> > https://github.com/tianocore/edk2-basetools/pull/88
> > This is the feature request for it: 
> > https://github.com/tianocore/edk2-basetools/issues/87
> > I'm also attaching the patch here: 
> > (0001-BaseTools-Generate-compile-information-in-build-repo.patch)
> >
> > On a side note, seems like tip of edk2-basetools is broken due this commit 
> > that makes direct import of Common package:
> > https://github.com/tianocore/edk2-basetools/commit/8e6018d3ea4c1aae7185f589d129cea14a5d89fd
> > edk2-basetools\edk2basetools\GenFds\SubTypeGuidSection.py:
> > import Common.LongFilePathOs as os
> >
> >
> 
> I sent a fix and a PR for this about a month ago:
> 
> https://github.com/tianocore/edk2-basetools/pull/86
> 
> but CodeCov seems to take issue with it, for reasons I don't
> understand (and I can't be bothered to spend more time on yet another
> CI automation pass that adds to my workload rather than reduce it)
> 
> 
> 
> 



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




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

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

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

*Where:*
https://github.com/tianocore/edk2/discussions/2614

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

*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 (#100523): https://edk2.groups.io/g/devel/message/100523
Mute This Topic: https://groups.io/mt/97256592/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 edk2-platforms 0/3] IpmiFeaturePkg: fix IPMI GetSelfTest command response

2023-02-27 Thread Mike Maslenkin
This patchset fixes "Get Self Test Results" IPMI command response processing.
The first patch just makes a fix.
The second patch removes a transfer buffer from IPMI instance data as a
preparation of further improvement. It's not clear why a buffer of
a maximum size used for all commands. For the command mentioned above
response contains only 3 bytes. 
The third patch drops raw byte array usage while parsing command
response because structure for this response is already defined in edk2.

Checked compilation for the Intel’s Aowanda platform using GCC5
toolchain.

Signed-off-by: Mike Maslenkin 
CC: Isaac Oram 
CC: Nate DeSimone 
CC: Liming Gao 



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




[edk2-devel] [PATCH edk2-platforms 1/3] IpmiFeaturePkg: fix IPMI GetSelfTest command response parsing

2023-02-27 Thread Mike Maslenkin
Byte 0 of a response contains completion code for the command.
So, the examined data starts from byte 1. It's easy to make a mistake
here since specification counts response data from 1.

For the "Get Self Test Results" command Intelligent Platform Management
Interface Specification v2.0 rev 1.1 paragraph 20.4 defines response as:
+-+---+
|byte | data field|
+-+---+
| 1   | Completion Code   |
| |   |
| 2   | 55h =  No error. All Self Tests Passed.   |
| | 56h = Self Test function not implemented in this controller.  |
| | 57h = Corrupted or inaccessible data or devices   |
| | 58h = Fatal hardware error|
| |   |
| 3   | For byte 2 = 55h, 56h, FFh: 00h   |
| | For byte 2 = 58h, all other: Device-specific  |
| | For byte 2 = 57h: self-test error bitfield.   |
+-+---+

Signed-off-by: Mike Maslenkin 
---
 .../IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c
index d788b4886723..aeaefaad642e 100644
--- 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c
+++ 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c
@@ -161,7 +161,7 @@ Returns:
 // Check the IPMI defined self test results.
 // Additional Cases are device specific test results.
 //
-switch (IpmiInstance->TempData[0]) {
+switch (IpmiInstance->TempData[1]) {
   case IPMI_APP_SELFTEST_NO_ERROR:
   case IPMI_APP_SELFTEST_NOT_IMPLEMENTED:
 IpmiInstance->BmcStatus = BMC_OK;
@@ -173,7 +173,7 @@ Returns:
 // BootBlock Firmware corruption, and Operational Firmware Corruption. 
 All
 // other errors are BMC soft failures.
 //
-if ((IpmiInstance->TempData[1] & (IPMI_APP_SELFTEST_FRU_CORRUPT | 
IPMI_APP_SELFTEST_FW_BOOTBLOCK_CORRUPT | IPMI_APP_SELFTEST_FW_CORRUPT)) != 0) {
+if ((IpmiInstance->TempData[2] & (IPMI_APP_SELFTEST_FRU_CORRUPT | 
IPMI_APP_SELFTEST_FW_BOOTBLOCK_CORRUPT | IPMI_APP_SELFTEST_FW_CORRUPT)) != 0) {
   IpmiInstance->BmcStatus = BMC_HARDFAIL;
 } else {
   IpmiInstance->BmcStatus = BMC_SOFTFAIL;
@@ -181,7 +181,7 @@ Returns:
 //
 // Check if SDR repository is empty and report it if it is.
 //
-if ((IpmiInstance->TempData[1] & 
IPMI_APP_SELFTEST_SDR_REPOSITORY_EMPTY) != 0) {
+if ((IpmiInstance->TempData[2] & 
IPMI_APP_SELFTEST_SDR_REPOSITORY_EMPTY) != 0) {
   if (*ErrorCount < MAX_SOFT_COUNT) {
 StatusCodeValue[*ErrorCount] = 
EFI_COMPUTING_UNIT_FIRMWARE_PROCESSOR | CU_FP_EC_SDR_EMPTY;
 (*ErrorCount)++;
-- 
2.35.3



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




[edk2-devel] [PATCH edk2-platforms 2/3] IpmiFeaturePkg: remove buffer temporary buffer from BMC instance structure

2023-02-27 Thread Mike Maslenkin
There is no point to have temporary buffer in BMC instance data
used only for synchronous IPMI command as a transfer buffer.
Using local variables make things much simpler.

Signed-off-by: Mike Maslenkin 
---
 .../GenericIpmi/Common/IpmiBmc.c  |  5 ++-
 .../GenericIpmi/Common/IpmiBmcCommon.h|  1 -
 .../IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c | 39 ++-
 .../GenericIpmi/Pei/PeiGenericIpmi.c  | 11 +++---
 .../GenericIpmi/Pei/PeiIpmiBmc.c  |  5 ++-
 .../GenericIpmi/Pei/PeiIpmiBmcDef.h   |  1 -
 6 files changed, 33 insertions(+), 29 deletions(-)

diff --git 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmc.c
 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmc.c
index 03b8174e3786..a6be2f46e84e 100644
--- 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmc.c
+++ 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmc.c
@@ -101,6 +101,7 @@ Returns:
   IPMI_RESPONSE   *IpmiResponse;
   UINT8   RetryCnt = IPMI_SEND_COMMAND_MAX_RETRY;
   UINT8   Index;
+  UINT8   TempData[MAX_TEMP_DATA];
 
   IpmiInstance = INSTANCE_FROM_SM_IPMI_BMC_THIS (This);
 
@@ -110,8 +111,8 @@ Returns:
 // response data.  Since the command format is different from the response
 // format, the buffer is cast to both structure definitions.
 //
-IpmiCommand  = (IPMI_COMMAND*)  IpmiInstance->TempData;
-IpmiResponse = (IPMI_RESPONSE*) IpmiInstance->TempData;
+IpmiCommand  = (IPMI_COMMAND*)  TempData;
+IpmiResponse = (IPMI_RESPONSE*) TempData;
 
 //
 // Send IPMI command to BMC
diff --git 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmcCommon.h
 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmcCommon.h
index 1e5dfd81f1fb..06eab62aaec9 100644
--- 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmcCommon.h
+++ 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmcCommon.h
@@ -50,7 +50,6 @@ typedef struct {
   UINTN   Signature;
   UINT64  KcsTimeoutPeriod;
   UINT8   SlaveAddress;
-  UINT8   TempData[MAX_TEMP_DATA];
   BMC_STATUS  BmcStatus;
   UINT64  ErrorStatus;
   UINT8   SoftErrorCount;
diff --git 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c
index aeaefaad642e..8a0c596a6434 100644
--- 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c
+++ 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c
@@ -84,6 +84,7 @@ Returns:
   UINT8   *TempPtr;
   UINT32  Retries;
   BOOLEAN bResultFlag = FALSE;
+  UINT8   TempData[MAX_TEMP_DATA];
 
   //
   // Get the SELF TEST Results.
@@ -97,9 +98,9 @@ Returns:
 Retries = PcdGet8 (PcdIpmiBmcReadyDelayTimer);
   }
 
-  DataSize = sizeof (IpmiInstance->TempData);
+  DataSize = sizeof (TempData);
 
-  IpmiInstance->TempData[1] = 0;
+  TempData[1] = 0;
 
   do {
 Status = IpmiSendCommand (
@@ -109,11 +110,11 @@ Returns:
IPMI_APP_GET_SELFTEST_RESULTS,
NULL,
0,
-   IpmiInstance->TempData,
+   TempData,
&DataSize
);
 if (Status == EFI_SUCCESS) {
-  switch (IpmiInstance->TempData[1]) {
+  switch (TempData[1]) {
 case IPMI_APP_SELFTEST_NO_ERROR:
 case IPMI_APP_SELFTEST_NOT_IMPLEMENTED:
 case IPMI_APP_SELFTEST_ERROR:
@@ -146,7 +147,7 @@ Returns:
 IpmiInstance->BmcStatus = BMC_HARDFAIL;
 return Status;
   } else {
-DEBUG ((EFI_D_INFO, "[IPMI] BMC self-test result: %02X-%02X\n", 
IpmiInstance->TempData[1], IpmiInstance->TempData[2]));
+DEBUG ((DEBUG_INFO, "[IPMI] BMC self-test result: %02X-%02X\n", 
TempData[1], TempData[2]));
 //
 // Copy the Self test results to Error Status.  Data will be copied as 
long as it
 // does not exceed the size of the ErrorStatus variable.
@@ -155,13 +156,13 @@ Returns:
  (Index < DataSize) && (Index < sizeof (IpmiInstance->ErrorStatus));
  Index++, TempPtr++
  ) {
-  *TempPtr = IpmiInstance->TempData[Index];
+  *TempPtr = TempData[Index];
 }
 //
 // Check the IPMI defined self test results.
 // Additional Cases are device specific test results.
 //
-switch (IpmiInstance->TempData[1]) {
+switch (TempData[1]) {
   case IPMI_APP_SELFTEST_NO_ERROR:
   case IPMI_APP_SELFTEST_NOT_IMPLEMENTED:
 IpmiInstance->BmcStatus = BMC_OK;
@@ -173,7 +174,7 @@ Returns:
 // BootBlock Firmware corruption, and Operational Firmware Corruption. 
 All
 // other errors are BMC soft failures.
 //
-if ((IpmiIn

[edk2-devel] [PATCH edk2-platforms 3/3] IpmiFeaturePkg: refine GetSelfTest function

2023-02-27 Thread Mike Maslenkin
Use predefined type while accessing IPMI command returned data
instead of raw byte array.

Signed-off-by: Mike Maslenkin 
---
 .../IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c | 15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c
index 8a0c596a6434..1db47e28c54e 100644
--- 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c
+++ 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c
@@ -86,6 +86,8 @@ Returns:
   BOOLEAN bResultFlag = FALSE;
   UINT8   TempData[MAX_TEMP_DATA];
 
+  IPMI_SELF_TEST_RESULT_RESPONSE *pSelfTestResult;
+
   //
   // Get the SELF TEST Results.
   //
@@ -100,7 +102,8 @@ Returns:
 
   DataSize = sizeof (TempData);
 
-  TempData[1] = 0;
+  pSelfTestResult = (IPMI_SELF_TEST_RESULT_RESPONSE*)&TempData[0];
+  pSelfTestResult->CompletionCode = 0;
 
   do {
 Status = IpmiSendCommand (
@@ -114,7 +117,7 @@ Returns:
&DataSize
);
 if (Status == EFI_SUCCESS) {
-  switch (TempData[1]) {
+  switch (pSelfTestResult->Result) {
 case IPMI_APP_SELFTEST_NO_ERROR:
 case IPMI_APP_SELFTEST_NOT_IMPLEMENTED:
 case IPMI_APP_SELFTEST_ERROR:
@@ -147,7 +150,7 @@ Returns:
 IpmiInstance->BmcStatus = BMC_HARDFAIL;
 return Status;
   } else {
-DEBUG ((DEBUG_INFO, "[IPMI] BMC self-test result: %02X-%02X\n", 
TempData[1], TempData[2]));
+DEBUG ((DEBUG_INFO, "[IPMI] BMC self-test result: %02X-%02X\n", 
pSelfTestResult->Result, pSelfTestResult->Param));
 //
 // Copy the Self test results to Error Status.  Data will be copied as 
long as it
 // does not exceed the size of the ErrorStatus variable.
@@ -162,7 +165,7 @@ Returns:
 // Check the IPMI defined self test results.
 // Additional Cases are device specific test results.
 //
-switch (TempData[1]) {
+switch (pSelfTestResult->Result) {
   case IPMI_APP_SELFTEST_NO_ERROR:
   case IPMI_APP_SELFTEST_NOT_IMPLEMENTED:
 IpmiInstance->BmcStatus = BMC_OK;
@@ -174,7 +177,7 @@ Returns:
 // BootBlock Firmware corruption, and Operational Firmware Corruption. 
 All
 // other errors are BMC soft failures.
 //
-if ((TempData[2] & (IPMI_APP_SELFTEST_FRU_CORRUPT | 
IPMI_APP_SELFTEST_FW_BOOTBLOCK_CORRUPT | IPMI_APP_SELFTEST_FW_CORRUPT)) != 0) {
+if ((pSelfTestResult->Param & (IPMI_APP_SELFTEST_FRU_CORRUPT | 
IPMI_APP_SELFTEST_FW_BOOTBLOCK_CORRUPT | IPMI_APP_SELFTEST_FW_CORRUPT)) != 0) {
   IpmiInstance->BmcStatus = BMC_HARDFAIL;
 } else {
   IpmiInstance->BmcStatus = BMC_SOFTFAIL;
@@ -182,7 +185,7 @@ Returns:
 //
 // Check if SDR repository is empty and report it if it is.
 //
-if ((TempData[2] & IPMI_APP_SELFTEST_SDR_REPOSITORY_EMPTY) != 0) {
+if ((pSelfTestResult->Param & IPMI_APP_SELFTEST_SDR_REPOSITORY_EMPTY) 
!= 0) {
   if (*ErrorCount < MAX_SOFT_COUNT) {
 StatusCodeValue[*ErrorCount] = 
EFI_COMPUTING_UNIT_FIRMWARE_PROCESSOR | CU_FP_EC_SDR_EMPTY;
 (*ErrorCount)++;
-- 
2.35.3



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




Re: [edk2-devel][PATCH V1 1/1] BaseTools: Generate compile information in build report

2023-02-27 Thread Guillermo Antonio Palomino Sosa
I have updated the pull based on Sean feedback. I added following fields to 
module_report.json:
* LibraryClass
* ModuleEntryPointList
* ConstructorList
* DestructorList

I have also added commit from Ard based on this request to fix build issue:
https://github.com/tianocore/edk2-basetools/pull/88

Thanks

-Original Message-
From: Kinney, Michael D  
Sent: Monday, February 27, 2023 4:36 PM
To: devel@edk2.groups.io; a...@kernel.org; Palomino Sosa, Guillermo A 

Cc: Ni, Ray ; Chen, Christine ; Feng, 
Bob C ; Gao, Liming ; Oram, 
Isaac W ; Sean Brogan ; 
Kinney, Michael D 
Subject: RE: [edk2-devel][PATCH V1 1/1] BaseTools: Generate compile information 
in build report

Hi Guillermo,

Can you please look at Ards PR and make sure his fix is included in your PR.

Also, please work with Christine and Bob to see what is going on with the Code 
Coverage check.  We do want it to be easy for all community members to submit 
change requests.  We may need support from the edk2-bastools maintainers to 
help with CI issues and help with changes to address.

Thanks,

Mike

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Ard 
> Biesheuvel
> Sent: Monday, February 27, 2023 10:58 AM
> To: devel@edk2.groups.io; Palomino Sosa, Guillermo A 
> 
> Cc: Ni, Ray ; Kinney, Michael D 
> ; Chen, Christine ; 
> Feng, Bob C ; Gao, Liming 
> ; Oram, Isaac W ; 
> Sean Brogan 
> Subject: Re: [edk2-devel][PATCH V1 1/1] BaseTools: Generate compile 
> information in build report
> 
> On Mon, 27 Feb 2023 at 18:40, Guillermo Antonio Palomino Sosa 
>  wrote:
> >
> > Hi. I have submitted a pull request to edk2-basetools repository: 
> > https://github.com/tianocore/edk2-basetools/pull/88
> > This is the feature request for it: 
> > https://github.com/tianocore/edk2-basetools/issues/87
> > I'm also attaching the patch here: 
> > (0001-BaseTools-Generate-compile-information-in-build-repo.patch)
> >
> > On a side note, seems like tip of edk2-basetools is broken due this commit 
> > that makes direct import of Common package:
> > https://github.com/tianocore/edk2-basetools/commit/8e6018d3ea4c1aae7
> > 185f589d129cea14a5d89fd
> > edk2-basetools\edk2basetools\GenFds\SubTypeGuidSection.py:
> > import Common.LongFilePathOs as os
> >
> >
> 
> I sent a fix and a PR for this about a month ago:
> 
> https://github.com/tianocore/edk2-basetools/pull/86
> 
> but CodeCov seems to take issue with it, for reasons I don't 
> understand (and I can't be bothered to spend more time on yet another 
> CI automation pass that adds to my workload rather than reduce it)
> 
> 
> 
> 



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




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

2023-02-27 Thread Group Notification
*Tools, CI, Code base construction meeting series*

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

*Where:*
https://github.com/tianocore/edk2/discussions/2614

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

*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 (#100529): https://edk2.groups.io/g/devel/message/100529
Mute This Topic: https://groups.io/mt/97280464/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]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v4 0/9] merge UefiCpuPkg/UefiCpuLib to MdePkg/CpuLib

2023-02-27 Thread Zhiguang Liu
Hi Gerd,

Yes, just like you said, no code logic modified, just relocation.

And thanks for your suggestion, but since it is a simple code change, but 
contains too many patches, if it is ok for you, I don't plan to send the whole 
patch series this time.

Thanks
Zhiguang

> -Original Message-
> From: Gerd Hoffmann 
> Sent: Monday, February 27, 2023 5:21 PM
> To: devel@edk2.groups.io; Liu, Zhiguang 
> Cc: Ard Biesheuvel ; Yao, Jiewen
> ; Justen, Jordan L 
> Subject: Re: [edk2-devel] [PATCH v4 0/9] merge UefiCpuPkg/UefiCpuLib to
> MdePkg/CpuLib
> 
> On Mon, Feb 27, 2023 at 03:23:57PM +0800, Zhiguang Liu wrote:
> > V4:
> > This patch set has already gotten reviewed-by except OvmfPkg. Also V4
> has a little code change for OvmfPkg.
> > So I only sent pathces about OvmfPkg (patch NO.1 and NO.4) to avoid
> disturbing other Package Maintainers.
> > Other patches can check the V3 version or check the PR link
> > https://github.com/tianocore/edk2/pull/4066
> 
> It is perfectly fine to repost the whole series, especially when v3 was posted
> months ago.  It's good to add any review tags to the patches though to make
> clear which are reviewed already and which are not.
> 
> > UefiCpuPkg which does not meet the design spec. So merge UefiCpuLib to
> > CpuLib is a good way to sovle these problems. To minimize the
> > impact,this change is carried out in four steps.
> 
> >  rename {UefiCpuPkg/Library/BaseUefiCpuLib =>
> > MdePkg/Library/BaseCpuLib}/Ia32/InitializeFpu.nasm (100%)  rename
> > {UefiCpuPkg/Library/BaseUefiCpuLib =>
> > MdePkg/Library/BaseCpuLib}/X64/InitializeFpu.nasm (100%)  rename
> > UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.c =>
> > MdePkg/Library/BaseCpuLib/X86BaseCpuLib.c (93%)
> 
> So in essence this series moves the code unmodified (other than some
> reaming due to the new location) and updates all references?
> 
> take care,
>   Gerd



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




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

2023-02-27 Thread Group Notification
*Reminder: TianoCore Bug Triage - APAC / NAMO*

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

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

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

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

*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&ivr=teams&d=conf.intel.com&test=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&tenantId=46c98d88-e344-4ed4-8496-4ed7712e255d&threadId=19_meeting_OTUyZTg2NjgtNDhlNS00ODVlLTllYTUtYzg1OTNjNjdiZjFh@thread.v2&messageId=0&language=en-US
 )


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100531): https://edk2.groups.io/g/devel/message/100531
Mute This Topic: https://groups.io/mt/97282624/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] CryptoPkg/OpensslLib: Upgrade OpenSSL to 1.1.1t

2023-02-27 Thread Sheng Wei
Upgrade openssl to 1.1.1t
Pick up bugfixes from the latest openssl release.

Cc: Jian J Wang 
Cc: Jiewen Yao 
Cc: Xiaoyu Lu 
Cc: Guomin Jiang 
Signed-off-by: Sheng Wei 
---
 CryptoPkg/Library/OpensslLib/OpensslLib.inf  | 1 +
 CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf | 1 +
 CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf| 1 +
 CryptoPkg/Library/OpensslLib/OpensslLibFull.inf  | 1 +
 CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf | 1 +
 CryptoPkg/Library/OpensslLib/openssl | 2 +-
 6 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf 
b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
index 60c6c24b0a..1474df8125 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
@@ -162,6 +162,7 @@
   $(OPENSSL_PATH)/crypto/bn/bn_srp.c
   $(OPENSSL_PATH)/crypto/bn/bn_word.c
   $(OPENSSL_PATH)/crypto/bn/bn_x931p.c
+  $(OPENSSL_PATH)/crypto/bn/rsa_sup_mul.c
   $(OPENSSL_PATH)/crypto/buffer/buf_err.c
   $(OPENSSL_PATH)/crypto/buffer/buffer.c
   $(OPENSSL_PATH)/crypto/cmac/cm_ameth.c
diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf 
b/CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf
index 103ef7bda2..3c5f6d5d17 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf
@@ -163,6 +163,7 @@
   $(OPENSSL_PATH)/crypto/bn/bn_srp.c
   $(OPENSSL_PATH)/crypto/bn/bn_word.c
   $(OPENSSL_PATH)/crypto/bn/bn_x931p.c
+  $(OPENSSL_PATH)/crypto/bn/rsa_sup_mul.c
   $(OPENSSL_PATH)/crypto/buffer/buf_err.c
   $(OPENSSL_PATH)/crypto/buffer/buffer.c
   $(OPENSSL_PATH)/crypto/cmac/cm_ameth.c
diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf 
b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
index c4eaea888c..a9adb94720 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
@@ -163,6 +163,7 @@
   $(OPENSSL_PATH)/crypto/bn/bn_srp.c
   $(OPENSSL_PATH)/crypto/bn/bn_word.c
   $(OPENSSL_PATH)/crypto/bn/bn_x931p.c
+  $(OPENSSL_PATH)/crypto/bn/rsa_sup_mul.c
   $(OPENSSL_PATH)/crypto/buffer/buf_err.c
   $(OPENSSL_PATH)/crypto/buffer/buffer.c
   $(OPENSSL_PATH)/crypto/cmac/cm_ameth.c
diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibFull.inf 
b/CryptoPkg/Library/OpensslLib/OpensslLibFull.inf
index 309e43055c..4c2cbe9cf7 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibFull.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibFull.inf
@@ -167,6 +167,7 @@
   $(OPENSSL_PATH)/crypto/bn/bn_srp.c
   $(OPENSSL_PATH)/crypto/bn/bn_word.c
   $(OPENSSL_PATH)/crypto/bn/bn_x931p.c
+  $(OPENSSL_PATH)/crypto/bn/rsa_sup_mul.c
   $(OPENSSL_PATH)/crypto/buffer/buf_err.c
   $(OPENSSL_PATH)/crypto/buffer/buffer.c
   $(OPENSSL_PATH)/crypto/cmac/cm_ameth.c
diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf 
b/CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf
index 4b79bd..591c57fdc2 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf
@@ -168,6 +168,7 @@
   $(OPENSSL_PATH)/crypto/bn/bn_srp.c
   $(OPENSSL_PATH)/crypto/bn/bn_word.c
   $(OPENSSL_PATH)/crypto/bn/bn_x931p.c
+  $(OPENSSL_PATH)/crypto/bn/rsa_sup_mul.c
   $(OPENSSL_PATH)/crypto/buffer/buf_err.c
   $(OPENSSL_PATH)/crypto/buffer/buffer.c
   $(OPENSSL_PATH)/crypto/cmac/cm_ameth.c
diff --git a/CryptoPkg/Library/OpensslLib/openssl 
b/CryptoPkg/Library/OpensslLib/openssl
index 129058165d..830bf8e1e4 16
--- a/CryptoPkg/Library/OpensslLib/openssl
+++ b/CryptoPkg/Library/OpensslLib/openssl
@@ -1 +1 @@
-Subproject commit 129058165d195e43a0ad10111b0c2e29bdf65980
+Subproject commit 830bf8e1e4749ad65c51b6a1d0d769ae689404ba
-- 
2.26.2.windows.1



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




Re: [edk2-devel] [edk2-platform][PATCH 1/1] MdeModulePkg: SdMmcPciHcDxe: Support for Bayhub SD/eMMC host

2023-02-27 Thread Wu, Hao A
Thanks for the patch.
The proposed method is not the intended way for the EDKII_SD_MMC_OVERRIDE 
protocol to work.

The content in BayhubHost.c should be placed a platform level driver.
This platform level driver should produce the EDKII_SD_MMC_OVERRIDE protocol.
Then SdMmcPciHcDxe will consume the protocol to perform the platform specific 
actions.

Best Regards,
Hao Wu

> -Original Message-
> From: Chevron Li 
> Sent: Friday, February 24, 2023 8:40 PM
> To: devel@edk2.groups.io
> Cc: Wu, Hao A ; Ni, Ray ; Wang,
> Jian J ; Gao, Liming ;
> shaper@bayhubtech.com; chevron...@bayhubtech.com;
> xiaoguang...@bayhubtech.com; shirley@bayhubtech.com
> Subject: [edk2-platform][PATCH 1/1] MdeModulePkg: SdMmcPciHcDxe:
> Support for Bayhub SD/eMMC host
> 
> From: "Chevron Li (WH)" 
> 
> 1.Implement override function for EdkiiSdMmcInitHostPre case to
> configure bayhub host.
> 2.Implement override function for EdkiiSdMmcInitHostPost case to
> configure bayhub host.
> 
> Cc: Hao A Wu 
> Cc: Ray Ni 
> Cc: Jian J Wang 
> Cc: Liming Gao 
> Signed-off-by: Chevron Li 
> ---
>  .../Bus/Pci/SdMmcPciHcDxe/BayhubHost.c| 676 ++
>  .../Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c |   3 +
>  .../Bus/Pci/SdMmcPciHcDxe/BayhubHost.h|  95 +++
>  .../Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.inf   |   2 +
>  4 files changed, 776 insertions(+)
>  create mode 100644
> MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/BayhubHost.c
>  create mode 100644
> MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/BayhubHost.h
> 
> diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/BayhubHost.c
> b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/BayhubHost.c
> new file mode 100644
> index 00..470838e37e
> --- /dev/null
> +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/BayhubHost.c
> @@ -0,0 +1,676 @@
> +/** @file
> +  This driver is used to manage SD/MMC PCI host controllers override
> function
> +  for BayHub SD/eMMC host controller.
> +
> +  Copyright (c) 2018 - 2019, BayHub Tech inc. All rights reserved.
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include "BayhubHost.h"
> +#include "SdMmcPciHcDxe.h"
> +#include 
> +
> +/* Driver global variables*/
> +UINT16  BhtDeviceId = 0;
> +
> +EDKII_SD_MMC_OVERRIDE  BhtOverride = {
> +  EDKII_SD_MMC_OVERRIDE_PROTOCOL_VERSION,
> +  BhtHostOverrideCapability,
> +  BhtHostOverrideNotifyPhase
> +};
> +
> +/**
> +  Judgement function for Host type
> +
> +  @param[in]  PciIo  The PCI IO protocol instance.
> +
> +  @retval UNSUPPORT  The host isn't Bayhub host.
> +  @retval EMMC_HOST  The host is Bayhub eMMC host.
> +  @retval SD_HOSTThe host is Bayhub SD host.
> +
> +**/
> +UINT8
> +BhtHostPciSupportType (
> +  IN EFI_PCI_IO_PROTOCOL  *PciIo
> +  )
> +{
> +  PCI_TYPE00  Pci;
> +  UINT8   HostType;
> +
> +  PciIo->Pci.Read (
> +   PciIo,
> +   EfiPciIoWidthUint32,
> +   0,
> +   sizeof (PCI_TYPE00) / sizeof (UINT32),
> +   &Pci
> +   );
> +  DEBUG ((DEBUG_INFO, "Check device %04x:%04x\n", Pci.Hdr.VendorId,
> Pci.Hdr.DeviceId));
> +
> +  // Judgement bayhub device or not
> +  if (Pci.Hdr.VendorId != 0x1217) {
> +HostType = UNSUPPORT;
> +goto end;
> +  }
> +
> +  BhtDeviceId = Pci.Hdr.DeviceId;
> +
> +  // Bayhub host only 0x8620 is eMMC host
> +  switch (Pci.Hdr.DeviceId) {
> +case PCI_DEV_ID_SB0:
> +  HostType = EMMC_HOST;
> +  break;
> +case PCI_DEV_ID_SB1:
> +default:
> +  HostType = SD_HOST;
> +  break;
> +  }
> +
> +end:
> +  return HostType;
> +}
> +
> +/**
> +  Read specified SD/MMC host controller mmio register
> +
> +  @param[in]  PciIoThe PCI IO protocol instance.
> +  @param[in]  Offset   The Offset within the selected BAR to start 
> the
> +   memory operation.
> +
> +  @retval ValueThe value of specified SD/MMC host controller
> mmio register.
> +
> +**/
> +UINT32
> +BhtMmRead32 (
> +  IN EFI_PCI_IO_PROTOCOL  *PciIo,
> +  IN UINT32   Offset
> +  )
> +{
> +  UINT32  Value;
> +
> +  PciIo->Mem.Read (PciIo, EfiPciIoWidthUint32, 1, Offset, 1, &Value);
> +  return Value;
> +}
> +
> +/**
> +  Write specified SD/MMC host controller mmio register
> +
> +  @param[in]  PciIoThe PCI IO protocol instance.
> +  @param[in]  Offset   The Offset within the selected BAR to start 
> the
> +   memory operation.
> +  @param[in]  ValueThe value to write.
> +
> +**/
> +VOID
> +BhtMmWrite32 (
> +  IN EFI_PCI_IO_PROTOCOL  *PciIo,
> +  IN UINT32   Offset,
> +  IN UINT32   Value
> +  )
> +{
> +  PciIo->Mem.Write (PciIo, EfiPciIoWidthUint32, 1, Offset, 1, &Value);
> +}
> +
> +/**
> +  Read specified SD/MMC host controller PCIe configure register
> +
> +  @param[in]  PciIoThe PCI IO protocol instance.
> +  @param[in]  Offset   The Offset within the selected BAR to start 
> the
> +   

Re: [edk2-devel] [PATCH v2] CryptoPkg/OpensslLib: Upgrade OpenSSL to 1.1.1t

2023-02-27 Thread Michael D Kinney
Hi,

From this patch, it looks like the main change is selecting a 
different submodule sha.

Do you know why crypto/bn/rsa_sup_mul.c is required with these changes?

What testing of this change has been done?

Thanks,

Mike

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Sheng Wei
> Sent: Monday, February 27, 2023 6:44 PM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J ; Yao, Jiewen ; 
> Lu, Xiaoyu1 ; Jiang, Guomin
> 
> Subject: [edk2-devel] [PATCH v2] CryptoPkg/OpensslLib: Upgrade OpenSSL to 
> 1.1.1t
> 
> Upgrade openssl to 1.1.1t
> Pick up bugfixes from the latest openssl release.
> 
> Cc: Jian J Wang 
> Cc: Jiewen Yao 
> Cc: Xiaoyu Lu 
> Cc: Guomin Jiang 
> Signed-off-by: Sheng Wei 
> ---
>  CryptoPkg/Library/OpensslLib/OpensslLib.inf  | 1 +
>  CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf | 1 +
>  CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf| 1 +
>  CryptoPkg/Library/OpensslLib/OpensslLibFull.inf  | 1 +
>  CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf | 1 +
>  CryptoPkg/Library/OpensslLib/openssl | 2 +-
>  6 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf 
> b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
> index 60c6c24b0a..1474df8125 100644
> --- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
> +++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
> @@ -162,6 +162,7 @@
>$(OPENSSL_PATH)/crypto/bn/bn_srp.c
> 
>$(OPENSSL_PATH)/crypto/bn/bn_word.c
> 
>$(OPENSSL_PATH)/crypto/bn/bn_x931p.c
> 
> +  $(OPENSSL_PATH)/crypto/bn/rsa_sup_mul.c
> 
>$(OPENSSL_PATH)/crypto/buffer/buf_err.c
> 
>$(OPENSSL_PATH)/crypto/buffer/buffer.c
> 
>$(OPENSSL_PATH)/crypto/cmac/cm_ameth.c
> 
> diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf 
> b/CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf
> index 103ef7bda2..3c5f6d5d17 100644
> --- a/CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf
> +++ b/CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf
> @@ -163,6 +163,7 @@
>$(OPENSSL_PATH)/crypto/bn/bn_srp.c
> 
>$(OPENSSL_PATH)/crypto/bn/bn_word.c
> 
>$(OPENSSL_PATH)/crypto/bn/bn_x931p.c
> 
> +  $(OPENSSL_PATH)/crypto/bn/rsa_sup_mul.c
> 
>$(OPENSSL_PATH)/crypto/buffer/buf_err.c
> 
>$(OPENSSL_PATH)/crypto/buffer/buffer.c
> 
>$(OPENSSL_PATH)/crypto/cmac/cm_ameth.c
> 
> diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf 
> b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
> index c4eaea888c..a9adb94720 100644
> --- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
> +++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
> @@ -163,6 +163,7 @@
>$(OPENSSL_PATH)/crypto/bn/bn_srp.c
> 
>$(OPENSSL_PATH)/crypto/bn/bn_word.c
> 
>$(OPENSSL_PATH)/crypto/bn/bn_x931p.c
> 
> +  $(OPENSSL_PATH)/crypto/bn/rsa_sup_mul.c
> 
>$(OPENSSL_PATH)/crypto/buffer/buf_err.c
> 
>$(OPENSSL_PATH)/crypto/buffer/buffer.c
> 
>$(OPENSSL_PATH)/crypto/cmac/cm_ameth.c
> 
> diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibFull.inf 
> b/CryptoPkg/Library/OpensslLib/OpensslLibFull.inf
> index 309e43055c..4c2cbe9cf7 100644
> --- a/CryptoPkg/Library/OpensslLib/OpensslLibFull.inf
> +++ b/CryptoPkg/Library/OpensslLib/OpensslLibFull.inf
> @@ -167,6 +167,7 @@
>$(OPENSSL_PATH)/crypto/bn/bn_srp.c
> 
>$(OPENSSL_PATH)/crypto/bn/bn_word.c
> 
>$(OPENSSL_PATH)/crypto/bn/bn_x931p.c
> 
> +  $(OPENSSL_PATH)/crypto/bn/rsa_sup_mul.c
> 
>$(OPENSSL_PATH)/crypto/buffer/buf_err.c
> 
>$(OPENSSL_PATH)/crypto/buffer/buffer.c
> 
>$(OPENSSL_PATH)/crypto/cmac/cm_ameth.c
> 
> diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf 
> b/CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf
> index 4b79bd..591c57fdc2 100644
> --- a/CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf
> +++ b/CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf
> @@ -168,6 +168,7 @@
>$(OPENSSL_PATH)/crypto/bn/bn_srp.c
> 
>$(OPENSSL_PATH)/crypto/bn/bn_word.c
> 
>$(OPENSSL_PATH)/crypto/bn/bn_x931p.c
> 
> +  $(OPENSSL_PATH)/crypto/bn/rsa_sup_mul.c
> 
>$(OPENSSL_PATH)/crypto/buffer/buf_err.c
> 
>$(OPENSSL_PATH)/crypto/buffer/buffer.c
> 
>$(OPENSSL_PATH)/crypto/cmac/cm_ameth.c
> 
> diff --git a/CryptoPkg/Library/OpensslLib/openssl 
> b/CryptoPkg/Library/OpensslLib/openssl
> index 129058165d..830bf8e1e4 16
> --- a/CryptoPkg/Library/OpensslLib/openssl
> +++ b/CryptoPkg/Library/OpensslLib/openssl
> @@ -1 +1 @@
> -Subproject commit 129058165d195e43a0ad10111b0c2e29bdf65980
> +Subproject commit 830bf8e1e4749ad65c51b6a1d0d769ae689404ba
> --
> 2.26.2.windows.1
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#100532): https://edk2.groups.io/g/devel/message/100532
> Mute This Topic: https://groups.io/mt/97282811/1643496
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [michael.d.kin...@intel.com]
> -=-=-=-=-=-=
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups

Re: [edk2-devel] [PATCH 1/1] SecurityPkg/DxeImageVerificationLib: Check result of GetEfiGlobalVariable2

2023-02-27 Thread Gerd Hoffmann
  Hi,

> > (a) the SecureBoot variable is not present (EFI_NOT_FOUND) according to
> > the return value, or
> 
> @Maintainers Would there be any objection to drop this and skip the SB checks 
> only when explicitly disabled?
> Please explicitly respond even if not, so we don't end up with everyone 
> silently agreeing, but forgetting about the patch after. Thanks! :)

I hold back v2, waiting for an answer here.

> > -  if (*SecureBoot == SECURE_BOOT_MODE_DISABLE) {
> > -FreePool (SecureBoot);
> > +  if ((VarStatus == EFI_SUCCESS) && (SecureBoot == 
> > SECURE_BOOT_MODE_DISABLE)) {
> 
> I would check the attributes here as well. They should be BS | RT, but
> explicitly not NV. This would force the SB checks in case a malicious
> actor somehow managed to store a persistent disable-value variable (be
> that a bug, physical access, or other means).

Like this (incremental fixup)?

Do we have macros for variable attribute checking?
Havn't seen anything while skimming variable-related headers ...

take care,
  Gerd

diff --git 
a/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c 
b/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c
index f29a27e5a053..79c784f77ac8 100644
--- a/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c
+++ b/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c
@@ -1688,6 +1688,7 @@ DxeImageVerificationHandler (
   EFI_STATUSHashStatus;
   EFI_STATUSDbStatus;
   EFI_STATUSVarStatus;
+  UINT32VarAttr;
   BOOLEAN   IsFound;
 
   SignatureList = NULL;
@@ -1745,7 +1746,7 @@ DxeImageVerificationHandler (
   }
 
   SecureBootSize = sizeof (SecureBoot);
-  VarStatus  = gRT->GetVariable (EFI_SECURE_BOOT_MODE_NAME, 
&gEfiGlobalVariableGuid, NULL, &SecureBootSize, &SecureBoot);
+  VarStatus  = gRT->GetVariable (EFI_SECURE_BOOT_MODE_NAME, 
&gEfiGlobalVariableGuid, &VarAttr, &SecureBootSize, &SecureBoot);
   //
   // Skip verification if SecureBoot variable doesn't exist.
   //
@@ -1756,7 +1757,12 @@ DxeImageVerificationHandler (
   //
   // Skip verification if SecureBoot is disabled but not AuditMode
   //
-  if ((VarStatus == EFI_SUCCESS) && (SecureBoot == SECURE_BOOT_MODE_DISABLE)) {
+  if ((VarStatus == EFI_SUCCESS) &&
+  !(VarAttr & EFI_VARIABLE_NON_VOLATILE) &&
+  (VarAttr & EFI_VARIABLE_BOOTSERVICE_ACCESS) &&
+  (VarAttr & EFI_VARIABLE_RUNTIME_ACCESS) &&
+  (SecureBoot == SECURE_BOOT_MODE_DISABLE))
+  {
 return EFI_SUCCESS;
   }
 



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




[edk2-devel] 回复: [edk2-stable202302 PATCH V2 1/1] OvmfPkg/RiscVVirt: Add Stack HOB

2023-02-27 Thread gaoliming via groups.io
Sunil:
  Is this a critical issue? Dose this fix need to catch this stable tag? Has
it been verified and code review?

Thanks
Liming
> -邮件原件-
> 发件人: Sunil V L 
> 发送时间: 2023年2月25日 13:32
> 收件人: devel@edk2.groups.io
> 抄送: Liming Gao ; Andrei Warkentin
> ; Ard Biesheuvel ;
> Jiewen Yao ; Jordan Justen
> ; Gerd Hoffmann 
> 主题: [edk2-stable202302 PATCH V2 1/1] OvmfPkg/RiscVVirt: Add Stack HOB
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4350
> 
> Currently, stack HOB is not created for the stack memory. This causes
> stack memory to be treated as free memory and any memory allocation
> which
> happens at this address causes random memory corruption. Fix this by
> creating the stack HOB which marks the memory as BS data.
> 
> Cc: Liming Gao 
> Cc: Andrei Warkentin 
> Cc: Ard Biesheuvel 
> Cc: Jiewen Yao 
> Cc: Jordan Justen 
> Cc: Gerd Hoffmann 
> Signed-off-by: Sunil V L 
> Reported-by: Andrei Warkentin 
> Tested-by: Andrei Warkentin 
> Reviewed-by: Andrei Warkentin 
> ---
> Changes since V1:
>   1) Added BZ reference
>   2) Added edk2-stable202302 in the title to request to catch
>  the stable tag
>   3) Updated tags
> 
>  OvmfPkg/RiscVVirt/Sec/SecMain.c | 9 ++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/OvmfPkg/RiscVVirt/Sec/SecMain.c
> b/OvmfPkg/RiscVVirt/Sec/SecMain.c
> index 73b9b21a67ba..adf73f2eb66c 100644
> --- a/OvmfPkg/RiscVVirt/Sec/SecMain.c
> +++ b/OvmfPkg/RiscVVirt/Sec/SecMain.c
> @@ -55,6 +55,7 @@ SecStartup (
>EFI_STATUS  Status;
>UINT64  UefiMemoryBase;
>UINT64  StackBase;
> +  UINT32  StackSize;
> 
>//
>// Report Status Code to indicate entering SEC core
> @@ -71,9 +72,9 @@ SecStartup (
>FirmwareContext.FlattenedDeviceTree = (UINT64)DeviceTreeAddress;
>SetFirmwareContextPointer (&FirmwareContext);
> 
> -  StackBase = (UINT64)FixedPcdGet32 (PcdOvmfSecPeiTempRamBase) +
> -  FixedPcdGet32 (PcdOvmfSecPeiTempRamSize);
> -  UefiMemoryBase = StackBase - SIZE_32MB;
> +  StackBase  = (UINT64)FixedPcdGet32
> (PcdOvmfSecPeiTempRamBase);
> +  StackSize  = FixedPcdGet32 (PcdOvmfSecPeiTempRamSize);
> +  UefiMemoryBase = StackBase + StackSize - SIZE_32MB;
> 
>// Declare the PI/UEFI memory region
>HobList = HobConstructor (
> @@ -86,6 +87,8 @@ SecStartup (
> 
>SecInitializePlatform ();
> 
> +  BuildStackHob (StackBase, StackSize);
> +
>//
>// Process all libraries constructor function linked to SecMain.
>//
> --
> 2.34.1





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100536): https://edk2.groups.io/g/devel/message/100536
Mute This Topic: https://groups.io/mt/97285399/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] Add a .editorconfig file to tell editors basic formatting details

2023-02-27 Thread Rebecca Cran

Given the following, I'm not sure line endings matter at all to git?


$ file .gitmodules
.gitmodules: ASCII text, with CRLF, LF line terminators
$ file .gitignore
.gitignore: ASCII text, with CRLF line terminators


There's a CRLF in .gitmodules at the end of the brotli section.

We could certainly specify that LF is _preferred_ for all .git files though?


--

Rebecca Cran


On 2/27/23 11:22 AM, Kinney, Michael D wrote:

.gitmodules must be lf.  Not sure about other git config files.

Mike


-Original Message-
From: Ard Biesheuvel 
Sent: Monday, February 27, 2023 10:18 AM
To: devel@edk2.groups.io; rebe...@bsdio.com
Cc: Kinney, Michael D ; Andrew Fish ; 
Leif Lindholm 
Subject: Re: [edk2-devel] [PATCH 1/1] Add a .editorconfig file to tell editors 
basic formatting details

On Mon, 27 Feb 2023 at 17:35, Rebecca Cran  wrote:

Is it just .sh files that need lf endings, or are there others?


I think this only applies to .sh files.



On 2/27/23 9:14 AM, Michael D Kinney wrote:

There are a few file types that must be lf instead of crlf.  Can those be added 
as well?

Mike


-Original Message-
From: devel@edk2.groups.io  On Behalf Of Rebecca Cran
Sent: Monday, February 27, 2023 5:03 AM
To: Ard Biesheuvel ; devel@edk2.groups.io
Cc: Andrew Fish ; Leif Lindholm ; 
Kinney, Michael D



Subject: Re: [edk2-devel] [PATCH 1/1] Add a .editorconfig file to tell editors 
basic formatting details

On 2/27/23 1:04 AM, Ard Biesheuvel wrote:


On Mon, 27 Feb 2023 at 04:47, Rebecca Cran  wrote:

Add a .editorconfig file which editors can use for basic formatting
details of files, such as tabs/spaces, line endings etc.

Signed-off-by: Rebecca Cran 

Thank you very much for this - this is very useful.

Acked-by: Ard Biesheuvel 

Could we add .dsc/.inf/.dec/etc files as well?

I'll move the c/c++ indentation up to the [*] section so it applies to
.dsc/.inf/etc too.


--
Rebecca Cran


















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




[edk2-devel] [PATCH edk2-platforms 1/1] Silicon/RiscVEdk2SbiLib.h: correct a duplicated macro definition

2023-02-27 Thread Chai, Evan
RiscVEdk2SbiLib.h has the same macro defination as BaseRiscVSbiLib.h,
the latter one was merged to MdePkg.

Signed-off-by: Evan Chai 
---
 .../RISC-V/ProcessorPkg/Include/Library/RiscVEdk2SbiLib.h| 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVEdk2SbiLib.h 
b/Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVEdk2SbiLib.h
index 36eb16e1..00fdca64 100644
--- a/Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVEdk2SbiLib.h
+++ b/Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVEdk2SbiLib.h
@@ -2,6 +2,7 @@
   Library to call the RISC-V SBI ecalls
 
   Copyright (c) 2021-2022, Hewlett Packard Development LP. All rights 
reserved.
+  Copyright (c) 2023, Intel Corporation. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -9,8 +10,8 @@
 - Hart - Hardware Thread, similar to a CPU core
 **/
 
-#ifndef RISCV_SBI_LIB_H_
-#define RISCV_SBI_LIB_H_
+#ifndef RISCV_SBI_LIB2_H_
+#define RISCV_SBI_LIB2_H_
 
 #include 
 #include 
-- 
2.34.1



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




Re: [edk2-devel] 回复: [edk2-stable202302 PATCH V2 1/1] OvmfPkg/RiscVVirt: Add Stack HOB

2023-02-27 Thread Sunil V L
On Tue, Feb 28, 2023 at 02:43:13PM +0800, gaoliming via groups.io wrote:
> Sunil:
>   Is this a critical issue? Dose this fix need to catch this stable tag? Has
> it been verified and code review?
> 
Hi Liming,

Yes, this is a critical issue. So, I request to catch the stable tag.

Andrei who reported this issue has verified the fix and helped with
review.

https://edk2.groups.io/g/devel/message/100496

Thanks!
Sunil


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