Re: [edk2] [PATCH edk2-platforms v3 1/5] Hisilicon/D0x: Fix secure boot bug in FlashFvbDxe

2018-11-20 Thread Ming Huang



On 11/20/2018 10:39 PM, Leif Lindholm wrote:
> On Tue, Nov 20, 2018 at 10:29:57PM +0800, Ming Huang wrote:
> And all Hisilicon platforms still use
> AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
> regardless of Secure Boot setting.
>
> So what problem does this patch solve? A runtime one?

 This patch solve bug in FlashFvbDxe.
>>>
>>> Yes, but what bug? What is the symptom? What _specific_ problem goes
>>> away by adding this patch? That information should have been in the
>>> original commit message. I have no information available to me as I
>>> now build -rc1 to suggest that this patch should be included.
>>
>> The bug is that gEfiAuthenticatedVariableGuid should be used in FlashFvbDxe,
>> not gEfiVariableGuid when enable secure boot.
> 
> OK, I will ask a third time: what _problem_ does this solve?
> What is the symptom?
> When someone uses the buggy firmware, what does not work for them?
> This information _always_ needs to be in the commit message.
> 
 Should I add a patch before this patch
 to solve build error with -D SECURE_BOOT_ENABLE=TRUE in v4?
>>>
>>> That would require a sane implementation of PlatformSecureLib,
>>> implementing a real UserPhysicalPresent().
>>> Can you turn that around within the next few hours?
>>
>> My original idea is using 
>> OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.
>> There is not enough time to implement a real UserPhysicalPresent.
> 
> If there is not enough time to implement a real PlatformSecureLib,
> there is no need to have Secure Boot at all. Same thing goes for
> secure variable store (to hardware devices that are not accessible
> from Non-secure world).
> 
>> This patch will add when we implement real secure boot in future.
> 
> That sounds like the best thing to do.
> 
> Meanwhile, could you create a patch to get rid of the SECURE_BOOT
> options completely from the .dsc/.fdf please? I don't like having it
> in there when we know it doesn't build.

OK, I will send the patch in next series.

Thanks.

> 
> /
> Leif
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] BaseTools: AutoGen and GenFds share the parser data.

2018-11-20 Thread Feng, Bob C
Hi Zhiqiang,

Could you extract the common part of your new API and the original main() 
function into one function. And call it in both your new API and main() ?

Thanks,
Bob

-Original Message-
From: Zhao, ZhiqiangX 
Sent: Wednesday, November 21, 2018 2:33 PM
To: edk2-devel@lists.01.org
Cc: Zhao, ZhiqiangX ; Gao, Liming 
; Carsey; Carsey, Jaben ; Feng, 
Bob C 
Subject: [PATCH] BaseTools: AutoGen and GenFds share the parser data.

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

Currently, AutoGen and GenFds run in different python interpreters. The parser 
are duplicated. This patch is going to create new API for GenFds and have the 
build to call that API instead of executing GenFds.py. As such, the GenFds and 
build can share the parser data.

This patch is expected to save the time of GenFds about 2~3 seconds.
More details will be logged in BZ.

This is the summary measure data generated from python cProfile for building 
Ovmf.

Currently:
8379147 function calls (8135450 primitive calls) in 12.580 seconds

After applying this patch:
3428712 function calls (3418881 primitive calls) in 8.944 seconds

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: ZhiqiangX Zhao 
Cc: Liming Gao 
Cc: Carsey, Jaben 
Cc: Bob Feng 
---
 BaseTools/Source/Python/AutoGen/AutoGen.py |   4 +
 BaseTools/Source/Python/GenFds/GenFds.py   | 266 -
 BaseTools/Source/Python/build/build.py |   4 +-
 3 files changed, 271 insertions(+), 3 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py 
b/BaseTools/Source/Python/AutoGen/AutoGen.py
index f3560bfc78..10ce7eb962 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -935,6 +935,10 @@ class WorkspaceAutoGen(AutoGen):
 def GenFdsCommand(self):
 return 
(GenMake.TopLevelMakefile(self)._TEMPLATE_.Replace(GenMake.TopLevelMakefile(self)._TemplateDict)).strip()
 
+@property
+def GenFdsCommandDict(self):
+return GenMake.TopLevelMakefile(self)._TemplateDict
+
 ## Create makefile for the platform and modules in it
 #
 #   @param  CreateDepsMakeFile  Flag indicating if the makefile for
diff --git a/BaseTools/Source/Python/GenFds/GenFds.py 
b/BaseTools/Source/Python/GenFds/GenFds.py
index 0c8091b798..96158568b0 100644
--- a/BaseTools/Source/Python/GenFds/GenFds.py
+++ b/BaseTools/Source/Python/GenFds/GenFds.py
@@ -35,7 +35,7 @@ from Common.Misc import DirCache, PathClass, 
GuidStructureStringToGuidString  from Common.Misc import SaveFileOnChange, 
ClearDuplicatedInf  from Common.BuildVersion import gBUILD_VERSION  from 
Common.MultipleWorkspace import MultipleWorkspace as mws -from 
Common.BuildToolError import FatalError, GENFDS_ERROR, CODE_ERROR, 
FORMAT_INVALID, RESOURCE_NOT_AVAILABLE, FILE_NOT_FOUND, OPTION_MISSING, 
FORMAT_NOT_SUPPORTED,OPTION_VALUE_INVALID
+from Common.BuildToolError import FatalError, GENFDS_ERROR, CODE_ERROR, 
+FORMAT_INVALID, RESOURCE_NOT_AVAILABLE, FILE_NOT_FOUND, OPTION_MISSING, 
+FORMAT_NOT_SUPPORTED, OPTION_VALUE_INVALID, PARAMETER_INVALID
 from Workspace.WorkspaceDatabase import WorkspaceDatabase
 
 from .FdfParser import FdfParser, Warning @@ -716,6 +716,270 @@ class 
GenFds(object):
 os.remove(GuidXRefFileName)
 GuidXRefFile.close()
 
+@staticmethod
+def GenFdsApi(FdsCommandDict, WorkSpaceDataBase):
+global Workspace
+Workspace = os.environ.get('WORKSPACE')
+ArchList = None
+ReturnCode = 0
+try:
+if not os.path.exists(Workspace):
+EdkLogger.error("GenFds", PARAMETER_INVALID, "WORKSPACE is 
invalid",
+ExtraData="Please use '-w' switch to pass it 
or set the WORKSPACE environment variable.")
+else:
+Workspace = os.path.normcase(Workspace)
+GenFdsGlobalVariable.WorkSpaceDir = Workspace
+if 'EDK_SOURCE' in os.environ:
+GenFdsGlobalVariable.EdkSourceDir = 
os.path.normcase(os.environ['EDK_SOURCE'])
+os.chdir(GenFdsGlobalVariable.WorkSpaceDir)
+
+# set multiple workspace
+PackagesPath = os.getenv("PACKAGES_PATH")
+mws.setWs(GenFdsGlobalVariable.WorkSpaceDir, PackagesPath)
+
+if FdsCommandDict["fdf_file"]:
+FdfFilename = FdsCommandDict["fdf_file"][0]
+FdfFilename = 
+ GenFdsGlobalVariable.ReplaceWorkspaceMacro(FdfFilename.Path)
+
+if FdfFilename[0:2] == '..':
+FdfFilename = os.path.realpath(FdfFilename)
+if not os.path.isabs(FdfFilename):
+FdfFilename = mws.join(GenFdsGlobalVariable.WorkSpaceDir, 
FdfFilename)
+if not os.path.exists(FdfFilename):
+EdkLogger.error("GenFds", FILE_NOT_FOUND, 
+ ExtraData=FdfFilename)
+
+GenFdsGlobalVariable.FdfFile = FdfFilename
+   

[edk2] [PATCH] BaseTools: AutoGen and GenFds share the parser data.

2018-11-20 Thread Zhaozh1x
https://bugzilla.tianocore.org/show_bug.cgi?id=1288

Currently, AutoGen and GenFds run in different python interpreters. The
parser are duplicated. This patch is going to create new API for GenFds
and have the build to call that API instead of executing GenFds.py. As
such, the GenFds and build can share the parser data.

This patch is expected to save the time of GenFds about 2~3 seconds.
More details will be logged in BZ.

This is the summary measure data generated from python cProfile for
building Ovmf.

Currently:
8379147 function calls (8135450 primitive calls) in 12.580 seconds

After applying this patch:
3428712 function calls (3418881 primitive calls) in 8.944 seconds

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: ZhiqiangX Zhao 
Cc: Liming Gao 
Cc: Carsey, Jaben 
Cc: Bob Feng 
---
 BaseTools/Source/Python/AutoGen/AutoGen.py |   4 +
 BaseTools/Source/Python/GenFds/GenFds.py   | 266 -
 BaseTools/Source/Python/build/build.py |   4 +-
 3 files changed, 271 insertions(+), 3 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py 
b/BaseTools/Source/Python/AutoGen/AutoGen.py
index f3560bfc78..10ce7eb962 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -935,6 +935,10 @@ class WorkspaceAutoGen(AutoGen):
 def GenFdsCommand(self):
 return 
(GenMake.TopLevelMakefile(self)._TEMPLATE_.Replace(GenMake.TopLevelMakefile(self)._TemplateDict)).strip()
 
+@property
+def GenFdsCommandDict(self):
+return GenMake.TopLevelMakefile(self)._TemplateDict
+
 ## Create makefile for the platform and modules in it
 #
 #   @param  CreateDepsMakeFile  Flag indicating if the makefile for
diff --git a/BaseTools/Source/Python/GenFds/GenFds.py 
b/BaseTools/Source/Python/GenFds/GenFds.py
index 0c8091b798..96158568b0 100644
--- a/BaseTools/Source/Python/GenFds/GenFds.py
+++ b/BaseTools/Source/Python/GenFds/GenFds.py
@@ -35,7 +35,7 @@ from Common.Misc import DirCache, PathClass, 
GuidStructureStringToGuidString
 from Common.Misc import SaveFileOnChange, ClearDuplicatedInf
 from Common.BuildVersion import gBUILD_VERSION
 from Common.MultipleWorkspace import MultipleWorkspace as mws
-from Common.BuildToolError import FatalError, GENFDS_ERROR, CODE_ERROR, 
FORMAT_INVALID, RESOURCE_NOT_AVAILABLE, FILE_NOT_FOUND, OPTION_MISSING, 
FORMAT_NOT_SUPPORTED,OPTION_VALUE_INVALID
+from Common.BuildToolError import FatalError, GENFDS_ERROR, CODE_ERROR, 
FORMAT_INVALID, RESOURCE_NOT_AVAILABLE, FILE_NOT_FOUND, OPTION_MISSING, 
FORMAT_NOT_SUPPORTED, OPTION_VALUE_INVALID, PARAMETER_INVALID
 from Workspace.WorkspaceDatabase import WorkspaceDatabase
 
 from .FdfParser import FdfParser, Warning
@@ -716,6 +716,270 @@ class GenFds(object):
 os.remove(GuidXRefFileName)
 GuidXRefFile.close()
 
+@staticmethod
+def GenFdsApi(FdsCommandDict, WorkSpaceDataBase):
+global Workspace
+Workspace = os.environ.get('WORKSPACE')
+ArchList = None
+ReturnCode = 0
+try:
+if not os.path.exists(Workspace):
+EdkLogger.error("GenFds", PARAMETER_INVALID, "WORKSPACE is 
invalid",
+ExtraData="Please use '-w' switch to pass it 
or set the WORKSPACE environment variable.")
+else:
+Workspace = os.path.normcase(Workspace)
+GenFdsGlobalVariable.WorkSpaceDir = Workspace
+if 'EDK_SOURCE' in os.environ:
+GenFdsGlobalVariable.EdkSourceDir = 
os.path.normcase(os.environ['EDK_SOURCE'])
+os.chdir(GenFdsGlobalVariable.WorkSpaceDir)
+
+# set multiple workspace
+PackagesPath = os.getenv("PACKAGES_PATH")
+mws.setWs(GenFdsGlobalVariable.WorkSpaceDir, PackagesPath)
+
+if FdsCommandDict["fdf_file"]:
+FdfFilename = FdsCommandDict["fdf_file"][0]
+FdfFilename = 
GenFdsGlobalVariable.ReplaceWorkspaceMacro(FdfFilename.Path)
+
+if FdfFilename[0:2] == '..':
+FdfFilename = os.path.realpath(FdfFilename)
+if not os.path.isabs(FdfFilename):
+FdfFilename = mws.join(GenFdsGlobalVariable.WorkSpaceDir, 
FdfFilename)
+if not os.path.exists(FdfFilename):
+EdkLogger.error("GenFds", FILE_NOT_FOUND, 
ExtraData=FdfFilename)
+
+GenFdsGlobalVariable.FdfFile = FdfFilename
+GenFdsGlobalVariable.FdfFileTimeStamp = 
os.path.getmtime(FdfFilename)
+else:
+EdkLogger.error("GenFds", OPTION_MISSING, "Missing FDF 
filename")
+
+if FdsCommandDict["build_target"]:
+GenFdsGlobalVariable.TargetName = 
FdsCommandDict["build_target"]
+
+if FdsCommandDict["toolchain_tag"]:
+GenFdsGlobalVariable.ToolChainTag = 
FdsCommandDict["toolchain_tag"]
+
+  

Re: [edk2] [PATCH v2 1/2] MdeModulePkg/SmmCorePerfLib: [CVE-2017-5753] Fix bounds check bypass

2018-11-20 Thread Wu, Hao A
Got it.
Since the patches have already been checked in. I will follow this style next
time.

Best Regards,
Hao Wu


> -Original Message-
> From: Gao, Liming
> Sent: Wednesday, November 21, 2018 2:16 PM
> To: Wu, Hao A; edk2-devel@lists.01.org
> Cc: Wu, Hao A; Laszlo Ersek; Yao, Jiewen; Zeng, Star
> Subject: RE: [edk2] [PATCH v2 1/2] MdeModulePkg/SmmCorePerfLib: [CVE-
> 2017-5753] Fix bounds check bypass
> 
> Hao:
>   In previous discussion, the suggested subject style is
> MdeModulePkg/SmmCorePerfLib: Fix bounds check bypass(CVE-2017-5753).
> 
> Thanks
> Liming
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Hao Wu
> > Sent: Friday, November 16, 2018 12:13 PM
> > To: edk2-devel@lists.01.org
> > Cc: Wu, Hao A ; Laszlo Ersek ;
> Yao, Jiewen ; Zeng, Star
> > 
> > Subject: [edk2] [PATCH v2 1/2] MdeModulePkg/SmmCorePerfLib: [CVE-
> 2017-5753] Fix bounds check bypass
> >
> > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1194
> >
> > Speculative execution is used by processor to avoid having to wait for
> > data to arrive from memory, or for previous operations to finish, the
> > processor may speculate as to what will be executed.
> >
> > If the speculation is incorrect, the speculatively executed instructions
> > might leave hints such as which memory locations have been brought into
> > cache. Malicious actors can use the bounds check bypass method (code
> > gadgets with controlled external inputs) to infer data values that have
> > been used in speculative operations to reveal secrets which should not
> > otherwise be accessed.
> >
> > This commit will focus on the SMI handler(s) registered within the
> > SmmCorePerformanceLib and insert AsmLfence API to mitigate the
> bounds
> > check bypass issue.
> >
> > For SMI handler SmmPerformanceHandlerEx():
> >
> > Under "case SMM_PERF_FUNCTION_GET_GAUGE_DATA :",
> > 'SmmPerfCommData->LogEntryKey' can be a potential cross boundary
> access of
> > the 'CommBuffer' (controlled external inputs) during speculative
> > execution. This cross boundary access is then assign to parameter
> > 'LogEntryKey'. And the value of 'LogEntryKey' can be inferred by code:
> >
> >   CopyMem (
> > (UINT8 *) [Index],
> > (UINT8 *) [LogEntryKey++],
> > sizeof (GAUGE_DATA_ENTRY_EX)
> > );
> >
> > One can observe which part of the content within 'GaugeEntryExArray' was
> > brought into cache to possibly reveal the value of 'LogEntryKey'.
> >
> > Hence, this commit adds a AsmLfence() after the boundary/range checks
> of
> > 'CommBuffer' to prevent the speculative execution.
> >
> > And there is 1 similar case for SMI handler SmmPerformanceHandler() as
> > well. This commit also handles it.
> >
> > A more detailed explanation of the purpose of commit is under the
> > 'Bounds check bypass mitigation' section of the below link:
> > https://software.intel.com/security-software-guidance/insights/host-
> firmware-speculative-execution-side-channel-mitigation
> >
> > And the document at:
> > https://software.intel.com/security-software-guidance/api-
> app/sites/default/files/337879-analyzing-potential-bounds-Check-bypass-
> vuln
> > erabilities.pdf
> >
> > Cc: Star Zeng 
> > Cc: Jiewen Yao 
> > Cc: Laszlo Ersek 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Hao Wu 
> > ---
> >
> MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLi
> b.c | 16 +++-
> >  1 file changed, 15 insertions(+), 1 deletion(-)
> >
> > diff --git
> a/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformance
> Lib.c
> >
> b/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformance
> Lib.c
> > index cd1f1a5d5f..63c1eea3a2 100644
> > ---
> a/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformance
> Lib.c
> > +++
> b/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformance
> Lib.c
> > @@ -16,7 +16,7 @@
> >
> >   SmmPerformanceHandlerEx(), SmmPerformanceHandler() will receive
> untrusted input and do basic validation.
> >
> > -Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.
> > +Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
> >  This program and the accompanying materials
> >  are licensed and made available under the terms and conditions of the
> BSD License
> >  which accompanies this distribution.  The full text of the license may be
> found at
> > @@ -538,6 +538,13 @@ SmmPerformanceHandlerEx (
> >   break;
> > }
> >
> > +   //
> > +   // The AsmLfence() call here is to ensure the previous range/content
> > +   // checks for the CommBuffer have been completed before calling
> > +   // CopyMem().
> > +   //
> > +   AsmLfence ();
> > +
> > GaugeEntryExArray = (GAUGE_DATA_ENTRY_EX *) (mGaugeData + 1);
> >
> > for (Index = 0; Index < NumberOfEntries; Index++) {
> > @@ -650,6 +657,13 @@ SmmPerformanceHandler (
> >   break;
> > }
> >
> > +   //
> > +   // 

Re: [edk2] [PATCH v2 1/2] MdeModulePkg/SmmCorePerfLib: [CVE-2017-5753] Fix bounds check bypass

2018-11-20 Thread Gao, Liming
Hao:
  In previous discussion, the suggested subject style is 
MdeModulePkg/SmmCorePerfLib: Fix bounds check bypass(CVE-2017-5753). 

Thanks
Liming
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Hao Wu
> Sent: Friday, November 16, 2018 12:13 PM
> To: edk2-devel@lists.01.org
> Cc: Wu, Hao A ; Laszlo Ersek ; Yao, 
> Jiewen ; Zeng, Star
> 
> Subject: [edk2] [PATCH v2 1/2] MdeModulePkg/SmmCorePerfLib: [CVE-2017-5753] 
> Fix bounds check bypass
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1194
> 
> Speculative execution is used by processor to avoid having to wait for
> data to arrive from memory, or for previous operations to finish, the
> processor may speculate as to what will be executed.
> 
> If the speculation is incorrect, the speculatively executed instructions
> might leave hints such as which memory locations have been brought into
> cache. Malicious actors can use the bounds check bypass method (code
> gadgets with controlled external inputs) to infer data values that have
> been used in speculative operations to reveal secrets which should not
> otherwise be accessed.
> 
> This commit will focus on the SMI handler(s) registered within the
> SmmCorePerformanceLib and insert AsmLfence API to mitigate the bounds
> check bypass issue.
> 
> For SMI handler SmmPerformanceHandlerEx():
> 
> Under "case SMM_PERF_FUNCTION_GET_GAUGE_DATA :",
> 'SmmPerfCommData->LogEntryKey' can be a potential cross boundary access of
> the 'CommBuffer' (controlled external inputs) during speculative
> execution. This cross boundary access is then assign to parameter
> 'LogEntryKey'. And the value of 'LogEntryKey' can be inferred by code:
> 
>   CopyMem (
> (UINT8 *) [Index],
> (UINT8 *) [LogEntryKey++],
> sizeof (GAUGE_DATA_ENTRY_EX)
> );
> 
> One can observe which part of the content within 'GaugeEntryExArray' was
> brought into cache to possibly reveal the value of 'LogEntryKey'.
> 
> Hence, this commit adds a AsmLfence() after the boundary/range checks of
> 'CommBuffer' to prevent the speculative execution.
> 
> And there is 1 similar case for SMI handler SmmPerformanceHandler() as
> well. This commit also handles it.
> 
> A more detailed explanation of the purpose of commit is under the
> 'Bounds check bypass mitigation' section of the below link:
> https://software.intel.com/security-software-guidance/insights/host-firmware-speculative-execution-side-channel-mitigation
> 
> And the document at:
> https://software.intel.com/security-software-guidance/api-app/sites/default/files/337879-analyzing-potential-bounds-Check-bypass-vuln
> erabilities.pdf
> 
> Cc: Star Zeng 
> Cc: Jiewen Yao 
> Cc: Laszlo Ersek 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Hao Wu 
> ---
>  MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c | 16 
> +++-
>  1 file changed, 15 insertions(+), 1 deletion(-)
> 
> diff --git 
> a/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c
> b/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c
> index cd1f1a5d5f..63c1eea3a2 100644
> --- a/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c
> +++ b/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c
> @@ -16,7 +16,7 @@
> 
>   SmmPerformanceHandlerEx(), SmmPerformanceHandler() will receive untrusted 
> input and do basic validation.
> 
> -Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.
> +Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
>  This program and the accompanying materials
>  are licensed and made available under the terms and conditions of the BSD 
> License
>  which accompanies this distribution.  The full text of the license may be 
> found at
> @@ -538,6 +538,13 @@ SmmPerformanceHandlerEx (
>   break;
> }
> 
> +   //
> +   // The AsmLfence() call here is to ensure the previous range/content
> +   // checks for the CommBuffer have been completed before calling
> +   // CopyMem().
> +   //
> +   AsmLfence ();
> +
> GaugeEntryExArray = (GAUGE_DATA_ENTRY_EX *) (mGaugeData + 1);
> 
> for (Index = 0; Index < NumberOfEntries; Index++) {
> @@ -650,6 +657,13 @@ SmmPerformanceHandler (
>   break;
> }
> 
> +   //
> +   // The AsmLfence() call here is to ensure the previous range/content
> +   // checks for the CommBuffer have been completed before calling
> +   // CopyMem().
> +   //
> +   AsmLfence ();
> +
> GaugeEntryExArray = (GAUGE_DATA_ENTRY_EX *) (mGaugeData + 1);
> 
> for (Index = 0; Index < NumberOfEntries; Index++) {
> --
> 2.12.0.windows.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org

Re: [edk2] [edk2-test][PATCH] Framework/Include: allow usage with EFI version 2.7

2018-11-20 Thread Lokesh Belathur Veerappa
Hi Supreeth,

Yes it has been compiled and tested against edk2 with SHA 
da2c81ee96eba5d5c8ef91fd870ac98d3cf72beb.

-Original Message-
From: Supreeth Venkatesh 
Sent: Tuesday, November 20, 2018 8:34 PM
To: Lokesh Belathur Veerappa ; edk2-devel@lists.01.org; 
eric@intel.com
Cc: Lokesh Belathur Veerappa 
Subject: RE: [edk2-test][PATCH] Framework/Include: allow usage with EFI version 
2.7

Thanks Lokesh for the patch.
Has this been compiled and sanity tested against latest edk2?
Let me know SHA of edk2 tested, so that I can test it against that SHA and push 
it.

If so, Reviewed-by: Supreeth Venkatesh 

-Original Message-
From: Lokesh B V 
Sent: Tuesday, November 20, 2018 12:50 AM
To: edk2-devel@lists.01.org; Supreeth Venkatesh ; 
eric@intel.com
Cc: Lokesh Belathur Veerappa 
Subject: [edk2-test][PATCH] Framework/Include: allow usage with EFI version 2.7

EDK2 supports EFI version 2.7 and so allow UEFI-SCT to be usable with this 
version of EFI.

Signed-off-by: Lokesh B V 
---
 uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/Include/SctDef.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/Include/SctDef.h 
b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/Include/SctDef.h
index d24c201..c861437 100644
--- a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/Include/SctDef.h
+++ b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/Include/SctDef.h
@@ -46,6 +46,8 @@ Abstract:
 #define EFI_SCT_NAMEL"UEFI2.5 Self Certification 
Test(SCT2)"
 #elif (EFI_SPECIFICATION_VERSION == EFI_2_60_SYSTEM_TABLE_REVISION)
 #define EFI_SCT_NAMEL"UEFI2.6 Self Certification 
Test(SCT2)"
+#elif (EFI_SPECIFICATION_VERSION == EFI_2_70_SYSTEM_TABLE_REVISION)
+#define EFI_SCT_NAMEL"UEFI2.7 Self Certification 
Test(SCT2)"
 #else
 #error Unknown EFI_SPECIFICATION_VERSION  #endif
--
2.7.4

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.
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH 4/6] EmulatorPkg: Update DSC/FDF to use NetworkPkg's include fragment file.

2018-11-20 Thread Fu Siyuan
This patch updates the platform DSC/FDF files to use the include fragment
files provided by NetworkPkg.
The feature enabling flags in [Defines] section have been updated to use
the NetworkPkg's terms, and the value has been overridden with the original
default value on this platform.

Cc: Jordan Justen 
Cc: Andrew Fish 
Cc: Ruiyu Ni 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Fu Siyuan 
---
 EmulatorPkg/EmulatorPkg.dsc | 32 +---
 EmulatorPkg/EmulatorPkg.fdf | 10 +-
 2 files changed, 16 insertions(+), 26 deletions(-)

diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc
index 4097e1192ebc..3609bc06bb29 100644
--- a/EmulatorPkg/EmulatorPkg.dsc
+++ b/EmulatorPkg/EmulatorPkg.dsc
@@ -29,6 +29,21 @@ [Defines]
   SKUID_IDENTIFIER   = DEFAULT
   FLASH_DEFINITION   = EmulatorPkg/EmulatorPkg.fdf
 
+  #
+  # Network stack drivers
+  #
+  
+  #
+  # EmuSnpDxe.inf will be used.
+  #
+  DEFINE NETWORK_SNP_ENABLE   = FALSE
+  DEFINE NETWORK_IP6_ENABLE   = FALSE
+  DEFINE NETWORK_TLS_ENABLE   = FALSE
+  DEFINE NETWORK_HTTP_BOOT_ENABLE = FALSE
+  DEFINE NETWORK_IPSEC_ENABLE = FALSE
+  DEFINE NETWORK_ISCSI_ENABLE = FALSE
+!include NetworkPkg/Network.dsc.inc
+
 [SkuIds]
   0|DEFAULT
 
@@ -74,10 +89,6 @@ [LibraryClasses]
   # Generic Modules
   #
   UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
-  NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
-  IpIoLib|MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf
-  UdpIoLib|MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
-  DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf
   
OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
   BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf
   FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
@@ -365,19 +376,6 @@ [Components]
 
   MdeModulePkg/Application/HelloWorld/HelloWorld.inf
 
-  #
-  # Network stack drivers
-  #
-  MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf
-  MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
-  MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
-  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf
-  MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf
-  MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf
-  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
-  MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
-  NetworkPkg/TcpDxe/TcpDxe.inf
-
   MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
   MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
   MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
diff --git a/EmulatorPkg/EmulatorPkg.fdf b/EmulatorPkg/EmulatorPkg.fdf
index 45697da25860..a8b46be66083 100644
--- a/EmulatorPkg/EmulatorPkg.fdf
+++ b/EmulatorPkg/EmulatorPkg.fdf
@@ -196,15 +196,7 @@ [FV.FvRecovery]
 !if $(NETWORK_SUPPORT)
 INF  EmulatorPkg/EmuSnpDxe/EmuSnpDxe.inf
 !endif
-INF  MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf
-INF  MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
-INF  MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
-INF  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf
-INF  MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf
-INF  MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf
-INF  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
-INF  NetworkPkg/TcpDxe/TcpDxe.inf
-INF  MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
+!include NetworkPkg/Network.fdf.inc
 
 INF FatPkg/EnhancedFatDxe/Fat.inf
 
-- 
2.19.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH 6/6] Vlv2TbltDevicePkg: Update DSC/FDF to use NetworkPkg's include fragment file.

2018-11-20 Thread Fu Siyuan
This patch updates the platform DSC/FDF files to use the include fragment
files provided by NetworkPkg.
The feature enabling flags in [Defines] section have been updated to use
the NetworkPkg's terms, and the value has been overridden with the original
default value on this platform.

Cc: David Wei 
Cc: Mang Guo 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Fu Siyuan 
---
 Vlv2TbltDevicePkg/PlatformPkg.fdf   | 25 +---
 Vlv2TbltDevicePkg/PlatformPkgConfig.dsc |  3 ++
 Vlv2TbltDevicePkg/PlatformPkgGcc.fdf| 25 +---
 Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc | 42 +++-
 Vlv2TbltDevicePkg/PlatformPkgIA32.dsc   | 42 +++-
 Vlv2TbltDevicePkg/PlatformPkgX64.dsc| 42 +++-
 6 files changed, 20 insertions(+), 159 deletions(-)

diff --git a/Vlv2TbltDevicePkg/PlatformPkg.fdf 
b/Vlv2TbltDevicePkg/PlatformPkg.fdf
index f976b9fa4057..e281d1407fc2 100644
--- a/Vlv2TbltDevicePkg/PlatformPkg.fdf
+++ b/Vlv2TbltDevicePkg/PlatformPkg.fdf
@@ -728,35 +728,12 @@ [FV.FVMAIN]
 #
 # Network Modules
 #
+!include NetworkPkg/Network.fdf.inc
 !if $(NETWORK_ENABLE) == TRUE
   FILE DRIVER = 22DE1691-D65D-456a-993E-A253DD1F308C {
 SECTION PE32 = 
Vlv2MiscBinariesPkg/UNDI/RtkUndiDxe/$(DXE_ARCHITECTURE)/RtkUndiDxe.efi
 SECTION UI = "UNDI"
   }
-  INF  MdeModulePkg/Universal/Network/SnpDxe/SnpDxe.inf
-  INF  MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf
-  INF  MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf
-  INF  MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
-  INF  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf
-  INF  MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
-  INF  MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
-  INF  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
-  INF  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  INF  NetworkPkg/TcpDxe/TcpDxe.inf
-  INF  NetworkPkg/IScsiDxe/IScsiDxe.inf
-  !if $(NETWORK_IP6_ENABLE) == TRUE
-  INF  NetworkPkg/Ip6Dxe/Ip6Dxe.inf
-  INF  NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf
-  INF  NetworkPkg/IpSecDxe/IpSecDxe.inf
-  INF  NetworkPkg/Udp6Dxe/Udp6Dxe.inf
-  INF  NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf
-  !endif
-  !if $(NETWORK_VLAN_ENABLE) == TRUE
-  INF  MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf
-  !endif
-  !if $(NETWORK_ISCSI_ENABLE) == TRUE
-INF  NetworkPkg/IScsiDxe/IScsiDxe.inf
-  !endif
 !endif
 
 !if $(CAPSULE_ENABLE)
diff --git a/Vlv2TbltDevicePkg/PlatformPkgConfig.dsc 
b/Vlv2TbltDevicePkg/PlatformPkgConfig.dsc
index 672853dda6a6..63a5b00b43bd 100644
--- a/Vlv2TbltDevicePkg/PlatformPkgConfig.dsc
+++ b/Vlv2TbltDevicePkg/PlatformPkgConfig.dsc
@@ -85,6 +85,9 @@
 DEFINE NETWORK_IP6_ENABLE = TRUE
 DEFINE NETWORK_ISCSI_ENABLE = FALSE
 DEFINE NETWORK_VLAN_ENABLE = FALSE
+DEFINE NETWORK_TLS_ENABLE = FALSE
+DEFINE NETWORK_HTTP_BOOT_ENABLE   = FALSE
+DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = FALSE
 
 DEFINE SATA_ENABLE   = TRUE
 DEFINE PCIESC_ENABLE = TRUE
diff --git a/Vlv2TbltDevicePkg/PlatformPkgGcc.fdf 
b/Vlv2TbltDevicePkg/PlatformPkgGcc.fdf
index 50032f7d5f19..6ea0ec92d4ae 100644
--- a/Vlv2TbltDevicePkg/PlatformPkgGcc.fdf
+++ b/Vlv2TbltDevicePkg/PlatformPkgGcc.fdf
@@ -684,35 +684,12 @@ [FV.FVMAIN]
 #
 # Network Modules
 #
+!include NetworkPkg/Network.fdf.inc
 !if $(NETWORK_ENABLE) == TRUE
   FILE DRIVER = 22DE1691-D65D-456a-993E-A253DD1F308C {
 SECTION PE32 = 
Vlv2MiscBinariesPkg/UNDI/RtkUndiDxe/$(DXE_ARCHITECTURE)/RtkUndiDxe.efi
 SECTION UI = "UNDI"
   }
-  INF  MdeModulePkg/Universal/Network/SnpDxe/SnpDxe.inf
-  INF  MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf
-  INF  MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf
-  INF  MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
-  INF  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf
-  INF  MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
-  INF  MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
-  INF  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
-  INF  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  INF  NetworkPkg/TcpDxe/TcpDxe.inf
-  INF  NetworkPkg/IScsiDxe/IScsiDxe.inf
-  !if $(NETWORK_IP6_ENABLE) == TRUE
-  INF  NetworkPkg/Ip6Dxe/Ip6Dxe.inf
-  INF  NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf
-  INF  NetworkPkg/IpSecDxe/IpSecDxe.inf
-  INF  NetworkPkg/Udp6Dxe/Udp6Dxe.inf
-  INF  NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf
-  !endif
-  !if $(NETWORK_VLAN_ENABLE) == TRUE
-  INF  MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf
-  !endif
-  !if $(NETWORK_ISCSI_ENABLE) == TRUE
-INF  NetworkPkg/IScsiDxe/IScsiDxe.inf
-  !endif
 !endif
 
 !if $(CAPSULE_ENABLE)
diff --git a/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc 
b/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
index f8ad29df5986..219ddd1646e5 100644
--- a/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
+++ b/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
@@ -56,6 +56,11 @@ [Defines]
   !include $(PLATFORM_PACKAGE)/AutoPlatformCFG.txt
   !include $(PLATFORM_PACKAGE)/PlatformPkgConfig.dsc
 
+  #
+  # Network Stacks
+  #
+  !include 

[edk2] [PATCH 2/6] Nt32Pkg: Update DSC/FDF to use NetworkPkg's include fragment file.

2018-11-20 Thread Fu Siyuan
This patch updates the platform DSC/FDF files to use the include fragment
files provided by NetworkPkg.
The feature enabling flags in [Defines] section have be updated to use the
NetworkPkg's terms, and the value have been overridden with the original
default value on this platform.

Cc: Ruiyu Ni 
Cc: Hao Wu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Fu Siyuan 
---
 Nt32Pkg/Nt32Pkg.dsc | 71 ++--
 Nt32Pkg/Nt32Pkg.fdf | 27 +---
 2 files changed, 8 insertions(+), 90 deletions(-)

diff --git a/Nt32Pkg/Nt32Pkg.dsc b/Nt32Pkg/Nt32Pkg.dsc
index 4dbde0cc45b6..8cd29b27b0a2 100644
--- a/Nt32Pkg/Nt32Pkg.dsc
+++ b/Nt32Pkg/Nt32Pkg.dsc
@@ -49,34 +49,15 @@ [Defines]
   #   located in CryptoPkg\Library\OpensslLib to enable the OpenSSL 
building first.
   #
   DEFINE SECURE_BOOT_ENABLE  = FALSE
-  
-  #
-  # This flag is to enable or disable TLS feature.  
-  # These can be changed on the command line.
-  # -D FLAG=VALUE
-  #
-  # Note: TLS feature highly depends on the OpenSSL building. To enable this 
-  #   feature, please follow the instructions found in the file 
"Patch-HOWTO.txt" 
-  #   located in CryptoPkg\Library\OpensslLib to enable the OpenSSL 
building first.
-  #
-  DEFINE TLS_ENABLE = FALSE
-  
-  #
-  # Indicates whether HTTP connections (i.e., unsecured) are permitted or not.
-  # -D FLAG=VALUE
-  #
-  # Note: If ALLOW_HTTP_CONNECTIONS is TRUE, HTTP connections are allowed. 
Both 
-  #   the "https://; and "http://; URI schemes are permitted. Otherwise, 
HTTP 
-  #   connections are denied. Only the "https://; URI scheme is permitted.
-  #
-  DEFINE ALLOW_HTTP_CONNECTIONS = TRUE
 
   #
-  # This flag is to enable or disable IPv6 network stack.
-  # These can be changed on the command line.
-  # -D FLAG=VALUE
+  # SnpNt32Dxe.inf will be used.
   #
+  DEFINE NETWORK_SNP_ENABLE = FALSE
   DEFINE NETWORK_IP6_ENABLE = FALSE
+  DEFINE NETWORK_TLS_ENABLE = FALSE
+  DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = TRUE
+!include NetworkPkg/Network.dsc.inc
 
 

 #
@@ -139,12 +120,6 @@ [LibraryClasses]
   #
   UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf
   UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
-  NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
-  IpIoLib|MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf
-  UdpIoLib|MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
-  TcpIoLib|MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.inf
-  HttpLib|MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.inf
-  DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf
   
OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
   GenericBdsLib|IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
   
CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
@@ -276,11 +251,6 @@ [PcdsFixedAtBuild]
   gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000
 
-!if $(ALLOW_HTTP_CONNECTIONS) == TRUE
-  gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections|TRUE
-!endif
-
-
 !if $(SECURE_BOOT_ENABLE) == TRUE
   # override the default values from SecurityPkg to ensure images from all 
sources are verified in secure boot
   gEfiSecurityPkgTokenSpaceGuid.PcdOptionRomImageVerificationPolicy|0x04
@@ -454,39 +424,10 @@ [Components]
   MdeModulePkg/Application/HelloWorld/HelloWorld.inf
 
   #
-  # Network stack drivers
+  # Network SNP drivers
   # To test network drivers, need network Io driver(SnpNt32Io.dll), please 
refer to NETWORK-IO Subproject.
   #
-  MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf
-  MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
-  MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
-  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf
-  MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf
-  MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf
-  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
-  MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
-  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  NetworkPkg/TcpDxe/TcpDxe.inf
-  NetworkPkg/IScsiDxe/IScsiDxe.inf
   Nt32Pkg/SnpNt32Dxe/SnpNt32Dxe.inf
-
-!if $(NETWORK_IP6_ENABLE) == TRUE
-  NetworkPkg/Ip6Dxe/Ip6Dxe.inf
-  NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf
-  NetworkPkg/Udp6Dxe/Udp6Dxe.inf
-  NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf
-!endif
-
-  NetworkPkg/HttpBootDxe/HttpBootDxe.inf
-  NetworkPkg/DnsDxe/DnsDxe.inf
-  NetworkPkg/HttpDxe/HttpDxe.inf
-  NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf
-   
-!if $(TLS_ENABLE) == TRUE
-  NetworkPkg/TlsDxe/TlsDxe.inf
-  NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf
-!endif
-
   MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
   MdeModulePkg/Application/UiApp/UiApp.inf{
 
diff --git a/Nt32Pkg/Nt32Pkg.fdf b/Nt32Pkg/Nt32Pkg.fdf
index b65c95201b36..3e7b4477f753 100644
--- a/Nt32Pkg/Nt32Pkg.fdf
+++ b/Nt32Pkg/Nt32Pkg.fdf
@@ 

[edk2] [PATCH 3/6] ArmVirtPkg: Update DSC/FDF to use NetworkPkg's include fragment file.

2018-11-20 Thread Fu Siyuan
This patch updates the platform DSC/FDF files to use the include fragment
files provided by NetworkPkg.
The feature enabling flags in [Defines] section have been updated to use
the NetworkPkg's terms, and the value has been overridden with the original
default value on this platform.

Cc: Laszlo Ersek 
Cc: Ard Biesheuvel 
Cc: Julien Grall 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Fu Siyuan 
---
 ArmVirtPkg/ArmVirt.dsc.inc   | 12 --
 ArmVirtPkg/ArmVirtQemu.dsc   | 44 
 ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc | 28 +
 ArmVirtPkg/ArmVirtQemuKernel.dsc | 38 +++--
 4 files changed, 14 insertions(+), 108 deletions(-)

diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc
index 70a0ac4d786c..24a064198b5e 100644
--- a/ArmVirtPkg/ArmVirt.dsc.inc
+++ b/ArmVirtPkg/ArmVirt.dsc.inc
@@ -75,18 +75,6 @@ [LibraryClasses.common]
   # use the accelerated BaseMemoryLibOptDxe by default, overrides for SEC/PEI 
below
   BaseMemoryLib|MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.inf
 
-  # Networking Requirements
-  NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
-  DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf
-  UdpIoLib|MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
-  IpIoLib|MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf
-!if $(NETWORK_IP6_ENABLE) == TRUE
-  TcpIoLib|MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.inf
-!endif
-!if $(HTTP_BOOT_ENABLE) == TRUE
-  HttpLib|MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.inf
-!endif
-
   #
   # It is not possible to prevent the ARM compiler from inserting calls to 
intrinsic functions.
   # This library provides the instrinsic functions such a compiler may 
generate calls to.
diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
index 885c6b14b844..5a1b6b0f0519 100644
--- a/ArmVirtPkg/ArmVirtQemu.dsc
+++ b/ArmVirtPkg/ArmVirtQemu.dsc
@@ -35,9 +35,14 @@ [Defines]
   #
   DEFINE SECURE_BOOT_ENABLE  = FALSE
   DEFINE NETWORK_IP6_ENABLE  = FALSE
-  DEFINE HTTP_BOOT_ENABLE= FALSE
-
+  DEFINE NETWORK_HTTP_BOOT_ENABLE= FALSE
+  DEFINE NETWORK_SNP_ENABLE  = FALSE
+  DEFINE NETWORK_TLS_ENABLE  = FALSE
+  DEFINE NETWORK_IPSEC_ENABLE= FALSE
+  DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS  = TRUE
+  
 !include ArmVirtPkg/ArmVirt.dsc.inc
+!include NetworkPkg/Network.dsc.inc
 
 [LibraryClasses.common]
   ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
@@ -123,10 +128,6 @@ [PcdsFixedAtBuild.common]
   #
   gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz|0
 
-!if $(HTTP_BOOT_ENABLE) == TRUE
-  gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections|TRUE
-!endif
-
   # System Memory Base -- fixed at 0x4000_
   gArmTokenSpaceGuid.PcdSystemMemoryBase|0x4000
 
@@ -335,37 +336,6 @@ [Components.common]
   
NULL|MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerUiLib.inf
   }
 
-  #
-  # Networking stack
-  #
-  MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf
-  MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
-  MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
-  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf
-  MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf
-  MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf
-  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
-  MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
-!if $(NETWORK_IP6_ENABLE) == TRUE
-  NetworkPkg/Ip6Dxe/Ip6Dxe.inf
-  NetworkPkg/TcpDxe/TcpDxe.inf
-  NetworkPkg/Udp6Dxe/Udp6Dxe.inf
-  NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf
-  NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf
-  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  NetworkPkg/IScsiDxe/IScsiDxe.inf
-!else
-  MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf
-  MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf
-!endif
-!if $(HTTP_BOOT_ENABLE) == TRUE
-  NetworkPkg/DnsDxe/DnsDxe.inf
-  NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf
-  NetworkPkg/HttpDxe/HttpDxe.inf
-  NetworkPkg/HttpBootDxe/HttpBootDxe.inf
-!endif
-
   #
   # SCSI Bus and Disk Driver
   #
diff --git a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc 
b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
index a6390bd4b841..560651e49e0b 100644
--- a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
+++ b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
@@ -118,33 +118,7 @@ [FV.FvMain]
   #
   # Networking stack
   #
-  INF MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf
-  INF MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
-  INF MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
-  INF MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf
-  INF MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf
-  INF MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf
-  INF MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
-  INF MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
-!if $(NETWORK_IP6_ENABLE) == TRUE
-  INF NetworkPkg/Ip6Dxe/Ip6Dxe.inf
-  INF NetworkPkg/TcpDxe/TcpDxe.inf
-  INF 

[edk2] [PATCH 5/6] OvmfPkg: Update DSC/FDF to use NetworkPkg's include fragment file.

2018-11-20 Thread Fu Siyuan
This patch updates the platform DSC/FDF files to use the include fragment
files provided by NetworkPkg.
The feature enabling flags in [Defines] section have been updated to use
the NetworkPkg's terms, and the value has been overridden with the original
default value on this platform.

Cc: Jordan Justen 
Cc: Laszlo Ersek 
Cc: Ard Biesheuvel 
Cc: Anthony Perard 
Cc: Julien Grall 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Fu Siyuan 
---
 OvmfPkg/OvmfPkgIa32.dsc| 52 ---
 OvmfPkg/OvmfPkgIa32.fdf| 25 +
 OvmfPkg/OvmfPkgIa32X64.dsc | 53 
 OvmfPkg/OvmfPkgIa32X64.fdf | 25 +
 OvmfPkg/OvmfPkgX64.dsc | 52 ---
 OvmfPkg/OvmfPkgX64.fdf | 25 +
 6 files changed, 36 insertions(+), 196 deletions(-)

diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
index eccf34d3d1cb..5d6ea3e67001 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -35,12 +35,21 @@ [Defines]
   # -D FLAG=VALUE
   #
   DEFINE SECURE_BOOT_ENABLE  = FALSE
-  DEFINE NETWORK_IP6_ENABLE  = FALSE
-  DEFINE HTTP_BOOT_ENABLE= FALSE
   DEFINE SMM_REQUIRE = FALSE
   DEFINE TLS_ENABLE  = FALSE
   DEFINE TPM2_ENABLE = FALSE
 
+  DEFINE NETWORK_IP6_ENABLE = FALSE
+  #
+  # TLS_ENABLE flag is used to control platform specific configuration for TLS 
support.
+  # NETWORK_TLS_ENABLE should always be set to FALSE.
+  #
+  DEFINE NETWORK_TLS_ENABLE = FALSE
+  DEFINE NETWORK_HTTP_BOOT_ENABLE   = FALSE
+  DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = FALSE
+  DEFINE NETWORK_IPSEC_ENABLE = FALSE
+!include NetworkPkg/Network.dsc.inc
+
   #
   # Flash size selection. Setting FD_SIZE_IN_KB on the command line directly to
   # one of the supported values, in place of any of the convenience macros, is
@@ -144,10 +153,6 @@ [LibraryClasses]
   FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
   UefiCpuLib|UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf
   
SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf
-  NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
-  IpIoLib|MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf
-  UdpIoLib|MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
-  DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf
   UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf
   
SerializeVariablesLib|OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.inf
   QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgDxeLib.inf
@@ -191,10 +196,6 @@ [LibraryClasses]
 
   TcpIoLib|MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.inf
 
-!if $(HTTP_BOOT_ENABLE) == TRUE
-  HttpLib|MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.inf
-!endif
-
 !if $(TLS_ENABLE) == TRUE
   TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
 !endif
@@ -504,10 +505,6 @@ [PcdsFixedAtBuild]
   gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|0x2
 !endif
 
-!if $(HTTP_BOOT_ENABLE) == TRUE
-  gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections|TRUE
-!endif
-
   gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile|{ 0x83, 0xA5, 0x04, 
0x7C, 0x3E, 0x9E, 0x1C, 0x4F, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1 }
 
 !if $(SMM_REQUIRE) == TRUE
@@ -774,33 +771,6 @@ [Components]
   MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.inf
   
MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
 
-  #
-  # Network Support
-  #
-  MdeModulePkg/Universal/Network/SnpDxe/SnpDxe.inf
-  MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf
-  MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf
-  MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf
-  MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
-  MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
-  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf
-  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
-  MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
-  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  NetworkPkg/TcpDxe/TcpDxe.inf
-  NetworkPkg/IScsiDxe/IScsiDxe.inf
-!if $(NETWORK_IP6_ENABLE) == TRUE
-  NetworkPkg/Ip6Dxe/Ip6Dxe.inf
-  NetworkPkg/Udp6Dxe/Udp6Dxe.inf
-  NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf
-  NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf
-!endif
-!if $(HTTP_BOOT_ENABLE) == TRUE
-  NetworkPkg/DnsDxe/DnsDxe.inf
-  NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf
-  NetworkPkg/HttpDxe/HttpDxe.inf
-  NetworkPkg/HttpBootDxe/HttpBootDxe.inf
-!endif
 !if $(TLS_ENABLE) == TRUE
   NetworkPkg/TlsDxe/TlsDxe.inf
   NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf {
diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf
index f7f9ab06bb5a..185b5a385ee3 100644
--- a/OvmfPkg/OvmfPkgIa32.fdf
+++ b/OvmfPkg/OvmfPkgIa32.fdf
@@ -296,30 +296,7 @@ [FV.DXEFV]
 #
 # Network modules
 #
-  INF  MdeModulePkg/Universal/Network/SnpDxe/SnpDxe.inf
-  INF  MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf
-  INF  MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf

[edk2] [PATCH 0/6] Add DSC/FDF include segment files for network stack

2018-11-20 Thread Fu Siyuan
There is a patch to remove the redudant IP4 only iSCSI/PXE/TCP drivers
from MdeModulePkg, which has been reviewed before edk2-stable201811 tag.
And we also have plan to move all network related libraries/modules to
NetworkPkg. In order to make these change more smoothly, 2 configuration
fragment files are provided for platform to enable the network stack
support, without directly reference the INF module path.

Patch 1/6 adds 2 centralized dsc/fdf include files to NetworkPkg, with
a set of flags for feature set enable/disable.
Patch 2~6 updates edk2 platform dsc/fdf files to use the new include
files, instead of reference the module INF.


Fu Siyuan (6):
  NetworkPkg: Add DSC/FDF include segment files to NetworkPkg.
  Nt32Pkg: Update DSC/FDF to use NetworkPkg's include fragment file.
  ArmVirtPkg: Update DSC/FDF to use NetworkPkg's include fragment file.
  EmulatorPkg: Update DSC/FDF to use NetworkPkg's include fragment file.
  OvmfPkg: Update DSC/FDF to use NetworkPkg's include fragment file.
  Vlv2TbltDevicePkg: Update DSC/FDF to use NetworkPkg's include fragment
file.

 ArmVirtPkg/ArmVirt.dsc.inc  |  12 --
 ArmVirtPkg/ArmVirtQemu.dsc  |  44 +
 ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc|  28 +--
 ArmVirtPkg/ArmVirtQemuKernel.dsc|  38 +---
 EmulatorPkg/EmulatorPkg.dsc |  32 ++-
 EmulatorPkg/EmulatorPkg.fdf |  10 +-
 NetworkPkg/Network.dsc.inc  | 203 
 NetworkPkg/Network.fdf.inc  |  81 
 Nt32Pkg/Nt32Pkg.dsc |  71 +--
 Nt32Pkg/Nt32Pkg.fdf |  27 +--
 OvmfPkg/OvmfPkgIa32.dsc |  52 ++---
 OvmfPkg/OvmfPkgIa32.fdf |  25 +--
 OvmfPkg/OvmfPkgIa32X64.dsc  |  53 ++---
 OvmfPkg/OvmfPkgIa32X64.fdf  |  25 +--
 OvmfPkg/OvmfPkgX64.dsc  |  52 ++---
 OvmfPkg/OvmfPkgX64.fdf  |  25 +--
 Vlv2TbltDevicePkg/PlatformPkg.fdf   |  25 +--
 Vlv2TbltDevicePkg/PlatformPkgConfig.dsc |   3 +
 Vlv2TbltDevicePkg/PlatformPkgGcc.fdf|  25 +--
 Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc |  42 +---
 Vlv2TbltDevicePkg/PlatformPkgIA32.dsc   |  42 +---
 Vlv2TbltDevicePkg/PlatformPkgX64.dsc|  42 +---
 22 files changed, 378 insertions(+), 579 deletions(-)
 create mode 100644 NetworkPkg/Network.dsc.inc
 create mode 100644 NetworkPkg/Network.fdf.inc

Cc: Jiaxin Wu 
Cc: Ting Ye 
Cc: Ruiyu Ni 
Cc: Hao Wu 
Cc: Laszlo Ersek 
Cc: Ard Biesheuvel 
Cc: Julien Grall 
Cc: Jordan Justen 
Cc: Andrew Fish 
Cc: Ruiyu Ni 
Cc: Anthony Perard 
Cc: David Wei 
Cc: Mang Guo 
-- 
2.19.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH 1/6] NetworkPkg: Add DSC/FDF include segment files to NetworkPkg.

2018-11-20 Thread Fu Siyuan
The "Network.dsc.inc" and "Network.fdf.inc" are added for platform owner to
easily enable/disable network stack support on their platform, by adding
  !include NetworkPkg/Network.dsc.inc
and
  !include NetworkPkg/Network.fdf.inc
to their platform DSC/FDF files.

A set of flags can be changed before the include line or in build command
line ("-D FLAG=VALUE") to enable or disable related feature set.

The default value of these flags are:
  DEFINE NETWORK_ENABLE = TRUE
  DEFINE NETWORK_SNP_ENABLE = TRUE
  DEFINE NETWORK_IP4_ENABLE = TRUE
  DEFINE NETWORK_IP6_ENABLE = TRUE
  DEFINE NETWORK_TLS_ENABLE = TRUE
  DEFINE NETWORK_HTTP_BOOT_ENABLE   = TRUE
  DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = FALSE
  DEFINE NETWORK_IPSEC_ENABLE = TRUE
  DEFINE NETWORK_ISCSI_ENABLE = TRUE
  DEFINE NETWORK_VLAN_ENABLE  = TRUE
Detail description of each flag is in Network.dsc.inc file.

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

Cc: Jiaxin Wu 
Cc: Ting Ye 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Fu Siyuan 
---
 NetworkPkg/Network.dsc.inc | 203 
 NetworkPkg/Network.fdf.inc |  81 
 2 files changed, 284 insertions(+)

diff --git a/NetworkPkg/Network.dsc.inc b/NetworkPkg/Network.dsc.inc
new file mode 100644
index ..50cf93ba816a
--- /dev/null
+++ b/NetworkPkg/Network.dsc.inc
@@ -0,0 +1,203 @@
+## @file
+# Network DSC include file for All Architectures.
+#
+# This file can be included to a platform DSC by using "!include 
NetworkPkg/Network.dsc.inc" 
+# to add edk2 network stack drivers.
+# Below flags can be changed on the command line to enable or disable related 
feature
+# support.
+#   -D FLAG=VALUE
+# The default value of these flags are:
+#   DEFINE NETWORK_ENABLE = TRUE
+#   DEFINE NETWORK_SNP_ENABLE = TRUE
+#   DEFINE NETWORK_IP4_ENABLE = TRUE
+#   DEFINE NETWORK_IP6_ENABLE = TRUE
+#   DEFINE NETWORK_TLS_ENABLE = TRUE
+#   DEFINE NETWORK_HTTP_BOOT_ENABLE   = TRUE
+#   DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = FALSE
+#   DEFINE NETWORK_IPSEC_ENABLE = TRUE
+#   DEFINE NETWORK_ISCSI_ENABLE = TRUE
+#   DEFINE NETWORK_VLAN_ENABLE  = TRUE
+#
+# Copyright (c) 2018, Intel Corporation. All rights reserved.
+#
+#This program and the accompanying materials
+#are licensed and made available under the terms and conditions of the BSD 
License
+#which accompanies this distribution. The full text of the license may be 
found at
+#http://opensource.org/licenses/bsd-license.php
+#
+#THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+##
+
+[Defines]
+!ifndef NETWORK_ENABLE
+  #
+  # This flag is to enable or disable the whole network stack.  
+  # These can be changed on the command line.
+  # -D FLAG=VALUE
+  #
+  DEFINE NETWORK_ENABLE = TRUE
+!endif
+
+!ifndef NETWORK_SNP_ENABLE
+  #
+  # This flag is to include the common SNP driver or not.
+  # These can be changed on the command line.
+  # -D FLAG=VALUE
+  #
+  DEFINE NETWORK_SNP_ENABLE = TRUE
+!endif
+
+!ifndef NETWORK_IP4_ENABLE
+  #
+  # This flag is to enable or disable IPv4 network stack.
+  # These can be changed on the command line.
+  # -D FLAG=VALUE
+  #
+  DEFINE NETWORK_IP4_ENABLE = TRUE
+!endif
+
+!ifndef NETWORK_IP6_ENABLE
+  #
+  # This flag is to enable or disable IPv6 network stack.
+  # These can be changed on the command line.
+  # -D FLAG=VALUE
+  #
+  DEFINE NETWORK_IP6_ENABLE = TRUE
+!endif
+
+!ifndef NETWORK_TLS_ENABLE
+  #
+  # This flag is to enable or disable TLS feature.  
+  # These can be changed on the command line.
+  # -D FLAG=VALUE
+  #
+  # Note: TLS feature highly depends on the OpenSSL building. To enable this 
+  #   feature, please follow the instructions found in the file 
"Patch-HOWTO.txt" 
+  #   located in CryptoPkg\Library\OpensslLib to enable the OpenSSL 
building first.
+  #
+  DEFINE NETWORK_TLS_ENABLE = TRUE
+!endif
+
+!ifndef NETWORK_HTTP_BOOT_ENABLE
+  #
+  # This flag is to enable or disable HTTP(s) boot feature.  
+  # These can be changed on the command line.
+  # -D FLAG=VALUE
+  #
+  DEFINE NETWORK_HTTP_BOOT_ENABLE = TRUE
+!endif
+
+!ifndef NETWORK_ALLOW_HTTP_CONNECTIONS
+  #
+  # Indicates whether HTTP connections (i.e., unsecured) are permitted or not.
+  # -D FLAG=VALUE
+  #
+  # Note: If NETWORK_ALLOW_HTTP_CONNECTIONS is TRUE, HTTP connections are 
allowed.
+  #   Both the "https://; and "http://; URI schemes are permitted. 
Otherwise, HTTP 
+  #   connections are denied. Only the "https://; URI scheme is permitted.
+  #
+  DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = FALSE
+!endif
+
+!ifndef NETWORK_IPSEC_ENABLE
+  #
+  # This flag is to enable or disable IPsec feature.
+  # These can be changed on the command line.
+  # -D FLAG=VALUE
+  #
+  DEFINE NETWORK_IPSEC_ENABLE = TRUE
+!endif
+
+!ifndef NETWORK_ISCSI_ENABLE
+  #
+  # This flag is to enable or disable iSCSI feature.
+  # These can be 

[edk2] [Patch] BaseTools Script: Update ConvertFceToStructurePcd to report warning messages

2018-11-20 Thread Liming Gao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1297
When the header files are not found for the used C structure, this script will
report the warning, let user know there is no header file to define C structure.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Wang BinX A 
Reviewed-by: Liming Gao 
---
 BaseTools/Scripts/ConvertFceToStructurePcd.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Scripts/ConvertFceToStructurePcd.py 
b/BaseTools/Scripts/ConvertFceToStructurePcd.py
index 9240b8f0f3..59eec28d5e 100644
--- a/BaseTools/Scripts/ConvertFceToStructurePcd.py
+++ b/BaseTools/Scripts/ConvertFceToStructurePcd.py
@@ -416,7 +416,7 @@ class PATH(object):
 
   def header(self,struct):
 header={}
-head_re = re.compile(r'} %s;[\s\S\n]+h{1}"'%struct,re.M|re.S)
+head_re = re.compile('typedef.*} 
%s;[\n]+(.*?)(?:typedef|formset)'%struct,re.M|re.S)
 head_re2 = re.compile(r'#line[\s\d]+"(\S+h)"')
 for i in list(self.lstinf.keys()):
   with open(i,'r') as lst:
-- 
2.13.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [edk2-test][Patch] uefi-sct/SctPkg:Remove old unused files in EfiCompliant test

2018-11-20 Thread Eric Jin
Cc: Supreeth Venkatesh 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Jin 
---
 .../BlackBoxTest/EfiCompliantBBTestDriver_efi.c|   64 -
 .../BlackBoxTest/EfiCompliantBBTestMain_efi.c  |  126 --
 .../BlackBoxTest/EfiCompliantBBTestMain_efi.h  |  117 --
 .../BlackBoxTest/EfiCompliantBBTestPlatform_efi.c  | 1441 
 .../BlackBoxTest/EfiCompliantBBTestRequired_efi.c  |  820 ---
 .../BlackBoxTest/EfiCompliantBBTestSupport_efi.c   |  390 --
 .../BlackBoxTest/EfiCompliantBBTest_efi.inf|   56 -
 .../Generic/EfiCompliant/BlackBoxTest/Guid_efi.c   |   65 -
 .../Generic/EfiCompliant/BlackBoxTest/Guid_efi.h   |  116 --
 9 files changed, 3195 deletions(-)
 delete mode 100644 
uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestDriver_efi.c
 delete mode 100644 
uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestMain_efi.c
 delete mode 100644 
uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestMain_efi.h
 delete mode 100644 
uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestPlatform_efi.c
 delete mode 100644 
uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestRequired_efi.c
 delete mode 100644 
uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestSupport_efi.c
 delete mode 100644 
uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTest_efi.inf
 delete mode 100644 
uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/Guid_efi.c
 delete mode 100644 
uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/Guid_efi.h

diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestDriver_efi.c
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestDriver_efi.c
deleted file mode 100644
index 5db3eae..000
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestDriver_efi.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/** @file
-
-  Copyright 2006 - 2010 Unified EFI, Inc.
-  Copyright (c) 2010, Intel Corporation. All rights reserved.
-
-  This program and the accompanying materials
-  are licensed and made available under the terms and conditions of the BSD 
License
-  which accompanies this distribution.  The full text of the license may be 
found at 
-  http://opensource.org/licenses/bsd-license.php
- 
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- 
-**/
-/*++
-
-Module Name:
-
-  EfiCompliantBbTestDriver.c
-
-Abstract:
-
-  Check the driver specific elements in EFI Spec.
-
---*/
-
-//
-// Includes
-//
-
-#include "SctLib.h"
-#include "EfiCompliantBbTestMain_efi.h"
-
-//
-// Module definitions
-//
-
-#define SECTION_NAME_DRIVER_SPECIFICL"Driver Specific"
-
-//
-// External functions implementation
-//
-
-EFI_STATUS
-DriverSpecificElementsBbTest (
-  IN EFI_BB_TEST_PROTOCOL *This,
-  IN VOID *ClientInterface,
-  IN EFI_TEST_LEVEL   TestLevel,
-  IN EFI_HANDLE   SupportHandle
-  )
-/*++
-
-Routine Description:
-
-  Check the driver specific elements, which defined in the EFI spec 1.10,
-  section 2.6.3.
-
-  We didn't find a good way to test this item. So currently it is commented in
-  the test entry point definitions of TestMain.c.
-
---*/
-{
-  return EFI_UNSUPPORTED;
-}
diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestMain_efi.c
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestMain_efi.c
deleted file mode 100644
index 31ee6c4..000
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestMain_efi.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/** @file
-
-  Copyright 2006 - 2010 Unified EFI, Inc.
-  Copyright (c) 2010, Intel Corporation. All rights reserved.
-
-  This program and the accompanying materials
-  are licensed and made available under the terms and conditions of the BSD 
License
-  which accompanies this distribution.  The full text of the license may be 
found at 
-  http://opensource.org/licenses/bsd-license.php
- 
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- 
-**/
-/*++
-
-Module Name:
-
-  EfiCompliantBbTestMain.c
-
-Abstract:
-
-  EFI Compliant Black-Box Test.
-
---*/
-
-#include "SctLib.h"
-#include "EfiCompliantBbTestMain_efi.h"
-
-//
-// Global variables
-//
-
-EFI_BB_TEST_PROTOCOL_FIELD gBBTestProtocolField = {
-  EFI_COMPLIANT_BB_TEST_REVISION,
-  EFI_COMPLIANT_BB_TEST_GUID,
-  L"EFI Compliant Test",
-  L"UEFI 2.0 Compliant Black-Box Test"
-};
-
-EFI_GUID 

Re: [edk2] [PATCH v2] SecurityPkg: Update TCG PFP spec revision.

2018-11-20 Thread Yao, Jiewen
Reviewed-by: jiewen@intel.com

> -Original Message-
> From: Zhang, Chao B
> Sent: Tuesday, November 20, 2018 10:54 AM
> To: edk2-devel@lists.01.org
> Cc: Yao, Jiewen 
> Subject: [PATCH v2] SecurityPkg: Update TCG PFP spec revision.
> 
> UEFI TCG has aligned with TCG PFP 1.03 v51 along with Errata Version 1.0.
> Update spec version accordingly.
> Spec Link:
> https://trustedcomputinggroup.org/wp-content/uploads/PC-ClientSpecific_
> Platform_Profile_for_TPM_2p0_Systems_v51.pdf
> https://trustedcomputinggroup.org/wp-content/uploads/PC-Client-Specific-
> Platform-Firmware-Profile-for-TPM-2-0-v1p03_r51-errata-v1p0_170426.pdf
> 
> Cc: Yao Jiewen 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Zhang, Chao B 
> ---
> 
> SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.inf
> | 4 +++-
>  SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf
> | 4 ++--
>  SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf
> | 4 ++--
>  SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.inf
> | 4 +++-
>  4 files changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git
> a/SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.i
> nf
> b/SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.i
> nf
> index 22eaced5fa..5610bc4da5 100644
> ---
> a/SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.i
> nf
> +++
> b/SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.i
> nf
> @@ -1,10 +1,12 @@
>  ## @file
>  #  Provides security service for TPM 2.0 measured boot
>  #
>  #  Spec Compliance Info:
> -#"TCG PC Client Platform Firmware Profile Specification for TPM
> Family 2.0 Level 00 Revision 00.21"
> +#"TCG PC Client Platform Firmware Profile Specification for TPM
> Family 2.0 Level 00 Revision 1.03 v51"
> +#  along with
> +#"Errata for PC Client Specific Platform Firmware Profile Specification
> Version 1.0 Revision 1.03"
>  #
>  #  This library instance hooks LoadImage() API to measure every image
> that
>  #  is not measured in PEI phase. And, it will also measure GPT partition.
>  #
>  #  Caution: This module requires additional review when modified.
> diff --git a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf
> b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf
> index 2b89869ef1..12b7448ade 100644
> --- a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf
> +++ b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf
> @@ -1,12 +1,12 @@
>  ## @file
>  #  Produces Tcg2 protocol and measure boot environment
>  #
>  #  Spec Compliance Info:
> -#"TCG PC Client Platform Firmware Profile Specification for TPM
> Family 2.0 Level 00 Revision 00.21"
> +#"TCG PC Client Platform Firmware Profile Specification for TPM
> Family 2.0 Level 00 Revision 1.03 v51"
>  #  along with
> -#"Errata for PC Client Specific Platform Firmware Profile Specification
> Version 1.0 Revision 0.21"
> +#"Errata for PC Client Specific Platform Firmware Profile Specification
> Version 1.0 Revision 1.03"
>  #"TCG EFI Protocol Specification" "Family 2.0" "Level 00 Revision
> 00.13"
>  #
>  #  This module will produce Tcg2 protocol and measure boot environment.
>  #
>  #  Caution: This module requires additional review when modified.
> diff --git a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf
> b/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf
> index 9608f9ae7e..ea9dc759ab 100644
> --- a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf
> +++ b/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf
> @@ -1,12 +1,12 @@
>  ## @file
>  #  Initializes TPM 2.0 device and measure FVs in PEI phase
>  #
>  #  Spec Compliance Info:
> -#"TCG PC Client Platform Firmware Profile Specification for TPM
> Family 2.0 Level 00 Revision 00.21"
> +#"TCG PC Client Platform Firmware Profile Specification for TPM
> Family 2.0 Level 00 Revision 1.03 v51"
>  #  along with
> -#"Errata for PC Client Specific Platform Firmware Profile Specification
> Version 1.0 Revision 0.21"
> +#"Errata for PC Client Specific Platform Firmware Profile Specification
> Version 1.0 Revision 1.03"
>  #
>  #  This module will initialize TPM device, measure reported FVs and BIOS
> version.
>  #
>  # Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
>  # Copyright (c) 2017, Microsoft Corporation.  All rights reserved. 
> diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.inf
> b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.inf
> index 142941e269..0a08885786 100644
> --- a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.inf
> +++ b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.inf
> @@ -4,11 +4,13 @@
>  #  Spec Compliance Info:
>  # "TCG ACPI Specification Level 00 Revision 00.37"
>  # "Physical Presence Interface Specification Version 1.30 Revision
> 00.52"
>  # "Platform Reset Attack Mitigation Specification Version 1.00"
>  #TPM2.0 ACPI device object
> -# "TCG PC Client Platform Firmware Profile Specification for TPM
> Family 2.0 Level 00 Revision 00.21"
> +# "TCG PC Client Platform Firmware Profile Specification for TPM
> Family 2.0 Level 00 Revision 1.03 v51"
> +#   along with
> +# "Errata for PC Client Specific 

Re: [edk2] [PATCH 1/1] MdePkg ACPI: fix the typos in Acpi61.h and Acpi62.h

2018-11-20 Thread Zeng, Star

On 2018/11/20 22:37, Gao, Liming wrote:

Reviewed-by: Liming Gao 


-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Laszlo 
Ersek
Sent: Tuesday, November 20, 2018 4:52 PM
To: Gary Lin ; edk2-devel@lists.01.org
Cc: Kinney, Michael D ; Gao, Liming 

Subject: Re: [edk2] [PATCH 1/1] MdePkg ACPI: fix the typos in Acpi61.h and 
Acpi62.h

On 11/20/18 08:03, Gary Lin wrote:

The GUID for VIRTUAL_CD_REGION_PERSISTENT was using the closing
square bracket mistakenly.

Cc: Michael D Kinney 
Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Gary Lin 
---
  MdePkg/Include/IndustryStandard/Acpi61.h | 2 +-
  MdePkg/Include/IndustryStandard/Acpi62.h | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)


Good catch!

Reviewed-by: Laszlo Ersek 


Reviewed-by: Star Zeng 

Thanks,
Star



Thanks
Laszlo


diff --git a/MdePkg/Include/IndustryStandard/Acpi61.h 
b/MdePkg/Include/IndustryStandard/Acpi61.h
index b2276b7d64d5..c66566e58647 100644
--- a/MdePkg/Include/IndustryStandard/Acpi61.h
+++ b/MdePkg/Include/IndustryStandard/Acpi61.h
@@ -1400,7 +1400,7 @@ typedef struct {
  #define 
EFI_ACPI_6_1_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_DISK_REGION_VOLATILE   { 
0x77AB535A, 0x45FC, 0x624B,

{ 0x55, 0x60, 0xF7, 0xB2, 0x81, 0xD1, 0xF9, 0x6E }}

  #define EFI_ACPI_6_1_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_VOLATILE 
{ 0x3D5ABD30, 0x4175, 0x87CE,

{ 0x6D, 0x64, 0xD2, 0xAD, 0xE5, 0x23, 0xC4, 0xBB }}

  #define 
EFI_ACPI_6_1_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_DISK_REGION_PERSISTENT { 
0x5CEA02C9, 0x4D07, 0x69D3,

{ 0x26, 0x9F ,0x44, 0x96, 0xFB, 0xE0, 0x96, 0xF9 }}

-#define 
EFI_ACPI_6_1_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_PERSISTENT   { 
0x08018188, 0x42CD, 0xBB48,

{ 0x10, 0x0F, 0x53, 0x87, 0xD5, 0x3D, 0xED, 0x3D ]}

+#define 
EFI_ACPI_6_1_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_PERSISTENT   { 
0x08018188, 0x42CD, 0xBB48,

{ 0x10, 0x0F, 0x53, 0x87, 0xD5, 0x3D, 0xED, 0x3D }}

  typedef struct {
UINT16  Type;
UINT16  Length;
diff --git a/MdePkg/Include/IndustryStandard/Acpi62.h 
b/MdePkg/Include/IndustryStandard/Acpi62.h
index 730365b521d1..11ce1c16fb91 100644
--- a/MdePkg/Include/IndustryStandard/Acpi62.h
+++ b/MdePkg/Include/IndustryStandard/Acpi62.h
@@ -1512,7 +1512,7 @@ typedef struct {
  #define 
EFI_ACPI_6_2_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_DISK_REGION_VOLATILE   { 
0x77AB535A, 0x45FC, 0x624B,

{ 0x55, 0x60, 0xF7, 0xB2, 0x81, 0xD1, 0xF9, 0x6E }}

  #define EFI_ACPI_6_2_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_VOLATILE 
{ 0x3D5ABD30, 0x4175, 0x87CE,

{ 0x6D, 0x64, 0xD2, 0xAD, 0xE5, 0x23, 0xC4, 0xBB }}

  #define 
EFI_ACPI_6_2_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_DISK_REGION_PERSISTENT { 
0x5CEA02C9, 0x4D07, 0x69D3,

{ 0x26, 0x9F ,0x44, 0x96, 0xFB, 0xE0, 0x96, 0xF9 }}

-#define 
EFI_ACPI_6_2_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_PERSISTENT   { 
0x08018188, 0x42CD, 0xBB48,

{ 0x10, 0x0F, 0x53, 0x87, 0xD5, 0x3D, 0xED, 0x3D ]}

+#define 
EFI_ACPI_6_2_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_PERSISTENT   { 
0x08018188, 0x42CD, 0xBB48,

{ 0x10, 0x0F, 0x53, 0x87, 0xD5, 0x3D, 0xED, 0x3D }}

  typedef struct {
UINT16  Type;
UINT16  Length;



___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] MdeModulePkg/Variable: add debug logs in VariableServiceSetVariable

2018-11-20 Thread Zeng, Star

On 2018/11/20 19:17, Laszlo Ersek wrote:

On 11/20/18 11:38, Vijayenthiran Subramaniam wrote:

Print debug messages if size of the VariableName plus DataSize exceeds
Max(Auth|Voltaile)VariableSize bytes. The messages will be useful if any
platform specific value of Max(Auth|Voltaile)VariableSize PCDs have to
be changed.

Cc: Star Zeng 
Cc: Jian J Wang 
Cc: Ruiyu Ni 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vijayenthiran Subramaniam 
---
  MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 6 ++
  1 file changed, 6 insertions(+)

diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c 
b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
index 8e8db71bd201..db54fa4412c0 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
@@ -3234,14 +3234,20 @@ VariableServiceSetVariable (
  //
  if ((Attributes & VARIABLE_ATTRIBUTE_AT_AW) != 0) {
if (StrSize (VariableName) + PayloadSize > 
mVariableModuleGlobal->MaxAuthVariableSize - GetVariableHeaderSize ()) {
+DEBUG ((DEBUG_ERROR, "%a: Size of (%s) variable + DataSize exceeds 
MaxAuthVariableSize.\n",
+  __FUNCTION__, VariableName));
  return EFI_INVALID_PARAMETER;
}
  } else if ((Attributes & EFI_VARIABLE_NON_VOLATILE) != 0) {
if (StrSize (VariableName) + PayloadSize > 
mVariableModuleGlobal->MaxVariableSize - GetVariableHeaderSize ()) {
+DEBUG ((DEBUG_ERROR, "%a: Size of (%s) variable + DataSize exceeds 
MaxVariableSize.\n",
+  __FUNCTION__, VariableName));
  return EFI_INVALID_PARAMETER;
}
  } else {
if (StrSize (VariableName) + PayloadSize > 
mVariableModuleGlobal->MaxVolatileVariableSize - GetVariableHeaderSize ()) {
+DEBUG ((DEBUG_ERROR, "%a: Size of (%s) variable + DataSize exceeds 
MaxVolatileVariableSize.\n",
+  __FUNCTION__, VariableName));
  return EFI_INVALID_PARAMETER;
}
  }



You could make this more useful as well -- again, *if* the package
maintainers agree with the new log messages --; namely, the vendor GUID,
DataSize, and the limit in question should / could all be logged.


I agree to add these debug messages. I also think Laszlo's suggestion is 
good.


So, how about having the debug message like below?

DEBUG ((
  DEBUG_ERROR,
  "%a: %s:%g\n",
  __FUNCTION__,
  VariableName,
  VendorGuid
  ));
DEBUG ((
  DEBUG_ERROR,
  "  NameSize(0x%x) + PayloadSize(0x%x) > 
MaxAuthVariableSize(0x%x) - HeaderSize(0x%x)\n",

  StrSize (VariableName),
  PayloadSize,
  mVariableModuleGlobal->MaxAuthVariableSize,
  GetVariableHeaderSize ()
  ));

Thanks,
Star



Thanks
Laszlo



___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v3] OvmfPkg: simply use the Bochs interface for vmsvga

2018-11-20 Thread yuchenlin via edk2-devel

On 2018-11-21 03:59, Laszlo Ersek wrote:

On 11/07/18 18:06, Laszlo Ersek wrote:

On 11/07/18 04:47, yuchen...@synology.com wrote:

From: yuchenlin 

BAR  |std vga |  vmsvga
-
0|   Framebuffer  | I/O space
1|   Reserved | Framebuffer
2|   MMIO | FIFO

- We cannot recognize VMW SVGA as BOCHS because that would confuse 
the

  IsQxl setting in QemuVideoControllerDriverStart(),

- We cannot recognize VMW SVGA as BOCHS_MMIO because BAR2 on VMW SVGA 
is

  not the BOCHS MMIO BAR (we can only use port IO).

Therefore the list of reasons for which we should introduce
QEMU_VIDEO_VMWARE_SVGA should name three reasons:

 (1) Get framebuffer from correct PCI BAR
 (2) Prevent using BAR2 for MMIO
 (3) Prevent mis-recognizing VMW SVGA as QXL

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: yuchenlin 
---
Changelog:

v1 -> v2
* use 'else' clause (Thanks Philippe).
* add more comment in revert patches (Thanks Philippe).
* reorder the revert patches, we should revert the last commit first.
* use correct framebuffer to ClearScreen.
* revert VMWare svga definitions.

v2 -> v3
* Update commit message (Thanks Laszlo)
* Treat QEMU_VIDEO_VMWARE_SVGA as QEMU_VIDEO_BOCHS (Thanks Laszlo)

---
 OvmfPkg/QemuVideoDxe/Driver.c | 16 +++-
 OvmfPkg/QemuVideoDxe/Gop.c|  2 +-
 OvmfPkg/QemuVideoDxe/Qemu.h   |  2 ++
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/OvmfPkg/QemuVideoDxe/Driver.c 
b/OvmfPkg/QemuVideoDxe/Driver.c

index 2304afd1e6..8e02700d39 100644
--- a/OvmfPkg/QemuVideoDxe/Driver.c
+++ b/OvmfPkg/QemuVideoDxe/Driver.c
@@ -69,6 +69,12 @@ QEMU_VIDEO_CARD gQemuVideoCardList[] = {
 0x1050,
 QEMU_VIDEO_BOCHS_MMIO,
 L"QEMU VirtIO VGA"
+},{
+PCI_CLASS_DISPLAY_VGA,
+0x15ad,
+0x0405,
+QEMU_VIDEO_VMWARE_SVGA,
+L"QEMU VMWare SVGA"
 },{
 0 /* end of list */
 }
@@ -316,6 +322,14 @@ QemuVideoControllerDriverStart (
 }
   }

+  //
+  // VMWare SVGA is handled like Bochs (with port IO only).
+  //
+  if (Private->Variant == QEMU_VIDEO_VMWARE_SVGA) {
+Private->Variant = QEMU_VIDEO_BOCHS;
+Private->FrameBufferVramBarIndex = PCI_BAR_IDX1;
+  }
+
   //
   // Check if accessing the bochs interface works.
   //
@@ -764,7 +778,7 @@ ClearScreen (
   Private->PciIo->Mem.Write (
 Private->PciIo,
 EfiPciIoWidthFillUint32,
-0,
+Private->FrameBufferVramBarIndex,
 0,
 0x40 >> 2,
 
diff --git a/OvmfPkg/QemuVideoDxe/Gop.c b/OvmfPkg/QemuVideoDxe/Gop.c
index d490fa7a2e..6f542d9eac 100644
--- a/OvmfPkg/QemuVideoDxe/Gop.c
+++ b/OvmfPkg/QemuVideoDxe/Gop.c
@@ -60,7 +60,7 @@ QemuVideoCompleteModeData (

   Private->PciIo->GetBarAttributes (
 Private->PciIo,
-0,
+Private->FrameBufferVramBarIndex,
 NULL,
 (VOID**) 
 );
diff --git a/OvmfPkg/QemuVideoDxe/Qemu.h 
b/OvmfPkg/QemuVideoDxe/Qemu.h

index d7da761705..3aac9eeca6 100644
--- a/OvmfPkg/QemuVideoDxe/Qemu.h
+++ b/OvmfPkg/QemuVideoDxe/Qemu.h
@@ -92,6 +92,7 @@ typedef enum {
   QEMU_VIDEO_CIRRUS_5446,
   QEMU_VIDEO_BOCHS,
   QEMU_VIDEO_BOCHS_MMIO,
+  QEMU_VIDEO_VMWARE_SVGA,
 } QEMU_VIDEO_VARIANT;

 typedef struct {
@@ -120,6 +121,7 @@ typedef struct {
   QEMU_VIDEO_VARIANTVariant;
   FRAME_BUFFER_CONFIGURE*FrameBufferBltConfigure;
   UINTN FrameBufferBltConfigureSize;
+  UINT8 FrameBufferVramBarIndex;
 } QEMU_VIDEO_PRIVATE_DATA;

 ///



Reviewed-by: Laszlo Ersek 

I'm not pushing this patch at once, for two reasons:

- I should leave time for other reviewers to comment,
- we are now in the soft feature freeze period
,
and this is not a bugfix, but a feature (re-)enablement that is only 
now

being reviewed.

I'll keep this tagged on my queue until after the edk2-stable201811 
tag

is pushed, and then I'll push this patch. Please do ping me, should I
forget.


I haven't forgotten. :)

* First, I've cherry-picked the first four patches (from the v2 series)
from the git history. See
<3167b5fd-5514-5a79-e400-39d7c64e50ea@redhat.com">http://mid.mail-archive.com/3167b5fd-5514-5a79-e400-39d7c64e50ea@redhat.com>.

* Second, I've added PhilMD's R-b to those four patches. See
http://mid.mail-archive.com/a2bb9800-6e82-b552-a950-fa11377d24e1@redhat.com>.

* Third, PhilMD got busy with other stuff meanwhile, so I've tested the
patch I'm replying to, myself. I have confirmed the following device
models continue to work:
- Cirrus 5446
- QEMU Standard VGA
- QEMU QXL VGA
- QEMU VirtIO 

Re: [edk2] [platforms: PATCH 01/12] Marvell/Library: ArmadaSoCDescLib: Add GPIO information

2018-11-20 Thread Marcin Wojtas
Hi Leif,

ƛr., 14 lis 2018 o 18:33 Leif Lindholm  napisaƂ(a):
>
> On Wed, Nov 14, 2018 at 07:05:01AM +0100, Marcin Wojtas wrote:
> > > I think all of my comments on this patch can be summarised as "what is
> > > an AP in this context"?
> > >
> > > The term either needs explicit documenting, or expansion in the macro
> > > names such that documentation is not required.
> >
> > Isn't a glossary on top of this file:
> > https://github.com/MarvellEmbeddedProcessors/edk2-open-platform/blob/8ff9b13675a401588d3cc999aef9891838047b18/Silicon/Marvell/Armada7k8k/Library/Armada7k8kSoCDescLib/Armada7k8kSoCDescLib.h#L13
> > and C file:
> > https://github.com/MarvellEmbeddedProcessors/edk2-open-platform/blob/8ff9b13675a401588d3cc999aef9891838047b18/Silicon/Marvell/Armada7k8k/Library/Armada7k8kSoCDescLib/Armada7k8kSoCDescLib.c#L13
> > sufficient?
>
> I will confess I missed that. But that also clearly shows the problem.
>
> The glossary in is sufficient according to the coding style.
> But it gets confusing, specifically for the abbreviation "AP", since
> this has a specific (and different) meaning in PI.
>

Xenon is in, so we can focus on the GPIO ;) I will use AP806 in order
to avoid confusion. Please don't mind my ignorance - what is the
default 'AP' meaning?

BoardDesc library patches will be affected when rebasing onto latest
merged patches - should I resend v2 or wait for more remarks?

Thanks,
Marcin
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 1/1] Platform/ARM/SgiPkg: increase max variable size to 8KB

2018-11-20 Thread Zeng, Star

On 2018/11/20 21:15, Leif Lindholm wrote:

On Tue, Nov 20, 2018 at 04:01:02PM +0530, Vijayenthiran Subramaniam wrote:

Commit dc37ca75 ("Edk2Platforms: Replace MdeModulePkg PXE/iSCSI/TCP with
NetworkPkg drivers") switched to using iSCSI driver from the NetworkPkg
package. This driver requires the platform to support a maximum variable
size of atleast 4KB.

So increase the maximum supported variable size to 8KB on the SGI
platforms. Without this, the iSCSI driver fails to load.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vijayenthiran Subramaniam 


Looks good to me, but I'd like an R-b from Thomas/Nariman.

On a separate note, MdeModulePkg maintainers - is this reason enough
to change the default of this Pcd?


Yes, the PCD is for platform to customize based on usage, so reasonable.

Thanks,
Star



/
 Leif


---
  Platform/ARM/SgiPkg/SgiPlatform.dsc | 1 +
  1 file changed, 1 insertion(+)

diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc 
b/Platform/ARM/SgiPkg/SgiPlatform.dsc
index 3f0ca9872e79..1c152fad2246 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dsc
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc
@@ -102,6 +102,7 @@
  
  [PcdsFixedAtBuild.common]

gArmTokenSpaceGuid.PcdVFPEnabled|1
+  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000
  
# DRAM Block2 Base and Size

gArmSgiTokenSpaceGuid.PcdDramBlock2Base|0x808000
--
2.17.1



___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [RFC] Proposal to remove DuetPkg

2018-11-20 Thread Andrew Fish
Works for me too. 

Thanks,

Andrew Fish

> On Nov 20, 2018, at 3:20 PM, Kinney, Michael D  
> wrote:
> 
> I agree with this proposal.
> 
> I also agree with Leif that large patch series
> must be shared on a branch for review.
> 
> Mike
> 
>> -Original Message-
>> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org]
>> On Behalf Of Leif Lindholm
>> Sent: Tuesday, November 20, 2018 1:57 AM
>> To: Ni, Ruiyu 
>> Cc: edk2-devel@lists.01.org; Gao, Liming
>> ; Richardson, Brian
>> ; Cetola, Stephano
>> ; Kinney, Michael D
>> ; Laszlo Ersek
>> 
>> Subject: Re: [edk2] [RFC] Proposal to remove DuetPkg
>> 
>> On Tue, Nov 20, 2018 at 05:27:13AM +, Ni, Ruiyu
>> wrote:
>>> All,
>>> DuetPkg depends on Legacy BIOS to provide a UEFI
>> environment. It was
>>> invented in the era when UEFI environment is hard to
>> find. Since now
>>> UEFI is very popular in PC area, we could stop the
>> official support
>>> of this package and remove it from the master.
>>> Anyone who wants to use it still can just grab it from
>> git
>>> history. This is the same as what we did for IPF
>> contents.
>>> 
>>> If there is no concern by end of November, we will send
>> out a formal
>>> patch to remove DuetPkg. (Since DuetPkg is big, we will
>> not generate
>>> the huge patch using git command, instead we will just
>> send out the
>>> patch mail with correct title/commit message but empty
>> content.)
>> 
>> Works for me. If you could include a link to the patch in
>> a branch
>> where it can be reviewed, that would be ideal.
>> 
>> /
>>Leif
>> 
>> ___
>> edk2-devel mailing list
>> edk2-devel@lists.01.org
>> https://lists.01.org/mailman/listinfo/edk2-devel
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [edk2-announce] Research Request

2018-11-20 Thread stephano
Thank you both for taking the time to add some insight to our 
discussions. Please see the list of questions here:


https://lists.01.org/pipermail/edk2-devel/2018-November/032462.html

These are a summary from our community meetings.

Enjoy the holiday!

Cheers,
Stephano

On 11/20/2018 3:47 PM, Jeremiah Cox wrote:

Hi Stephano,
Sean and I will put something together for GitHub by next Tuesday.

Thank you,
Jeremiah Cox  (departing for Thanksgiving holiday... now...)

-Original Message-
From: edk2-devel  On Behalf Of stephano
Sent: Wednesday, November 14, 2018 10:34 AM
To: edk2-devel@lists.01.org
Subject: [edk2] [edk2-announce] Research Request

We are currently researching several different options to help make 
contributing to TianoCore easier for the community. A big part of this effort 
will be enabling pull requests and allowing for a more customizable code review 
process.

I am looking for members of the community willing to answer a few questions 
about these solutions to allow us to evaluate our options quickly. The options 
are:

System/Tool Investigator
Phabricator Rebecca Cran (thank you again :) )
Github  ???
Gerrit  ???
Gitlab  ???

I have a list of questions that I can send out to each investigator.
Assuming you are familiar with the software/system, these questions should be 
answerable with a couple hours of research, writing, and screenshots / examples.

Thanks in advance for your help!

-Stephano

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.01.org%2Fmailman%2Flistinfo%2Fedk2-develdata=02%7C01%7Cjerecox%40microsoft.com%7C9e286d6c4ed146e984f408d64a60f4e0%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636778177619451439sdata=KhWxcMKtoC0Pm%2B2KvOLAoxxue4sFICLQBbALaAYX3o4%3Dreserved=0


___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] NetworkPkg/IScsiDxe: add debug logs for failed SetVariable attempts

2018-11-20 Thread Fu, Siyuan



Reviewed-by: Fu Siyuan 

> -Original Message-
> From: Vijayenthiran Subramaniam [mailto:vijayenthiran.subraman...@arm.com]
> Sent: Tuesday, November 20, 2018 6:40 PM
> To: edk2-devel@lists.01.org; Fu, Siyuan ; Wu, Jiaxin
> 
> Cc: Vijayenthiran Subramaniam 
> Subject: [PATCH] NetworkPkg/IScsiDxe: add debug logs for failed
> SetVariable attempts
> 
> Add debug messages for failed attempts to write to a variable.
> 
> Cc: Siyuan Fu 
> Cc: Jiaxin Wu 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Vijayenthiran Subramaniam
> 
> ---
>  NetworkPkg/IScsiDxe/IScsiMisc.c | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/NetworkPkg/IScsiDxe/IScsiMisc.c
> b/NetworkPkg/IScsiDxe/IScsiMisc.c
> index dd0d32dcda16..46760d79a8f3 100644
> --- a/NetworkPkg/IScsiDxe/IScsiMisc.c
> +++ b/NetworkPkg/IScsiDxe/IScsiMisc.c
> @@ -845,6 +845,8 @@ IScsiCreateAttempts (
>  );
>  FreePool (AttemptConfigOrder);
>  if (EFI_ERROR (Status)) {
> +  DEBUG ((DEBUG_ERROR, "%a: SetVariable failed with return: %r\n",
> +__FUNCTION__, Status));
>return Status;
>  }
> 
> @@ -887,6 +889,8 @@ IScsiCreateAttempts (
>  );
>  FreePool (AttemptConfigData);
>  if (EFI_ERROR (Status)) {
> +  DEBUG ((DEBUG_ERROR, "%a: SetVariable failed with return: %r\n",
> +__FUNCTION__, Status));
>return Status;
>  }
>}
> --
> 2.17.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [edk2-announce] Research Request

2018-11-20 Thread Jeremiah Cox via edk2-devel
Hi Stephano,
Sean and I will put something together for GitHub by next Tuesday.  

Thank you,
Jeremiah Cox  (departing for Thanksgiving holiday... now...)

-Original Message-
From: edk2-devel  On Behalf Of stephano
Sent: Wednesday, November 14, 2018 10:34 AM
To: edk2-devel@lists.01.org
Subject: [edk2] [edk2-announce] Research Request

We are currently researching several different options to help make 
contributing to TianoCore easier for the community. A big part of this effort 
will be enabling pull requests and allowing for a more customizable code review 
process.

I am looking for members of the community willing to answer a few questions 
about these solutions to allow us to evaluate our options quickly. The options 
are:

System/Tool Investigator
Phabricator Rebecca Cran (thank you again :) )
Github  ???
Gerrit  ???
Gitlab  ???

I have a list of questions that I can send out to each investigator. 
Assuming you are familiar with the software/system, these questions should be 
answerable with a couple hours of research, writing, and screenshots / examples.

Thanks in advance for your help!

-Stephano

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.01.org%2Fmailman%2Flistinfo%2Fedk2-develdata=02%7C01%7Cjerecox%40microsoft.com%7C9e286d6c4ed146e984f408d64a60f4e0%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636778177619451439sdata=KhWxcMKtoC0Pm%2B2KvOLAoxxue4sFICLQBbALaAYX3o4%3Dreserved=0
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [RFC] Proposal to remove DuetPkg

2018-11-20 Thread Kinney, Michael D
Ray,

One additional note.  There are some tools in
BaseTools that are only used by Duet.  We should
remove those tools too.

Mike

> -Original Message-
> From: Kinney, Michael D
> Sent: Tuesday, November 20, 2018 3:21 PM
> To: Leif Lindholm ; Ni, Ruiyu
> ; Kinney, Michael D
> 
> Cc: edk2-devel@lists.01.org; Gao, Liming
> ; Richardson, Brian
> ; Cetola, Stephano
> ; Laszlo Ersek
> 
> Subject: RE: [edk2] [RFC] Proposal to remove DuetPkg
> 
> I agree with this proposal.
> 
> I also agree with Leif that large patch series
> must be shared on a branch for review.
> 
> Mike
> 
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-
> boun...@lists.01.org]
> > On Behalf Of Leif Lindholm
> > Sent: Tuesday, November 20, 2018 1:57 AM
> > To: Ni, Ruiyu 
> > Cc: edk2-devel@lists.01.org; Gao, Liming
> > ; Richardson, Brian
> > ; Cetola, Stephano
> > ; Kinney, Michael D
> > ; Laszlo Ersek
> > 
> > Subject: Re: [edk2] [RFC] Proposal to remove DuetPkg
> >
> > On Tue, Nov 20, 2018 at 05:27:13AM +, Ni, Ruiyu
> > wrote:
> > > All,
> > > DuetPkg depends on Legacy BIOS to provide a UEFI
> > environment. It was
> > > invented in the era when UEFI environment is hard to
> > find. Since now
> > > UEFI is very popular in PC area, we could stop the
> > official support
> > > of this package and remove it from the master.
> > > Anyone who wants to use it still can just grab it
> from
> > git
> > > history. This is the same as what we did for IPF
> > contents.
> > >
> > > If there is no concern by end of November, we will
> send
> > out a formal
> > > patch to remove DuetPkg. (Since DuetPkg is big, we
> will
> > not generate
> > > the huge patch using git command, instead we will
> just
> > send out the
> > > patch mail with correct title/commit message but
> empty
> > content.)
> >
> > Works for me. If you could include a link to the patch
> in
> > a branch
> > where it can be reviewed, that would be ideal.
> >
> > /
> > Leif
> >
> > ___
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [RFC] Proposal to remove DuetPkg

2018-11-20 Thread Kinney, Michael D
I agree with this proposal.

I also agree with Leif that large patch series
must be shared on a branch for review.

Mike

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org]
> On Behalf Of Leif Lindholm
> Sent: Tuesday, November 20, 2018 1:57 AM
> To: Ni, Ruiyu 
> Cc: edk2-devel@lists.01.org; Gao, Liming
> ; Richardson, Brian
> ; Cetola, Stephano
> ; Kinney, Michael D
> ; Laszlo Ersek
> 
> Subject: Re: [edk2] [RFC] Proposal to remove DuetPkg
> 
> On Tue, Nov 20, 2018 at 05:27:13AM +, Ni, Ruiyu
> wrote:
> > All,
> > DuetPkg depends on Legacy BIOS to provide a UEFI
> environment. It was
> > invented in the era when UEFI environment is hard to
> find. Since now
> > UEFI is very popular in PC area, we could stop the
> official support
> > of this package and remove it from the master.
> > Anyone who wants to use it still can just grab it from
> git
> > history. This is the same as what we did for IPF
> contents.
> >
> > If there is no concern by end of November, we will send
> out a formal
> > patch to remove DuetPkg. (Since DuetPkg is big, we will
> not generate
> > the huge patch using git command, instead we will just
> send out the
> > patch mail with correct title/commit message but empty
> content.)
> 
> Works for me. If you could include a link to the patch in
> a branch
> where it can be reviewed, that would be ideal.
> 
> /
> Leif
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v3] OvmfPkg: simply use the Bochs interface for vmsvga

2018-11-20 Thread Laszlo Ersek
On 11/07/18 18:06, Laszlo Ersek wrote:
> On 11/07/18 04:47, yuchen...@synology.com wrote:
>> From: yuchenlin 
>>
>> BAR  |std vga |  vmsvga
>> -
>> 0|   Framebuffer  | I/O space
>> 1|   Reserved | Framebuffer
>> 2|   MMIO | FIFO
>>
>> - We cannot recognize VMW SVGA as BOCHS because that would confuse the
>>   IsQxl setting in QemuVideoControllerDriverStart(),
>>
>> - We cannot recognize VMW SVGA as BOCHS_MMIO because BAR2 on VMW SVGA is
>>   not the BOCHS MMIO BAR (we can only use port IO).
>>
>> Therefore the list of reasons for which we should introduce
>> QEMU_VIDEO_VMWARE_SVGA should name three reasons:
>>
>>  (1) Get framebuffer from correct PCI BAR
>>  (2) Prevent using BAR2 for MMIO
>>  (3) Prevent mis-recognizing VMW SVGA as QXL
>>
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: yuchenlin 
>> ---
>> Changelog:
>>
>> v1 -> v2
>> * use 'else' clause (Thanks Philippe).
>> * add more comment in revert patches (Thanks Philippe).
>> * reorder the revert patches, we should revert the last commit first.
>> * use correct framebuffer to ClearScreen.
>> * revert VMWare svga definitions.
>>
>> v2 -> v3
>> * Update commit message (Thanks Laszlo)
>> * Treat QEMU_VIDEO_VMWARE_SVGA as QEMU_VIDEO_BOCHS (Thanks Laszlo)
>>
>> ---
>>  OvmfPkg/QemuVideoDxe/Driver.c | 16 +++-
>>  OvmfPkg/QemuVideoDxe/Gop.c|  2 +-
>>  OvmfPkg/QemuVideoDxe/Qemu.h   |  2 ++
>>  3 files changed, 18 insertions(+), 2 deletions(-)
>>
>> diff --git a/OvmfPkg/QemuVideoDxe/Driver.c b/OvmfPkg/QemuVideoDxe/Driver.c
>> index 2304afd1e6..8e02700d39 100644
>> --- a/OvmfPkg/QemuVideoDxe/Driver.c
>> +++ b/OvmfPkg/QemuVideoDxe/Driver.c
>> @@ -69,6 +69,12 @@ QEMU_VIDEO_CARD gQemuVideoCardList[] = {
>>  0x1050,
>>  QEMU_VIDEO_BOCHS_MMIO,
>>  L"QEMU VirtIO VGA"
>> +},{
>> +PCI_CLASS_DISPLAY_VGA,
>> +0x15ad,
>> +0x0405,
>> +QEMU_VIDEO_VMWARE_SVGA,
>> +L"QEMU VMWare SVGA"
>>  },{
>>  0 /* end of list */
>>  }
>> @@ -316,6 +322,14 @@ QemuVideoControllerDriverStart (
>>  }
>>}
>>  
>> +  //
>> +  // VMWare SVGA is handled like Bochs (with port IO only).
>> +  //
>> +  if (Private->Variant == QEMU_VIDEO_VMWARE_SVGA) {
>> +Private->Variant = QEMU_VIDEO_BOCHS;
>> +Private->FrameBufferVramBarIndex = PCI_BAR_IDX1;
>> +  }
>> +
>>//
>>// Check if accessing the bochs interface works.
>>//
>> @@ -764,7 +778,7 @@ ClearScreen (
>>Private->PciIo->Mem.Write (
>>  Private->PciIo,
>>  EfiPciIoWidthFillUint32,
>> -0,
>> +Private->FrameBufferVramBarIndex,
>>  0,
>>  0x40 >> 2,
>>  
>> diff --git a/OvmfPkg/QemuVideoDxe/Gop.c b/OvmfPkg/QemuVideoDxe/Gop.c
>> index d490fa7a2e..6f542d9eac 100644
>> --- a/OvmfPkg/QemuVideoDxe/Gop.c
>> +++ b/OvmfPkg/QemuVideoDxe/Gop.c
>> @@ -60,7 +60,7 @@ QemuVideoCompleteModeData (
>>  
>>Private->PciIo->GetBarAttributes (
>>  Private->PciIo,
>> -0,
>> +Private->FrameBufferVramBarIndex,
>>  NULL,
>>  (VOID**) 
>>  );
>> diff --git a/OvmfPkg/QemuVideoDxe/Qemu.h b/OvmfPkg/QemuVideoDxe/Qemu.h
>> index d7da761705..3aac9eeca6 100644
>> --- a/OvmfPkg/QemuVideoDxe/Qemu.h
>> +++ b/OvmfPkg/QemuVideoDxe/Qemu.h
>> @@ -92,6 +92,7 @@ typedef enum {
>>QEMU_VIDEO_CIRRUS_5446,
>>QEMU_VIDEO_BOCHS,
>>QEMU_VIDEO_BOCHS_MMIO,
>> +  QEMU_VIDEO_VMWARE_SVGA,
>>  } QEMU_VIDEO_VARIANT;
>>  
>>  typedef struct {
>> @@ -120,6 +121,7 @@ typedef struct {
>>QEMU_VIDEO_VARIANTVariant;
>>FRAME_BUFFER_CONFIGURE*FrameBufferBltConfigure;
>>UINTN FrameBufferBltConfigureSize;
>> +  UINT8 FrameBufferVramBarIndex;
>>  } QEMU_VIDEO_PRIVATE_DATA;
>>  
>>  ///
>>
> 
> Reviewed-by: Laszlo Ersek 
> 
> I'm not pushing this patch at once, for two reasons:
> 
> - I should leave time for other reviewers to comment,
> - we are now in the soft feature freeze period
> ,
> and this is not a bugfix, but a feature (re-)enablement that is only now
> being reviewed.
> 
> I'll keep this tagged on my queue until after the edk2-stable201811 tag
> is pushed, and then I'll push this patch. Please do ping me, should I
> forget.

I haven't forgotten. :)

* First, I've cherry-picked the first four patches (from the v2 series)
from the git history. See
<3167b5fd-5514-5a79-e400-39d7c64e50ea@redhat.com">http://mid.mail-archive.com/3167b5fd-5514-5a79-e400-39d7c64e50ea@redhat.com>.

* Second, I've added PhilMD's R-b to those four patches. See

Re: [edk2] [PATCH edk2-platforms v3 1/5] Hisilicon/D0x: Fix secure boot bug in FlashFvbDxe

2018-11-20 Thread Leif Lindholm
On Tue, Nov 20, 2018 at 11:00:49PM +0800, Ming Huang wrote:
> On 11/20/2018 10:39 PM, Leif Lindholm wrote:
> > On Tue, Nov 20, 2018 at 10:29:57PM +0800, Ming Huang wrote:
> > And all Hisilicon platforms still use
> > AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
> > regardless of Secure Boot setting.
> >
> > So what problem does this patch solve? A runtime one?
> 
>  This patch solve bug in FlashFvbDxe.
> >>>
> >>> Yes, but what bug? What is the symptom? What _specific_ problem goes
> >>> away by adding this patch? That information should have been in the
> >>> original commit message. I have no information available to me as I
> >>> now build -rc1 to suggest that this patch should be included.
> >>
> >> The bug is that gEfiAuthenticatedVariableGuid should be used in 
> >> FlashFvbDxe,
> >> not gEfiVariableGuid when enable secure boot.
> > 
> > OK, I will ask a third time: what _problem_ does this solve?
> > What is the symptom?
> > When someone uses the buggy firmware, what does not work for them?
> > This information _always_ needs to be in the commit message.
> 
> This patch is using with series v1 patch 'Hisilicon/D06: Fix SBBR-SCT AuthVar 
> issue'
> to fix the SCT issue:
> RT.SetVariable - Set Invalid Time Base Auth Variable – FAILURE;
> RT.SetVariable - Create one Time Base Auth Variable, the expect return
> status should be EFI_SUCCESS – FAILURE.

OK, but if we don't have authenticated variables (all the way to the
hardware), then this is the correct behaviour? Making the test pass
anyway is not the correct solution.

/
Leif
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v2] ArmPkg/ArmSmcPsciResetSystemLib: add missing call to ExitBootServices()

2018-11-20 Thread Leif Lindholm
On Tue, Nov 20, 2018 at 04:44:33PM +0100, Ard Biesheuvel wrote:
> Our poor man's implementation of EnterS3WithImmediateWake () currently
> sets a high TPL level to disable interrupts, and simply calls the
> PEI entrypoint again after disabling the MMU.
> 
> Unfortunately, this is not sufficient: DMA capable devices such as
> network controllers or USB controllers may still be enabled and
> writing to memory, e.g., in response to incoming network packets.
> 
> So instead, do the full ExitBootServices() dance: allocate space and
> get the memory map, call ExitBootServices(), and in case it fails, get
> the memory map again and call ExitBootServices() again. This ensures
> that all cleanup related to DMA capable devices is performed before
> doing the warm reset.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel 
> ---
> v2: - add asm routines to ensure that we don't access memory after
>   disabling the MMU and caches

Fun times.
Reviewed-by: Leif Lindholm 

> - set MemMap to NULL
> 
>  ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.S  | 30 
> +++
>  ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.asm| 35 
> 
>  ArmPkg/Library/ArmSmcPsciResetSystemLib/Arm/Reset.S  | 29 
> ++
>  ArmPkg/Library/ArmSmcPsciResetSystemLib/Arm/Reset.asm| 34 
> 
>  ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c   | 57 
> +---
>  ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.inf |  8 +++
>  6 files changed, 187 insertions(+), 6 deletions(-)
> 
> diff --git a/ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.S 
> b/ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.S
> new file mode 100644
> index ..1edca941cb8f
> --- /dev/null
> +++ b/ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.S
> @@ -0,0 +1,30 @@
> +/** @file
> +  ResetSystemLib implementation using PSCI calls
> +
> +  Copyright (c) 2018, Linaro Ltd. All rights reserved.
> +
> +  This program and the accompanying materials
> +  are licensed and made available under the terms and conditions of the BSD 
> License
> +  which accompanies this distribution. The full text of the license may be 
> found at
> +  http://opensource.org/licenses/bsd-license.php
> +
> +  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
> IMPLIED.
> +
> +**/
> +
> +#include 
> +
> +ASM_FUNC(DisableMmuAndReenterPei)
> +  stp   x29, x30, [sp, #-16]!
> +  mov   x29, sp
> +
> +  blArmDisableMmu
> +
> +  // no memory accesses after MMU and caches have been disabled
> +
> +  MOV64 (x0, FixedPcdGet64 (PcdFvBaseAddress))
> +  blr   x0
> +
> +  // never returns
> +  nop
> diff --git a/ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.asm 
> b/ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.asm
> new file mode 100644
> index ..b3dca150c150
> --- /dev/null
> +++ b/ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.asm
> @@ -0,0 +1,35 @@
> +/** @file
> +  ResetSystemLib implementation using PSCI calls
> +
> +  Copyright (c) 2018, Linaro Ltd. All rights reserved.
> +
> +  This program and the accompanying materials
> +  are licensed and made available under the terms and conditions of the BSD 
> License
> +  which accompanies this distribution. The full text of the license may be 
> found at
> +  http://opensource.org/licenses/bsd-license.php
> +
> +  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
> IMPLIED.
> +
> +**/
> +
> +  AREA Reset, CODE, READONLY
> +
> +  EXPORT DisableMmuAndReenterPei
> +  IMPORT ArmDisableMmu
> +
> +DisableMmuAndReenterPei
> +  stp   x29, x30, [sp, #-16]!
> +  mov   x29, sp
> +
> +  blArmDisableMmu
> +
> +  ; no memory accesses after MMU and caches have been disabled
> +
> +  movl  x0, FixedPcdGet64 (PcdFvBaseAddress)
> +  blr   x0
> +
> +  ; never returns
> +  nop
> +
> +  END
> diff --git a/ArmPkg/Library/ArmSmcPsciResetSystemLib/Arm/Reset.S 
> b/ArmPkg/Library/ArmSmcPsciResetSystemLib/Arm/Reset.S
> new file mode 100644
> index ..b6fe2bd82baa
> --- /dev/null
> +++ b/ArmPkg/Library/ArmSmcPsciResetSystemLib/Arm/Reset.S
> @@ -0,0 +1,29 @@
> +/** @file
> +  ResetSystemLib implementation using PSCI calls
> +
> +  Copyright (c) 2018, Linaro Ltd. All rights reserved.
> +
> +  This program and the accompanying materials
> +  are licensed and made available under the terms and conditions of the BSD 
> License
> +  which accompanies this distribution. The full text of the license may be 
> found at
> +  http://opensource.org/licenses/bsd-license.php
> +
> +  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
> IMPLIED.
> +
> +**/
> +
> 

[edk2] [PATCH v2] ArmPkg/ArmSmcPsciResetSystemLib: add missing call to ExitBootServices()

2018-11-20 Thread Ard Biesheuvel
Our poor man's implementation of EnterS3WithImmediateWake () currently
sets a high TPL level to disable interrupts, and simply calls the
PEI entrypoint again after disabling the MMU.

Unfortunately, this is not sufficient: DMA capable devices such as
network controllers or USB controllers may still be enabled and
writing to memory, e.g., in response to incoming network packets.

So instead, do the full ExitBootServices() dance: allocate space and
get the memory map, call ExitBootServices(), and in case it fails, get
the memory map again and call ExitBootServices() again. This ensures
that all cleanup related to DMA capable devices is performed before
doing the warm reset.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel 
---
v2: - add asm routines to ensure that we don't access memory after
  disabling the MMU and caches
- set MemMap to NULL

 ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.S  | 30 
+++
 ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.asm| 35 

 ArmPkg/Library/ArmSmcPsciResetSystemLib/Arm/Reset.S  | 29 
++
 ArmPkg/Library/ArmSmcPsciResetSystemLib/Arm/Reset.asm| 34 

 ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c   | 57 
+---
 ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.inf |  8 +++
 6 files changed, 187 insertions(+), 6 deletions(-)

diff --git a/ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.S 
b/ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.S
new file mode 100644
index ..1edca941cb8f
--- /dev/null
+++ b/ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.S
@@ -0,0 +1,30 @@
+/** @file
+  ResetSystemLib implementation using PSCI calls
+
+  Copyright (c) 2018, Linaro Ltd. All rights reserved.
+
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution. The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include 
+
+ASM_FUNC(DisableMmuAndReenterPei)
+  stp   x29, x30, [sp, #-16]!
+  mov   x29, sp
+
+  blArmDisableMmu
+
+  // no memory accesses after MMU and caches have been disabled
+
+  MOV64 (x0, FixedPcdGet64 (PcdFvBaseAddress))
+  blr   x0
+
+  // never returns
+  nop
diff --git a/ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.asm 
b/ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.asm
new file mode 100644
index ..b3dca150c150
--- /dev/null
+++ b/ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.asm
@@ -0,0 +1,35 @@
+/** @file
+  ResetSystemLib implementation using PSCI calls
+
+  Copyright (c) 2018, Linaro Ltd. All rights reserved.
+
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution. The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+  AREA Reset, CODE, READONLY
+
+  EXPORT DisableMmuAndReenterPei
+  IMPORT ArmDisableMmu
+
+DisableMmuAndReenterPei
+  stp   x29, x30, [sp, #-16]!
+  mov   x29, sp
+
+  blArmDisableMmu
+
+  ; no memory accesses after MMU and caches have been disabled
+
+  movl  x0, FixedPcdGet64 (PcdFvBaseAddress)
+  blr   x0
+
+  ; never returns
+  nop
+
+  END
diff --git a/ArmPkg/Library/ArmSmcPsciResetSystemLib/Arm/Reset.S 
b/ArmPkg/Library/ArmSmcPsciResetSystemLib/Arm/Reset.S
new file mode 100644
index ..b6fe2bd82baa
--- /dev/null
+++ b/ArmPkg/Library/ArmSmcPsciResetSystemLib/Arm/Reset.S
@@ -0,0 +1,29 @@
+/** @file
+  ResetSystemLib implementation using PSCI calls
+
+  Copyright (c) 2018, Linaro Ltd. All rights reserved.
+
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution. The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include 
+
+ASM_FUNC(DisableMmuAndReenterPei)
+  push  {lr}
+
+  blArmDisableMmu
+
+  // no memory accesses after MMU and caches have been disabled
+
+  MOV32 (r0, FixedPcdGet64 (PcdFvBaseAddress))
+  blx   r0
+
+  // never returns
+  nop
diff --git a/ArmPkg/Library/ArmSmcPsciResetSystemLib/Arm/Reset.asm 
b/ArmPkg/Library/ArmSmcPsciResetSystemLib/Arm/Reset.asm
new file mode 100644
index 

Re: [edk2] [PATCH edk2-platforms v3 1/5] Hisilicon/D0x: Fix secure boot bug in FlashFvbDxe

2018-11-20 Thread Laszlo Ersek
On 11/20/18 16:00, Ming Huang wrote:
> 
> 
> On 11/20/2018 10:39 PM, Leif Lindholm wrote:
>> On Tue, Nov 20, 2018 at 10:29:57PM +0800, Ming Huang wrote:
>> And all Hisilicon platforms still use
>> AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
>> regardless of Secure Boot setting.
>>
>> So what problem does this patch solve? A runtime one?
>
> This patch solve bug in FlashFvbDxe.

 Yes, but what bug? What is the symptom? What _specific_ problem goes
 away by adding this patch? That information should have been in the
 original commit message. I have no information available to me as I
 now build -rc1 to suggest that this patch should be included.
>>>
>>> The bug is that gEfiAuthenticatedVariableGuid should be used in FlashFvbDxe,
>>> not gEfiVariableGuid when enable secure boot.
>>
>> OK, I will ask a third time: what _problem_ does this solve?
>> What is the symptom?
>> When someone uses the buggy firmware, what does not work for them?
>> This information _always_ needs to be in the commit message.
> 
> This patch is using with series v1 patch 'Hisilicon/D06: Fix SBBR-SCT AuthVar 
> issue'
> to fix the SCT issue:
> RT.SetVariable - Set Invalid Time Base Auth Variable – FAILURE;
> RT.SetVariable - Create one Time Base Auth Variable, the expect return
> status should be EFI_SUCCESS – FAILURE.

Side comment (because the main comment is Ard's): regarding the
Signature GUID in VARIABLE_STORE_HEADER, commit d92eaabefbe0 ("OvmfPkg:
simplify VARIABLE_STORE_HEADER generation", 2016-02-15) might provide
some background.

Thanks,
Laszlo

> Should I add a patch before this patch
> to solve build error with -D SECURE_BOOT_ENABLE=TRUE in v4?

 That would require a sane implementation of PlatformSecureLib,
 implementing a real UserPhysicalPresent().
 Can you turn that around within the next few hours?
>>>
>>> My original idea is using 
>>> OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.
>>> There is not enough time to implement a real UserPhysicalPresent.
>>
>> If there is not enough time to implement a real PlatformSecureLib,
>> there is no need to have Secure Boot at all. Same thing goes for
>> secure variable store (to hardware devices that are not accessible
>> from Non-secure world).
>>
>>> This patch will add when we implement real secure boot in future.
>>
>> That sounds like the best thing to do.
>>
>> Meanwhile, could you create a patch to get rid of the SECURE_BOOT
>> options completely from the .dsc/.fdf please? I don't like having it
>> in there when we know it doesn't build.
>>
>> /
>> Leif
>>

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v3 1/5] Hisilicon/D0x: Fix secure boot bug in FlashFvbDxe

2018-11-20 Thread Laszlo Ersek
On 11/20/18 15:40, Ard Biesheuvel wrote:
> On Tue, 20 Nov 2018 at 15:30, Ming Huang  wrote:
>>
>>
>>
>> On 11/20/2018 8:58 PM, Leif Lindholm wrote:
>>> On Tue, Nov 20, 2018 at 08:40:28PM +0800, Ming Huang wrote:


 On 11/20/2018 8:13 PM, Leif Lindholm wrote:
> On Tue, Nov 20, 2018 at 05:01:46PM +0800, Ming Huang wrote:
>> Now that the generic Variable Runtime DXE code no longer
>> distinguishes between gEfiVariableGuid and
>> gEfiAuthenticatedVariableGuid in the varstore FV header.
>> We can relax the check in the flashFvb driver to accept
>> either GUID regardless of whether we are running a secure
>> boot capable build or not.
>
> We are still in a situation where D06 is not buildable with Secure
> Boot enabled though.
>
> If you build with -D SECURE_BOOT_ENABLE=TRUE, you still end up with
> /work/git/edk2-platforms/Platform/Hisilicon/D06/D06.dsc(...): error
> 4000: Instance of library class [PlatformSecureLib] is not found
>   in 
> [/work/git/edk2/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf]
>  [AARCH64]
>   consumed by module 
> [/work/git/edk2/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf]
>
> And all Hisilicon platforms still use
> AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
> regardless of Secure Boot setting.
>
> So what problem does this patch solve? A runtime one?

 This patch solve bug in FlashFvbDxe.
>>>
>>> Yes, but what bug? What is the symptom? What _specific_ problem goes
>>> away by adding this patch? That information should have been in the
>>> original commit message. I have no information available to me as I
>>> now build -rc1 to suggest that this patch should be included.
>>
>> The bug is that gEfiAuthenticatedVariableGuid should be used in FlashFvbDxe,
>> not gEfiVariableGuid when enable secure boot.
>>
>>>
 Should I add a patch before this patch
 to solve build error with -D SECURE_BOOT_ENABLE=TRUE in v4?
>>>
>>> That would require a sane implementation of PlatformSecureLib,
>>> implementing a real UserPhysicalPresent().
>>> Can you turn that around within the next few hours?
>>
>> My original idea is using 
>> OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.
>> There is not enough time to implement a real UserPhysicalPresent.
>> This patch will add when we implement real secure boot in future.
>>
> 
> I think it is a terrible idea to enable secure boot now in an insecure
> manner, and enable 'real' secure boot later.
> 
> Note that it is impossible to implement secure boot in a secure manner
> using the generic VariableRuntimeDxe. The crypto routines that perform
> the authentication are located in EfiRuntimeServicesCode memory
> regions, which are writable by the OS, and so any exploit on the OS
> side can modify that code to defeat the checks. Also, the SPI flash
> that backs the variable store is accessible by the OS directly.
> 
> That means a proper secure boot implementation will not be based on
> any of the components in use currently, and so enabling it does
> nothing except confuse people or give them a false sense of security.
> If this is based on OS or firmware test results, please disregard
> those - this is a tick the box mentality that is wholly incompatible
> with building secure systems.
> 

Yup.

Thanks,
Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [edk2-test][PATCH] Framework/Include: allow usage with EFI version 2.7

2018-11-20 Thread Supreeth Venkatesh
Thanks Lokesh for the patch.
Has this been compiled and sanity tested against latest edk2?
Let me know SHA of edk2 tested, so that I can test it against that SHA and push 
it.

If so, Reviewed-by: Supreeth Venkatesh 

-Original Message-
From: Lokesh B V 
Sent: Tuesday, November 20, 2018 12:50 AM
To: edk2-devel@lists.01.org; Supreeth Venkatesh ; 
eric@intel.com
Cc: Lokesh Belathur Veerappa 
Subject: [edk2-test][PATCH] Framework/Include: allow usage with EFI version 2.7

EDK2 supports EFI version 2.7 and so allow UEFI-SCT to be usable with this 
version of EFI.

Signed-off-by: Lokesh B V 
---
 uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/Include/SctDef.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/Include/SctDef.h 
b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/Include/SctDef.h
index d24c201..c861437 100644
--- a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/Include/SctDef.h
+++ b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/Include/SctDef.h
@@ -46,6 +46,8 @@ Abstract:
 #define EFI_SCT_NAMEL"UEFI2.5 Self Certification 
Test(SCT2)"
 #elif (EFI_SPECIFICATION_VERSION == EFI_2_60_SYSTEM_TABLE_REVISION)
 #define EFI_SCT_NAMEL"UEFI2.6 Self Certification 
Test(SCT2)"
+#elif (EFI_SPECIFICATION_VERSION == EFI_2_70_SYSTEM_TABLE_REVISION)
+#define EFI_SCT_NAMEL"UEFI2.7 Self Certification 
Test(SCT2)"
 #else
 #error Unknown EFI_SPECIFICATION_VERSION  #endif
--
2.7.4

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.
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v3 1/5] Hisilicon/D0x: Fix secure boot bug in FlashFvbDxe

2018-11-20 Thread Ming Huang


On 11/20/2018 10:39 PM, Leif Lindholm wrote:
> On Tue, Nov 20, 2018 at 10:29:57PM +0800, Ming Huang wrote:
> And all Hisilicon platforms still use
> AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
> regardless of Secure Boot setting.
>
> So what problem does this patch solve? A runtime one?

 This patch solve bug in FlashFvbDxe.
>>>
>>> Yes, but what bug? What is the symptom? What _specific_ problem goes
>>> away by adding this patch? That information should have been in the
>>> original commit message. I have no information available to me as I
>>> now build -rc1 to suggest that this patch should be included.
>>
>> The bug is that gEfiAuthenticatedVariableGuid should be used in FlashFvbDxe,
>> not gEfiVariableGuid when enable secure boot.
> 
> OK, I will ask a third time: what _problem_ does this solve?
> What is the symptom?
> When someone uses the buggy firmware, what does not work for them?
> This information _always_ needs to be in the commit message.

This patch is using with series v1 patch 'Hisilicon/D06: Fix SBBR-SCT AuthVar 
issue'
to fix the SCT issue:
RT.SetVariable - Set Invalid Time Base Auth Variable – FAILURE;
RT.SetVariable - Create one Time Base Auth Variable, the expect return
status should be EFI_SUCCESS – FAILURE.

> 
 Should I add a patch before this patch
 to solve build error with -D SECURE_BOOT_ENABLE=TRUE in v4?
>>>
>>> That would require a sane implementation of PlatformSecureLib,
>>> implementing a real UserPhysicalPresent().
>>> Can you turn that around within the next few hours?
>>
>> My original idea is using 
>> OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.
>> There is not enough time to implement a real UserPhysicalPresent.
> 
> If there is not enough time to implement a real PlatformSecureLib,
> there is no need to have Secure Boot at all. Same thing goes for
> secure variable store (to hardware devices that are not accessible
> from Non-secure world).
> 
>> This patch will add when we implement real secure boot in future.
> 
> That sounds like the best thing to do.
> 
> Meanwhile, could you create a patch to get rid of the SECURE_BOOT
> options completely from the .dsc/.fdf please? I don't like having it
> in there when we know it doesn't build.
> 
> /
> Leif
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 1/1] Platform/ARM/SgiPkg: increase max variable size to 8KB

2018-11-20 Thread Leif Lindholm
On Tue, Nov 20, 2018 at 07:32:35PM +0530, Thomas Abraham wrote:
> On Tue, Nov 20, 2018 at 6:45 PM Leif Lindholm  
> wrote:
> >
> > On Tue, Nov 20, 2018 at 04:01:02PM +0530, Vijayenthiran Subramaniam wrote:
> > > Commit dc37ca75 ("Edk2Platforms: Replace MdeModulePkg PXE/iSCSI/TCP with
> > > NetworkPkg drivers") switched to using iSCSI driver from the NetworkPkg
> > > package. This driver requires the platform to support a maximum variable
> > > size of atleast 4KB.
> > >
> > > So increase the maximum supported variable size to 8KB on the SGI
> > > platforms. Without this, the iSCSI driver fails to load.
> > >
> > > Cc: Ard Biesheuvel 
> > > Cc: Leif Lindholm 
> > > Contributed-under: TianoCore Contribution Agreement 1.1
> > > Signed-off-by: Vijayenthiran Subramaniam 
> > > 
> >
> > Looks good to me, but I'd like an R-b from Thomas/Nariman.
> 
> Reviewed-by: Thomas Abraham 

Thanks!
Reviewed-by: Leif Lindholm 
Pushed as d9e68a756c.

> >
> > On a separate note, MdeModulePkg maintainers - is this reason enough
> > to change the default of this Pcd?
> >
> > /
> > Leif
> >
> > > ---
> > >  Platform/ARM/SgiPkg/SgiPlatform.dsc | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc 
> > > b/Platform/ARM/SgiPkg/SgiPlatform.dsc
> > > index 3f0ca9872e79..1c152fad2246 100644
> > > --- a/Platform/ARM/SgiPkg/SgiPlatform.dsc
> > > +++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc
> > > @@ -102,6 +102,7 @@
> > >
> > >  [PcdsFixedAtBuild.common]
> > >gArmTokenSpaceGuid.PcdVFPEnabled|1
> > > +  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000
> > >
> > ># DRAM Block2 Base and Size
> > >gArmSgiTokenSpaceGuid.PcdDramBlock2Base|0x808000
> > > --
> > > 2.17.1
> > >
> > ___
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ArmPkg/ArmSmcPsciResetSystemLib: add missing call to ExitBootServices()

2018-11-20 Thread Leif Lindholm
On Tue, Nov 20, 2018 at 03:33:00PM +0100, Ard Biesheuvel wrote:
> Our poor man's implementation of EnterS3WithImmediateWake () currently
> sets a high TPL level to disable interrupts, and simply calls the
> PEI entrypoint again after disabling the MMU.
> 
> Unfortunately, this is not sufficient: DMA capable devices such as
> network controllers or USB controllers may still be enabled and
> writing to memory, e.g., in response to incoming network packets.
> 
> So instead, do the full ExitBootServices() dance: allocate space and
> get the memory map, call ExitBootServices(), and in case it fails, get
> the memory map again and call ExitBootServices() again. This ensures
> that all cleanup related to DMA capable devices is performed before
> doing the warm reset.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel 
> ---
>  ArmPkg/Include/Library/ArmLib.h|  1 +
>  ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c | 51 
> ++--
>  2 files changed, 49 insertions(+), 3 deletions(-)
> 
> diff --git a/ArmPkg/Include/Library/ArmLib.h b/ArmPkg/Include/Library/ArmLib.h
> index e46df447b33d..ffda50e9d767 100644
> --- a/ArmPkg/Include/Library/ArmLib.h
> +++ b/ArmPkg/Include/Library/ArmLib.h
> @@ -59,6 +59,7 @@ typedef enum {
>  
>  typedef struct {
>EFI_PHYSICAL_ADDRESS  PhysicalBase;
> +  EFI_VIRTUAL_ADDRESS   VirtualBase;
>UINT64Length;
>ARM_MEMORY_REGION_ATTRIBUTES  Attributes;
>  } ARM_MEMORY_REGION_DESCRIPTOR;

Without the above hunk:
Reviewed-by: Leif Lindholm 

> diff --git 
> a/ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c 
> b/ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c
> index 10ceafd14d5d..c9c42ab3b244 100644
> --- a/ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c
> +++ b/ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c
> @@ -1,7 +1,7 @@
>  /** @file
>ResetSystemLib implementation using PSCI calls
>  
> -  Copyright (c) 2017, Linaro Ltd. All rights reserved.
> +  Copyright (c) 2017 - 2018, Linaro Ltd. All rights reserved.
>  
>This program and the accompanying materials
>are licensed and made available under the terms and conditions of the BSD 
> License
> @@ -92,7 +92,13 @@ EnterS3WithImmediateWake (
>VOID
>)
>  {
> -  VOID (*Reset)(VOID);
> +  VOID(*Reset)(VOID);
> +  EFI_PHYSICAL_ADDRESSAlloc;
> +  EFI_MEMORY_DESCRIPTOR   *MemMap;
> +  UINTN   MemMapSize;
> +  UINTN   MapKey, DescriptorSize;
> +  UINT32  DescriptorVersion;
> +  EFI_STATUS  Status;
>  
>if (FeaturePcdGet (PcdArmReenterPeiForCapsuleWarmReboot) &&
>!EfiAtRuntime ()) {
> @@ -103,7 +109,46 @@ EnterS3WithImmediateWake (
>  //
>  Reset = (VOID (*)(VOID))(UINTN)FixedPcdGet64 (PcdFvBaseAddress);
>  
> -gBS->RaiseTPL (TPL_HIGH_LEVEL);
> +//
> +// Obtain the size of the memory map
> +//
> +MemMapSize = 0;
> +Status = gBS->GetMemoryMap (, MemMap, , 
> ,
> +);
> +ASSERT (Status == EFI_BUFFER_TOO_SMALL);
> +
> +//
> +// Add some slack to the allocation to cater for changes in the memory
> +// map if ExitBootServices () fails the first time around.
> +//
> +MemMapSize += SIZE_4KB;
> +Status = gBS->AllocatePages (AllocateAnyPages, EfiBootServicesData,
> +EFI_SIZE_TO_PAGES (MemMapSize), );
> +ASSERT_EFI_ERROR (Status);
> +
> +MemMap = (EFI_MEMORY_DESCRIPTOR *)(UINTN)Alloc;
> +
> +Status = gBS->GetMemoryMap (, MemMap, , 
> ,
> +);
> +ASSERT_EFI_ERROR (Status);
> +
> +Status = gBS->ExitBootServices (gImageHandle, MapKey);
> +if (EFI_ERROR (Status)) {
> +  //
> +  // ExitBootServices () may fail the first time around if an event fired
> +  // right after the call to GetMemoryMap() which allocated or freed 
> memory.
> +  // Since that first call to ExitBootServices () will disarm the timer,
> +  // this is guaranteed not to happen again, so one additional attempt
> +  // should suffice.
> +  //
> +  Status = gBS->GetMemoryMap (, MemMap, , 
> ,
> +  );
> +  ASSERT_EFI_ERROR (Status);
> +
> +  Status = gBS->ExitBootServices (gImageHandle, MapKey);
> +  ASSERT_EFI_ERROR (Status);
> +}
> +
>  ArmDisableMmu ();
>  Reset ();
>}
> -- 
> 2.17.1
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v3 1/5] Hisilicon/D0x: Fix secure boot bug in FlashFvbDxe

2018-11-20 Thread Ard Biesheuvel
On Tue, 20 Nov 2018 at 15:30, Ming Huang  wrote:
>
>
>
> On 11/20/2018 8:58 PM, Leif Lindholm wrote:
> > On Tue, Nov 20, 2018 at 08:40:28PM +0800, Ming Huang wrote:
> >>
> >>
> >> On 11/20/2018 8:13 PM, Leif Lindholm wrote:
> >>> On Tue, Nov 20, 2018 at 05:01:46PM +0800, Ming Huang wrote:
>  Now that the generic Variable Runtime DXE code no longer
>  distinguishes between gEfiVariableGuid and
>  gEfiAuthenticatedVariableGuid in the varstore FV header.
>  We can relax the check in the flashFvb driver to accept
>  either GUID regardless of whether we are running a secure
>  boot capable build or not.
> >>>
> >>> We are still in a situation where D06 is not buildable with Secure
> >>> Boot enabled though.
> >>>
> >>> If you build with -D SECURE_BOOT_ENABLE=TRUE, you still end up with
> >>> /work/git/edk2-platforms/Platform/Hisilicon/D06/D06.dsc(...): error
> >>> 4000: Instance of library class [PlatformSecureLib] is not found
> >>>   in 
> >>> [/work/git/edk2/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf]
> >>>  [AARCH64]
> >>>   consumed by module 
> >>> [/work/git/edk2/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf]
> >>>
> >>> And all Hisilicon platforms still use
> >>> AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
> >>> regardless of Secure Boot setting.
> >>>
> >>> So what problem does this patch solve? A runtime one?
> >>
> >> This patch solve bug in FlashFvbDxe.
> >
> > Yes, but what bug? What is the symptom? What _specific_ problem goes
> > away by adding this patch? That information should have been in the
> > original commit message. I have no information available to me as I
> > now build -rc1 to suggest that this patch should be included.
>
> The bug is that gEfiAuthenticatedVariableGuid should be used in FlashFvbDxe,
> not gEfiVariableGuid when enable secure boot.
>
> >
> >> Should I add a patch before this patch
> >> to solve build error with -D SECURE_BOOT_ENABLE=TRUE in v4?
> >
> > That would require a sane implementation of PlatformSecureLib,
> > implementing a real UserPhysicalPresent().
> > Can you turn that around within the next few hours?
>
> My original idea is using OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.
> There is not enough time to implement a real UserPhysicalPresent.
> This patch will add when we implement real secure boot in future.
>

I think it is a terrible idea to enable secure boot now in an insecure
manner, and enable 'real' secure boot later.

Note that it is impossible to implement secure boot in a secure manner
using the generic VariableRuntimeDxe. The crypto routines that perform
the authentication are located in EfiRuntimeServicesCode memory
regions, which are writable by the OS, and so any exploit on the OS
side can modify that code to defeat the checks. Also, the SPI flash
that backs the variable store is accessible by the OS directly.

That means a proper secure boot implementation will not be based on
any of the components in use currently, and so enabling it does
nothing except confuse people or give them a false sense of security.
If this is based on OS or firmware test results, please disregard
those - this is a tick the box mentality that is wholly incompatible
with building secure systems.
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH] ArmPkg/ArmSmcPsciResetSystemLib: add missing call to ExitBootServices()

2018-11-20 Thread Ard Biesheuvel
Our poor man's implementation of EnterS3WithImmediateWake () currently
sets a high TPL level to disable interrupts, and simply calls the
PEI entrypoint again after disabling the MMU.

Unfortunately, this is not sufficient: DMA capable devices such as
network controllers or USB controllers may still be enabled and
writing to memory, e.g., in response to incoming network packets.

So instead, do the full ExitBootServices() dance: allocate space and
get the memory map, call ExitBootServices(), and in case it fails, get
the memory map again and call ExitBootServices() again. This ensures
that all cleanup related to DMA capable devices is performed before
doing the warm reset.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel 
---
 ArmPkg/Include/Library/ArmLib.h|  1 +
 ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c | 51 
++--
 2 files changed, 49 insertions(+), 3 deletions(-)

diff --git a/ArmPkg/Include/Library/ArmLib.h b/ArmPkg/Include/Library/ArmLib.h
index e46df447b33d..ffda50e9d767 100644
--- a/ArmPkg/Include/Library/ArmLib.h
+++ b/ArmPkg/Include/Library/ArmLib.h
@@ -59,6 +59,7 @@ typedef enum {
 
 typedef struct {
   EFI_PHYSICAL_ADDRESS  PhysicalBase;
+  EFI_VIRTUAL_ADDRESS   VirtualBase;
   UINT64Length;
   ARM_MEMORY_REGION_ATTRIBUTES  Attributes;
 } ARM_MEMORY_REGION_DESCRIPTOR;
diff --git a/ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c 
b/ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c
index 10ceafd14d5d..c9c42ab3b244 100644
--- a/ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c
+++ b/ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c
@@ -1,7 +1,7 @@
 /** @file
   ResetSystemLib implementation using PSCI calls
 
-  Copyright (c) 2017, Linaro Ltd. All rights reserved.
+  Copyright (c) 2017 - 2018, Linaro Ltd. All rights reserved.
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
@@ -92,7 +92,13 @@ EnterS3WithImmediateWake (
   VOID
   )
 {
-  VOID (*Reset)(VOID);
+  VOID(*Reset)(VOID);
+  EFI_PHYSICAL_ADDRESSAlloc;
+  EFI_MEMORY_DESCRIPTOR   *MemMap;
+  UINTN   MemMapSize;
+  UINTN   MapKey, DescriptorSize;
+  UINT32  DescriptorVersion;
+  EFI_STATUS  Status;
 
   if (FeaturePcdGet (PcdArmReenterPeiForCapsuleWarmReboot) &&
   !EfiAtRuntime ()) {
@@ -103,7 +109,46 @@ EnterS3WithImmediateWake (
 //
 Reset = (VOID (*)(VOID))(UINTN)FixedPcdGet64 (PcdFvBaseAddress);
 
-gBS->RaiseTPL (TPL_HIGH_LEVEL);
+//
+// Obtain the size of the memory map
+//
+MemMapSize = 0;
+Status = gBS->GetMemoryMap (, MemMap, , ,
+);
+ASSERT (Status == EFI_BUFFER_TOO_SMALL);
+
+//
+// Add some slack to the allocation to cater for changes in the memory
+// map if ExitBootServices () fails the first time around.
+//
+MemMapSize += SIZE_4KB;
+Status = gBS->AllocatePages (AllocateAnyPages, EfiBootServicesData,
+EFI_SIZE_TO_PAGES (MemMapSize), );
+ASSERT_EFI_ERROR (Status);
+
+MemMap = (EFI_MEMORY_DESCRIPTOR *)(UINTN)Alloc;
+
+Status = gBS->GetMemoryMap (, MemMap, , ,
+);
+ASSERT_EFI_ERROR (Status);
+
+Status = gBS->ExitBootServices (gImageHandle, MapKey);
+if (EFI_ERROR (Status)) {
+  //
+  // ExitBootServices () may fail the first time around if an event fired
+  // right after the call to GetMemoryMap() which allocated or freed 
memory.
+  // Since that first call to ExitBootServices () will disarm the timer,
+  // this is guaranteed not to happen again, so one additional attempt
+  // should suffice.
+  //
+  Status = gBS->GetMemoryMap (, MemMap, , 
,
+  );
+  ASSERT_EFI_ERROR (Status);
+
+  Status = gBS->ExitBootServices (gImageHandle, MapKey);
+  ASSERT_EFI_ERROR (Status);
+}
+
 ArmDisableMmu ();
 Reset ();
   }
-- 
2.17.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v3 1/5] Hisilicon/D0x: Fix secure boot bug in FlashFvbDxe

2018-11-20 Thread Leif Lindholm
On Tue, Nov 20, 2018 at 10:29:57PM +0800, Ming Huang wrote:
> >>> And all Hisilicon platforms still use
> >>> AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
> >>> regardless of Secure Boot setting.
> >>>
> >>> So what problem does this patch solve? A runtime one?
> >>
> >> This patch solve bug in FlashFvbDxe.
> > 
> > Yes, but what bug? What is the symptom? What _specific_ problem goes
> > away by adding this patch? That information should have been in the
> > original commit message. I have no information available to me as I
> > now build -rc1 to suggest that this patch should be included.
> 
> The bug is that gEfiAuthenticatedVariableGuid should be used in FlashFvbDxe,
> not gEfiVariableGuid when enable secure boot.

OK, I will ask a third time: what _problem_ does this solve?
What is the symptom?
When someone uses the buggy firmware, what does not work for them?
This information _always_ needs to be in the commit message.

> >> Should I add a patch before this patch
> >> to solve build error with -D SECURE_BOOT_ENABLE=TRUE in v4?
> > 
> > That would require a sane implementation of PlatformSecureLib,
> > implementing a real UserPhysicalPresent().
> > Can you turn that around within the next few hours?
> 
> My original idea is using OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.
> There is not enough time to implement a real UserPhysicalPresent.

If there is not enough time to implement a real PlatformSecureLib,
there is no need to have Secure Boot at all. Same thing goes for
secure variable store (to hardware devices that are not accessible
from Non-secure world).

> This patch will add when we implement real secure boot in future.

That sounds like the best thing to do.

Meanwhile, could you create a patch to get rid of the SECURE_BOOT
options completely from the .dsc/.fdf please? I don't like having it
in there when we know it doesn't build.

/
Leif
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms] Platform/ARM: replace hardcoded VenHW() device paths referring to NOR flash

2018-11-20 Thread Thomas Abraham
On Tue, Nov 20, 2018 at 7:48 PM Leif Lindholm  wrote:
>
> On Tue, Nov 20, 2018 at 07:31:34PM +0530, Thomas Abraham wrote:
> > On Tue, Nov 20, 2018 at 1:01 AM Ard Biesheuvel
> >  wrote:
> > >
> > > On Mon, 19 Nov 2018 at 11:30, Leif Lindholm  
> > > wrote:
> > > >
> > > > Hmm, a follow-up question (which does not affect my r-b):
> > > >
> > > > We still keep the manually generated GUIDs in
> > > > ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c,
> > > > Platform/ARM/JunoPkg/Library/NorFlashJunoLib/NorFlashJuno.c,
> > > > Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.c,
> > > > Platform/ARM/VExpressPkg/Library/NorFlashArmVExpressLib/NorFlashArmVExpress.c,
> > > > Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacer.c,
> > > >
> > > > and indeed in the NOR_FLASH_DESCRIPTION struct in
> > > > ArmPlatformPkg/Include/Library/NorFlashPlatformLib.h
> > > >
> > > > Is this an opportunity for a negative diffstat?
> > >
> > > Yes. I was anticipating some discussion on renaming the NOR flash
> > > blocks, but indeed, we can drop all of the above once the rename
> > > change is in.
> > >
> > >
> > > > On Mon, Nov 19, 2018 at 07:12:47PM +, Leif Lindholm wrote:
> > > > > On Fri, Nov 16, 2018 at 05:23:08PM -0800, Ard Biesheuvel wrote:
> > > > > > The ArmPlatformPkg NOR flash driver has been updated to use device 
> > > > > > paths
> > > > > > consisting of a fixed GUID and a numeric index rather than a 
> > > > > > separate GUID
> > > > > > for each flash bank on a given system. This means all explicit 
> > > > > > device path
> > > > > > references to NOR flash banks have to be brought up to date as well.
> > > > > >
> > > > > > Contributed-under: TianoCore Contribution Agreement 1.1
> > > > > > Signed-off-by: Ard Biesheuvel 
> > > > >
> > > > > This looks good to me, but I'd like a comment from Thomas/Nariman.
> > > > >
> > > > > With that:
> > > > > Reviewed-by: Leif Lindholm 
> > > > >
> >
> > Tested this patch and "[PATCH 0/2] ArmPlatformPkg, ArmVirtPkg:
> > discover NOR flash banks from DTB" patch series on the SGI-575
> > platform. Access to NOR flash works fine with bank index as well.
>
> That is good to know, but the platform I'm more concerned about is
> Juno with its crazy bootmonfs. There are still plenty of those used in
> test farms and suchlike.

Sure, I will test this change on the Juno board as well.

>
> > Should GUID's listed in all the instances of NOR_FLASH_DESCRIPTION in
> > edk2-platforms be removed in this patch?
>
> That was what I alluded to above. Ard prefers to do that as a separate
> patch once this is all merged, and I don't mind that approach.

Okay.

Thanks,
Thomas.

>
> Regards,
>
> Leif
>
> > Thanks,
> > Thomas.
> >
> >
> > > > > > ---
> > > > > >  Platform/ARM/JunoPkg/ArmJuno.dec  | 2 +-
> > > > > >  Platform/ARM/JunoPkg/ArmJuno.dsc  | 2 +-
> > > > > >  Platform/ARM/SgiPkg/SgiPlatform.dsc   | 2 +-
> > > > > >  Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc | 2 +-
> > > > > >  Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc  | 2 +-
> > > > > >  5 files changed, 5 insertions(+), 5 deletions(-)
> > > > > >
> > > > > > diff --git a/Platform/ARM/JunoPkg/ArmJuno.dec 
> > > > > > b/Platform/ARM/JunoPkg/ArmJuno.dec
> > > > > > index edbbb827ad45..c511796d8913 100644
> > > > > > --- a/Platform/ARM/JunoPkg/ArmJuno.dec
> > > > > > +++ b/Platform/ARM/JunoPkg/ArmJuno.dec
> > > > > > @@ -44,7 +44,7 @@
> > > > > >
> > > > > > gArmJunoTokenSpaceGuid.PcdSynopsysUsbEhciBaseAddress|0x7FFC|UINT32|0x0005
> > > > > >
> > > > > ># Juno Device Trees are loaded from NOR Flash
> > > > > > -  
> > > > > > gArmJunoTokenSpaceGuid.PcdJunoFdtDevicePath|L"VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)/board.dtb"|VOID*|0x0008
> > > > > > +  
> > > > > > gArmJunoTokenSpaceGuid.PcdJunoFdtDevicePath|L"VenHw(93E34C7E-B50E-11DF-9223-2443DFD72085,00)/board.dtb"|VOID*|0x0008
> > > > > >
> > > > > ># MHU Register base used by SCMI Mailbox transport
> > > > > >
> > > > > > gArmJunoTokenSpaceGuid.PcdArmMtlDoorBell|0x2B1F|UINT64|0x0024
> > > > > > diff --git a/Platform/ARM/JunoPkg/ArmJuno.dsc 
> > > > > > b/Platform/ARM/JunoPkg/ArmJuno.dsc
> > > > > > index ac3d63bd4d39..55b9d64d3deb 100644
> > > > > > --- a/Platform/ARM/JunoPkg/ArmJuno.dsc
> > > > > > +++ b/Platform/ARM/JunoPkg/ArmJuno.dsc
> > > > > > @@ -176,7 +176,7 @@
> > > > > >gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize|24
> > > > > >
> > > > > ># List of Device Paths that support BootMonFs
> > > > > > -  
> > > > > > gArmBootMonFsTokenSpaceGuid.PcdBootMonFsSupportedDevicePaths|L"VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)"
> > > > > > +  
> > > > > > gArmBootMonFsTokenSpaceGuid.PcdBootMonFsSupportedDevicePaths|L"VenHw(93E34C7E-B50E-11DF-9223-2443DFD72085,00)"
> > > > > >
> > > > > >#
> > > > > ># ARM Architectural Timer Frequency
> > > > > > diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc 
> > > > > > 

Re: [edk2] [PATCH 1/1] MdePkg ACPI: fix the typos in Acpi61.h and Acpi62.h

2018-11-20 Thread Gao, Liming
Reviewed-by: Liming Gao 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Laszlo 
> Ersek
> Sent: Tuesday, November 20, 2018 4:52 PM
> To: Gary Lin ; edk2-devel@lists.01.org
> Cc: Kinney, Michael D ; Gao, Liming 
> 
> Subject: Re: [edk2] [PATCH 1/1] MdePkg ACPI: fix the typos in Acpi61.h and 
> Acpi62.h
> 
> On 11/20/18 08:03, Gary Lin wrote:
> > The GUID for VIRTUAL_CD_REGION_PERSISTENT was using the closing
> > square bracket mistakenly.
> >
> > Cc: Michael D Kinney 
> > Cc: Liming Gao 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Gary Lin 
> > ---
> >  MdePkg/Include/IndustryStandard/Acpi61.h | 2 +-
> >  MdePkg/Include/IndustryStandard/Acpi62.h | 2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> Good catch!
> 
> Reviewed-by: Laszlo Ersek 
> 
> Thanks
> Laszlo
> 
> > diff --git a/MdePkg/Include/IndustryStandard/Acpi61.h 
> > b/MdePkg/Include/IndustryStandard/Acpi61.h
> > index b2276b7d64d5..c66566e58647 100644
> > --- a/MdePkg/Include/IndustryStandard/Acpi61.h
> > +++ b/MdePkg/Include/IndustryStandard/Acpi61.h
> > @@ -1400,7 +1400,7 @@ typedef struct {
> >  #define 
> > EFI_ACPI_6_1_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_DISK_REGION_VOLATILE   { 
> > 0x77AB535A, 0x45FC, 0x624B,
> { 0x55, 0x60, 0xF7, 0xB2, 0x81, 0xD1, 0xF9, 0x6E }}
> >  #define 
> > EFI_ACPI_6_1_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_VOLATILE { 
> > 0x3D5ABD30, 0x4175, 0x87CE,
> { 0x6D, 0x64, 0xD2, 0xAD, 0xE5, 0x23, 0xC4, 0xBB }}
> >  #define 
> > EFI_ACPI_6_1_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_DISK_REGION_PERSISTENT { 
> > 0x5CEA02C9, 0x4D07, 0x69D3,
> { 0x26, 0x9F ,0x44, 0x96, 0xFB, 0xE0, 0x96, 0xF9 }}
> > -#define 
> > EFI_ACPI_6_1_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_PERSISTENT   { 
> > 0x08018188, 0x42CD, 0xBB48,
> { 0x10, 0x0F, 0x53, 0x87, 0xD5, 0x3D, 0xED, 0x3D ]}
> > +#define 
> > EFI_ACPI_6_1_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_PERSISTENT   { 
> > 0x08018188, 0x42CD, 0xBB48,
> { 0x10, 0x0F, 0x53, 0x87, 0xD5, 0x3D, 0xED, 0x3D }}
> >  typedef struct {
> >UINT16  Type;
> >UINT16  Length;
> > diff --git a/MdePkg/Include/IndustryStandard/Acpi62.h 
> > b/MdePkg/Include/IndustryStandard/Acpi62.h
> > index 730365b521d1..11ce1c16fb91 100644
> > --- a/MdePkg/Include/IndustryStandard/Acpi62.h
> > +++ b/MdePkg/Include/IndustryStandard/Acpi62.h
> > @@ -1512,7 +1512,7 @@ typedef struct {
> >  #define 
> > EFI_ACPI_6_2_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_DISK_REGION_VOLATILE   { 
> > 0x77AB535A, 0x45FC, 0x624B,
> { 0x55, 0x60, 0xF7, 0xB2, 0x81, 0xD1, 0xF9, 0x6E }}
> >  #define 
> > EFI_ACPI_6_2_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_VOLATILE { 
> > 0x3D5ABD30, 0x4175, 0x87CE,
> { 0x6D, 0x64, 0xD2, 0xAD, 0xE5, 0x23, 0xC4, 0xBB }}
> >  #define 
> > EFI_ACPI_6_2_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_DISK_REGION_PERSISTENT { 
> > 0x5CEA02C9, 0x4D07, 0x69D3,
> { 0x26, 0x9F ,0x44, 0x96, 0xFB, 0xE0, 0x96, 0xF9 }}
> > -#define 
> > EFI_ACPI_6_2_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_PERSISTENT   { 
> > 0x08018188, 0x42CD, 0xBB48,
> { 0x10, 0x0F, 0x53, 0x87, 0xD5, 0x3D, 0xED, 0x3D ]}
> > +#define 
> > EFI_ACPI_6_2_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_PERSISTENT   { 
> > 0x08018188, 0x42CD, 0xBB48,
> { 0x10, 0x0F, 0x53, 0x87, 0xD5, 0x3D, 0xED, 0x3D }}
> >  typedef struct {
> >UINT16  Type;
> >UINT16  Length;
> >
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ArmPkg/ArmSmcPsciResetSystemLib: add missing call to ExitBootServices()

2018-11-20 Thread Ard Biesheuvel
On Tue, 20 Nov 2018 at 15:33, Ard Biesheuvel  wrote:
>
> Our poor man's implementation of EnterS3WithImmediateWake () currently
> sets a high TPL level to disable interrupts, and simply calls the
> PEI entrypoint again after disabling the MMU.
>
> Unfortunately, this is not sufficient: DMA capable devices such as
> network controllers or USB controllers may still be enabled and
> writing to memory, e.g., in response to incoming network packets.
>
> So instead, do the full ExitBootServices() dance: allocate space and
> get the memory map, call ExitBootServices(), and in case it fails, get
> the memory map again and call ExitBootServices() again. This ensures
> that all cleanup related to DMA capable devices is performed before
> doing the warm reset.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel 
> ---
>  ArmPkg/Include/Library/ArmLib.h|  1 +
>  ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c | 51 
> ++--
>  2 files changed, 49 insertions(+), 3 deletions(-)
>
> diff --git a/ArmPkg/Include/Library/ArmLib.h b/ArmPkg/Include/Library/ArmLib.h
> index e46df447b33d..ffda50e9d767 100644
> --- a/ArmPkg/Include/Library/ArmLib.h
> +++ b/ArmPkg/Include/Library/ArmLib.h
> @@ -59,6 +59,7 @@ typedef enum {
>
>  typedef struct {
>EFI_PHYSICAL_ADDRESS  PhysicalBase;
> +  EFI_VIRTUAL_ADDRESS   VirtualBase;
>UINT64Length;
>ARM_MEMORY_REGION_ATTRIBUTES  Attributes;
>  } ARM_MEMORY_REGION_DESCRIPTOR;

This first hunk was included by accident - please disregard.

> diff --git 
> a/ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c 
> b/ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c
> index 10ceafd14d5d..c9c42ab3b244 100644
> --- a/ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c
> +++ b/ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c
> @@ -1,7 +1,7 @@
>  /** @file
>ResetSystemLib implementation using PSCI calls
>
> -  Copyright (c) 2017, Linaro Ltd. All rights reserved.
> +  Copyright (c) 2017 - 2018, Linaro Ltd. All rights reserved.
>
>This program and the accompanying materials
>are licensed and made available under the terms and conditions of the BSD 
> License
> @@ -92,7 +92,13 @@ EnterS3WithImmediateWake (
>VOID
>)
>  {
> -  VOID (*Reset)(VOID);
> +  VOID(*Reset)(VOID);
> +  EFI_PHYSICAL_ADDRESSAlloc;
> +  EFI_MEMORY_DESCRIPTOR   *MemMap;
> +  UINTN   MemMapSize;
> +  UINTN   MapKey, DescriptorSize;
> +  UINT32  DescriptorVersion;
> +  EFI_STATUS  Status;
>
>if (FeaturePcdGet (PcdArmReenterPeiForCapsuleWarmReboot) &&
>!EfiAtRuntime ()) {
> @@ -103,7 +109,46 @@ EnterS3WithImmediateWake (
>  //
>  Reset = (VOID (*)(VOID))(UINTN)FixedPcdGet64 (PcdFvBaseAddress);
>
> -gBS->RaiseTPL (TPL_HIGH_LEVEL);
> +//
> +// Obtain the size of the memory map
> +//
> +MemMapSize = 0;
> +Status = gBS->GetMemoryMap (, MemMap, , 
> ,
> +);
> +ASSERT (Status == EFI_BUFFER_TOO_SMALL);
> +
> +//
> +// Add some slack to the allocation to cater for changes in the memory
> +// map if ExitBootServices () fails the first time around.
> +//
> +MemMapSize += SIZE_4KB;
> +Status = gBS->AllocatePages (AllocateAnyPages, EfiBootServicesData,
> +EFI_SIZE_TO_PAGES (MemMapSize), );
> +ASSERT_EFI_ERROR (Status);
> +
> +MemMap = (EFI_MEMORY_DESCRIPTOR *)(UINTN)Alloc;
> +
> +Status = gBS->GetMemoryMap (, MemMap, , 
> ,
> +);
> +ASSERT_EFI_ERROR (Status);
> +
> +Status = gBS->ExitBootServices (gImageHandle, MapKey);
> +if (EFI_ERROR (Status)) {
> +  //
> +  // ExitBootServices () may fail the first time around if an event fired
> +  // right after the call to GetMemoryMap() which allocated or freed 
> memory.
> +  // Since that first call to ExitBootServices () will disarm the timer,
> +  // this is guaranteed not to happen again, so one additional attempt
> +  // should suffice.
> +  //
> +  Status = gBS->GetMemoryMap (, MemMap, , 
> ,
> +  );
> +  ASSERT_EFI_ERROR (Status);
> +
> +  Status = gBS->ExitBootServices (gImageHandle, MapKey);
> +  ASSERT_EFI_ERROR (Status);
> +}
> +
>  ArmDisableMmu ();
>  Reset ();
>}
> --
> 2.17.1
>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v3 1/5] Hisilicon/D0x: Fix secure boot bug in FlashFvbDxe

2018-11-20 Thread Ming Huang



On 11/20/2018 8:58 PM, Leif Lindholm wrote:
> On Tue, Nov 20, 2018 at 08:40:28PM +0800, Ming Huang wrote:
>>
>>
>> On 11/20/2018 8:13 PM, Leif Lindholm wrote:
>>> On Tue, Nov 20, 2018 at 05:01:46PM +0800, Ming Huang wrote:
 Now that the generic Variable Runtime DXE code no longer
 distinguishes between gEfiVariableGuid and
 gEfiAuthenticatedVariableGuid in the varstore FV header.
 We can relax the check in the flashFvb driver to accept
 either GUID regardless of whether we are running a secure
 boot capable build or not.
>>>
>>> We are still in a situation where D06 is not buildable with Secure
>>> Boot enabled though.
>>>
>>> If you build with -D SECURE_BOOT_ENABLE=TRUE, you still end up with
>>> /work/git/edk2-platforms/Platform/Hisilicon/D06/D06.dsc(...): error
>>> 4000: Instance of library class [PlatformSecureLib] is not found
>>>   in 
>>> [/work/git/edk2/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf]
>>>  [AARCH64]
>>>   consumed by module 
>>> [/work/git/edk2/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf]
>>>
>>> And all Hisilicon platforms still use
>>> AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
>>> regardless of Secure Boot setting.
>>>
>>> So what problem does this patch solve? A runtime one?
>>
>> This patch solve bug in FlashFvbDxe.
> 
> Yes, but what bug? What is the symptom? What _specific_ problem goes
> away by adding this patch? That information should have been in the
> original commit message. I have no information available to me as I
> now build -rc1 to suggest that this patch should be included.

The bug is that gEfiAuthenticatedVariableGuid should be used in FlashFvbDxe,
not gEfiVariableGuid when enable secure boot.

> 
>> Should I add a patch before this patch
>> to solve build error with -D SECURE_BOOT_ENABLE=TRUE in v4?
> 
> That would require a sane implementation of PlatformSecureLib,
> implementing a real UserPhysicalPresent().
> Can you turn that around within the next few hours?

My original idea is using OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.
There is not enough time to implement a real UserPhysicalPresent.
This patch will add when we implement real secure boot in future.

Thanks.

> 
> Regards,
> 
> Leif
> 
>> Thanks.
>>
>>>
>>> /
>>> Leif
>>>
 Contributed-under: TianoCore Contribution Agreement 1.1
 Signed-off-by: Ming Huang 
 ---
  Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf | 1 +
  Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c   | 5 +++--
  2 files changed, 4 insertions(+), 2 deletions(-)

 diff --git a/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf 
 b/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf
 index f8be4741ef7c..a0226e0d87c0 100644
 --- a/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf
 +++ b/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf
 @@ -44,6 +44,7 @@ [LibraryClasses]
UefiRuntimeLib
  
  [Guids]
 +  gEfiAuthenticatedVariableGuid
gEfiSystemNvDataFvGuid
gEfiVariableGuid
  
 diff --git a/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c 
 b/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c
 index e18cc9e06ec2..12baed41cd4e 100644
 --- a/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c
 +++ b/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c
 @@ -189,7 +189,7 @@ InitializeFvAndVariableStoreHeaders (
  // VARIABLE_STORE_HEADER
  //
  VariableStoreHeader = (VARIABLE_STORE_HEADER*)((UINTN)Headers + 
 (UINTN)FirmwareVolumeHeader->HeaderLength);
 -CopyGuid (>Signature, );
 +CopyGuid (>Signature, 
 );
  VariableStoreHeader->Size = PcdGet32(PcdFlashNvStorageVariableSize) - 
 FirmwareVolumeHeader->HeaderLength;
  VariableStoreHeader->Format= VARIABLE_STORE_FORMATTED;
  VariableStoreHeader->State = VARIABLE_STORE_HEALTHY;
 @@ -258,7 +258,8 @@ ValidateFvHeader (
  VariableStoreHeader = (VARIABLE_STORE_HEADER*)((UINTN)FwVolHeader + 
 (UINTN)FwVolHeader->HeaderLength);
  
  // Check the Variable Store Guid
 -if ( CompareGuid (>Signature, ) 
 == FALSE )
 +if (!CompareGuid (>Signature, ) 
 &&
 +!CompareGuid (>Signature, 
 ))
  {
  DEBUG ((EFI_D_ERROR, "ValidateFvHeader: Variable Store Guid 
 non-compatible\n"));
  return EFI_NOT_FOUND;
 -- 
 2.9.5

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms] Platform/ARM: replace hardcoded VenHW() device paths referring to NOR flash

2018-11-20 Thread Leif Lindholm
On Tue, Nov 20, 2018 at 07:31:34PM +0530, Thomas Abraham wrote:
> On Tue, Nov 20, 2018 at 1:01 AM Ard Biesheuvel
>  wrote:
> >
> > On Mon, 19 Nov 2018 at 11:30, Leif Lindholm  
> > wrote:
> > >
> > > Hmm, a follow-up question (which does not affect my r-b):
> > >
> > > We still keep the manually generated GUIDs in
> > > ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c,
> > > Platform/ARM/JunoPkg/Library/NorFlashJunoLib/NorFlashJuno.c,
> > > Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.c,
> > > Platform/ARM/VExpressPkg/Library/NorFlashArmVExpressLib/NorFlashArmVExpress.c,
> > > Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacer.c,
> > >
> > > and indeed in the NOR_FLASH_DESCRIPTION struct in
> > > ArmPlatformPkg/Include/Library/NorFlashPlatformLib.h
> > >
> > > Is this an opportunity for a negative diffstat?
> >
> > Yes. I was anticipating some discussion on renaming the NOR flash
> > blocks, but indeed, we can drop all of the above once the rename
> > change is in.
> >
> >
> > > On Mon, Nov 19, 2018 at 07:12:47PM +, Leif Lindholm wrote:
> > > > On Fri, Nov 16, 2018 at 05:23:08PM -0800, Ard Biesheuvel wrote:
> > > > > The ArmPlatformPkg NOR flash driver has been updated to use device 
> > > > > paths
> > > > > consisting of a fixed GUID and a numeric index rather than a separate 
> > > > > GUID
> > > > > for each flash bank on a given system. This means all explicit device 
> > > > > path
> > > > > references to NOR flash banks have to be brought up to date as well.
> > > > >
> > > > > Contributed-under: TianoCore Contribution Agreement 1.1
> > > > > Signed-off-by: Ard Biesheuvel 
> > > >
> > > > This looks good to me, but I'd like a comment from Thomas/Nariman.
> > > >
> > > > With that:
> > > > Reviewed-by: Leif Lindholm 
> > > >
> 
> Tested this patch and "[PATCH 0/2] ArmPlatformPkg, ArmVirtPkg:
> discover NOR flash banks from DTB" patch series on the SGI-575
> platform. Access to NOR flash works fine with bank index as well.

That is good to know, but the platform I'm more concerned about is
Juno with its crazy bootmonfs. There are still plenty of those used in
test farms and suchlike.

> Should GUID's listed in all the instances of NOR_FLASH_DESCRIPTION in
> edk2-platforms be removed in this patch?

That was what I alluded to above. Ard prefers to do that as a separate
patch once this is all merged, and I don't mind that approach.

Regards,

Leif

> Thanks,
> Thomas.
> 
> 
> > > > > ---
> > > > >  Platform/ARM/JunoPkg/ArmJuno.dec  | 2 +-
> > > > >  Platform/ARM/JunoPkg/ArmJuno.dsc  | 2 +-
> > > > >  Platform/ARM/SgiPkg/SgiPlatform.dsc   | 2 +-
> > > > >  Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc | 2 +-
> > > > >  Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc  | 2 +-
> > > > >  5 files changed, 5 insertions(+), 5 deletions(-)
> > > > >
> > > > > diff --git a/Platform/ARM/JunoPkg/ArmJuno.dec 
> > > > > b/Platform/ARM/JunoPkg/ArmJuno.dec
> > > > > index edbbb827ad45..c511796d8913 100644
> > > > > --- a/Platform/ARM/JunoPkg/ArmJuno.dec
> > > > > +++ b/Platform/ARM/JunoPkg/ArmJuno.dec
> > > > > @@ -44,7 +44,7 @@
> > > > >
> > > > > gArmJunoTokenSpaceGuid.PcdSynopsysUsbEhciBaseAddress|0x7FFC|UINT32|0x0005
> > > > >
> > > > ># Juno Device Trees are loaded from NOR Flash
> > > > > -  
> > > > > gArmJunoTokenSpaceGuid.PcdJunoFdtDevicePath|L"VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)/board.dtb"|VOID*|0x0008
> > > > > +  
> > > > > gArmJunoTokenSpaceGuid.PcdJunoFdtDevicePath|L"VenHw(93E34C7E-B50E-11DF-9223-2443DFD72085,00)/board.dtb"|VOID*|0x0008
> > > > >
> > > > ># MHU Register base used by SCMI Mailbox transport
> > > > >
> > > > > gArmJunoTokenSpaceGuid.PcdArmMtlDoorBell|0x2B1F|UINT64|0x0024
> > > > > diff --git a/Platform/ARM/JunoPkg/ArmJuno.dsc 
> > > > > b/Platform/ARM/JunoPkg/ArmJuno.dsc
> > > > > index ac3d63bd4d39..55b9d64d3deb 100644
> > > > > --- a/Platform/ARM/JunoPkg/ArmJuno.dsc
> > > > > +++ b/Platform/ARM/JunoPkg/ArmJuno.dsc
> > > > > @@ -176,7 +176,7 @@
> > > > >gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize|24
> > > > >
> > > > ># List of Device Paths that support BootMonFs
> > > > > -  
> > > > > gArmBootMonFsTokenSpaceGuid.PcdBootMonFsSupportedDevicePaths|L"VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)"
> > > > > +  
> > > > > gArmBootMonFsTokenSpaceGuid.PcdBootMonFsSupportedDevicePaths|L"VenHw(93E34C7E-B50E-11DF-9223-2443DFD72085,00)"
> > > > >
> > > > >#
> > > > ># ARM Architectural Timer Frequency
> > > > > diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc 
> > > > > b/Platform/ARM/SgiPkg/SgiPlatform.dsc
> > > > > index 3f0ca9872e79..06d866d6dc30 100644
> > > > > --- a/Platform/ARM/SgiPkg/SgiPlatform.dsc
> > > > > +++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc
> > > > > @@ -163,7 +163,7 @@
> > > > >gArmPlatformTokenSpaceGuid.PcdPL031RtcBase|0x1C17
> > > > >
> > > > ># List of Device Paths that support BootMonFs
> > > > > -  
> > > > > 

Re: [edk2] [PATCH 1/1] Platform/ARM/SgiPkg: increase max variable size to 8KB

2018-11-20 Thread Thomas Abraham
On Tue, Nov 20, 2018 at 6:45 PM Leif Lindholm  wrote:
>
> On Tue, Nov 20, 2018 at 04:01:02PM +0530, Vijayenthiran Subramaniam wrote:
> > Commit dc37ca75 ("Edk2Platforms: Replace MdeModulePkg PXE/iSCSI/TCP with
> > NetworkPkg drivers") switched to using iSCSI driver from the NetworkPkg
> > package. This driver requires the platform to support a maximum variable
> > size of atleast 4KB.
> >
> > So increase the maximum supported variable size to 8KB on the SGI
> > platforms. Without this, the iSCSI driver fails to load.
> >
> > Cc: Ard Biesheuvel 
> > Cc: Leif Lindholm 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Vijayenthiran Subramaniam 
>
> Looks good to me, but I'd like an R-b from Thomas/Nariman.

Reviewed-by: Thomas Abraham 

>
> On a separate note, MdeModulePkg maintainers - is this reason enough
> to change the default of this Pcd?
>
> /
> Leif
>
> > ---
> >  Platform/ARM/SgiPkg/SgiPlatform.dsc | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc 
> > b/Platform/ARM/SgiPkg/SgiPlatform.dsc
> > index 3f0ca9872e79..1c152fad2246 100644
> > --- a/Platform/ARM/SgiPkg/SgiPlatform.dsc
> > +++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc
> > @@ -102,6 +102,7 @@
> >
> >  [PcdsFixedAtBuild.common]
> >gArmTokenSpaceGuid.PcdVFPEnabled|1
> > +  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000
> >
> ># DRAM Block2 Base and Size
> >gArmSgiTokenSpaceGuid.PcdDramBlock2Base|0x808000
> > --
> > 2.17.1
> >
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms] Platform/ARM: replace hardcoded VenHW() device paths referring to NOR flash

2018-11-20 Thread Ard Biesheuvel
On Tue, 20 Nov 2018 at 15:01, Thomas Abraham  wrote:
>
> On Tue, Nov 20, 2018 at 1:01 AM Ard Biesheuvel
>  wrote:
> >
> > On Mon, 19 Nov 2018 at 11:30, Leif Lindholm  
> > wrote:
> > >
> > > Hmm, a follow-up question (which does not affect my r-b):
> > >
> > > We still keep the manually generated GUIDs in
> > > ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c,
> > > Platform/ARM/JunoPkg/Library/NorFlashJunoLib/NorFlashJuno.c,
> > > Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.c,
> > > Platform/ARM/VExpressPkg/Library/NorFlashArmVExpressLib/NorFlashArmVExpress.c,
> > > Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacer.c,
> > >
> > > and indeed in the NOR_FLASH_DESCRIPTION struct in
> > > ArmPlatformPkg/Include/Library/NorFlashPlatformLib.h
> > >
> > > Is this an opportunity for a negative diffstat?
> > >
> >
> > Yes. I was anticipating some discussion on renaming the NOR flash
> > blocks, but indeed, we can drop all of the above once the rename
> > change is in.
> >
> >
> > > On Mon, Nov 19, 2018 at 07:12:47PM +, Leif Lindholm wrote:
> > > > On Fri, Nov 16, 2018 at 05:23:08PM -0800, Ard Biesheuvel wrote:
> > > > > The ArmPlatformPkg NOR flash driver has been updated to use device 
> > > > > paths
> > > > > consisting of a fixed GUID and a numeric index rather than a separate 
> > > > > GUID
> > > > > for each flash bank on a given system. This means all explicit device 
> > > > > path
> > > > > references to NOR flash banks have to be brought up to date as well.
> > > > >
> > > > > Contributed-under: TianoCore Contribution Agreement 1.1
> > > > > Signed-off-by: Ard Biesheuvel 
> > > >
> > > > This looks good to me, but I'd like a comment from Thomas/Nariman.
> > > >
> > > > With that:
> > > > Reviewed-by: Leif Lindholm 
> > > >
>
> Tested this patch and "[PATCH 0/2] ArmPlatformPkg, ArmVirtPkg:
> discover NOR flash banks from DTB" patch series on the SGI-575
> platform. Access to NOR flash works fine with bank index as well.
> Should GUID's listed in all the instances of NOR_FLASH_DESCRIPTION in
> edk2-platforms be removed in this patch?
>

Thank you Thomas.

I will follow up with a patch that removes all the GUIDs once the EDK2
changes are in.
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms] Platform/ARM: replace hardcoded VenHW() device paths referring to NOR flash

2018-11-20 Thread Thomas Abraham
On Tue, Nov 20, 2018 at 1:01 AM Ard Biesheuvel
 wrote:
>
> On Mon, 19 Nov 2018 at 11:30, Leif Lindholm  wrote:
> >
> > Hmm, a follow-up question (which does not affect my r-b):
> >
> > We still keep the manually generated GUIDs in
> > ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c,
> > Platform/ARM/JunoPkg/Library/NorFlashJunoLib/NorFlashJuno.c,
> > Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.c,
> > Platform/ARM/VExpressPkg/Library/NorFlashArmVExpressLib/NorFlashArmVExpress.c,
> > Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacer.c,
> >
> > and indeed in the NOR_FLASH_DESCRIPTION struct in
> > ArmPlatformPkg/Include/Library/NorFlashPlatformLib.h
> >
> > Is this an opportunity for a negative diffstat?
> >
>
> Yes. I was anticipating some discussion on renaming the NOR flash
> blocks, but indeed, we can drop all of the above once the rename
> change is in.
>
>
> > On Mon, Nov 19, 2018 at 07:12:47PM +, Leif Lindholm wrote:
> > > On Fri, Nov 16, 2018 at 05:23:08PM -0800, Ard Biesheuvel wrote:
> > > > The ArmPlatformPkg NOR flash driver has been updated to use device paths
> > > > consisting of a fixed GUID and a numeric index rather than a separate 
> > > > GUID
> > > > for each flash bank on a given system. This means all explicit device 
> > > > path
> > > > references to NOR flash banks have to be brought up to date as well.
> > > >
> > > > Contributed-under: TianoCore Contribution Agreement 1.1
> > > > Signed-off-by: Ard Biesheuvel 
> > >
> > > This looks good to me, but I'd like a comment from Thomas/Nariman.
> > >
> > > With that:
> > > Reviewed-by: Leif Lindholm 
> > >

Tested this patch and "[PATCH 0/2] ArmPlatformPkg, ArmVirtPkg:
discover NOR flash banks from DTB" patch series on the SGI-575
platform. Access to NOR flash works fine with bank index as well.
Should GUID's listed in all the instances of NOR_FLASH_DESCRIPTION in
edk2-platforms be removed in this patch?

Thanks,
Thomas.


> > > > ---
> > > >  Platform/ARM/JunoPkg/ArmJuno.dec  | 2 +-
> > > >  Platform/ARM/JunoPkg/ArmJuno.dsc  | 2 +-
> > > >  Platform/ARM/SgiPkg/SgiPlatform.dsc   | 2 +-
> > > >  Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc | 2 +-
> > > >  Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc  | 2 +-
> > > >  5 files changed, 5 insertions(+), 5 deletions(-)
> > > >
> > > > diff --git a/Platform/ARM/JunoPkg/ArmJuno.dec 
> > > > b/Platform/ARM/JunoPkg/ArmJuno.dec
> > > > index edbbb827ad45..c511796d8913 100644
> > > > --- a/Platform/ARM/JunoPkg/ArmJuno.dec
> > > > +++ b/Platform/ARM/JunoPkg/ArmJuno.dec
> > > > @@ -44,7 +44,7 @@
> > > >
> > > > gArmJunoTokenSpaceGuid.PcdSynopsysUsbEhciBaseAddress|0x7FFC|UINT32|0x0005
> > > >
> > > ># Juno Device Trees are loaded from NOR Flash
> > > > -  
> > > > gArmJunoTokenSpaceGuid.PcdJunoFdtDevicePath|L"VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)/board.dtb"|VOID*|0x0008
> > > > +  
> > > > gArmJunoTokenSpaceGuid.PcdJunoFdtDevicePath|L"VenHw(93E34C7E-B50E-11DF-9223-2443DFD72085,00)/board.dtb"|VOID*|0x0008
> > > >
> > > ># MHU Register base used by SCMI Mailbox transport
> > > >gArmJunoTokenSpaceGuid.PcdArmMtlDoorBell|0x2B1F|UINT64|0x0024
> > > > diff --git a/Platform/ARM/JunoPkg/ArmJuno.dsc 
> > > > b/Platform/ARM/JunoPkg/ArmJuno.dsc
> > > > index ac3d63bd4d39..55b9d64d3deb 100644
> > > > --- a/Platform/ARM/JunoPkg/ArmJuno.dsc
> > > > +++ b/Platform/ARM/JunoPkg/ArmJuno.dsc
> > > > @@ -176,7 +176,7 @@
> > > >gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize|24
> > > >
> > > ># List of Device Paths that support BootMonFs
> > > > -  
> > > > gArmBootMonFsTokenSpaceGuid.PcdBootMonFsSupportedDevicePaths|L"VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)"
> > > > +  
> > > > gArmBootMonFsTokenSpaceGuid.PcdBootMonFsSupportedDevicePaths|L"VenHw(93E34C7E-B50E-11DF-9223-2443DFD72085,00)"
> > > >
> > > >#
> > > ># ARM Architectural Timer Frequency
> > > > diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc 
> > > > b/Platform/ARM/SgiPkg/SgiPlatform.dsc
> > > > index 3f0ca9872e79..06d866d6dc30 100644
> > > > --- a/Platform/ARM/SgiPkg/SgiPlatform.dsc
> > > > +++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc
> > > > @@ -163,7 +163,7 @@
> > > >gArmPlatformTokenSpaceGuid.PcdPL031RtcBase|0x1C17
> > > >
> > > ># List of Device Paths that support BootMonFs
> > > > -  
> > > > gArmBootMonFsTokenSpaceGuid.PcdBootMonFsSupportedDevicePaths|L"VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)"
> > > > +  
> > > > gArmBootMonFsTokenSpaceGuid.PcdBootMonFsSupportedDevicePaths|L"VenHw(93E34C7E-B50E-11DF-9223-2443DFD72085,00)"
> > > >
> > > ># ARM OS Loader
> > > >gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|3
> > > > diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc 
> > > > b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
> > > > index 0542808f7d0c..3a3b4e3dbbc8 100644
> > > > --- a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
> > > > +++ 

Re: [edk2] [PATCH 1/1] Platform/ARM/SgiPkg: increase max variable size to 8KB

2018-11-20 Thread Leif Lindholm
On Tue, Nov 20, 2018 at 04:01:02PM +0530, Vijayenthiran Subramaniam wrote:
> Commit dc37ca75 ("Edk2Platforms: Replace MdeModulePkg PXE/iSCSI/TCP with
> NetworkPkg drivers") switched to using iSCSI driver from the NetworkPkg
> package. This driver requires the platform to support a maximum variable
> size of atleast 4KB.
> 
> So increase the maximum supported variable size to 8KB on the SGI
> platforms. Without this, the iSCSI driver fails to load.
> 
> Cc: Ard Biesheuvel 
> Cc: Leif Lindholm 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Vijayenthiran Subramaniam 

Looks good to me, but I'd like an R-b from Thomas/Nariman.

On a separate note, MdeModulePkg maintainers - is this reason enough
to change the default of this Pcd?

/
Leif

> ---
>  Platform/ARM/SgiPkg/SgiPlatform.dsc | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc 
> b/Platform/ARM/SgiPkg/SgiPlatform.dsc
> index 3f0ca9872e79..1c152fad2246 100644
> --- a/Platform/ARM/SgiPkg/SgiPlatform.dsc
> +++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc
> @@ -102,6 +102,7 @@
>  
>  [PcdsFixedAtBuild.common]
>gArmTokenSpaceGuid.PcdVFPEnabled|1
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000
>  
># DRAM Block2 Base and Size
>gArmSgiTokenSpaceGuid.PcdDramBlock2Base|0x808000
> -- 
> 2.17.1
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v3 0/5] Fix D06 SBSA/SBBR issue and improve

2018-11-20 Thread Leif Lindholm
On Tue, Nov 20, 2018 at 05:01:45PM +0800, Ming Huang wrote:
> Main Change since v2:
> 1. Use new way to fix secure boot bug in FlashFvbDxe;
> 2. Spilit patch from "Modify Gic base";
> 3. Modify some commit messages;
> 
> Code can also be found in github:
> https://github.com/hisilicon/OpenPlatformPkg.git
> branch: d06-acs-platforms-v3

The below three patches:
   Hisilicon/D06: Correct PcdGicInterruptInterfaceBase
   Hisilicon/D06: Modify Gic base
   was folded into
   Silicon/Hisilicon/D06: Set TA as Node 0 for TA boot
Reviewed-by: Leif Lindholm 
Pushed as 1360ddbc30..cc2b26de91..

The two patches:
   Hisilicon/D0x: Fix secure boot bug in FlashFvbDxe
   and
   Hisilicon/D06: Move some functions to OemMiscLib
require further revisions, and may miss the release.

/
Leif

> Ming Huang (5):
>   Hisilicon/D0x: Fix secure boot bug in FlashFvbDxe
>   Hisilicon/D06: Modify Gic base
>   Hisilicon/D06: Correct PcdGicInterruptInterfaceBase
>   Silicon/Hisilicon/D06: Set TA as Node 0 for TA boot
>   Hisilicon/D06: Move some functions to OemMiscLib
> 
>  Platform/Hisilicon/D06/D06.dsc  
> |   2 +-
>  Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf   
> |   1 +
>  Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.inf 
> |   2 -
>  Silicon/Hisilicon/Include/Library/OemMiscLib.h  
> |   9 +
>  Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClock.h  
> |   4 -
>  Platform/Hisilicon/D06/Library/OemMiscLibD06/OemMiscLibD06.c
> |  82 +
>  Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c 
> |   5 +-
>  Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.c   
> |  90 +
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Dsdt/Hi1620Pci.asl
> |  28 +--
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Hi1620Iort.asl
> |  18 +-
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Hi1620Srat.aslc   
> | 194 ++--
>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/MadtHi1620.aslc   
> |   2 +-
>  12 files changed, 224 insertions(+), 213 deletions(-)
> 
> -- 
> 2.9.5
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v3 1/5] Hisilicon/D0x: Fix secure boot bug in FlashFvbDxe

2018-11-20 Thread Leif Lindholm
On Tue, Nov 20, 2018 at 08:40:28PM +0800, Ming Huang wrote:
> 
> 
> On 11/20/2018 8:13 PM, Leif Lindholm wrote:
> > On Tue, Nov 20, 2018 at 05:01:46PM +0800, Ming Huang wrote:
> >> Now that the generic Variable Runtime DXE code no longer
> >> distinguishes between gEfiVariableGuid and
> >> gEfiAuthenticatedVariableGuid in the varstore FV header.
> >> We can relax the check in the flashFvb driver to accept
> >> either GUID regardless of whether we are running a secure
> >> boot capable build or not.
> > 
> > We are still in a situation where D06 is not buildable with Secure
> > Boot enabled though.
> > 
> > If you build with -D SECURE_BOOT_ENABLE=TRUE, you still end up with
> > /work/git/edk2-platforms/Platform/Hisilicon/D06/D06.dsc(...): error
> > 4000: Instance of library class [PlatformSecureLib] is not found
> >   in 
> > [/work/git/edk2/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf]
> >  [AARCH64]
> >   consumed by module 
> > [/work/git/edk2/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf]
> > 
> > And all Hisilicon platforms still use
> > AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
> > regardless of Secure Boot setting.
> > 
> > So what problem does this patch solve? A runtime one?
> 
> This patch solve bug in FlashFvbDxe.

Yes, but what bug? What is the symptom? What _specific_ problem goes
away by adding this patch? That information should have been in the
original commit message. I have no information available to me as I
now build -rc1 to suggest that this patch should be included.

> Should I add a patch before this patch
> to solve build error with -D SECURE_BOOT_ENABLE=TRUE in v4?

That would require a sane implementation of PlatformSecureLib,
implementing a real UserPhysicalPresent().
Can you turn that around within the next few hours?

Regards,

Leif

> Thanks.
> 
> > 
> > /
> > Leif
> > 
> >> Contributed-under: TianoCore Contribution Agreement 1.1
> >> Signed-off-by: Ming Huang 
> >> ---
> >>  Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf | 1 +
> >>  Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c   | 5 +++--
> >>  2 files changed, 4 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf 
> >> b/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf
> >> index f8be4741ef7c..a0226e0d87c0 100644
> >> --- a/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf
> >> +++ b/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf
> >> @@ -44,6 +44,7 @@ [LibraryClasses]
> >>UefiRuntimeLib
> >>  
> >>  [Guids]
> >> +  gEfiAuthenticatedVariableGuid
> >>gEfiSystemNvDataFvGuid
> >>gEfiVariableGuid
> >>  
> >> diff --git a/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c 
> >> b/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c
> >> index e18cc9e06ec2..12baed41cd4e 100644
> >> --- a/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c
> >> +++ b/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c
> >> @@ -189,7 +189,7 @@ InitializeFvAndVariableStoreHeaders (
> >>  // VARIABLE_STORE_HEADER
> >>  //
> >>  VariableStoreHeader = (VARIABLE_STORE_HEADER*)((UINTN)Headers + 
> >> (UINTN)FirmwareVolumeHeader->HeaderLength);
> >> -CopyGuid (>Signature, );
> >> +CopyGuid (>Signature, 
> >> );
> >>  VariableStoreHeader->Size = PcdGet32(PcdFlashNvStorageVariableSize) - 
> >> FirmwareVolumeHeader->HeaderLength;
> >>  VariableStoreHeader->Format= VARIABLE_STORE_FORMATTED;
> >>  VariableStoreHeader->State = VARIABLE_STORE_HEALTHY;
> >> @@ -258,7 +258,8 @@ ValidateFvHeader (
> >>  VariableStoreHeader = (VARIABLE_STORE_HEADER*)((UINTN)FwVolHeader + 
> >> (UINTN)FwVolHeader->HeaderLength);
> >>  
> >>  // Check the Variable Store Guid
> >> -if ( CompareGuid (>Signature, ) 
> >> == FALSE )
> >> +if (!CompareGuid (>Signature, ) 
> >> &&
> >> +!CompareGuid (>Signature, 
> >> ))
> >>  {
> >>  DEBUG ((EFI_D_ERROR, "ValidateFvHeader: Variable Store Guid 
> >> non-compatible\n"));
> >>  return EFI_NOT_FOUND;
> >> -- 
> >> 2.9.5
> >>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v2 00/15] Fix D06 SBSA/SBBR issue and improve

2018-11-20 Thread Ming Huang



On 11/20/2018 6:32 PM, Leif Lindholm wrote:
> On Tue, Nov 20, 2018 at 03:02:44PM +0800, Ming Huang wrote:
>>> Please rebase on new master and address comments for v3.
>>> If you can merge
>>>  Silicon/Hisilicon/D06: Set TA as Node 0 for TA boot
>>> and
>>>  Hisilicon/D06: Modify Gic base
>>> as requested and get those sent out before I start work tomorrow,
>>> we are in pretty good shape for me to roll out an -rc1 tomorrow.
>>> (Which would be good, because I hope to have Wednesday-Friday as
>>> holiday :)
>>>
>>> If you can also address "Fix secure boot bug in FlashFvbDxe", that
>>> should be all remaining functional changes.
>>
>> I have address all comment include "Fix secure boot bug in FlashFvbDxe".
> 
> Thanks!
> 
>>> FYI: I am now working against edk2 tag edk2-stable201811.
>>
>> I update edk2 to edk2-stable201811, but can't build in my build server,
>> maybe my build environment has some problems, it can build with edk2
>> commit (52437cb7633b Star Zeng 2018-08-01 10:15:45).
> 
> I cannot reproduce this error.
> Can you try cleaning up your edk2 repo with 'git clean -fdx'?
> (This will delete anything not checked into the repo.)

It works with 'git clean -fdx'.
Thanks.

> 
> /
> Leif
> 
>> Build error log:
>> ---
>> huangming@EstBuildSvr1:~/source/new$ ./uefi-tools/edk2-build.sh d06
>> Loading previous configuration from 
>> /home/huangming/source/new/edk2/Conf/BuildEnv.sh
>> WORKSPACE: /home/huangming/source/new
>> EDK_TOOLS_PATH: /home/huangming/source/new/edk2/BaseTools
>> CONF_PATH: /home/huangming/source/new/edk2/Conf
>> Copying $EDK_TOOLS_PATH/Conf/build_rule.template
>>  to /home/huangming/source/new/edk2/Conf/build_rule.txt
>> Copying $EDK_TOOLS_PATH/Conf/tools_def.template
>>  to /home/huangming/source/new/edk2/Conf/tools_def.txt
>> Copying $EDK_TOOLS_PATH/Conf/target.template
>>  to /home/huangming/source/new/edk2/Conf/target.txt
>> make: Entering directory '/home/huangming/source/new/edk2/BaseTools'
>> make -C Source/C
>> make[1]: Entering directory 
>> '/home/huangming/source/new/edk2/BaseTools/Source/C'
>> Attempting to detect HOST_ARCH from 'uname -m': x86_64
>> Detected HOST_ARCH of X64 using uname.
>> mkdir -p .
>> make -C Common
>> make[2]: Entering directory 
>> '/home/huangming/source/new/edk2/BaseTools/Source/C/Common'
>> make[2]: Nothing to be done for 'all'.
>> make[2]: Leaving directory 
>> '/home/huangming/source/new/edk2/BaseTools/Source/C/Common'
>> make -C BrotliCompress
>> make[2]: Entering directory 
>> '/home/huangming/source/new/edk2/BaseTools/Source/C/BrotliCompress'
>> make[2]: *** No rule to make target 'common/././types.h', needed by 
>> 'common/dictionary.o'.  Stop.
>> make[2]: Leaving directory 
>> '/home/huangming/source/new/edk2/BaseTools/Source/C/BrotliCompress'
>> GNUmakefile:85: recipe for target 'BrotliCompress' failed
>> make[1]: *** [BrotliCompress] Error 2
>> make[1]: Leaving directory 
>> '/home/huangming/source/new/edk2/BaseTools/Source/C'
>> GNUmakefile:25: recipe for target 'Source/C' failed
>> make: *** [Source/C] Error 2
>> make: Leaving directory '/home/huangming/source/new/edk2/BaseTools'
>> /home/huangming/source/new
>>  !!! BaseTools failed to build !!!
>> ---
>>
>>>
>>> /
>>> Leif
>>>
  Silicon/Hisilicon/HisiPkg.dec 
|1 +
  Platform/Hisilicon/D03/D03.dsc
|5 +
  Platform/Hisilicon/D05/D05.dsc
|5 +
  Platform/Hisilicon/D06/D06.dsc
|7 +-
  Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf 
|2 +
  Silicon/Hisilicon/Library/ArmPlatformLibHisilicon/ArmPlatformLib.inf  
|2 +-
  Silicon/Hisilicon/Library/ArmPlatformLibHisilicon/ArmPlatformLibSec.inf   
|2 +-
  
 Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.inf
   |1 -
  Silicon/Hisilicon/Pv660/Drivers/IoInitDxe/IoInitDxe.inf   
|   58 --
  Silicon/Hisilicon/Pv660/Drivers/PcieInitDxe/PcieInitDxe.inf   
|   56 --
  Silicon/Hisilicon/Pv660/Drivers/SasInitDxe/SasV1Init.inf  
|   48 -
  
 Silicon/Hisilicon/Pv660/Drivers/UnInstallAcpiTableDxe/UnInstallAcpiTable.inf
  |   57 --
  Silicon/Hisilicon/Pv660/Pv660AcpiTables/AcpiTables.inf
|   60 --
  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Hi1620Platform.h
|2 +-
  Silicon/Hisilicon/Include/Library/OemMiscLib.h
|9 +
  Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClock.h
|4 -
  Silicon/Hisilicon/Pv660/Drivers/IoInitDxe/Smmu.h  
|   36 -
  

Re: [edk2] [PATCH edk2-platforms v3 1/5] Hisilicon/D0x: Fix secure boot bug in FlashFvbDxe

2018-11-20 Thread Ming Huang



On 11/20/2018 8:13 PM, Leif Lindholm wrote:
> On Tue, Nov 20, 2018 at 05:01:46PM +0800, Ming Huang wrote:
>> Now that the generic Variable Runtime DXE code no longer
>> distinguishes between gEfiVariableGuid and
>> gEfiAuthenticatedVariableGuid in the varstore FV header.
>> We can relax the check in the flashFvb driver to accept
>> either GUID regardless of whether we are running a secure
>> boot capable build or not.
> 
> We are still in a situation where D06 is not buildable with Secure
> Boot enabled though.
> 
> If you build with -D SECURE_BOOT_ENABLE=TRUE, you still end up with
> /work/git/edk2-platforms/Platform/Hisilicon/D06/D06.dsc(...): error
> 4000: Instance of library class [PlatformSecureLib] is not found
>   in 
> [/work/git/edk2/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf]
>  [AARCH64]
>   consumed by module 
> [/work/git/edk2/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf]
> 
> And all Hisilicon platforms still use
> AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
> regardless of Secure Boot setting.
> 
> So what problem does this patch solve? A runtime one?

This patch solve bug in FlashFvbDxe. Should I add a patch before this patch
to solve build error with -D SECURE_BOOT_ENABLE=TRUE in v4?

Thanks.

> 
> /
> Leif
> 
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Ming Huang 
>> ---
>>  Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf | 1 +
>>  Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c   | 5 +++--
>>  2 files changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf 
>> b/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf
>> index f8be4741ef7c..a0226e0d87c0 100644
>> --- a/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf
>> +++ b/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf
>> @@ -44,6 +44,7 @@ [LibraryClasses]
>>UefiRuntimeLib
>>  
>>  [Guids]
>> +  gEfiAuthenticatedVariableGuid
>>gEfiSystemNvDataFvGuid
>>gEfiVariableGuid
>>  
>> diff --git a/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c 
>> b/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c
>> index e18cc9e06ec2..12baed41cd4e 100644
>> --- a/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c
>> +++ b/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c
>> @@ -189,7 +189,7 @@ InitializeFvAndVariableStoreHeaders (
>>  // VARIABLE_STORE_HEADER
>>  //
>>  VariableStoreHeader = (VARIABLE_STORE_HEADER*)((UINTN)Headers + 
>> (UINTN)FirmwareVolumeHeader->HeaderLength);
>> -CopyGuid (>Signature, );
>> +CopyGuid (>Signature, 
>> );
>>  VariableStoreHeader->Size = PcdGet32(PcdFlashNvStorageVariableSize) - 
>> FirmwareVolumeHeader->HeaderLength;
>>  VariableStoreHeader->Format= VARIABLE_STORE_FORMATTED;
>>  VariableStoreHeader->State = VARIABLE_STORE_HEALTHY;
>> @@ -258,7 +258,8 @@ ValidateFvHeader (
>>  VariableStoreHeader = (VARIABLE_STORE_HEADER*)((UINTN)FwVolHeader + 
>> (UINTN)FwVolHeader->HeaderLength);
>>  
>>  // Check the Variable Store Guid
>> -if ( CompareGuid (>Signature, ) 
>> == FALSE )
>> +if (!CompareGuid (>Signature, ) &&
>> +!CompareGuid (>Signature, 
>> ))
>>  {
>>  DEBUG ((EFI_D_ERROR, "ValidateFvHeader: Variable Store Guid 
>> non-compatible\n"));
>>  return EFI_NOT_FOUND;
>> -- 
>> 2.9.5
>>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v3 1/5] Hisilicon/D0x: Fix secure boot bug in FlashFvbDxe

2018-11-20 Thread Leif Lindholm
On Tue, Nov 20, 2018 at 05:01:46PM +0800, Ming Huang wrote:
> Now that the generic Variable Runtime DXE code no longer
> distinguishes between gEfiVariableGuid and
> gEfiAuthenticatedVariableGuid in the varstore FV header.
> We can relax the check in the flashFvb driver to accept
> either GUID regardless of whether we are running a secure
> boot capable build or not.

We are still in a situation where D06 is not buildable with Secure
Boot enabled though.

If you build with -D SECURE_BOOT_ENABLE=TRUE, you still end up with
/work/git/edk2-platforms/Platform/Hisilicon/D06/D06.dsc(...): error
4000: Instance of library class [PlatformSecureLib] is not found
  in 
[/work/git/edk2/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf]
 [AARCH64]
  consumed by module 
[/work/git/edk2/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf]

And all Hisilicon platforms still use
AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
regardless of Secure Boot setting.

So what problem does this patch solve? A runtime one?

/
Leif

> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> ---
>  Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf | 1 +
>  Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c   | 5 +++--
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf 
> b/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf
> index f8be4741ef7c..a0226e0d87c0 100644
> --- a/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf
> +++ b/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf
> @@ -44,6 +44,7 @@ [LibraryClasses]
>UefiRuntimeLib
>  
>  [Guids]
> +  gEfiAuthenticatedVariableGuid
>gEfiSystemNvDataFvGuid
>gEfiVariableGuid
>  
> diff --git a/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c 
> b/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c
> index e18cc9e06ec2..12baed41cd4e 100644
> --- a/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c
> +++ b/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c
> @@ -189,7 +189,7 @@ InitializeFvAndVariableStoreHeaders (
>  // VARIABLE_STORE_HEADER
>  //
>  VariableStoreHeader = (VARIABLE_STORE_HEADER*)((UINTN)Headers + 
> (UINTN)FirmwareVolumeHeader->HeaderLength);
> -CopyGuid (>Signature, );
> +CopyGuid (>Signature, 
> );
>  VariableStoreHeader->Size = PcdGet32(PcdFlashNvStorageVariableSize) - 
> FirmwareVolumeHeader->HeaderLength;
>  VariableStoreHeader->Format= VARIABLE_STORE_FORMATTED;
>  VariableStoreHeader->State = VARIABLE_STORE_HEALTHY;
> @@ -258,7 +258,8 @@ ValidateFvHeader (
>  VariableStoreHeader = (VARIABLE_STORE_HEADER*)((UINTN)FwVolHeader + 
> (UINTN)FwVolHeader->HeaderLength);
>  
>  // Check the Variable Store Guid
> -if ( CompareGuid (>Signature, ) == 
> FALSE )
> +if (!CompareGuid (>Signature, ) &&
> +!CompareGuid (>Signature, 
> ))
>  {
>  DEBUG ((EFI_D_ERROR, "ValidateFvHeader: Variable Store Guid 
> non-compatible\n"));
>  return EFI_NOT_FOUND;
> -- 
> 2.9.5
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-non-osi v2 0/4] Upload D06 binary modules for SBSA test

2018-11-20 Thread Leif Lindholm
On Tue, Nov 20, 2018 at 09:34:51AM +0800, Ming Huang wrote:
> 
> 
> On 11/20/2018 2:46 AM, Leif Lindholm wrote:
> > On Fri, Nov 16, 2018 at 04:13:02PM +0800, Ming Huang wrote:
> >> Main Change since v1:
> >> 1 Modify comments;
> >>
> >> Code can also be found in github:
> >> https://github.com/hisilicon/OpenPlatformPkg.git
> >> branch: d06-acs-non-osi-v2
> > 
> > From the black-box standpoint, this series look fine.
> > Are there any implications of the TB->TA boot that means I need to
> > synchronise pushing these with pushing that change for edk2-platforms?
> 
> This four binary patches is irrelevant about TB->TA boot. D06 has been
> TA boot from last series (August).

Gotcha.

For the series:
Reviewed-by: Leif Lindholm 
Pushed as 572f1053..047bb77d.

> 
> > 
> > If not, for the series:
> > Reviewed-by: Leif Lindholm 
> > and I'll push when I have confirmation.
> >  
> >> Ming Huang (4):
> >>   Hisilicon/D06: Add cpu on/off feature in TrustedFirmware
> >>   Hisilicon/D06: Fix SBSA test case 42 failed issues
> >>   Hisilicon/D06: Fix set usb reg failed issue
> >>   Hisilicon/D06: Fix SBSA PE-15 failed issue
> >>
> >>  Platform/Hisilicon/D06/Drivers/IoInitDxe/IoInitDxe.efi | Bin 229216 -> 
> >> 232832 bytes
> >>  Platform/Hisilicon/D06/bl1.bin | Bin 12432 -> 
> >> 12432 bytes
> >>  Platform/Hisilicon/D06/fip.bin | Bin 113578 -> 
> >> 113450 bytes
> >>  3 files changed, 0 insertions(+), 0 deletions(-)
> >>
> >> -- 
> >> 2.9.5
> >>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] MdeModulePkg/Variable: add debug logs in VariableServiceSetVariable

2018-11-20 Thread Laszlo Ersek
On 11/20/18 11:38, Vijayenthiran Subramaniam wrote:
> Print debug messages if size of the VariableName plus DataSize exceeds
> Max(Auth|Voltaile)VariableSize bytes. The messages will be useful if any
> platform specific value of Max(Auth|Voltaile)VariableSize PCDs have to
> be changed.
> 
> Cc: Star Zeng 
> Cc: Jian J Wang 
> Cc: Ruiyu Ni 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Vijayenthiran Subramaniam 
> ---
>  MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 6 ++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c 
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> index 8e8db71bd201..db54fa4412c0 100644
> --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> @@ -3234,14 +3234,20 @@ VariableServiceSetVariable (
>  //
>  if ((Attributes & VARIABLE_ATTRIBUTE_AT_AW) != 0) {
>if (StrSize (VariableName) + PayloadSize > 
> mVariableModuleGlobal->MaxAuthVariableSize - GetVariableHeaderSize ()) {
> +DEBUG ((DEBUG_ERROR, "%a: Size of (%s) variable + DataSize exceeds 
> MaxAuthVariableSize.\n",
> +  __FUNCTION__, VariableName));
>  return EFI_INVALID_PARAMETER;
>}
>  } else if ((Attributes & EFI_VARIABLE_NON_VOLATILE) != 0) {
>if (StrSize (VariableName) + PayloadSize > 
> mVariableModuleGlobal->MaxVariableSize - GetVariableHeaderSize ()) {
> +DEBUG ((DEBUG_ERROR, "%a: Size of (%s) variable + DataSize exceeds 
> MaxVariableSize.\n",
> +  __FUNCTION__, VariableName));
>  return EFI_INVALID_PARAMETER;
>}
>  } else {
>if (StrSize (VariableName) + PayloadSize > 
> mVariableModuleGlobal->MaxVolatileVariableSize - GetVariableHeaderSize ()) {
> +DEBUG ((DEBUG_ERROR, "%a: Size of (%s) variable + DataSize exceeds 
> MaxVolatileVariableSize.\n",
> +  __FUNCTION__, VariableName));
>  return EFI_INVALID_PARAMETER;
>}
>  }
> 

You could make this more useful as well -- again, *if* the package
maintainers agree with the new log messages --; namely, the vendor GUID,
DataSize, and the limit in question should / could all be logged.

Thanks
Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] NetworkPkg/IScsiDxe: add debug logs for failed SetVariable attempts

2018-11-20 Thread Laszlo Ersek
On 11/20/18 11:39, Vijayenthiran Subramaniam wrote:
> Add debug messages for failed attempts to write to a variable.
> 
> Cc: Siyuan Fu 
> Cc: Jiaxin Wu 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Vijayenthiran Subramaniam 
> ---
>  NetworkPkg/IScsiDxe/IScsiMisc.c | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/NetworkPkg/IScsiDxe/IScsiMisc.c b/NetworkPkg/IScsiDxe/IScsiMisc.c
> index dd0d32dcda16..46760d79a8f3 100644
> --- a/NetworkPkg/IScsiDxe/IScsiMisc.c
> +++ b/NetworkPkg/IScsiDxe/IScsiMisc.c
> @@ -845,6 +845,8 @@ IScsiCreateAttempts (
>  );
>  FreePool (AttemptConfigOrder);
>  if (EFI_ERROR (Status)) {
> +  DEBUG ((DEBUG_ERROR, "%a: SetVariable failed with return: %r\n",
> +__FUNCTION__, Status));
>return Status;
>  }
>  
> @@ -887,6 +889,8 @@ IScsiCreateAttempts (
>  );
>  FreePool (AttemptConfigData);
>  if (EFI_ERROR (Status)) {
> +  DEBUG ((DEBUG_ERROR, "%a: SetVariable failed with return: %r\n",
> +__FUNCTION__, Status));
>return Status;
>  }
>}
> 

I'll let Siyuan and Jiaxin decide whether these log messages should be
added or not. However, if we do add them, then we should distinguish
them better. Right now they look the same. I suggest logging the
variable namespace (or "vendor") GUID and the variable name as well.

Thanks
Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] NetworkPkg/IScsiDxe: add debug logs for failed SetVariable attempts

2018-11-20 Thread Udit Kumar



> -Original Message-
> From: edk2-devel  On Behalf Of
> Vijayenthiran Subramaniam
> Sent: Tuesday, November 20, 2018 4:10 PM
> To: edk2-devel@lists.01.org; siyuan...@intel.com; jiaxin...@intel.com
> Cc: Vijayenthiran Subramaniam 
> Subject: [edk2] [PATCH] NetworkPkg/IScsiDxe: add debug logs for failed
> SetVariable attempts
> 
> Add debug messages for failed attempts to write to a variable.
> 
> Cc: Siyuan Fu 
> Cc: Jiaxin Wu 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Vijayenthiran Subramaniam
> 
> ---
>  NetworkPkg/IScsiDxe/IScsiMisc.c | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/NetworkPkg/IScsiDxe/IScsiMisc.c b/NetworkPkg/IScsiDxe/IScsiMisc.c
> index dd0d32dcda16..46760d79a8f3 100644
> --- a/NetworkPkg/IScsiDxe/IScsiMisc.c
> +++ b/NetworkPkg/IScsiDxe/IScsiMisc.c
> @@ -845,6 +845,8 @@ IScsiCreateAttempts (
>  );
>  FreePool (AttemptConfigOrder);
>  if (EFI_ERROR (Status)) {
> +  DEBUG ((DEBUG_ERROR, "%a: SetVariable failed with return: %r\n",
> +__FUNCTION__, Status));
>return Status;
>  }
> 
> @@ -887,6 +889,8 @@ IScsiCreateAttempts (
>  );
>  FreePool (AttemptConfigData);
>  if (EFI_ERROR (Status)) {
> +  DEBUG ((DEBUG_ERROR, "%a: SetVariable failed with return: %r\n",
> +__FUNCTION__, Status));
>return Status;
>  }
>}

Since you are printing, same text for both failure , how will you decide which 
SetVariable is failed 
You can choose to have different text or __LINE__ should help 


> --
> 2.17.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.01
> .org%2Fmailman%2Flistinfo%2Fedk2-
> develdata=02%7C01%7Cudit.kumar%40nxp.com%7C5faa1c1f546046d1f1
> a708d64ed7ff20%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C1%7C6367
> 83086961408415sdata=RZdmCRaq8x0ps9gu13YAoWf8lsGS9zH2fAdnDLbP
> 3rE%3Dreserved=0
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v2 10/15] Hisilicon/D06: Modify Gic base

2018-11-20 Thread Leif Lindholm
On Tue, Nov 20, 2018 at 02:55:11PM +0800, Ming Huang wrote:
> > But if I understand correctly, the remainder of the patch will be
> > incorrect until the other changes to book from TA have been applied
> > (in the subsequent patch).
> > So please move the MADT change to the other patch.
> 
> D06 had been boot from TA from last series (Upload for D06 platform).
>  Silicon/Hisilicon/D06: Set TA as Node 0 for TA boot
> and
>  Hisilicon/D06: Modify Gic base
> are tow important patches missed by last series.

Understood, and that's not ideal.
But this (what you have in v3) is still the way the patch should have
been then.

/
Leif
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH] NetworkPkg/IScsiDxe: add debug logs for failed SetVariable attempts

2018-11-20 Thread Vijayenthiran Subramaniam
Add debug messages for failed attempts to write to a variable.

Cc: Siyuan Fu 
Cc: Jiaxin Wu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vijayenthiran Subramaniam 
---
 NetworkPkg/IScsiDxe/IScsiMisc.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/NetworkPkg/IScsiDxe/IScsiMisc.c b/NetworkPkg/IScsiDxe/IScsiMisc.c
index dd0d32dcda16..46760d79a8f3 100644
--- a/NetworkPkg/IScsiDxe/IScsiMisc.c
+++ b/NetworkPkg/IScsiDxe/IScsiMisc.c
@@ -845,6 +845,8 @@ IScsiCreateAttempts (
 );
 FreePool (AttemptConfigOrder);
 if (EFI_ERROR (Status)) {
+  DEBUG ((DEBUG_ERROR, "%a: SetVariable failed with return: %r\n",
+__FUNCTION__, Status));
   return Status;
 }
 
@@ -887,6 +889,8 @@ IScsiCreateAttempts (
 );
 FreePool (AttemptConfigData);
 if (EFI_ERROR (Status)) {
+  DEBUG ((DEBUG_ERROR, "%a: SetVariable failed with return: %r\n",
+__FUNCTION__, Status));
   return Status;
 }
   }
-- 
2.17.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH] MdeModulePkg/Variable: add debug logs in VariableServiceSetVariable

2018-11-20 Thread Vijayenthiran Subramaniam
Print debug messages if size of the VariableName plus DataSize exceeds
Max(Auth|Voltaile)VariableSize bytes. The messages will be useful if any
platform specific value of Max(Auth|Voltaile)VariableSize PCDs have to
be changed.

Cc: Star Zeng 
Cc: Jian J Wang 
Cc: Ruiyu Ni 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vijayenthiran Subramaniam 
---
 MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c 
b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
index 8e8db71bd201..db54fa4412c0 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
@@ -3234,14 +3234,20 @@ VariableServiceSetVariable (
 //
 if ((Attributes & VARIABLE_ATTRIBUTE_AT_AW) != 0) {
   if (StrSize (VariableName) + PayloadSize > 
mVariableModuleGlobal->MaxAuthVariableSize - GetVariableHeaderSize ()) {
+DEBUG ((DEBUG_ERROR, "%a: Size of (%s) variable + DataSize exceeds 
MaxAuthVariableSize.\n",
+  __FUNCTION__, VariableName));
 return EFI_INVALID_PARAMETER;
   }
 } else if ((Attributes & EFI_VARIABLE_NON_VOLATILE) != 0) {
   if (StrSize (VariableName) + PayloadSize > 
mVariableModuleGlobal->MaxVariableSize - GetVariableHeaderSize ()) {
+DEBUG ((DEBUG_ERROR, "%a: Size of (%s) variable + DataSize exceeds 
MaxVariableSize.\n",
+  __FUNCTION__, VariableName));
 return EFI_INVALID_PARAMETER;
   }
 } else {
   if (StrSize (VariableName) + PayloadSize > 
mVariableModuleGlobal->MaxVolatileVariableSize - GetVariableHeaderSize ()) {
+DEBUG ((DEBUG_ERROR, "%a: Size of (%s) variable + DataSize exceeds 
MaxVolatileVariableSize.\n",
+  __FUNCTION__, VariableName));
 return EFI_INVALID_PARAMETER;
   }
 }
-- 
2.17.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v2 06/15] Hisilicon/D06: Move some functions to OemMiscLib

2018-11-20 Thread Leif Lindholm
On Tue, Nov 20, 2018 at 02:38:32PM +0800, Ming Huang wrote:
> > My feedback was:
> > ---
> > This would be more clear as "platform specific" than "cpld relative".
> > 
> > I did not realise this wasn't a Hisilicon component when reviewing the
> > original set.
> > 
> > I approve of this change, but can you tell me why it is included in
> > this set? If the goal is to make the M41T83 support platform
> > independent, should the library also move to Silicon/ST/?
> > ---
> > 
> > So could you please update the commit message, and add a subsequent
> > patch moving Library/M41T83RealTimeClockLib to
> > Silicon/STMicroelectronics (and updating D06.dsc to match)?
> > I do not care if it is not perfectly abstracted yet - we can deal with
> > that when we have other users of the component in the tree.
> 
> Sorry for missing update the commit message this patch.
> I will update it in v3. I try to move the library to 
> Silicon/STMicroelectronics,
> but M41T83RealTimeClockLib depend on I2CLib in Hisilicon, so can't move the
> library to STMicroelectronics. Main gist of this patch
> is making this library as a common module in Hisilicon.

And a PCI component depends on PciLib - that does not mean it should
live in edk2 MdePkg. And it does not mean that this library should be
considered Hisilicon-specific. If we get other platforms with this
component, they will not be permitted to add duplicated code - we
will then need to make sure the library is suitable for all users.

There is no situation other than the maintainers (me) dropping the
ball that lets you have a private driver for a generic component.

Regardless, I will leave this patch out for now, to avoid delaying the
release.

/
Leif
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v2 00/15] Fix D06 SBSA/SBBR issue and improve

2018-11-20 Thread Leif Lindholm
On Tue, Nov 20, 2018 at 03:02:44PM +0800, Ming Huang wrote:
> > Please rebase on new master and address comments for v3.
> > If you can merge
> >  Silicon/Hisilicon/D06: Set TA as Node 0 for TA boot
> > and
> >  Hisilicon/D06: Modify Gic base
> > as requested and get those sent out before I start work tomorrow,
> > we are in pretty good shape for me to roll out an -rc1 tomorrow.
> > (Which would be good, because I hope to have Wednesday-Friday as
> > holiday :)
> > 
> > If you can also address "Fix secure boot bug in FlashFvbDxe", that
> > should be all remaining functional changes.
> 
> I have address all comment include "Fix secure boot bug in FlashFvbDxe".

Thanks!

> > FYI: I am now working against edk2 tag edk2-stable201811.
> 
> I update edk2 to edk2-stable201811, but can't build in my build server,
> maybe my build environment has some problems, it can build with edk2
> commit (52437cb7633b Star Zeng 2018-08-01 10:15:45).

I cannot reproduce this error.
Can you try cleaning up your edk2 repo with 'git clean -fdx'?
(This will delete anything not checked into the repo.)

/
Leif

> Build error log:
> ---
> huangming@EstBuildSvr1:~/source/new$ ./uefi-tools/edk2-build.sh d06
> Loading previous configuration from 
> /home/huangming/source/new/edk2/Conf/BuildEnv.sh
> WORKSPACE: /home/huangming/source/new
> EDK_TOOLS_PATH: /home/huangming/source/new/edk2/BaseTools
> CONF_PATH: /home/huangming/source/new/edk2/Conf
> Copying $EDK_TOOLS_PATH/Conf/build_rule.template
>  to /home/huangming/source/new/edk2/Conf/build_rule.txt
> Copying $EDK_TOOLS_PATH/Conf/tools_def.template
>  to /home/huangming/source/new/edk2/Conf/tools_def.txt
> Copying $EDK_TOOLS_PATH/Conf/target.template
>  to /home/huangming/source/new/edk2/Conf/target.txt
> make: Entering directory '/home/huangming/source/new/edk2/BaseTools'
> make -C Source/C
> make[1]: Entering directory 
> '/home/huangming/source/new/edk2/BaseTools/Source/C'
> Attempting to detect HOST_ARCH from 'uname -m': x86_64
> Detected HOST_ARCH of X64 using uname.
> mkdir -p .
> make -C Common
> make[2]: Entering directory 
> '/home/huangming/source/new/edk2/BaseTools/Source/C/Common'
> make[2]: Nothing to be done for 'all'.
> make[2]: Leaving directory 
> '/home/huangming/source/new/edk2/BaseTools/Source/C/Common'
> make -C BrotliCompress
> make[2]: Entering directory 
> '/home/huangming/source/new/edk2/BaseTools/Source/C/BrotliCompress'
> make[2]: *** No rule to make target 'common/././types.h', needed by 
> 'common/dictionary.o'.  Stop.
> make[2]: Leaving directory 
> '/home/huangming/source/new/edk2/BaseTools/Source/C/BrotliCompress'
> GNUmakefile:85: recipe for target 'BrotliCompress' failed
> make[1]: *** [BrotliCompress] Error 2
> make[1]: Leaving directory 
> '/home/huangming/source/new/edk2/BaseTools/Source/C'
> GNUmakefile:25: recipe for target 'Source/C' failed
> make: *** [Source/C] Error 2
> make: Leaving directory '/home/huangming/source/new/edk2/BaseTools'
> /home/huangming/source/new
>  !!! BaseTools failed to build !!!
> ---
> 
> > 
> > /
> > Leif
> > 
> >>  Silicon/Hisilicon/HisiPkg.dec 
> >>|1 +
> >>  Platform/Hisilicon/D03/D03.dsc
> >>|5 +
> >>  Platform/Hisilicon/D05/D05.dsc
> >>|5 +
> >>  Platform/Hisilicon/D06/D06.dsc
> >>|7 +-
> >>  Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf 
> >>|2 +
> >>  Silicon/Hisilicon/Library/ArmPlatformLibHisilicon/ArmPlatformLib.inf  
> >>|2 +-
> >>  Silicon/Hisilicon/Library/ArmPlatformLibHisilicon/ArmPlatformLibSec.inf   
> >>|2 +-
> >>  
> >> Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.inf
> >>   |1 -
> >>  Silicon/Hisilicon/Pv660/Drivers/IoInitDxe/IoInitDxe.inf   
> >>|   58 --
> >>  Silicon/Hisilicon/Pv660/Drivers/PcieInitDxe/PcieInitDxe.inf   
> >>|   56 --
> >>  Silicon/Hisilicon/Pv660/Drivers/SasInitDxe/SasV1Init.inf  
> >>|   48 -
> >>  
> >> Silicon/Hisilicon/Pv660/Drivers/UnInstallAcpiTableDxe/UnInstallAcpiTable.inf
> >>  |   57 --
> >>  Silicon/Hisilicon/Pv660/Pv660AcpiTables/AcpiTables.inf
> >>|   60 --
> >>  Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Hi1620Platform.h
> >>|2 +-
> >>  Silicon/Hisilicon/Include/Library/OemMiscLib.h
> >>|9 +
> >>  Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClock.h
> >>|4 -
> >>  Silicon/Hisilicon/Pv660/Drivers/IoInitDxe/Smmu.h  
> >>|   36 -
> >>  Silicon/Hisilicon/Pv660/Drivers/PcieInitDxe/PcieInit.h
> >>|   93 --
> >>  Silicon/Hisilicon/Pv660/Drivers/PcieInitDxe/PcieInitLib.h   

[edk2] [PATCH 1/1] Platform/ARM/SgiPkg: increase max variable size to 8KB

2018-11-20 Thread Vijayenthiran Subramaniam
Commit dc37ca75 ("Edk2Platforms: Replace MdeModulePkg PXE/iSCSI/TCP with
NetworkPkg drivers") switched to using iSCSI driver from the NetworkPkg
package. This driver requires the platform to support a maximum variable
size of atleast 4KB.

So increase the maximum supported variable size to 8KB on the SGI
platforms. Without this, the iSCSI driver fails to load.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vijayenthiran Subramaniam 
---
 Platform/ARM/SgiPkg/SgiPlatform.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc 
b/Platform/ARM/SgiPkg/SgiPlatform.dsc
index 3f0ca9872e79..1c152fad2246 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dsc
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc
@@ -102,6 +102,7 @@
 
 [PcdsFixedAtBuild.common]
   gArmTokenSpaceGuid.PcdVFPEnabled|1
+  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000
 
   # DRAM Block2 Base and Size
   gArmSgiTokenSpaceGuid.PcdDramBlock2Base|0x808000
-- 
2.17.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [platforms: PATCH v6 0/8] Armada7k8k Xenon driver rework

2018-11-20 Thread Marcin Wojtas
Thanks!

Best regards,
Marcin
wt., 20 lis 2018 o 10:58 Ard Biesheuvel  napisaƂ(a):
>
> On Mon, 19 Nov 2018 at 07:54, Marcin Wojtas  wrote:
> >
> > Hi,
> >
> > The sixth version of the patchset applies minor correction in the
> > last patch and also simplifies the BoardDesc library callbacks.
> > There is no unnecessary allocation now.
> >
> > Patches are available in the github:
> > https://github.com/MarvellEmbeddedProcessors/edk2-open-platform/commits/xenon-upstream-r20181119
> >
> > Generic driver patches with fixes and extended SdMmcOverride protocol:
> > https://github.com/MarvellEmbeddedProcessors/edk2-open-platform/commits/sdmmc-override-upstream-r20181109
> >
> > I'm looking forward to the comments and remarks.
> >
> > Best regards,
> > Marcin
> >
> > Changelog:
> > v5->v6:
> > * 3,4,5
> >   - pass the pointer to the static table directly instead of
> > the copy allocation
> >
> > * 6/8
> >   - remove freeing SdMmc board description structure in
> > NonDiscoverableDevicesDxe, as from now on the static
> > table will be used
> >
> > * 8/8
> >   - change SdMmcOverride protocol comment to '#PRODUCES'
> >   - s/Controler/Controller/
> >   - remove freeing board description structure
> >
> > v4->v5:
> > * 1,2,6/8
> >   - add Ard's RB
> >
> > * 2,3,4,5
> >   - change parameters to OUT
> >   - assign count only after allocation is successful
> >
> > * 7/8 & 8/8
> >   - split driver rework patches into two steps
> >
> > v3->v4:
> > * 1/7:
> >   - add Ard's RB
> >
> > * 2/7:
> >   - use local enum definition for SlotType in order not to include 
> > MdeModulePkg
> > private header
> >
> > * 7/7:
> >   - rework capability handling, without using the structure defined in the
> > MdeModulePkg header
> >
> > v2->v3
> > * 1/7:
> >   - rename NotifyPhase parameter to PhaseData
> >
> > * 7/7:
> >   - rename NotifyPhase parameter to PhaseData
> >   - update UHS_MODE_SEL only for HS200/HS400
> >  in XenonSdMmcHcUhsSignaling
> >   - use local macros for standard SDHC registers in order not to
> > include private MdeModulePkg header
> >
> > v1 -> v2
> > * 1/7 and 7/7 - adjust to modified SdMmcOverride
> >   NotifyPhase and Capability routines
> >
> >
> > Marcin Wojtas (2):
> >   Silicon/SynQuacer/PlatformDxe: adjust to updated SdMmcOverride
> >   Marvell/Drivers: XenonDxe: Remove SdMmcPciHcDxe files
> >
> > Tomasz Michalec (6):
> >   Marvell/Library: ArmadaBoardDescLib: Extend SDMMC information
> >   SolidRun/Armada80x0McBin: Introduce board description library
> >   Marvell/Armada70x0Db: Introduce board description library
> >   Marvell/Armada80x0Db: Introduce board description library
> >   Marvell/Drivers: MvBoardDesc: Extend information for SdMmc
> >   Marvell/Drivers: XenonDxe: Switch to use generic SdMmcPciHcDxe
> >
>
> For the series
>
> Reviewed-by: Ard Biesheuvel 
>
> Pushed as ce4f7528ed71..1360ddbc30e2
>
> Thanks for
> >  32 files changed, 1691 insertions(+), 7384 deletions(-)
>
>
>
> >  Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc  
> >|3 +-
> >  Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc 
> >|3 +
> >  Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc 
> >|3 +
> >  Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc  
> >|3 +
> >  Silicon/Marvell/Armada7k8k/Armada7k8k.fdf  
> >|3 +-
> >  
> > Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.inf
> >|   34 +
> >  
> > Platform/Marvell/Armada80x0Db/Armada80x0DbBoardDescLib/Armada80x0DbBoardDescLib.inf
> >|   34 +
> >  
> > Platform/SolidRun/Armada80x0McBin/Armada80x0McBinBoardDescLib/Armada80x0McBinBoardDescLib.inf
> >  |   34 +
> >  Silicon/Marvell/Drivers/BoardDesc/MvBoardDescDxe.inf   
> >|1 +
> >  Silicon/Marvell/Drivers/SdMmc/XenonDxe/{SdMmcPciHcDxe.inf => XenonDxe.inf} 
> >|   33 +-
> >  Silicon/Marvell/Drivers/SdMmc/XenonDxe/SdMmcPciHcDxe.h 
> >|  791 
> >  Silicon/Marvell/Drivers/SdMmc/XenonDxe/SdMmcPciHci.h   
> >|  550 --
> >  Silicon/Marvell/Drivers/SdMmc/XenonDxe/XenonPciHci.h   
> >|  151 ++
> >  Silicon/Marvell/Drivers/SdMmc/XenonDxe/XenonSdMmcOverride.h
> >|   53 +
> >  Silicon/Marvell/Drivers/SdMmc/XenonDxe/XenonSdhci.h
> >|  131 +-
> >  Silicon/Marvell/Include/Library/ArmadaBoardDescLib.h   
> >|   21 +-
> >  
> > Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.c
> >  |   60 +
> >  
> > 

Re: [edk2] [platforms: PATCH v6 0/8] Armada7k8k Xenon driver rework

2018-11-20 Thread Ard Biesheuvel
On Mon, 19 Nov 2018 at 07:54, Marcin Wojtas  wrote:
>
> Hi,
>
> The sixth version of the patchset applies minor correction in the
> last patch and also simplifies the BoardDesc library callbacks.
> There is no unnecessary allocation now.
>
> Patches are available in the github:
> https://github.com/MarvellEmbeddedProcessors/edk2-open-platform/commits/xenon-upstream-r20181119
>
> Generic driver patches with fixes and extended SdMmcOverride protocol:
> https://github.com/MarvellEmbeddedProcessors/edk2-open-platform/commits/sdmmc-override-upstream-r20181109
>
> I'm looking forward to the comments and remarks.
>
> Best regards,
> Marcin
>
> Changelog:
> v5->v6:
> * 3,4,5
>   - pass the pointer to the static table directly instead of
> the copy allocation
>
> * 6/8
>   - remove freeing SdMmc board description structure in
> NonDiscoverableDevicesDxe, as from now on the static
> table will be used
>
> * 8/8
>   - change SdMmcOverride protocol comment to '#PRODUCES'
>   - s/Controler/Controller/
>   - remove freeing board description structure
>
> v4->v5:
> * 1,2,6/8
>   - add Ard's RB
>
> * 2,3,4,5
>   - change parameters to OUT
>   - assign count only after allocation is successful
>
> * 7/8 & 8/8
>   - split driver rework patches into two steps
>
> v3->v4:
> * 1/7:
>   - add Ard's RB
>
> * 2/7:
>   - use local enum definition for SlotType in order not to include 
> MdeModulePkg
> private header
>
> * 7/7:
>   - rework capability handling, without using the structure defined in the
> MdeModulePkg header
>
> v2->v3
> * 1/7:
>   - rename NotifyPhase parameter to PhaseData
>
> * 7/7:
>   - rename NotifyPhase parameter to PhaseData
>   - update UHS_MODE_SEL only for HS200/HS400
>  in XenonSdMmcHcUhsSignaling
>   - use local macros for standard SDHC registers in order not to
> include private MdeModulePkg header
>
> v1 -> v2
> * 1/7 and 7/7 - adjust to modified SdMmcOverride
>   NotifyPhase and Capability routines
>
>
> Marcin Wojtas (2):
>   Silicon/SynQuacer/PlatformDxe: adjust to updated SdMmcOverride
>   Marvell/Drivers: XenonDxe: Remove SdMmcPciHcDxe files
>
> Tomasz Michalec (6):
>   Marvell/Library: ArmadaBoardDescLib: Extend SDMMC information
>   SolidRun/Armada80x0McBin: Introduce board description library
>   Marvell/Armada70x0Db: Introduce board description library
>   Marvell/Armada80x0Db: Introduce board description library
>   Marvell/Drivers: MvBoardDesc: Extend information for SdMmc
>   Marvell/Drivers: XenonDxe: Switch to use generic SdMmcPciHcDxe
>

For the series

Reviewed-by: Ard Biesheuvel 

Pushed as ce4f7528ed71..1360ddbc30e2

Thanks for
>  32 files changed, 1691 insertions(+), 7384 deletions(-)



>  Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
>  |3 +-
>  Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc   
>  |3 +
>  Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc   
>  |3 +
>  Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc
>  |3 +
>  Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
>  |3 +-
>  
> Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.inf
>|   34 +
>  
> Platform/Marvell/Armada80x0Db/Armada80x0DbBoardDescLib/Armada80x0DbBoardDescLib.inf
>|   34 +
>  
> Platform/SolidRun/Armada80x0McBin/Armada80x0McBinBoardDescLib/Armada80x0McBinBoardDescLib.inf
>  |   34 +
>  Silicon/Marvell/Drivers/BoardDesc/MvBoardDescDxe.inf 
>  |1 +
>  Silicon/Marvell/Drivers/SdMmc/XenonDxe/{SdMmcPciHcDxe.inf => XenonDxe.inf}   
>  |   33 +-
>  Silicon/Marvell/Drivers/SdMmc/XenonDxe/SdMmcPciHcDxe.h   
>  |  791 
>  Silicon/Marvell/Drivers/SdMmc/XenonDxe/SdMmcPciHci.h 
>  |  550 --
>  Silicon/Marvell/Drivers/SdMmc/XenonDxe/XenonPciHci.h 
>  |  151 ++
>  Silicon/Marvell/Drivers/SdMmc/XenonDxe/XenonSdMmcOverride.h  
>  |   53 +
>  Silicon/Marvell/Drivers/SdMmc/XenonDxe/XenonSdhci.h  
>  |  131 +-
>  Silicon/Marvell/Include/Library/ArmadaBoardDescLib.h 
>  |   21 +-
>  
> Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.c
>  |   60 +
>  
> Platform/Marvell/Armada80x0Db/Armada80x0DbBoardDescLib/Armada80x0DbBoardDescLib.c
>  |   60 +
>  
> Platform/SolidRun/Armada80x0McBin/Armada80x0McBinBoardDescLib/Armada80x0McBinBoardDescLib.c
>|   60 +
>  Silicon/Marvell/Drivers/BoardDesc/MvBoardDescDxe.c   
>  |   24 +-
>  Silicon/Marvell/Drivers/NonDiscoverableDxe/NonDiscoverableDxe.c  
> 

Re: [edk2] [RFC] Proposal to remove DuetPkg

2018-11-20 Thread Leif Lindholm
On Tue, Nov 20, 2018 at 05:27:13AM +, Ni, Ruiyu wrote:
> All,
> DuetPkg depends on Legacy BIOS to provide a UEFI environment. It was
> invented in the era when UEFI environment is hard to find. Since now
> UEFI is very popular in PC area, we could stop the official support
> of this package and remove it from the master.
> Anyone who wants to use it still can just grab it from git
> history. This is the same as what we did for IPF contents.
> 
> If there is no concern by end of November, we will send out a formal
> patch to remove DuetPkg. (Since DuetPkg is big, we will not generate
> the huge patch using git command, instead we will just send out the
> patch mail with correct title/commit message but empty content.)

Works for me. If you could include a link to the patch in a branch
where it can be reviewed, that would be ideal.

/
Leif

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH edk2-platforms v3 5/5] Hisilicon/D06: Move some functions to OemMiscLib

2018-11-20 Thread Ming Huang
As M41T83RealTimeClockLib is common library, so move two platform
specific functions to OemMiscLib and rename this two functions.
Main gist of this patch is making this library as a common module
in Hisilicon.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ming Huang 
---
 Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.inf |  
2 -
 Silicon/Hisilicon/Include/Library/OemMiscLib.h  |  
9 ++
 Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClock.h  |  
4 -
 Platform/Hisilicon/D06/Library/OemMiscLibD06/OemMiscLibD06.c| 
82 ++
 Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.c   | 
90 ++--
 5 files changed, 98 insertions(+), 89 deletions(-)

diff --git 
a/Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.inf 
b/Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.inf
index e0bf6b3f24db..7bbba5389737 100644
--- 
a/Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.inf
+++ 
b/Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.inf
@@ -27,12 +27,10 @@ [Sources.common]
 [Packages]
   EmbeddedPkg/EmbeddedPkg.dec
   MdePkg/MdePkg.dec
-  Platform/Hisilicon/D06/D06.dec
   Silicon/Hisilicon/HisiPkg.dec
 
 [LibraryClasses]
   BaseMemoryLib
-  CpldIoLib
   DebugLib
   I2CLib
   IoLib
diff --git a/Silicon/Hisilicon/Include/Library/OemMiscLib.h 
b/Silicon/Hisilicon/Include/Library/OemMiscLib.h
index 86ea6a1b3deb..0d7bf71b17d2 100644
--- a/Silicon/Hisilicon/Include/Library/OemMiscLib.h
+++ b/Silicon/Hisilicon/Include/Library/OemMiscLib.h
@@ -53,4 +53,13 @@ BOOLEAN OemIsNeedDisableExpanderBuffer(VOID);
 
 extern EFI_STRING_ID gDimmToDevLocator[MAX_SOCKET][MAX_CHANNEL][MAX_DIMM];
 EFI_HII_HANDLE EFIAPI OemGetPackages ();
+
+VOID
+OemReleaseOwnershipOfRtc (
+  VOID
+  );
+EFI_STATUS
+OemSwitchRtcI2cChannelAndLock (
+  VOID
+  );
 #endif
diff --git 
a/Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClock.h 
b/Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClock.h
index d985055d9bb6..f32910885856 100644
--- a/Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClock.h
+++ b/Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClock.h
@@ -17,11 +17,7 @@
 #define __M41T83_REAL_TIME_CLOCK_H__
 
 // The delay is need for cpld and I2C. This is a empirical value. MemoryFence 
is no need.
-#define RTC_DELAY_30_MS3
-// The delay is need for cpld and I2C. This is a empirical value. MemoryFence 
is no need.
 #define RTC_DELAY_1000_MACROSECOND 1000
-// The delay is need for cpld and I2C. This is a empirical value. MemoryFence 
is no need.
-#define RTC_DELAY_2_MACROSECOND2
 
 #define M41T83_REGADDR_DOTSECONDS   0x00
 #define M41T83_REGADDR_SECONDS  0x01
diff --git a/Platform/Hisilicon/D06/Library/OemMiscLibD06/OemMiscLibD06.c 
b/Platform/Hisilicon/D06/Library/OemMiscLibD06/OemMiscLibD06.c
index 2a9db46d1ff9..64d167d18ae6 100644
--- a/Platform/Hisilicon/D06/Library/OemMiscLibD06/OemMiscLibD06.c
+++ b/Platform/Hisilicon/D06/Library/OemMiscLibD06/OemMiscLibD06.c
@@ -17,6 +17,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -27,6 +28,12 @@
 #include 
 #include 
 #include 
+#include 
+
+// The delay is need for cpld and I2C. This is a empirical value. MemoryFence 
is no need.
+#define RTC_DELAY_30_MS3
+// The delay is need for cpld and I2C. This is a empirical value. MemoryFence 
is no need.
+#define RTC_DELAY_2_MACROSECOND2
 
 REPORT_PCIEDIDVID2BMC PcieDeviceToReport[PCIEDEVICE_REPORT_MAX] = {
   {67,0,0,0},
@@ -207,3 +214,78 @@ OemIsNeedDisableExpanderBuffer (
 {
   return TRUE;
 }
+
+EFI_STATUS
+OemSwitchRtcI2cChannelAndLock (
+  VOID
+  )
+{
+  UINT8   Temp;
+  UINT8   Count;
+
+  for (Count = 0; Count < 100; Count++) {
+// To get the other side's state is idle first
+Temp = ReadCpldReg (CPLD_I2C_SWITCH_FLAG);
+if ((Temp & BIT3) != 0) {
+  (VOID) MicroSecondDelay (RTC_DELAY_30_MS);
+  // Try 100 times, if BMC has not released the bus, return preemption 
failed
+  if (Count == 99) {
+if (!EfiAtRuntime ()) {
+  DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Clear cpu_i2c_rtc_state 100 times 
fail!\n",
+__FUNCTION__, __LINE__));
+}
+return EFI_DEVICE_ERROR;
+  }
+  continue;
+}
+
+// if BMC free the bus, can be set 1 preemption
+Temp = ReadCpldReg (CPLD_I2C_SWITCH_FLAG);
+Temp = Temp | CPU_GET_I2C_CONTROL;
+// CPU occupied RTC I2C State
+WriteCpldReg (CPLD_I2C_SWITCH_FLAG, Temp);
+(VOID) MicroSecondDelay (RTC_DELAY_2_MACROSECOND);
+Temp = ReadCpldReg (CPLD_I2C_SWITCH_FLAG);
+// Is preempt success
+if(CPU_GET_I2C_CONTROL == (Temp & CPU_GET_I2C_CONTROL)) {
+  break;
+}
+if (Count == 99) {
+  if (!EfiAtRuntime ()) {
+DEBUG((DEBUG_ERROR, 

[edk2] [PATCH edk2-platforms v3 4/5] Silicon/Hisilicon/D06: Set TA as Node 0 for TA boot

2018-11-20 Thread Ming Huang
Linux kernel will recognize NUMA node by processor order,
and the Node and proximity domain (PXM) will be not identical
between BIOS and OS kernel after changing to TA(Totem A) boot,
so adjust the NUMA node number and proximity domain (PXM) to
match.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ming Huang 
---
 Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Dsdt/Hi1620Pci.asl |  28 +--
 Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Hi1620Iort.asl |  18 +-
 Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Hi1620Srat.aslc| 194 
++--
 3 files changed, 120 insertions(+), 120 deletions(-)

diff --git a/Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Dsdt/Hi1620Pci.asl 
b/Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Dsdt/Hi1620Pci.asl
index 87a2da8843e4..27fde2e09bfe 100644
--- a/Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Dsdt/Hi1620Pci.asl
+++ b/Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Dsdt/Hi1620Pci.asl
@@ -212,7 +212,7 @@ Scope(_SB)
 
   Method (_PXM, 0, NotSerialized)
   {
-Return(0x01)
+Return(0x00)
   }
 } // Device(PCI0)
 
@@ -262,7 +262,7 @@ Device (PCI1)
 
   Method (_PXM, 0, NotSerialized)
   {
-Return(0x01)
+Return(0x00)
   }
 } // Device(PCI1)
 
@@ -325,7 +325,7 @@ Device (PCI2)
 
   Method (_PXM, 0, NotSerialized)
   {
-Return(0x01)
+Return(0x00)
   }
 }
 
@@ -374,7 +374,7 @@ Device (PCI3)
 
   Method (_PXM, 0, NotSerialized)
   {
-Return(0x01)
+Return(0x00)
   }
 }
 
@@ -423,7 +423,7 @@ Device (PCI4)
 
   Method (_PXM, 0, NotSerialized)
   {
-Return(0x01)
+Return(0x00)
   }
 }
 
@@ -733,7 +733,7 @@ Device (PCI5)
 
   Method (_PXM, 0, NotSerialized)
   {
-Return(0x01)
+Return(0x00)
   }
 }
 
@@ -866,11 +866,11 @@ Device (PCI6)
 // Never allow SHPC (no SHPC controller in this system)
 And(CTRL,0x1D,CTRL)
 
-If(LNotEqual(Arg1,One)) {  // Unknown revision
+If(LNotEqual(Arg1,One)) { // Unknown revision
   Or(CDW1,0x08,CDW1)
 }
 
-If(LNotEqual(CDW3,CTRL)) {  // Capabilities bits were masked
+If(LNotEqual(CDW3,CTRL)) { // Capabilities bits were masked
   Or(CDW1,0x10,CDW1)
 }
 
@@ -924,7 +924,7 @@ Device (PCI6)
 
   Method (_PXM, 0, NotSerialized)
   {
-Return(0x03)
+Return(0x02)
   }
 } // Device(PCI6)
 
@@ -974,7 +974,7 @@ Device (PCI7)
 
   Method (_PXM, 0, NotSerialized)
   {
-Return(0x03)
+Return(0x02)
   }
 } // Device(PCI7)
 
@@ -1038,7 +1038,7 @@ Device (PCI8)
 
   Method (_PXM, 0, NotSerialized)
   {
-Return(0x03)
+Return(0x02)
   }
 }// Device(PCI8)
 
@@ -1087,7 +1087,7 @@ Device (PCI9)
 
   Method (_PXM, 0, NotSerialized)
   {
-Return(0x03)
+Return(0x02)
   }
 }// Device(PCI9)
 
@@ -1136,7 +1136,7 @@ Device (PCIA)
 
   Method (_PXM, 0, NotSerialized)
   {
-Return(0x03)
+Return(0x02)
   }
 }// Device(PCIA)
 
@@ -1210,7 +1210,7 @@ Device (PCIB)
 
   Method (_PXM, 0, NotSerialized)
   {
-Return(0x03)
+Return(0x02)
   }
 }
 
diff --git a/Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Hi1620Iort.asl 
b/Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Hi1620Iort.asl
index 08e15c17bf40..994018db96b5 100644
--- a/Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Hi1620Iort.asl
+++ b/Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Hi1620Iort.asl
@@ -53,7 +53,7 @@
 [0004]  PRI Interrupt : 
 [0004] GERR Interrupt : 
 [0004] Sync Interrupt : 
-[0004]   Proximity Domain : 0001
+[0004]   Proximity Domain : 
 [0004] DeviceID mapping index : 0002
 
 [0004] Input base : 
@@ -97,7 +97,7 @@
 [0004]  PRI Interrupt : 
 [0004] GERR Interrupt : 
 [0004] Sync Interrupt : 
-[0004]   Proximity Domain : 0001
+[0004]   Proximity Domain : 
 [0004] DeviceID mapping index : 0001
 
 [0004] Input base : 7c00
@@ -135,7 +135,7 @@
 [0004]  PRI Interrupt : 
 [0004] GERR Interrupt : 
 [0004] Sync Interrupt : 
-[0004]   Proximity Domain : 0001
+[0004]   Proximity Domain : 
 [0004] DeviceID mapping index : 0001
 
 [0004] Input base : 7400
@@ -173,7 +173,7 @@
 [0004]  PRI Interrupt : 
 [0004] GERR Interrupt : 
 [0004] Sync Interrupt : 
-[0004]   Proximity Domain : 0003
+[0004]   Proximity Domain : 0002
 [0004] DeviceID mapping index : 0002
 
 [0004] Input base : 8000
@@ -217,7 +217,7 @@
 [0004]  PRI Interrupt : 
 [0004] GERR Interrupt : 
 [0004] Sync 

[edk2] [PATCH edk2-platforms v3 0/5] Fix D06 SBSA/SBBR issue and improve

2018-11-20 Thread Ming Huang
Main Change since v2:
1. Use new way to fix secure boot bug in FlashFvbDxe;
2. Spilit patch from "Modify Gic base";
3. Modify some commit messages;

Code can also be found in github:
https://github.com/hisilicon/OpenPlatformPkg.git
branch: d06-acs-platforms-v3


Ming Huang (5):
  Hisilicon/D0x: Fix secure boot bug in FlashFvbDxe
  Hisilicon/D06: Modify Gic base
  Hisilicon/D06: Correct PcdGicInterruptInterfaceBase
  Silicon/Hisilicon/D06: Set TA as Node 0 for TA boot
  Hisilicon/D06: Move some functions to OemMiscLib

 Platform/Hisilicon/D06/D06.dsc  |  
 2 +-
 Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf   |  
 1 +
 Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.inf |  
 2 -
 Silicon/Hisilicon/Include/Library/OemMiscLib.h  |  
 9 +
 Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClock.h  |  
 4 -
 Platform/Hisilicon/D06/Library/OemMiscLibD06/OemMiscLibD06.c|  
82 +
 Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c |  
 5 +-
 Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.c   |  
90 +
 Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Dsdt/Hi1620Pci.asl|  
28 +--
 Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Hi1620Iort.asl|  
18 +-
 Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/Hi1620Srat.aslc   | 
194 ++--
 Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/MadtHi1620.aslc   |  
 2 +-
 12 files changed, 224 insertions(+), 213 deletions(-)

-- 
2.9.5

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH edk2-platforms v3 2/5] Hisilicon/D06: Modify Gic base

2018-11-20 Thread Ming Huang
The values of GICD are wrong, so modify it.
Fix SBSA test case 21:
21 : Check GIC version
 GIC version is   0
 Failed on PE -0 for Level=  3 : Result:  --FAIL-- 2

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ming Huang 
---
 Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/MadtHi1620.aslc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/MadtHi1620.aslc 
b/Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/MadtHi1620.aslc
index 43b43142aff4..d3de69a3ef6c 100644
--- a/Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/MadtHi1620.aslc
+++ b/Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/MadtHi1620.aslc
@@ -361,7 +361,7 @@ EFI_ACPI_MULTIPLE_APIC_DESCRIPTION_TABLE Madt = {
 0x0, 0x0, 25, 0x4000AA00 + 0x6C /* GicRBase */, 0),
   },
 
-  EFI_ACPI_6_1_GIC_DISTRIBUTOR_INIT(0, 0xAA00, 0, 0x4),
+  EFI_ACPI_6_1_GIC_DISTRIBUTOR_INIT(0, 0xAE00, 0, 0x4),
   {
 EFI_ACPI_6_1_GIC_ITS_INIT(0,0x20210), //peri a
 //EFI_ACPI_6_1_GIC_ITS_INIT(1,0x40020210), //peri a
-- 
2.9.5

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH edk2-platforms v3 1/5] Hisilicon/D0x: Fix secure boot bug in FlashFvbDxe

2018-11-20 Thread Ming Huang
Now that the generic Variable Runtime DXE code no longer
distinguishes between gEfiVariableGuid and
gEfiAuthenticatedVariableGuid in the varstore FV header.
We can relax the check in the flashFvb driver to accept
either GUID regardless of whether we are running a secure
boot capable build or not.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ming Huang 
---
 Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf | 1 +
 Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c   | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf 
b/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf
index f8be4741ef7c..a0226e0d87c0 100644
--- a/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf
+++ b/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf
@@ -44,6 +44,7 @@ [LibraryClasses]
   UefiRuntimeLib
 
 [Guids]
+  gEfiAuthenticatedVariableGuid
   gEfiSystemNvDataFvGuid
   gEfiVariableGuid
 
diff --git a/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c 
b/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c
index e18cc9e06ec2..12baed41cd4e 100644
--- a/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c
+++ b/Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c
@@ -189,7 +189,7 @@ InitializeFvAndVariableStoreHeaders (
 // VARIABLE_STORE_HEADER
 //
 VariableStoreHeader = (VARIABLE_STORE_HEADER*)((UINTN)Headers + 
(UINTN)FirmwareVolumeHeader->HeaderLength);
-CopyGuid (>Signature, );
+CopyGuid (>Signature, );
 VariableStoreHeader->Size = PcdGet32(PcdFlashNvStorageVariableSize) - 
FirmwareVolumeHeader->HeaderLength;
 VariableStoreHeader->Format= VARIABLE_STORE_FORMATTED;
 VariableStoreHeader->State = VARIABLE_STORE_HEALTHY;
@@ -258,7 +258,8 @@ ValidateFvHeader (
 VariableStoreHeader = (VARIABLE_STORE_HEADER*)((UINTN)FwVolHeader + 
(UINTN)FwVolHeader->HeaderLength);
 
 // Check the Variable Store Guid
-if ( CompareGuid (>Signature, ) == 
FALSE )
+if (!CompareGuid (>Signature, ) &&
+!CompareGuid (>Signature, 
))
 {
 DEBUG ((EFI_D_ERROR, "ValidateFvHeader: Variable Store Guid 
non-compatible\n"));
 return EFI_NOT_FOUND;
-- 
2.9.5

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH edk2-platforms v3 3/5] Hisilicon/D06: Correct PcdGicInterruptInterfaceBase

2018-11-20 Thread Ming Huang
The PcdGicInterruptInterfaceBase(0xFE00) is wrong,
it just copy from D05/D03. Maybe somewhere will need
the right value of Pcd.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ming Huang 
---
 Platform/Hisilicon/D06/D06.dsc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Platform/Hisilicon/D06/D06.dsc b/Platform/Hisilicon/D06/D06.dsc
index e8bf5582572a..742fe30b62c3 100644
--- a/Platform/Hisilicon/D06/D06.dsc
+++ b/Platform/Hisilicon/D06/D06.dsc
@@ -181,7 +181,7 @@ [PcdsFixedAtBuild.common]
   gHisiTokenSpaceGuid.PcdArmPrimaryCoreTemp|0x8001
   gArmTokenSpaceGuid.PcdGicDistributorBase|0xAE00
   gArmTokenSpaceGuid.PcdGicRedistributorsBase|0xAE10
-  gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0xFE00
+  gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0x9B00
 
 
 
-- 
2.9.5

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] EmulatorPkg Unix Host Segmentation fault.

2018-11-20 Thread Laszlo Ersek
On 11/19/18 23:29, Jordan Justen wrote:
> On 2018-11-19 13:22:27, Andrew Fish wrote:

>> I seem to remember we hit an issue like this a long time ago? Do you
>> remember the details? Maybe it was we needed to write the
>> TempRamSupport code in assembly?
> 
> It does also creep up there, which is why we also adjust ebp/rbp in
> the TemporaryRamMigration function in OVMF.
> 
> In that case, it helps prevent the stack from reverting to the old
> stack when TemporaryRamMigration is returning to it's caller. (As
> opposed to after it returns, which I think is what is happening now.)

Right, in retrospect, I should have been clearer about this (= with
myself as well), when pointing out the commit that added the BP
massaging to OVMF's temp RAM migration. I just wanted to point out that
the BP massaging hadn't always been there in the OVMF code, so it wasn't
"part of the original design" or some such.

Thanks
Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 1/1] MdePkg ACPI: fix the typos in Acpi61.h and Acpi62.h

2018-11-20 Thread Laszlo Ersek
On 11/20/18 08:03, Gary Lin wrote:
> The GUID for VIRTUAL_CD_REGION_PERSISTENT was using the closing
> square bracket mistakenly.
> 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Gary Lin 
> ---
>  MdePkg/Include/IndustryStandard/Acpi61.h | 2 +-
>  MdePkg/Include/IndustryStandard/Acpi62.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

Good catch!

Reviewed-by: Laszlo Ersek 

Thanks
Laszlo

> diff --git a/MdePkg/Include/IndustryStandard/Acpi61.h 
> b/MdePkg/Include/IndustryStandard/Acpi61.h
> index b2276b7d64d5..c66566e58647 100644
> --- a/MdePkg/Include/IndustryStandard/Acpi61.h
> +++ b/MdePkg/Include/IndustryStandard/Acpi61.h
> @@ -1400,7 +1400,7 @@ typedef struct {
>  #define 
> EFI_ACPI_6_1_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_DISK_REGION_VOLATILE   { 
> 0x77AB535A, 0x45FC, 0x624B, { 0x55, 0x60, 0xF7, 0xB2, 0x81, 0xD1, 0xF9, 0x6E 
> }}
>  #define 
> EFI_ACPI_6_1_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_VOLATILE { 
> 0x3D5ABD30, 0x4175, 0x87CE, { 0x6D, 0x64, 0xD2, 0xAD, 0xE5, 0x23, 0xC4, 0xBB 
> }}
>  #define 
> EFI_ACPI_6_1_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_DISK_REGION_PERSISTENT { 
> 0x5CEA02C9, 0x4D07, 0x69D3, { 0x26, 0x9F ,0x44, 0x96, 0xFB, 0xE0, 0x96, 0xF9 
> }}
> -#define 
> EFI_ACPI_6_1_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_PERSISTENT   { 
> 0x08018188, 0x42CD, 0xBB48, { 0x10, 0x0F, 0x53, 0x87, 0xD5, 0x3D, 0xED, 0x3D 
> ]}
> +#define 
> EFI_ACPI_6_1_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_PERSISTENT   { 
> 0x08018188, 0x42CD, 0xBB48, { 0x10, 0x0F, 0x53, 0x87, 0xD5, 0x3D, 0xED, 0x3D 
> }}
>  typedef struct {
>UINT16  Type;
>UINT16  Length;
> diff --git a/MdePkg/Include/IndustryStandard/Acpi62.h 
> b/MdePkg/Include/IndustryStandard/Acpi62.h
> index 730365b521d1..11ce1c16fb91 100644
> --- a/MdePkg/Include/IndustryStandard/Acpi62.h
> +++ b/MdePkg/Include/IndustryStandard/Acpi62.h
> @@ -1512,7 +1512,7 @@ typedef struct {
>  #define 
> EFI_ACPI_6_2_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_DISK_REGION_VOLATILE   { 
> 0x77AB535A, 0x45FC, 0x624B, { 0x55, 0x60, 0xF7, 0xB2, 0x81, 0xD1, 0xF9, 0x6E 
> }}
>  #define 
> EFI_ACPI_6_2_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_VOLATILE { 
> 0x3D5ABD30, 0x4175, 0x87CE, { 0x6D, 0x64, 0xD2, 0xAD, 0xE5, 0x23, 0xC4, 0xBB 
> }}
>  #define 
> EFI_ACPI_6_2_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_DISK_REGION_PERSISTENT { 
> 0x5CEA02C9, 0x4D07, 0x69D3, { 0x26, 0x9F ,0x44, 0x96, 0xFB, 0xE0, 0x96, 0xF9 
> }}
> -#define 
> EFI_ACPI_6_2_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_PERSISTENT   { 
> 0x08018188, 0x42CD, 0xBB48, { 0x10, 0x0F, 0x53, 0x87, 0xD5, 0x3D, 0xED, 0x3D 
> ]}
> +#define 
> EFI_ACPI_6_2_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_PERSISTENT   { 
> 0x08018188, 0x42CD, 0xBB48, { 0x10, 0x0F, 0x53, 0x87, 0xD5, 0x3D, 0xED, 0x3D 
> }}
>  typedef struct {
>UINT16  Type;
>UINT16  Length;
> 

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [RFC] Proposal to remove DuetPkg

2018-11-20 Thread Laszlo Ersek
On 11/20/18 06:27, Ni, Ruiyu wrote:
> All,
> DuetPkg depends on Legacy BIOS to provide a UEFI environment. It was invented 
> in the era when UEFI environment is hard to find. Since now UEFI is very 
> popular in PC area, we could stop the official support of this package and 
> remove it from the master.
> Anyone who wants to use it still can just grab it from git history. This is 
> the same as what we did for IPF contents.
> 
> If there is no concern by end of November, we will send out a formal patch to 
> remove DuetPkg. (Since DuetPkg is big, we will not generate the huge patch 
> using git command, instead we will just send out the patch mail with correct 
> title/commit message but empty content.)
> 
> Thanks,
> Ray
> 

I have no objection.

Thanks,
Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [edk2-test][PATCH] SctPkg/Tools: Fix incorrect line ending detection by GenBin tool

2018-11-20 Thread Jin, Eric
Please don't forget to change the copyright info when commit patch.
Reviewed-by: Eric Jin 

-Original Message-
From: Lokesh B V  
Sent: Tuesday, November 20, 2018 2:50 PM
To: edk2-devel@lists.01.org; supreeth.venkat...@arm.com; Jin, Eric 

Cc: Lokesh B V 
Subject: [edk2-test][PATCH] SctPkg/Tools: Fix incorrect line ending detection 
by GenBin tool

Some windows editors uses "\r\n" for line feed. While processing uefi testcase 
info file, the GenBin tool logic to skip line feed doesn't consider the 
presence of carraige return(\r) in line feed. So this results in incorrect 
format error.

Signed-off-by: Lokesh B V 
---
 uefi-sct/SctPkg/Tools/Source/GenBin/GenBin.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/uefi-sct/SctPkg/Tools/Source/GenBin/GenBin.c 
b/uefi-sct/SctPkg/Tools/Source/GenBin/GenBin.c
index 61bb35b..ce271a1 100644
--- a/uefi-sct/SctPkg/Tools/Source/GenBin/GenBin.c
+++ b/uefi-sct/SctPkg/Tools/Source/GenBin/GenBin.c
@@ -176,6 +176,7 @@ Trim (
   for (Index1 = 0; Index1 < Length; Index1++) {
 if ((String[Index1] != ' ' ) &&
 (String[Index1] != '\t') &&
+(String[Index1] != '\r') &&
 (String[Index1] != '\n')) {
   break;
 }
@@ -193,6 +194,7 @@ Trim (
   for (Index1 = 0; Index1 < Length; Index1++) {
 if ((String[Length - 1 - Index1] != ' ' ) &&
 (String[Length - 1 - Index1] != '\t') &&
+(String[Length - 1 - Index1] != '\r') &&
 (String[Length - 1 - Index1] != '\n')) {
   break;
 }
--
2.7.4

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [edk2-test][PATCH] SctPkg/UEFI: Fix invalid GUID value format error

2018-11-20 Thread Jin, Eric
Please don't forget to change the copyright info when commit patch.
Reviewed-by: Eric Jin 

-Original Message-
From: Lokesh B V  
Sent: Tuesday, November 20, 2018 2:50 PM
To: edk2-devel@lists.01.org; supreeth.venkat...@arm.com; Jin, Eric 

Cc: Lokesh B V 
Subject: [edk2-test][PATCH] SctPkg/UEFI: Fix invalid GUID value format error

Fix all GUID values that are defined with a invalid GUID value format.

Signed-off-by: Lokesh B V 
---
 uefi-sct/SctPkg/UEFI/UEFI.dec | 202 +-
 1 file changed, 101 insertions(+), 101 deletions(-)

diff --git a/uefi-sct/SctPkg/UEFI/UEFI.dec b/uefi-sct/SctPkg/UEFI/UEFI.dec 
index 14cc5b0..7e4d248 100644
--- a/uefi-sct/SctPkg/UEFI/UEFI.dec
+++ b/uefi-sct/SctPkg/UEFI/UEFI.dec
@@ -44,25 +44,25 @@
   
 
 [Guids.common]
-  gBlackBoxEfiFileInfoGuid = { 0x9576e92, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 
0xa0, 0xc9, 0x69, 0x72, 0x3b }
-  gBlackBoxEfiFileInfoIdGuid = { 0x9576e93, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 
0xa0, 0xc9, 0x69, 0x72, 0x3b }
+  gBlackBoxEfiFileInfoGuid = { 0x9576e92, 0x6d3f, 0x11d2, { 0x8e, 0x39, 
+ 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }}  gBlackBoxEfiFileInfoIdGuid = { 
+ 0x9576e93, 0x6d3f, 0x11d2, { 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 
+ 0x3b }}
   gBlackBoxEfiFileSystemInfoGuid = { 0x09576E93, 0x6D3F, 0x11D2, { 0x8E, 0x39, 
0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }}
-  gBlackBoxEfiFileSystemVolumeLabelInfoIdGuid = { 0xDB47D7D3,0xFE81, 0x11d3, 
0x9A, 0x35, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }
-  gBlackBoxEfiTcp4RegistryDataGuid = { 0x755B4303, 0xCAA5, 0x4481, 0xB1, 0x3D, 
0x07, 0xBE, 0x14, 0xD5, 0x4D, 0x3F}
-  gBlackBoxEfiTcp6RegistryDataGuid = { 0x80623540, 0x7B41, 0x4306, 0x99, 0x87, 
0x1B, 0xF6, 0xE5, 0xAD, 0x15, 0x3E }
+  gBlackBoxEfiFileSystemVolumeLabelInfoIdGuid = { 0xDB47D7D3, 0xFE81, 
+ 0x11d3, { 0x9A, 0x35, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }}  
+ gBlackBoxEfiTcp4RegistryDataGuid = { 0x755B4303, 0xCAA5, 0x4481, { 
+ 0xB1, 0x3D, 0x07, 0xBE, 0x14, 0xD5, 0x4D, 0x3F }}  
+ gBlackBoxEfiTcp6RegistryDataGuid = { 0x80623540, 0x7B41, 0x4306, { 
+ 0x99, 0x87, 0x1B, 0xF6, 0xE5, 0xAD, 0x15, 0x3E }}
   gBlackBoxEfiPcAnsiGuid = { 0xE0C14753, 0xF9BE, 0x11D2, { 0x9A, 0x0C, 0x00, 
0x90, 0x27, 0x3F, 0xC1, 0x4D }}
   gBlackBoxEfiVT100Guid = { 0xDFA66065, 0xB419, 0x11D3, { 0x9A, 0x2D, 0x00, 
0x90, 0x27, 0x3F, 0xC1, 0x4D }}
   gBlackBoxEfiVT100PlusGuid = { 0x7BAEC70B, 0x57E0, 0x4C76, { 0x8E, 0x87, 
0x2F, 0x9E, 0x28, 0x08, 0x83, 0x43 }}
   gBlackBoxEfiVTUTF8Guid = { 0xAD15A0D6, 0x8BEC, 0x4ACF, { 0xA0, 0x73, 0xD0, 
0x1D, 0xE7, 0x7E, 0x2D, 0x88 }}
 
-  gBlackBoxEfiHash2AlgorithmSha1Guid = { 0x2ae9d80f, 0x3fb2, 0x4095, 0xb7, 
0xb1, 0xe9, 0x31, 0x57, 0xb9, 0x46, 0xb6 }
-  gBlackBoxEfiHash2AlgorithmSha224Guid = { 0x8df01a06, 0x9bd5, 0x4bf7, 0xb0, 
0x21, 0xdb, 0x4f, 0xd9, 0xcc, 0xf4, 0x5b }
-  gBlackBoxEfiHash2AlgorithmSha256Guid = { 0x51aa59de, 0xfdf2, 0x4ea3, 0xbc, 
0x63, 0x87, 0x5f, 0xb7, 0x84, 0x2e, 0xe9 }
-  gBlackBoxEfiHash2AlgorithmSha384Guid = { 0xefa96432, 0xde33, 0x4dd2, 0xae, 
0xe6, 0x32, 0x8c, 0x33, 0xdf, 0x77, 0x7a }
-  gBlackBoxEfiHash2AlgorithmSha512Guid = { 0xcaa4381e, 0x750c, 0x4770, 0xb8, 
0x70, 0x7a, 0x23, 0xb4, 0xe4, 0x21, 0x30 }
-  gBlackBoxEfiHash2AlgorithmMD5Guid = { 0xaf7c79c, 0x65b5, 0x4319, 0xb0, 0xae, 
0x44, 0xec, 0x48, 0x4e, 0x4a, 0xd7 }
-  gBlackBoxEfiHash2AlgorithmSha1NoPadGuid = { 0x24c5dc2f, 0x53e2, 0x40ca, 
0x9e, 0xd6, 0xa5, 0xd9, 0xa4, 0x9f, 0x46, 0x3b }
-  gBlackBoxEfiHash2AlgorithmSha256NoPadGuid = { 0x8628752a, 0x6cb7, 0x4814, 
0x96, 0xfc, 0x24, 0xa8, 0x15, 0xac, 0x22, 0x26 }
+  gBlackBoxEfiHash2AlgorithmSha1Guid = { 0x2ae9d80f, 0x3fb2, 0x4095, { 
+ 0xb7, 0xb1, 0xe9, 0x31, 0x57, 0xb9, 0x46, 0xb6 }}  
+ gBlackBoxEfiHash2AlgorithmSha224Guid = { 0x8df01a06, 0x9bd5, 0x4bf7, { 
+ 0xb0, 0x21, 0xdb, 0x4f, 0xd9, 0xcc, 0xf4, 0x5b }}  
+ gBlackBoxEfiHash2AlgorithmSha256Guid = { 0x51aa59de, 0xfdf2, 0x4ea3, { 
+ 0xbc, 0x63, 0x87, 0x5f, 0xb7, 0x84, 0x2e, 0xe9 }}  
+ gBlackBoxEfiHash2AlgorithmSha384Guid = { 0xefa96432, 0xde33, 0x4dd2, { 
+ 0xae, 0xe6, 0x32, 0x8c, 0x33, 0xdf, 0x77, 0x7a }}  
+ gBlackBoxEfiHash2AlgorithmSha512Guid = { 0xcaa4381e, 0x750c, 0x4770, { 
+ 0xb8, 0x70, 0x7a, 0x23, 0xb4, 0xe4, 0x21, 0x30 }}  
+ gBlackBoxEfiHash2AlgorithmMD5Guid = { 0xaf7c79c, 0x65b5, 0x4319, { 
+ 0xb0, 0xae, 0x44, 0xec, 0x48, 0x4e, 0x4a, 0xd7 }}  
+ gBlackBoxEfiHash2AlgorithmSha1NoPadGuid = { 0x24c5dc2f, 0x53e2, 
+ 0x40ca, { 0x9e, 0xd6, 0xa5, 0xd9, 0xa4, 0x9f, 0x46, 0x3b }}  
+ gBlackBoxEfiHash2AlgorithmSha256NoPadGuid = { 0x8628752a, 0x6cb7, 
+ 0x4814, { 0x96, 0xfc, 0x24, 0xa8, 0x15, 0xac, 0x22, 0x26 }}
 
   
   gBlackBoxEfiCertSha256Guid = { 0xc1c41626, 0x504c, 0x4092, 
{0xac, 0xa9, 0x41, 0xf9, 0x36, 0x93, 0x43, 0x28 }} 
@@ -79,109 +79,109 @@
   gBlackBoxEfiPersistentVirtualCdGuid = { 0x08018188, 0x42CD, 0xBB48, {0x10, 
0x0F, 0x53, 0x87, 0xD5, 0x3D, 0xED, 0x3D }}
 
 [Protocols.common]
-  gBlackBoxEfiAbsolutePointerProtocolGuid = { 0x8D59D32B, 0xC655, 0x4AE9, { 
0x9B, 0x15, 0xF2, 0x59, 0x04, 0x99, 0x2A, 0x43 } }
-  

Re: [edk2] [PATCH] Silicon/SynQuacer: remove bogus PL011 _HID from DSDT ACPI table

2018-11-20 Thread Mark Kettenis
> From: Ard Biesheuvel 
> Date: Mon, 19 Nov 2018 08:03:38 -0800
> 
> PL011 is not a valid ACPI identifier so don't expose it as a _CID.
> Since _CID (Comptable ID) is optional, let's just drop it.

Heh, I Noticed that one when adding ACPI support for OpenBSD/arm64.

Reviewed-by: Mark Kettenis 

> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel 
> ---
>  Silicon/Socionext/SynQuacer/AcpiTables/Dsdt.asl | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/Silicon/Socionext/SynQuacer/AcpiTables/Dsdt.asl 
> b/Silicon/Socionext/SynQuacer/AcpiTables/Dsdt.asl
> index 3f73c191d4d6..7c7677f1fea0 100644
> --- a/Silicon/Socionext/SynQuacer/AcpiTables/Dsdt.asl
> +++ b/Silicon/Socionext/SynQuacer/AcpiTables/Dsdt.asl
> @@ -135,7 +135,6 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 1, "SNI", 
> "SYNQUACR",
>  // UART PL011
>  Device (COM0) {
>Name (_HID, "ARMH0011")
> -  Name (_CID, "PL011")
>Name (_UID, Zero)
>Name (_CRS, ResourceTemplate () {
>  Memory32Fixed (ReadWrite, FixedPcdGet32 (PcdSerialRegisterBase), 
> 0x1000)
> -- 
> 2.17.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [edk2-test][PATCH] Framework/Include: allow usage with EFI version 2.7

2018-11-20 Thread Jin, Eric
Please don't forget to change the copyright info when commit patch.
Reviewed-by: Eric Jin 

-Original Message-
From: Lokesh B V  
Sent: Tuesday, November 20, 2018 2:50 PM
To: edk2-devel@lists.01.org; supreeth.venkat...@arm.com; Jin, Eric 

Cc: Lokesh B V 
Subject: [edk2-test][PATCH] Framework/Include: allow usage with EFI version 2.7

EDK2 supports EFI version 2.7 and so allow UEFI-SCT to be usable with this 
version of EFI.

Signed-off-by: Lokesh B V 
---
 uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/Include/SctDef.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/Include/SctDef.h 
b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/Include/SctDef.h
index d24c201..c861437 100644
--- a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/Include/SctDef.h
+++ b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/Include/SctDef.h
@@ -46,6 +46,8 @@ Abstract:
 #define EFI_SCT_NAMEL"UEFI2.5 Self Certification 
Test(SCT2)"
 #elif (EFI_SPECIFICATION_VERSION == EFI_2_60_SYSTEM_TABLE_REVISION)
 #define EFI_SCT_NAMEL"UEFI2.6 Self Certification 
Test(SCT2)"
+#elif (EFI_SPECIFICATION_VERSION == EFI_2_70_SYSTEM_TABLE_REVISION)
+#define EFI_SCT_NAMEL"UEFI2.7 Self Certification 
Test(SCT2)"
 #else
 #error Unknown EFI_SPECIFICATION_VERSION  #endif
--
2.7.4

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel