Re: [edk2-devel] [PATCH] UefiCpuPkg: Adding a new TSC library by using CPUID(0x15) TSC leaf

2019-08-12 Thread Dong, Eric
Hi Donald,

Thanks for your explanation.  In this case, Reviewed-by: Eric Dong 


Thanks,
Eric
> -Original Message-
> From: Kuo, Donald
> Sent: Tuesday, August 13, 2019 11:26 AM
> To: Dong, Eric ; devel@edk2.groups.io
> Cc: Ni, Ray ; Zeng, Star ; Chan,
> Amy ; Chaganty, Rangasai V
> 
> Subject: RE: [PATCH] UefiCpuPkg: Adding a new TSC library by using
> CPUID(0x15) TSC leaf
> 
> Hi Eric,
> 
> The CPUID Leaf 0x1:EDX.TSC[bit 4] is to check capability for
> IA32_TIME_STAMP_COUNTER MSR and RDTSC instruction which defined in
> IA32 SDM chapter 17.17
> 
> And what we implement is based on IA32 SDM Chapter 18.7 for CPU core
> XTAL clock frequency which is from CPUID Leaf 0x15 and new TSC frequency
> = (ECX, Core XTAL Frequency) * EBX/EAX
> 
> So no need to check CPUID(0x01).
> 
> Thanks,
> Donald
> 
> > -Original Message-
> > From: Dong, Eric
> > Sent: Tuesday, August 13, 2019 10:27 AM
> > To: Kuo, Donald ; devel@edk2.groups.io
> > Cc: Ni, Ray ; Zeng, Star ;
> > Chan, Amy ; Chaganty, Rangasai V
> > 
> > Subject: RE: [PATCH] UefiCpuPkg: Adding a new TSC library by using
> > CPUID(0x15) TSC leaf
> >
> > Hi Donald,
> >
> > Do you think it's necessary to check the TIME_STAMP_COUNTER capability
> > before using it? I see SDM has CPUID(0x01) which return the capability
> > of TIME_STAMP_COUNTER.
> >
> > Thanks,
> > Eric
> >
> > > -Original Message-
> > > From: Kuo, Donald
> > > Sent: Monday, August 12, 2019 7:23 PM
> > > To: devel@edk2.groups.io
> > > Cc: Ni, Ray ; Zeng, Star ;
> > > Dong, Eric ; Chan, Amy ;
> > > Chaganty, Rangasai V 
> > > Subject: [PATCH] UefiCpuPkg: Adding a new TSC library by using
> > > CPUID(0x15) TSC leaf
> > >
> > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1909
> > >
> > > Cc: Ray Ni 
> > > Cc: Star Zeng 
> > > Cc: Eric Dong 
> > > Cc: Amy Chan 
> > > Cc: Rangasai V Chaganty 
> > > Signed-off-by: Donald Kuo 
> > > ---
> > >  .../Library/BaseCpuTimerLib/BaseCpuTimerLib.c  |  40 +++
> > >  .../Library/BaseCpuTimerLib/BaseCpuTimerLib.inf|  35 +++
> > >  .../Library/BaseCpuTimerLib/BaseCpuTimerLib.uni|  16 ++
> > >  UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c   | 272
> > > +
> > >  UefiCpuPkg/UefiCpuPkg.dec  |   8 +
> > >  UefiCpuPkg/UefiCpuPkg.dsc  |   1 +
> > >  6 files changed, 372 insertions(+)
> > >  create mode 100644
> > > UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
> > >  create mode 100644
> > > UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
> > >  create mode 100644
> > > UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni
> > >  create mode 100644
> UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c
> > >
> > > diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
> > > b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
> > > new file mode 100644
> > > index 00..ccb92a95d3
> > > --- /dev/null
> > > +++ b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
> > > @@ -0,0 +1,40 @@
> > > +/** @file
> > > +  CPUID Leaf 0x15 for Core Crystal Clock frequency instance of
> > > +Timer
> > Library.
> > > +
> > > +  Copyright (c) 2019 Intel Corporation. All rights reserved.
> > > +  SPDX-License-Identifier: BSD-2-Clause-Patent
> > > +
> > > +**/
> > > +
> > > +#include 
> > > +#include 
> > > +#include 
> > > +
> > > +/**
> > > +  CPUID Leaf 0x15 for Core Crystal Clock Frequency.
> > > +
> > > +  The TSC counting frequency is determined by using CPUID leaf 0x15.
> > > Frequency in MHz = Core XTAL frequency * EBX/EAX.
> > > +  In newer flavors of the CPU, core xtal frequency is returned in
> > > + ECX or 0 if
> > > not supported.
> > > +  @return The number of TSC counts per second.
> > > +
> > > +**/
> > > +UINT64
> > > +CpuidCoreClockCalculateTscFrequency (
> > > +  VOID
> > > +  );
> > > +
> > > +/**
> > > +  Internal function to retrieves the 64-bit frequency in Hz.
> > > +
> > > +  Internal function to retrieves the 64-bit frequency in Hz.
> > > +
> > > +  @return The frequency in Hz.
> > > +
> > > +**/
> > > +UINT64
> > > +InternalGetPerformanceCounterFrequency (
> > > +  VOID
> > > +  )
> > > +{
> > > +  return CpuidCoreClockCalculateTscFrequency (); }
> > > diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
> > > b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
> > > new file mode 100644
> > > index 00..7e27a55c90
> > > --- /dev/null
> > > +++ b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
> > > @@ -0,0 +1,35 @@
> > > +## @file
> > > +#  Base CPU Timer Library
> > > +#
> > > +#  Provides basic timer support using CPUID Leaf 0x15 XTAL frequency.
> > > +The performance #  counter features are provided by the processors
> > > +time
> > > stamp counter.
> > > +#
> > > +#  Copyright (c) 2019, Intel Corporation. All rights reserved.
> > > +#
> > > +SPDX-License-Identifier: BSD-2-Clause-Patent # ##
> > > +
> > > +[Defines]
> > > +  INF_VERSION= 0x00010005
> > > +  BASE_NAME  

Re: [edk2-devel] [Patch 1/1] BaseTools: Fix incremental build bug

2019-08-12 Thread Liming Gao
Reviewed-by: Liming Gao 

>-Original Message-
>From: Feng, Bob C
>Sent: Tuesday, August 13, 2019 12:12 PM
>To: devel@edk2.groups.io
>Cc: Gao, Liming ; Feng, Bob C 
>Subject: [Patch 1/1] BaseTools: Fix incremental build bug
>
>https://bugzilla.tianocore.org/show_bug.cgi?id=2078
>
>This is a build tool regression issue that
>is introduced by multiple-process-autogen.
>
>The workspace timestamp value is not pass
>to module autogen object correctly, so build tool
>does not detect the change of .dsc and ignore the autogen.
>
>This patch is to fix this issue.
>
>Cc: Liming Gao 
>Signed-off-by: Bob Feng 
>---
> BaseTools/Source/Python/AutoGen/ModuleAutoGen.py | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
>diff --git a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
>b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
>index ed6822334e93..0654b11ad8e4 100644
>--- a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
>+++ b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
>@@ -216,11 +216,11 @@ class ModuleAutoGen(AutoGen):
> #
> def _InitWorker(self, Workspace, ModuleFile, Target, Toolchain, Arch,
>PlatformFile,DataPipe):
> EdkLogger.debug(EdkLogger.DEBUG_9, "AutoGen module [%s] [%s]" %
>(ModuleFile, Arch))
> GlobalData.gProcessingFile = "%s [%s, %s, %s]" % (ModuleFile, Arch,
>Toolchain, Target)
>
>-self.Workspace = None
>+self.Workspace = Workspace
> self.WorkspaceDir = ""
> self.PlatformInfo = None
> self.DataPipe = DataPipe
> self.__init_platform_info__()
> self.MetaFile = ModuleFile
>@@ -253,11 +253,10 @@ class ModuleAutoGen(AutoGen):
> self.ReferenceModules = []
> self.ConstPcd  = {}
>
> def __init_platform_info__(self):
> pinfo = self.DataPipe.Get("P_Info")
>-self.Workspace =
>WorkSpaceInfo(pinfo.get("WorkspaceDir"),pinfo.get("ActivePlatform"),pinfo.
>get("Target"),pinfo.get("ToolChain"),pinfo.get("ArchList"))
> self.WorkspaceDir = pinfo.get("WorkspaceDir")
> self.PlatformInfo =
>PlatformInfo(self.Workspace,pinfo.get("ActivePlatform"),pinfo.get("Target"),
>pinfo.get("ToolChain"),pinfo.get("Arch"),self.DataPipe)
> ## hash() operator of ModuleAutoGen
> #
> #  The module file path and arch string will be used to represent
>--
>2.20.1.windows.1


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

View/Reply Online (#45500): https://edk2.groups.io/g/devel/message/45500
Mute This Topic: https://groups.io/mt/32849454/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [Patch] BaseTools: Add "-" in a re to parse line in .map file

2019-08-12 Thread Liming Gao
Reviewed-by: Liming Gao 

>-Original Message-
>From: Feng, Bob C
>Sent: Tuesday, August 13, 2019 9:58 AM
>To: devel@edk2.groups.io
>Cc: Gao, Liming ; Feng, Bob C 
>Subject: [Patch] BaseTools: Add "-" in a re to parse line in .map file
>
>https://bugzilla.tianocore.org/show_bug.cgi?id=2058
>
>If there are multiple module instances with different
>guid used in .dsc file, the temp path of the module will
>contain 8-4-4-4-12 format guid string. So "-" need to be
>added into the regular expression for parsing it correctly.
>
>Cc: Liming Gao 
>Signed-off-by: Bob Feng 
>---
> BaseTools/Source/Python/Common/Misc.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/BaseTools/Source/Python/Common/Misc.py
>b/BaseTools/Source/Python/Common/Misc.py
>index 26d149c270..554ec010dd 100644
>--- a/BaseTools/Source/Python/Common/Misc.py
>+++ b/BaseTools/Source/Python/Common/Misc.py
>@@ -162,11 +162,11 @@ def _parseForGCC(lines, efifilepath, varnames):
>
> def _parseGeneral(lines, efifilepath, varnames):
> status = 0#0 - beginning of file; 1 - PE section definition; 2 - 
> symbol table
> secs  = []# key = section name
> varoffset = []
>-symRe = re.compile('^([\da-fA-F]+):([\da-fA-F]+) +([\.:\w\?@\$]+)
>+([\da-fA-F]+)', re.UNICODE)
>+symRe = re.compile('^([\da-fA-F]+):([\da-fA-F]+) +([\.:\w\?@\$-]+)
>+([\da-fA-F]+)', re.UNICODE)
>
> for line in lines:
> line = line.strip()
> if startPatternGeneral.match(line):
> status = 1
>--
>2.20.1.windows.1


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

View/Reply Online (#45499): https://edk2.groups.io/g/devel/message/45499
Mute This Topic: https://groups.io/mt/32848513/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [Patch 1/1] BaseTools: Fix incremental build bug

2019-08-12 Thread Bob Feng
https://bugzilla.tianocore.org/show_bug.cgi?id=2078

This is a build tool regression issue that
is introduced by multiple-process-autogen.

The workspace timestamp value is not pass
to module autogen object correctly, so build tool
does not detect the change of .dsc and ignore the autogen.

This patch is to fix this issue.

Cc: Liming Gao 
Signed-off-by: Bob Feng 
---
 BaseTools/Source/Python/AutoGen/ModuleAutoGen.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py 
b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
index ed6822334e93..0654b11ad8e4 100644
--- a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
@@ -216,11 +216,11 @@ class ModuleAutoGen(AutoGen):
 #
 def _InitWorker(self, Workspace, ModuleFile, Target, Toolchain, Arch, 
PlatformFile,DataPipe):
 EdkLogger.debug(EdkLogger.DEBUG_9, "AutoGen module [%s] [%s]" % 
(ModuleFile, Arch))
 GlobalData.gProcessingFile = "%s [%s, %s, %s]" % (ModuleFile, Arch, 
Toolchain, Target)
 
-self.Workspace = None
+self.Workspace = Workspace
 self.WorkspaceDir = ""
 self.PlatformInfo = None
 self.DataPipe = DataPipe
 self.__init_platform_info__()
 self.MetaFile = ModuleFile
@@ -253,11 +253,10 @@ class ModuleAutoGen(AutoGen):
 self.ReferenceModules = []
 self.ConstPcd  = {}
 
 def __init_platform_info__(self):
 pinfo = self.DataPipe.Get("P_Info")
-self.Workspace = 
WorkSpaceInfo(pinfo.get("WorkspaceDir"),pinfo.get("ActivePlatform"),pinfo.get("Target"),pinfo.get("ToolChain"),pinfo.get("ArchList"))
 self.WorkspaceDir = pinfo.get("WorkspaceDir")
 self.PlatformInfo = 
PlatformInfo(self.Workspace,pinfo.get("ActivePlatform"),pinfo.get("Target"),pinfo.get("ToolChain"),pinfo.get("Arch"),self.DataPipe)
 ## hash() operator of ModuleAutoGen
 #
 #  The module file path and arch string will be used to represent
-- 
2.20.1.windows.1


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

View/Reply Online (#45498): https://edk2.groups.io/g/devel/message/45498
Mute This Topic: https://groups.io/mt/32849454/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH v2 3/4] BaseTools: Change the [Arch][Name] module key in Build cache

2019-08-12 Thread Steven Shi
From: "Shi, Steven" 

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

Current build cache use the module's [self.Arch][self.Name]
info as the ModuleAutoGen object key in hash list and dictionary.
The [self.Arch][self.Name] is not safe as the module key because
there could be two modules with same module name and arch name in
one platform. E.g. A platform can override a module or library
instance in another different path, the overriding module can has
the same module name and arch name as the original one.
Directly use the ModuleAutoGen obj self as the key, because
the obj __hash__ and __repr__ attributes already contain the
full path and arch name.

Cc: Liming Gao 
Cc: Bob Feng 
Signed-off-by: Steven Shi 
---
 BaseTools/Source/Python/AutoGen/GenMake.py |  6 +-
 BaseTools/Source/Python/build/build.py | 49 
+
 2 files changed, 22 insertions(+), 33 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py 
b/BaseTools/Source/Python/AutoGen/GenMake.py
index 79387856bd..de820eeb2f 100755
--- a/BaseTools/Source/Python/AutoGen/GenMake.py
+++ b/BaseTools/Source/Python/AutoGen/GenMake.py
@@ -940,16 +940,12 @@ cleanlib:
 continue
 headerFileDependencySet.add(aFileName)
 
-# Ensure that gModuleBuildTracking has been initialized per 
architecture
-if self._AutoGenObject.Arch not in GlobalData.gModuleBuildTracking:
-GlobalData.gModuleBuildTracking[self._AutoGenObject.Arch] = dict()
-
 # Check if a module dependency header file is missing from the 
module's MetaFile
 for aFile in headerFileDependencySet:
 if aFile in headerFilesInMetaFileSet:
 continue
 if GlobalData.gUseHashCache:
-
GlobalData.gModuleBuildTracking[self._AutoGenObject.Arch][self._AutoGenObject] 
= 'FAIL_METAFILE'
+GlobalData.gModuleBuildTracking[self._AutoGenObject] = 
'FAIL_METAFILE'
 EdkLogger.warn("build","Module MetaFile [Sources] is missing local 
header!",
 ExtraData = "Local Header: " + aFile + " not found in 
" + self._AutoGenObject.MetaFile.Path
 )
diff --git a/BaseTools/Source/Python/build/build.py 
b/BaseTools/Source/Python/build/build.py
index 84540d61f5..81f0bbb467 100755
--- a/BaseTools/Source/Python/build/build.py
+++ b/BaseTools/Source/Python/build/build.py
@@ -630,12 +630,11 @@ class BuildTask:
 
 # Set the value used by hash invalidation flow in 
GlobalData.gModuleBuildTracking to 'SUCCESS'
 # If Module or Lib is being tracked, it did not fail header check 
test, and built successfully
-if (self.BuildItem.BuildObject.Arch in GlobalData.gModuleBuildTracking 
and
-   self.BuildItem.BuildObject in 
GlobalData.gModuleBuildTracking[self.BuildItem.BuildObject.Arch] and
-   
GlobalData.gModuleBuildTracking[self.BuildItem.BuildObject.Arch][self.BuildItem.BuildObject]
 != 'FAIL_METAFILE' and
+if (self.BuildItem.BuildObject in GlobalData.gModuleBuildTracking and
+   GlobalData.gModuleBuildTracking[self.BuildItem.BuildObject] != 
'FAIL_METAFILE' and
not BuildTask._ErrorFlag.isSet()
):
-
GlobalData.gModuleBuildTracking[self.BuildItem.BuildObject.Arch][self.BuildItem.BuildObject]
 = 'SUCCESS'
+GlobalData.gModuleBuildTracking[self.BuildItem.BuildObject] = 
'SUCCESS'
 
 # indicate there's a thread is available for another build task
 BuildTask._RunningQueueLock.acquire()
@@ -1169,25 +1168,24 @@ class Build():
 return
 
 # GlobalData.gModuleBuildTracking contains only modules or libs that 
cannot be skipped by hash
-for moduleAutoGenObjArch in GlobalData.gModuleBuildTracking.keys():
-for moduleAutoGenObj in 
GlobalData.gModuleBuildTracking[moduleAutoGenObjArch].keys():
-# Skip invalidating for Successful Module/Lib builds
-if 
GlobalData.gModuleBuildTracking[moduleAutoGenObjArch][moduleAutoGenObj] == 
'SUCCESS':
-continue
+for Ma in GlobalData.gModuleBuildTracking:
+# Skip invalidating for Successful Module/Lib builds
+if GlobalData.gModuleBuildTracking[Ma] == 'SUCCESS':
+continue
 
-# The module failed to build, failed to start building, or 
failed the header check test from this point on
+# The module failed to build, failed to start building, or failed 
the header check test from this point on
 
-# Remove .hash from build
-ModuleHashFile = os.path.join(moduleAutoGenObj.BuildDir, 
moduleAutoGenObj.Name + ".hash")
-if os.path.exists(ModuleHashFile):
-os.remove(ModuleHashFile)
+# Remove .hash from build
+ModuleHashFile = os.path.join(Ma.BuildDir, Ma.Name + ".hash")
+if 

[edk2-devel] [PATCH v2 4/4] BaseTools: Add GenFds multi-thread support in build cache

2019-08-12 Thread Steven Shi
From: "Shi, Steven" 

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

Fix the issue that the GenFds multi-thread will build fail
if enable the build cache together.

Cc: Liming Gao 
Cc: Bob Feng 
Signed-off-by: Steven Shi 
---
 BaseTools/Source/Python/AutoGen/ModuleAutoGen.py | 23 +--
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py 
b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
index a73a8a53a0..ee8518e19c 100755
--- a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
@@ -1248,11 +1248,13 @@ class ModuleAutoGen(AutoGen):
 fStringIO.close ()
 fInputfile.close ()
 return OutputName
+
 @cached_property
 def OutputFile(self):
 retVal = set()
 OutputDir = self.OutputDir.replace('\\', '/').strip('/')
 DebugDir = self.DebugDir.replace('\\', '/').strip('/')
+FfsOutputDir = self.FfsOutputDir.replace('\\', '/').rstrip('/')
 for Item in self.CodaTargetList:
 File = Item.Target.Path.replace('\\', 
'/').strip('/').replace(DebugDir, '').replace(OutputDir, '').strip('/')
 retVal.add(File)
@@ -1268,6 +1270,12 @@ class ModuleAutoGen(AutoGen):
 if File.lower().endswith('.pdb'):
 retVal.add(File)
 
+for Root, Dirs, Files in os.walk(FfsOutputDir):
+for File in Files:
+if File.lower().endswith('.ffs') or 
File.lower().endswith('.offset') or File.lower().endswith('.raw') \
+or File.lower().endswith('.raw.txt'):
+retVal.add(File)
+
 return retVal
 
 ## Create AsBuilt INF file the module
@@ -1638,13 +1646,16 @@ class ModuleAutoGen(AutoGen):
 for File in self.OutputFile:
 File = str(File)
 if not os.path.isabs(File):
-File = os.path.join(self.OutputDir, File)
+NewFile = os.path.join(self.OutputDir, File)
+if not os.path.exists(NewFile):
+NewFile = os.path.join(self.FfsOutputDir, File)
+File = NewFile
 if os.path.exists(File):
-sub_dir = os.path.relpath(File, self.OutputDir)
-destination_file = os.path.join(FileDir, sub_dir)
-destination_dir = os.path.dirname(destination_file)
-CreateDirectory(destination_dir)
-CopyFileOnChange(File, destination_dir)
+if File.lower().endswith('.ffs') or 
File.lower().endswith('.offset') or File.lower().endswith('.raw') \
+or File.lower().endswith('.raw.txt'):
+self.CacheCopyFile(FfsDir, self.FfsOutputDir, File)
+else:
+self.CacheCopyFile(FileDir, self.OutputDir, File)
 
 def SaveHashChainFileToCache(self, gDict):
 if not GlobalData.gBinCacheDest:
-- 
2.17.1


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

View/Reply Online (#45497): https://edk2.groups.io/g/devel/message/45497
Mute This Topic: https://groups.io/mt/32849285/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH v2 2/4] BaseTools: Print first cache missing file for build cachle

2019-08-12 Thread Steven Shi
From: "Shi, Steven" 

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

When a module build cache miss, add support to print the first
cache missing file path and name.

Cc: Liming Gao 
Cc: Bob Feng 
Signed-off-by: Steven Shi 
---
 BaseTools/Source/Python/AutoGen/AutoGenWorker.py |  2 ++
 BaseTools/Source/Python/AutoGen/ModuleAutoGen.py | 76 

 2 files changed, 78 insertions(+)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGenWorker.py 
b/BaseTools/Source/Python/AutoGen/AutoGenWorker.py
index a84ed46f2e..30d2f96fc7 100755
--- a/BaseTools/Source/Python/AutoGen/AutoGenWorker.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGenWorker.py
@@ -246,6 +246,8 @@ class AutoGenWorkerInProcess(mp.Process):
 Ma.GenMakeHash(GlobalData.gCacheIR)
 if Ma.CanSkipbyMakeCache(GlobalData.gCacheIR):
 continue
+else:
+Ma.PrintFirstMakeCacheMissFile(GlobalData.gCacheIR)
 except Empty:
 pass
 except:
diff --git a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py 
b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
index 6cb7cae1c7..a73a8a53a0 100755
--- a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
@@ -2365,6 +2365,82 @@ class ModuleAutoGen(AutoGen):
 print("[cache hit]: checkpoint_Makefile:", self.MetaFile.Path, 
self.Arch)
 return True
 
+## Show the first file name which causes cache miss
+def PrintFirstMakeCacheMissFile(self, gDict):
+if not GlobalData.gBinCacheSource:
+return
+
+# skip binary module
+if self.IsBinaryModule:
+return
+
+if not (self.MetaFile.Path, self.Arch) in gDict:
+return
+
+# Only print cache miss file for the MakeCache not hit module
+if gDict[(self.MetaFile.Path, self.Arch)].MakeCacheHit:
+return
+
+if not gDict[(self.MetaFile.Path, self.Arch)].MakeHashChain:
+EdkLogger.quiet("[cache insight]: MakeHashChain is missing for: 
%s[%s]" % (self.MetaFile.Path, self.Arch))
+return
+
+# Find the cache dir name through the .ModuleHashPair file info
+FileDir = path.join(GlobalData.gBinCacheSource, 
self.PlatformInfo.OutputDir, self.BuildTarget + "_" + self.ToolChain, 
self.Arch, self.SourceDir, self.MetaFile.BaseName)
+
+ModuleHashPairList = [] # tuple list: [tuple(PreMakefileHash, 
MakeHash)]
+ModuleHashPair = path.join(FileDir, self.Name + ".ModuleHashPair")
+if not os.path.exists(ModuleHashPair):
+EdkLogger.quiet("[cache insight]: Cannot find ModuleHashPair file 
for module: %s[%s]" % (self.MetaFile.Path, self.Arch))
+return
+
+try:
+f = open(ModuleHashPair, 'r')
+ModuleHashPairList = json.load(f)
+f.close()
+except:
+EdkLogger.quiet("[cache insight]: Cannot load ModuleHashPair file 
for module: %s[%s]" % (self.MetaFile.Path, self.Arch))
+return
+
+MakeHashSet = set()
+for idx, (PreMakefileHash, MakeHash) in enumerate (ModuleHashPairList):
+TargetHashDir = path.join(FileDir, str(MakeHash))
+if os.path.exists(TargetHashDir):
+MakeHashSet.add(MakeHash)
+if not MakeHashSet:
+EdkLogger.quiet("[cache insight]: Cannot find valid cache dir for 
module: %s[%s]" % (self.MetaFile.Path, self.Arch))
+return
+
+TargetHash = list(MakeHashSet)[0]
+TargetHashDir = path.join(FileDir, str(TargetHash))
+if len(MakeHashSet) > 1 :
+EdkLogger.quiet("[cache insight]: found multiple cache dirs for 
this module, random select dir '%s' to search the first cache miss file: 
%s[%s]" % (TargetHash, self.MetaFile.Path, self.Arch))
+
+ListFile = path.join(TargetHashDir, self.Name + '.MakeHashChain')
+if os.path.exists(ListFile):
+try:
+f = open(ListFile, 'r')
+CachedList = json.load(f)
+f.close()
+except:
+EdkLogger.quiet("[cache insight]: Cannot load MakeHashChain 
file: %s" % ListFile)
+return
+else:
+EdkLogger.quiet("[cache insight]: Cannot find MakeHashChain file: 
%s" % ListFile)
+return
+
+CurrentList = gDict[(self.MetaFile.Path, self.Arch)].MakeHashChain
+for idx, (file, hash) in enumerate (CurrentList):
+(filecached, hashcached) = CachedList[idx]
+if file != filecached:
+EdkLogger.quiet("[cache insight]: first different file in 
%s[%s] is %s, the cached one is %s" % (self.MetaFile.Path, self.Arch, file, 
filecached))
+break
+if hash != hashcached:
+EdkLogger.quiet("[cache insight]: first cache miss file in 

[edk2-devel] [PATCH v2 0/4] Build cache enhancement

2019-08-12 Thread Steven Shi
From: "Shi, Steven" 

Enhance the edk2 build cache with below patches:
Patch 01/04: Improve the cache hit rate through new cache checkpoint and hash 
algorithm
Patch 02/04: Print more info to explain why a module build cache miss
Patch 03/04: Fix the unsafe [self.Arch][self.Name] key usage in build cache
Patch 04/04  Add the GenFds multi-thread support in build cache

You can directly try this patch set in the branch:
https://github.com/shijunjing/edk2/tree/build_cache_improve_v2

V2:
Enhance the SaveHashChainFileToCache() function in ModuleAutoGen.py and
not need to call f.close() in the "with open(xxx) as f:" block. The
with block will close the file automatically

V1:
Initial patch set


Shi, Steven (4):
  BaseTools: Improve the cache hit in the edk2 build cache
  BaseTools: Print first cache missing file for build cachle
  BaseTools: Change the [Arch][Name] module key in Build cache
  BaseTools: Add GenFds multi-thread support in build cache

 .../Source/Python/AutoGen/AutoGenWorker.py|  23 +
 BaseTools/Source/Python/AutoGen/CacheIR.py|  28 +
 BaseTools/Source/Python/AutoGen/DataPipe.py   |   8 +
 BaseTools/Source/Python/AutoGen/GenMake.py| 229 +++---
 .../Source/Python/AutoGen/ModuleAutoGen.py| 739 --
 BaseTools/Source/Python/Common/GlobalData.py  |   9 +
 BaseTools/Source/Python/build/build.py| 171 ++--
 7 files changed, 976 insertions(+), 231 deletions(-)
 mode change 100644 => 100755 BaseTools/Source/Python/AutoGen/AutoGenWorker.py
 create mode 100755 BaseTools/Source/Python/AutoGen/CacheIR.py
 mode change 100644 => 100755 BaseTools/Source/Python/AutoGen/DataPipe.py
 mode change 100644 => 100755 BaseTools/Source/Python/AutoGen/GenMake.py
 mode change 100644 => 100755 BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
 mode change 100644 => 100755 BaseTools/Source/Python/Common/GlobalData.py
 mode change 100644 => 100755 BaseTools/Source/Python/build/build.py

-- 
2.17.1


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

View/Reply Online (#45493): https://edk2.groups.io/g/devel/message/45493
Mute This Topic: https://groups.io/mt/32849280/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH v2 1/4] BaseTools: Improve the cache hit in the edk2 build cache

2019-08-12 Thread Steven Shi
From: "Shi, Steven" 

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

Current cache hash algorithm does not parse and generate
the makefile to get the accurate dependency files for a
module. It instead use the platform and package meta files
to get the module depenedency in a quick but over approximate
way. These meta files are monolithic and involve many redundant
dependency for the module, which cause the module build
cache miss easily.
This patch introduces one more cache checkpoint and a new
hash algorithm besides the current quick one. The new hash
algorithm leverages the module makefile to achieve more
accurate and precise dependency info for a module. When
the build cache miss with the first quick hash, the
Basetool will caculate new one after makefile is generated
and then check again.

Cc: Liming Gao 
Cc: Bob Feng 
Signed-off-by: Steven Shi 
---
 BaseTools/Source/Python/AutoGen/AutoGenWorker.py |  21 +
 BaseTools/Source/Python/AutoGen/CacheIR.py   |  28 

 BaseTools/Source/Python/AutoGen/DataPipe.py  |   8 
 BaseTools/Source/Python/AutoGen/GenMake.py   | 223 
++-
 BaseTools/Source/Python/AutoGen/ModuleAutoGen.py | 640 
+++-
 BaseTools/Source/Python/Common/GlobalData.py |   9 +
 BaseTools/Source/Python/build/build.py   | 122 
--
 7 files changed, 859 insertions(+), 192 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGenWorker.py 
b/BaseTools/Source/Python/AutoGen/AutoGenWorker.py
old mode 100644
new mode 100755
index e583828741..a84ed46f2e
--- a/BaseTools/Source/Python/AutoGen/AutoGenWorker.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGenWorker.py
@@ -182,6 +182,12 @@ class AutoGenWorkerInProcess(mp.Process):
 GlobalData.gDisableIncludePathCheck = False
 GlobalData.gFdfParser = self.data_pipe.Get("FdfParser")
 GlobalData.gDatabasePath = self.data_pipe.Get("DatabasePath")
+GlobalData.gBinCacheSource = self.data_pipe.Get("BinCacheSource")
+GlobalData.gBinCacheDest = self.data_pipe.Get("BinCacheDest")
+GlobalData.gCacheIR = self.data_pipe.Get("CacheIR")
+GlobalData.gEnableGenfdsMultiThread = 
self.data_pipe.Get("EnableGenfdsMultiThread")
+GlobalData.file_lock = self.file_lock
+CommandTarget = self.data_pipe.Get("CommandTarget")
 pcd_from_build_option = []
 for pcd_tuple in self.data_pipe.Get("BuildOptPcd"):
 pcd_id = ".".join((pcd_tuple[0],pcd_tuple[1]))
@@ -193,10 +199,13 @@ class AutoGenWorkerInProcess(mp.Process):
 FfsCmd = self.data_pipe.Get("FfsCommand")
 if FfsCmd is None:
 FfsCmd = {}
+GlobalData.FfsCmd = FfsCmd
 PlatformMetaFile = 
self.GetPlatformMetaFile(self.data_pipe.Get("P_Info").get("ActivePlatform"),
  
self.data_pipe.Get("P_Info").get("WorkspaceDir"))
 libConstPcd = self.data_pipe.Get("LibConstPcd")
 Refes = self.data_pipe.Get("REFS")
+GlobalData.libConstPcd = libConstPcd
+GlobalData.Refes = Refes
 while True:
 if self.module_queue.empty():
 break
@@ -223,8 +232,20 @@ class AutoGenWorkerInProcess(mp.Process):
 Ma.ConstPcd = 
libConstPcd[(Ma.MetaFile.File,Ma.MetaFile.Root,Ma.Arch,Ma.MetaFile.Path)]
 if 
(Ma.MetaFile.File,Ma.MetaFile.Root,Ma.Arch,Ma.MetaFile.Path) in Refes:
 Ma.ReferenceModules = 
Refes[(Ma.MetaFile.File,Ma.MetaFile.Root,Ma.Arch,Ma.MetaFile.Path)]
+if GlobalData.gBinCacheSource and CommandTarget in [None, "", 
"all"]:
+Ma.GenModuleFilesHash(GlobalData.gCacheIR)
+Ma.GenPreMakefileHash(GlobalData.gCacheIR)
+if Ma.CanSkipbyPreMakefileCache(GlobalData.gCacheIR):
+   continue
+
 

Re: [edk2-devel] [PATCH] UefiCpuPkg: Adding a new TSC library by using CPUID(0x15) TSC leaf

2019-08-12 Thread Donald Kuo
Hi Eric,

The CPUID Leaf 0x1:EDX.TSC[bit 4] is to check capability for 
IA32_TIME_STAMP_COUNTER MSR and RDTSC instruction which defined in IA32 SDM 
chapter 17.17

And what we implement is based on IA32 SDM Chapter 18.7 for CPU core XTAL clock 
frequency which is from CPUID Leaf 0x15 and new TSC frequency = (ECX, Core XTAL 
Frequency) * EBX/EAX

So no need to check CPUID(0x01).

Thanks,
Donald

> -Original Message-
> From: Dong, Eric
> Sent: Tuesday, August 13, 2019 10:27 AM
> To: Kuo, Donald ; devel@edk2.groups.io
> Cc: Ni, Ray ; Zeng, Star ; Chan,
> Amy ; Chaganty, Rangasai V
> 
> Subject: RE: [PATCH] UefiCpuPkg: Adding a new TSC library by using
> CPUID(0x15) TSC leaf
> 
> Hi Donald,
> 
> Do you think it's necessary to check the TIME_STAMP_COUNTER capability
> before using it? I see SDM has CPUID(0x01) which return the capability of
> TIME_STAMP_COUNTER.
> 
> Thanks,
> Eric
> 
> > -Original Message-
> > From: Kuo, Donald
> > Sent: Monday, August 12, 2019 7:23 PM
> > To: devel@edk2.groups.io
> > Cc: Ni, Ray ; Zeng, Star ;
> > Dong, Eric ; Chan, Amy ;
> > Chaganty, Rangasai V 
> > Subject: [PATCH] UefiCpuPkg: Adding a new TSC library by using
> > CPUID(0x15) TSC leaf
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1909
> >
> > Cc: Ray Ni 
> > Cc: Star Zeng 
> > Cc: Eric Dong 
> > Cc: Amy Chan 
> > Cc: Rangasai V Chaganty 
> > Signed-off-by: Donald Kuo 
> > ---
> >  .../Library/BaseCpuTimerLib/BaseCpuTimerLib.c  |  40 +++
> >  .../Library/BaseCpuTimerLib/BaseCpuTimerLib.inf|  35 +++
> >  .../Library/BaseCpuTimerLib/BaseCpuTimerLib.uni|  16 ++
> >  UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c   | 272
> > +
> >  UefiCpuPkg/UefiCpuPkg.dec  |   8 +
> >  UefiCpuPkg/UefiCpuPkg.dsc  |   1 +
> >  6 files changed, 372 insertions(+)
> >  create mode 100644
> > UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
> >  create mode 100644
> > UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
> >  create mode 100644
> > UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni
> >  create mode 100644 UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c
> >
> > diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
> > b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
> > new file mode 100644
> > index 00..ccb92a95d3
> > --- /dev/null
> > +++ b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
> > @@ -0,0 +1,40 @@
> > +/** @file
> > +  CPUID Leaf 0x15 for Core Crystal Clock frequency instance of Timer
> Library.
> > +
> > +  Copyright (c) 2019 Intel Corporation. All rights reserved.
> > +  SPDX-License-Identifier: BSD-2-Clause-Patent
> > +
> > +**/
> > +
> > +#include 
> > +#include 
> > +#include 
> > +
> > +/**
> > +  CPUID Leaf 0x15 for Core Crystal Clock Frequency.
> > +
> > +  The TSC counting frequency is determined by using CPUID leaf 0x15.
> > Frequency in MHz = Core XTAL frequency * EBX/EAX.
> > +  In newer flavors of the CPU, core xtal frequency is returned in ECX
> > + or 0 if
> > not supported.
> > +  @return The number of TSC counts per second.
> > +
> > +**/
> > +UINT64
> > +CpuidCoreClockCalculateTscFrequency (
> > +  VOID
> > +  );
> > +
> > +/**
> > +  Internal function to retrieves the 64-bit frequency in Hz.
> > +
> > +  Internal function to retrieves the 64-bit frequency in Hz.
> > +
> > +  @return The frequency in Hz.
> > +
> > +**/
> > +UINT64
> > +InternalGetPerformanceCounterFrequency (
> > +  VOID
> > +  )
> > +{
> > +  return CpuidCoreClockCalculateTscFrequency (); }
> > diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
> > b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
> > new file mode 100644
> > index 00..7e27a55c90
> > --- /dev/null
> > +++ b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
> > @@ -0,0 +1,35 @@
> > +## @file
> > +#  Base CPU Timer Library
> > +#
> > +#  Provides basic timer support using CPUID Leaf 0x15 XTAL frequency.
> > +The performance #  counter features are provided by the processors
> > +time
> > stamp counter.
> > +#
> > +#  Copyright (c) 2019, Intel Corporation. All rights reserved. #
> > +SPDX-License-Identifier: BSD-2-Clause-Patent # ##
> > +
> > +[Defines]
> > +  INF_VERSION= 0x00010005
> > +  BASE_NAME  = BaseCpuTimerLib
> > +  FILE_GUID  = F10B5B91-D15A-496C-B044-B5235721AA08
> > +  MODULE_TYPE= BASE
> > +  VERSION_STRING = 1.0
> > +  LIBRARY_CLASS  = TimerLib
> > +  MODULE_UNI_FILE= BaseCpuTimerLib.uni
> > +
> > +[Sources]
> > +  CpuTimerLib.c
> > +  BaseCpuTimerLib.c
> > +
> > +[Packages]
> > +  MdePkg/MdePkg.dec
> > +  UefiCpuPkg/UefiCpuPkg.dec
> > +
> > +[LibraryClasses]
> > +  BaseLib
> > +  PcdLib
> > +  DebugLib
> > +
> > +[Pcd]
> > +  gUefiCpuPkgTokenSpaceGuid.PcdCpuCoreCrystalClockFrequency  ##
> > +CONSUMES
> > diff --git 

Re: [edk2-devel] [edk2-test][PATCH V3 2/3] Adding HII to IHVSCT

2019-08-12 Thread Eric Jin
Hello Shrishail,

The patch set format is strange to me and have issue when I try to apply them. 
Could you please check or send to me(eric@intel.com) your patch series as 
attachment? Thanks.

@@ -279,7 +279,8 @@ rem  copy %ProcessorType%\IhvUsbHcTest.efi  
   %Framework%\T
   copy %ProcessorType%\IhvUsb2HcTest.efi
%Framework%\Test\ > NUL
   copy %ProcessorType%\IhviScsiInitiatorNameBBTest.efi  
%Framework%\Test\ > NUL

Best Regards
Eric
-Original Message-
From: devel@edk2.groups.io  On Behalf Of shrishail
Sent: Thursday, August 8, 2019 10:05 AM
To: devel@edk2.groups.io
Cc: Jin, Eric ; supreeth.venkat...@arm.com; 
jeff.booher-kaed...@arm.com; Shrishail Patil ; 
shrishail patil 
Subject: [edk2-devel] [edk2-test][PATCH V3 2/3] Adding HII to IHVSCT

From: Shrishail Patil 

Adding HII Config Access Protocol to IHVSCT This patch contains the changes to 
build/compilation Changes.
Addressed the review comments relating to adding space between sections.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shrishail patil 
---
uefi-sct/SctPkg/CommonGenFramework.bat | 3 ++- 
uefi-sct/SctPkg/CommonGenFramework.sh  | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/uefi-sct/SctPkg/CommonGenFramework.bat 
b/uefi-sct/SctPkg/CommonGenFramework.bat
index 5c614eaa..c164c4d8 100644
--- a/uefi-sct/SctPkg/CommonGenFramework.bat
+++ b/uefi-sct/SctPkg/CommonGenFramework.bat
@@ -279,7 +279,8 @@ rem  copy %ProcessorType%\IhvUsbHcTest.efi  
   %Framework%\T
   copy %ProcessorType%\IhvUsb2HcTest.efi
%Framework%\Test\ > NUL
   copy %ProcessorType%\IhviScsiInitiatorNameBBTest.efi  
%Framework%\Test\ > NUL
   copy %ProcessorType%\IhvStorageSecurityCommandBBTest.efi  
%Framework%\Test\ > NUL
-
+  copy %ProcessorType%\IhvHIIConfigAccessBBTest.efi 
%Framework%\Test\ > NUL
+
   rem *
   rem Copy the UEFI 2.1 Test Cases for IHV
   rem *
diff --git a/uefi-sct/SctPkg/CommonGenFramework.sh 
b/uefi-sct/SctPkg/CommonGenFramework.sh
index c422034a..fc024274 100755
--- a/uefi-sct/SctPkg/CommonGenFramework.sh
+++ b/uefi-sct/SctPkg/CommonGenFramework.sh
@@ -312,6 +312,7 @@ then
   cp $ProcessorType/IhvUsb2HcTest.efi$Framework/Test/ 
> NUL
   cp $ProcessorType/IhviScsiInitiatorNameBBTest.efi  $Framework/Test/ 
> NUL
   cp $ProcessorType/IhvStorageSecurityCommandBBTest.efi  $Framework/Test/ 
> NUL
+  cp $ProcessorType/IhvHIIConfigAccessBBTest.efi $Framework/Test/ 
> NUL

   # *
   # Copy the UEFI 2.1 Test Cases for IHV
--
2.22.0.windows.1






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

View/Reply Online (#45491): https://edk2.groups.io/g/devel/message/45491
Mute This Topic: https://groups.io/mt/32794803/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCHv3 0/4] Add EDKII_UFS_HC_PLATFORM_PROTOCOL to support platform specific programming of UFS host controllers

2019-08-12 Thread Wu, Hao A
> -Original Message-
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> Wu, Hao A
> Sent: Monday, August 12, 2019 10:39 AM
> To: Albecki, Mateusz; devel@edk2.groups.io
> Cc: Andrew Fish; Laszlo Ersek; Leif Lindholm; Kinney, Michael D; Gao, Liming
> Subject: Re: [edk2-devel] [PATCHv3 0/4] Add
> EDKII_UFS_HC_PLATFORM_PROTOCOL to support platform specific
> programming of UFS host controllers
> 
> > -Original Message-
> > From: Albecki, Mateusz
> > Sent: Friday, August 09, 2019 10:36 PM
> > To: devel@edk2.groups.io
> > Cc: Albecki, Mateusz; Wu, Hao A
> > Subject: [PATCHv3 0/4] Add EDKII_UFS_HC_PLATFORM_PROTOCOL to
> > support platform specific programming of UFS host controllers
> >
> > To cover additional host controller programming mentioned in the UFS
> > specification we have added an additional protocol that allows the UEFI
> > driver to give control to platform driver. This allows the platform to 
> > perform
> > any additional steps needed for the stable operation.
> >
> > Changes in v3:
> > - UFS driver will abort initializaton when it fails to get host controler
> > information
> > - Fixed bug with calling post link startup callback on failed device 
> > detection
> >
> > Test coverage:
> > Tested on platform with UFS 2.1 host controller with Samsung UFS2.0 part
> > with 3 LUs enabled All LUs have been enumerated in boot manager.
> > Tested that enumeration works without platform protocol installed(on host
> > controller that can support it) Tested that enumeration works with
> platform
> > protocol installed and with additional programming steps after link
> > startup(power mode change to GEAR2).
> >
> > Cc: Hao A Wu  >
> >
> > Mateusz Albecki (4):
> >   MdeModulePkg: Add definition of the
> > EDKII_UFS_HC_PLATFORM_PROTOCOL
> >   MdeModulePkg/UfsPassThruDxe: Refactor UfsExecUicCommand function
> >   MdeModulePkg/UfsPassThruDxe: Refactor private data to use
> > EDKII_UFS_HC_INFO
> >   MdeModulePkg/UfsPassThruDxe: Implement
> > EDKII_UFS_HC_PLATFORM_PROTOCOL
> 
> 
> For the 3rd patch, in order to please the PatchCheck.py, I will change the
> title a little bit to:
> * MdeModulePkg/UfsPassThruDxe: Refactor private data to use UfsHcInfo
> 
> Other than that, for the series,
> Reviewed-by: Hao A Wu 
> 
> Since there is already a confirmation from Laszlo for adding this feature in
> the upcoming stable tag:
> https://edk2.groups.io/g/devel/message/45217?p=,,,20,0,0,0::Created,,ufs,2
> 0,2,0,32784353
> 
> I plan to push the series tomorrow (after around 24 hours, in case if there
> are additional feedbacks).


Thanks all, the series has been pushed via commits 12dcad5b1e..ecc32c90ee.

Best Regards,
Hao Wu


> 
> Best Regards,
> Hao Wu
> 
> 
> >
> >  MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c  |  26 +++-
> >  MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.h  |  44 +-
> >  .../Bus/Ufs/UfsPassThruDxe/UfsPassThruDxe.inf  |   3 +-
> >  .../Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c| 173
> +++-
> > -
> >  .../Include/Protocol/UfsHostControllerPlatform.h   | 124
> +++
> >  MdeModulePkg/MdeModulePkg.dec  |   3 +
> >  6 files changed, 324 insertions(+), 49 deletions(-)
> >  create mode 100644
> > MdeModulePkg/Include/Protocol/UfsHostControllerPlatform.h
> >
> > --
> > 2.14.1.windows.1
> 
> 
> 


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

View/Reply Online (#45490): https://edk2.groups.io/g/devel/message/45490
Mute This Topic: https://groups.io/mt/32811056/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [Patch v2 0/6] Add "test then write" mechanism.

2019-08-12 Thread Dong, Eric
Hi Laszlo,

Yes, I already checked IA32 build.

As Ray is leaving these days, can you help to review this serial?

Thanks,
Eric

> -Original Message-
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> Laszlo Ersek
> Sent: Monday, August 12, 2019 10:15 PM
> To: Dong, Eric ; devel@edk2.groups.io
> Cc: Ni, Ray 
> Subject: Re: [edk2-devel] [Patch v2 0/6] Add "test then write" mechanism.
> 
> On 08/12/19 12:31, Eric Dong wrote:
> > V2 changes:
> > 1. Split CR read/write action in to one discrete patch 2. Keep the old
> > logic which continue the process if error found.
> >
> > Below code is current implementation:
> >   if (MsrRegister[ProcessorNumber].Bits.Lock == 0) {
> > CPU_REGISTER_TABLE_WRITE_FIELD (
> >   ProcessorNumber,
> >   Msr,
> >   MSR_IA32_FEATURE_CONTROL,
> >   MSR_IA32_FEATURE_CONTROL_REGISTER,
> >   Bits.Lock,
> >   1
> > );
> >   }
> >
> > With below steps, the Bits.Lock bit will lose its value:
> > 1. Trig normal boot, the Bits.Lock is 0. 1 will be added
> >into the register table and then will set to the MSR.
> > 2. Trig warm reboot, MSR value preserves. After normal boot phase,
> >the Bits.Lock is 1, so it will not be added into the register
> >table during the warm reboot phase.
> > 3. Trig S3 then resume, the Bits.Lock change to 0 and Bits.Lock is
> >not added in register table during normal boot phase. so it's
> >still 0 after resume.
> > This is not an expect behavior. The expect result is the value should
> > always 1 after booting or resuming from S3.
> >
> > The root cause for this issue is
> > 1. driver bases on current value to insert the "set value action" to
> >the register table.
> > 2. Some MSRs may reserve their value during warm reboot. So the insert
> >action may be skip after warm reboot.
> >
> > The solution for this issue is:
> > 1. Always add "Test then Set" action for above referred MSRs.
> > 2. Detect current value before set new value. Only set new value when
> >current value not same as new value.
> >
> > Cc: Ray Ni 
> > Cc: Laszlo Ersek 
> >
> > Eric Dong (6):
> >   UefiCpuPkg/RegisterCpuFeaturesLib: Add "Test Then Write" Macros.
> >   UefiCpuPkg/PiSmmCpuDxeSmm: Combine CR read/write action in one
> > function.
> >   UefiCpuPkg/PiSmmCpuDxeSmm: Supports test then write new value logic.
> >   UefiCpuPkg/RegisterCpuFeaturesLib: Combine CR read/write action in
> one
> > function.
> >   UefiCpuPkg/RegisterCpuFeaturesLib: Supports test then write new value
> > logic.
> >   UefiCpuPkg/CpuCommonFeaturesLib: Use new macros.
> >
> >  UefiCpuPkg/Include/AcpiCpuData.h  |   1 +
> >  .../Include/Library/RegisterCpuFeaturesLib.h  |  77 +-
> > .../CpuCommonFeaturesLib/CpuCommonFeatures.h  |  15 --
> >  .../CpuCommonFeaturesLib.c|   8 +-
> >  .../CpuCommonFeaturesLib/FeatureControl.c | 141 ++
> >  .../CpuCommonFeaturesLib/MachineCheck.c   |  23 ++-
> >  .../CpuFeaturesInitialize.c   | 141 --
> >  .../RegisterCpuFeaturesLib.c  |  14 +-
> >  UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c | 135 +++--
> >  9 files changed, 323 insertions(+), 232 deletions(-)
> >
> 
> Please don't forget to build-test this series for IA32 too.
> 
> Thanks
> Laszlo
> 
> 


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

View/Reply Online (#45489): https://edk2.groups.io/g/devel/message/45489
Mute This Topic: https://groups.io/mt/32839204/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH] UefiCpuPkg: Adding a new TSC library by using CPUID(0x15) TSC leaf

2019-08-12 Thread Dong, Eric
Hi Donald,

Do you think it's necessary to check the TIME_STAMP_COUNTER capability before 
using it? I see SDM has CPUID(0x01) which return the capability of 
TIME_STAMP_COUNTER.

Thanks,
Eric 

> -Original Message-
> From: Kuo, Donald
> Sent: Monday, August 12, 2019 7:23 PM
> To: devel@edk2.groups.io
> Cc: Ni, Ray ; Zeng, Star ; Dong, Eric
> ; Chan, Amy ; Chaganty,
> Rangasai V 
> Subject: [PATCH] UefiCpuPkg: Adding a new TSC library by using CPUID(0x15)
> TSC leaf
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1909
> 
> Cc: Ray Ni 
> Cc: Star Zeng 
> Cc: Eric Dong 
> Cc: Amy Chan 
> Cc: Rangasai V Chaganty 
> Signed-off-by: Donald Kuo 
> ---
>  .../Library/BaseCpuTimerLib/BaseCpuTimerLib.c  |  40 +++
>  .../Library/BaseCpuTimerLib/BaseCpuTimerLib.inf|  35 +++
>  .../Library/BaseCpuTimerLib/BaseCpuTimerLib.uni|  16 ++
>  UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c   | 272
> +
>  UefiCpuPkg/UefiCpuPkg.dec  |   8 +
>  UefiCpuPkg/UefiCpuPkg.dsc  |   1 +
>  6 files changed, 372 insertions(+)
>  create mode 100644
> UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
>  create mode 100644
> UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
>  create mode 100644
> UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni
>  create mode 100644 UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c
> 
> diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
> b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
> new file mode 100644
> index 00..ccb92a95d3
> --- /dev/null
> +++ b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
> @@ -0,0 +1,40 @@
> +/** @file
> +  CPUID Leaf 0x15 for Core Crystal Clock frequency instance of Timer Library.
> +
> +  Copyright (c) 2019 Intel Corporation. All rights reserved.
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include 
> +#include 
> +#include 
> +
> +/**
> +  CPUID Leaf 0x15 for Core Crystal Clock Frequency.
> +
> +  The TSC counting frequency is determined by using CPUID leaf 0x15.
> Frequency in MHz = Core XTAL frequency * EBX/EAX.
> +  In newer flavors of the CPU, core xtal frequency is returned in ECX or 0 if
> not supported.
> +  @return The number of TSC counts per second.
> +
> +**/
> +UINT64
> +CpuidCoreClockCalculateTscFrequency (
> +  VOID
> +  );
> +
> +/**
> +  Internal function to retrieves the 64-bit frequency in Hz.
> +
> +  Internal function to retrieves the 64-bit frequency in Hz.
> +
> +  @return The frequency in Hz.
> +
> +**/
> +UINT64
> +InternalGetPerformanceCounterFrequency (
> +  VOID
> +  )
> +{
> +  return CpuidCoreClockCalculateTscFrequency (); }
> diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
> b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
> new file mode 100644
> index 00..7e27a55c90
> --- /dev/null
> +++ b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
> @@ -0,0 +1,35 @@
> +## @file
> +#  Base CPU Timer Library
> +#
> +#  Provides basic timer support using CPUID Leaf 0x15 XTAL frequency.
> +The performance #  counter features are provided by the processors time
> stamp counter.
> +#
> +#  Copyright (c) 2019, Intel Corporation. All rights reserved. #
> +SPDX-License-Identifier: BSD-2-Clause-Patent # ##
> +
> +[Defines]
> +  INF_VERSION= 0x00010005
> +  BASE_NAME  = BaseCpuTimerLib
> +  FILE_GUID  = F10B5B91-D15A-496C-B044-B5235721AA08
> +  MODULE_TYPE= BASE
> +  VERSION_STRING = 1.0
> +  LIBRARY_CLASS  = TimerLib
> +  MODULE_UNI_FILE= BaseCpuTimerLib.uni
> +
> +[Sources]
> +  CpuTimerLib.c
> +  BaseCpuTimerLib.c
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +  UefiCpuPkg/UefiCpuPkg.dec
> +
> +[LibraryClasses]
> +  BaseLib
> +  PcdLib
> +  DebugLib
> +
> +[Pcd]
> +  gUefiCpuPkgTokenSpaceGuid.PcdCpuCoreCrystalClockFrequency  ##
> +CONSUMES
> diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni
> b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni
> new file mode 100644
> index 00..6e5c3ef70e
> --- /dev/null
> +++ b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni
> @@ -0,0 +1,16 @@
> +// /** @file
> +// Base CPU Timer Library
> +//
> +// Provides basic timer support using CPUID Leaf 0x15 XTAL frequency.
> +The performance // counter features are provided by the processors time
> stamp counter.
> +//
> +// Copyright (c) 2019, Intel Corporation. All rights reserved. //
> +// SPDX-License-Identifier: BSD-2-Clause-Patent // // **/
> +
> +
> +#string STR_MODULE_ABSTRACT #language en-US "CPU Timer
> Library"
> +
> +#string STR_MODULE_DESCRIPTION  #language en-US "Provides basic
> timer support using CPUID Leaf 0x15 XTAL frequency."
> diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c
> b/UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c
> new file mode 100644
> index 

Re: [edk2-devel] [PATCH 1/1] MdeModulePkg/DxeIplPeim: Relocate the operation of PageMapLevel5Entry++

2019-08-12 Thread Dong, Eric
Agree with Dandan's comments. With that update, Reviewed-by: Eric Dong 


> -Original Message-
> From: Bi, Dandan
> Sent: Tuesday, August 13, 2019 10:04 AM
> To: Zhang, Shenglei ; devel@edk2.groups.io
> Cc: Gao, Liming ; Wu, Hao A ;
> Laszlo Ersek ; Dong, Eric 
> Subject: RE: [PATCH 1/1] MdeModulePkg/DxeIplPeim: Relocate the
> operation of PageMapLevel5Entry++
> 
> > -Original Message-
> > From: Zhang, Shenglei
> > Sent: Monday, August 12, 2019 2:25 PM
> > To: devel@edk2.groups.io
> > Cc: Bi, Dandan ; Gao, Liming
> > ; Wu, Hao A ; Laszlo Ersek
> > ; Dong, Eric 
> > Subject: [PATCH 1/1] MdeModulePkg/DxeIplPeim: Relocate the operation
> > of
> > PageMapLevel5Entry++
> >
> > PageMapLevel5Entry may be uninitialized in original code, which means
> > uninitialized pointer will be modified at some circumstance.
> > So relocate the operation of PageMapLevel5Entry++ in order to make
> > sure the pointer could be modified only when it is uninitialized.
> I think "uninitialized" here should be a typo, you may mean "initialized".
> Please update it before commit.
> I have no other comments for this patch.
> Reviewed-by: Dandan Bi 
> 
> >
> > Cc: Dandan Bi 
> > Cc: Liming Gao 
> > Cc: Hao A Wu 
> > Cc: Laszlo Ersek 
> > Cc: Eric Dong 
> > Signed-off-by: Shenglei Zhang 
> > ---
> >  MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
> > b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
> > index b40b7e0c9813..2389f3eb485b 100644
> > --- a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
> > +++ b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
> > @@ -764,7 +764,7 @@ CreateIdentityMappingPageTables (
> >
> >for ( IndexOfPml5Entries = 0
> >; IndexOfPml5Entries < NumberOfPml5EntriesNeeded
> > -  ; IndexOfPml5Entries++, PageMapLevel5Entry++) {
> > +  ; IndexOfPml5Entries++) {
> >  //
> >  // Each PML5 entry points to a page of PML4 entires.
> >  // So lets allocate space for them and fill them in in the
> > IndexOfPml4Entries loop.
> > @@ -780,6 +780,7 @@ CreateIdentityMappingPageTables (
> >PageMapLevel5Entry->Uint64 = (UINT64) (UINTN)
> > PageMapLevel4Entry | AddressEncMask;
> >PageMapLevel5Entry->Bits.ReadWrite = 1;
> >PageMapLevel5Entry->Bits.Present   = 1;
> > +  PageMapLevel5Entry++;
> >  }
> >
> >  for ( IndexOfPml4Entries = 0
> > --
> > 2.18.0.windows.1


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

View/Reply Online (#45487): https://edk2.groups.io/g/devel/message/45487
Mute This Topic: https://groups.io/mt/32838114/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] NetworkPkg: sending a second HTTPS request without tearing down instance in-between causes a crash

2019-08-12 Thread rebecca
I've been working to debug a problem I've been seeing booting FreeBSD
via HTTPS. I filed a BZ at
https://bugzilla.tianocore.org/show_bug.cgi?id=1917 .


I've done some more debugging and tracked the issue down to attempting to 
request a file twice without tearing down the http instance in-between. 

In 
https://svnweb.freebsd.org/base/head/stand/efi/libefi/efihttp.c?revision=349613=markup
 :

If, in function efihttp_fs_open (line 565) I call efihttp_dev_close followed by 
efihttp_dev_open if the first call to _efihttp_fs_open fails, then everything 
works. 
But if I don't then I get the crash due to the corruption of the 
SetSessionDataPointer.


-- 
Rebecca Cran


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

View/Reply Online (#45486): https://edk2.groups.io/g/devel/message/45486
Mute This Topic: https://groups.io/mt/32848622/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH 1/1] MdeModulePkg/DxeIplPeim: Relocate the operation of PageMapLevel5Entry++

2019-08-12 Thread Dandan Bi
> -Original Message-
> From: Zhang, Shenglei
> Sent: Monday, August 12, 2019 2:25 PM
> To: devel@edk2.groups.io
> Cc: Bi, Dandan ; Gao, Liming ;
> Wu, Hao A ; Laszlo Ersek ; Dong,
> Eric 
> Subject: [PATCH 1/1] MdeModulePkg/DxeIplPeim: Relocate the operation of
> PageMapLevel5Entry++
> 
> PageMapLevel5Entry may be uninitialized in original code, which means
> uninitialized pointer will be modified at some circumstance.
> So relocate the operation of PageMapLevel5Entry++ in order to make sure
> the pointer could be modified only when it is uninitialized.
I think "uninitialized" here should be a typo, you may mean "initialized".
Please update it before commit.
I have no other comments for this patch.
Reviewed-by: Dandan Bi 

> 
> Cc: Dandan Bi 
> Cc: Liming Gao 
> Cc: Hao A Wu 
> Cc: Laszlo Ersek 
> Cc: Eric Dong 
> Signed-off-by: Shenglei Zhang 
> ---
>  MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
> b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
> index b40b7e0c9813..2389f3eb485b 100644
> --- a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
> +++ b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
> @@ -764,7 +764,7 @@ CreateIdentityMappingPageTables (
> 
>for ( IndexOfPml5Entries = 0
>; IndexOfPml5Entries < NumberOfPml5EntriesNeeded
> -  ; IndexOfPml5Entries++, PageMapLevel5Entry++) {
> +  ; IndexOfPml5Entries++) {
>  //
>  // Each PML5 entry points to a page of PML4 entires.
>  // So lets allocate space for them and fill them in in the
> IndexOfPml4Entries loop.
> @@ -780,6 +780,7 @@ CreateIdentityMappingPageTables (
>PageMapLevel5Entry->Uint64 = (UINT64) (UINTN) PageMapLevel4Entry |
> AddressEncMask;
>PageMapLevel5Entry->Bits.ReadWrite = 1;
>PageMapLevel5Entry->Bits.Present   = 1;
> +  PageMapLevel5Entry++;
>  }
> 
>  for ( IndexOfPml4Entries = 0
> --
> 2.18.0.windows.1


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

View/Reply Online (#45485): https://edk2.groups.io/g/devel/message/45485
Mute This Topic: https://groups.io/mt/32838114/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [edk2-non-osi patch 1/1] SimicsICH10SiliconBinPkg: Add UNDI ROM for SIMICS QSP Platform

2019-08-12 Thread Nate DeSimone
Hi David,

I would prefer if we follow Pascal casing and rename this package to 
SimicsIch10SiliconBinPkg (instead of SimicsICH10SiliconBinPkg).

 Also, I think it would be good if we can also add owners for the new packages 
to the Maintainers.txt file. (SimicsIch10SiliconBinPkg, SimicsX58SktPkg, 
SimicsIch10Pkg, and SimicsOpenBoardPkg).

Thanks,
Nate

-Original Message-
From: Wei, David Y 
Sent: Friday, August 9, 2019 4:50 PM
To: devel@edk2.groups.io
Cc: Wu, Hao A ; Gao, Liming ; Sinha, 
Ankit ; Agyeman, Prince ; 
Kubacki, Michael A ; Desimone, Nathaniel L 
; Kinney, Michael D 
Subject: [edk2-non-osi patch 1/1] SimicsICH10SiliconBinPkg: Add UNDI ROM for 
SIMICS QSP Platform

Add UNDI option ROM for SIMICS QSP Network support

Cc: Hao Wu 
Cc: Liming Gao 
Cc: Ankit Sinha 
Cc: Agyeman Prince 
Cc: Kubacki Michael A 
Cc: Nate DeSimone 
Cc: Michael D Kinney 
Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: David Wei 
---
 Silicon/Intel/SimicsICH10SiliconBinPkg/License.txt |  30 ++
 .../UndiBinary/GigUndiDxe.efi  | Bin 0 -> 195360 bytes
 .../UndiBinary/IntelProprietaryLicense.txt |  43 +
 3 files changed, 73 insertions(+)
 create mode 100644 Silicon/Intel/SimicsICH10SiliconBinPkg/License.txt
 create mode 100644 
Silicon/Intel/SimicsICH10SiliconBinPkg/UndiBinary/GigUndiDxe.efi
 create mode 100644 
Silicon/Intel/SimicsICH10SiliconBinPkg/UndiBinary/IntelProprietaryLicense.txt

diff --git a/Silicon/Intel/SimicsICH10SiliconBinPkg/License.txt 
b/Silicon/Intel/SimicsICH10SiliconBinPkg/License.txt
new file mode 100644
index 000..5507dd0
--- /dev/null
+++ b/Silicon/Intel/SimicsICH10SiliconBinPkg/License.txt
@@ -0,0 +1,30 @@
+Copyright (c) 2012 - 2019, Intel Corporation. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+* Redistributions of source code must retain the above copyright
+  notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+  notice, this list of conditions and the following disclaimer in
+  the documentation and/or other materials provided with the
+  distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+Some files are subject to a license documented in the
+IntelProprietaryLicense.txt file. These files are in the same
+directory as IntelProprietaryLicense.txt, and they do not have
+a license specified within the file.
diff --git a/Silicon/Intel/SimicsICH10SiliconBinPkg/UndiBinary/GigUndiDxe.efi 
b/Silicon/Intel/SimicsICH10SiliconBinPkg/UndiBinary/GigUndiDxe.efi
new file mode 100644
index 
..7b8e0d7be00dccedb84ebed5c5c87a0e79078983
GIT binary patch
literal 195360
zcmc$Hdwf*Ywg1dyCK({%1SJ>|F>2IQe5A%|VtmYj37nA$hL>V}rD~_NYNap(u~41i
zBqWpLC|+!}y=|pe+hVmX)+))U7Ez9K|re&6rjXC49U@AJF=
z{AkVDkG0ocd+oi~UVH7e_tbvZ_P_qO@qbK
zzafaC51`F#C)=LgUSch=*%qI3^Y?<^Ls;uZTyfaytuOOa|2#HZUn;!#c<^lxa9Q6}
zI=>#9ZTdM465(fKk?=k$Ce!%M`sX3s((m7T`%N~{b{lw50v_<2{f}@%(~z-i*Dfu3
zZK?YzO@F^cGhWk-gXRoCYKH6LPKV7O^OkzFSkV%+Q8W6JYabMOBC%j|GMUtj7qzIi
z2zlnSBJ0}Ha!r4>NbV2~3(0kJzw^EWbcODglv*_mOP`O8%1T2z-Vd6Ue%
zJC&)UBxo+vlIsQTsK3-bAJi`a6E2jnOGqxb6D?RH2rp>nCswo*#Ip^_!w1&%Mkw892qV_V}7)STu9T{jt+~gbdR+;Y)el^
z_H1N>oL#9l6~#R$8@szS48W{%jB18V_Qx7aTSVNIkK!P`21NCGOUpRm{Kj@Np#-Ii
zC1)CDYKB!JR`4gJfqSU)E27{yin*TKWf82#<`#mgr=D@xI_$uftg8cS8(d}{f%RvX
zT!S%|HFjMFAb~50PrM#5vCAJx)_E#0M)!(7xtryTf(6KrT~%LG(P=*Qh#e`e=}6h2
z1l^iGxL?yd3wu1y613z8t4LH`p%&9zo|Y<4>#M!Clj|1M^m=j~wwyvwOT)NcPyWbr
zHczjo7`W}do+))ReDl1@CXW+?`K_lNwm?ld}Q0+)2fi2k?sLAOHeN;9ZfAEmp7ObZjm7B`{PB8*emj5B|vb(jWWIhHi(=XE+Z9sy1GGn#~rR
z4cgd}xDBi{=S;LAH~$b4G`*`nUUv-=tE@z(m@SjY0@wF|x1;b3_UZu;-da$Ogk-m}
zsjGVL(qBlrj9_V{W~{>W$8=V&@80D%{_cxj14$8iKa4`Y*or%>&?JvbK7j{-Vbr-d)M3jv$bRLTN|>pujNf|W8?^z}rU(;#zxvV-N8h@27B
z%|Y3K!Rl)8%fYq;GxMy=IDTEf%?soJ)%_nwHB{#R9CyxOnSQ0r)sSoWdxyWVQ@r
z?z$Ebft<9i7M4cXgY;FG$S`MXodwU?db0)3*;;AAm!MTo$2nW;L__*G@@F9NAtXi`
z|6$Geb?I7iAo6S)n(?d_U4((R
zq?oI~62IXq^T#~yUe87@x0*46Nw7gPK1OwAs16+XcBHRrD;3DN}Ip*ytogwD{WnYY1;z&
z0jIL&&{Clbu+(Vxkszbppfp^6i@P@HS;NWl_8TTQ*yux-WQV+)TN`^)E8f$4KsB`0bt^aExeMs)8emW=bpZz(AS=Ksm;@XdVR{n

[edk2-devel] [Patch] BaseTools: Add "-" in a re to parse line in .map file

2019-08-12 Thread Bob Feng
https://bugzilla.tianocore.org/show_bug.cgi?id=2058

If there are multiple module instances with different
guid used in .dsc file, the temp path of the module will
contain 8-4-4-4-12 format guid string. So "-" need to be
added into the regular expression for parsing it correctly.

Cc: Liming Gao 
Signed-off-by: Bob Feng 
---
 BaseTools/Source/Python/Common/Misc.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/Common/Misc.py 
b/BaseTools/Source/Python/Common/Misc.py
index 26d149c270..554ec010dd 100644
--- a/BaseTools/Source/Python/Common/Misc.py
+++ b/BaseTools/Source/Python/Common/Misc.py
@@ -162,11 +162,11 @@ def _parseForGCC(lines, efifilepath, varnames):
 
 def _parseGeneral(lines, efifilepath, varnames):
 status = 0#0 - beginning of file; 1 - PE section definition; 2 - 
symbol table
 secs  = []# key = section name
 varoffset = []
-symRe = re.compile('^([\da-fA-F]+):([\da-fA-F]+) +([\.:\w\?@\$]+) 
+([\da-fA-F]+)', re.UNICODE)
+symRe = re.compile('^([\da-fA-F]+):([\da-fA-F]+) +([\.:\w\?@\$-]+) 
+([\da-fA-F]+)', re.UNICODE)
 
 for line in lines:
 line = line.strip()
 if startPatternGeneral.match(line):
 status = 1
-- 
2.20.1.windows.1


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

View/Reply Online (#45482): https://edk2.groups.io/g/devel/message/45482
Mute This Topic: https://groups.io/mt/32848513/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel][edk2-platfoms][PATCH v2 06/22] Platform/CoreDxeInclude.dsc: Add ResetUtilityLib to dsc file

2019-08-12 Thread Kubacki, Michael A
Reviewed-by: Michael Kubacki 

> -Original Message-
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Gao,
> Zhichao
> Sent: Sunday, August 11, 2019 8:05 PM
> To: devel@edk2.groups.io
> Cc: Ard Biesheuvel ; Leif Lindholm
> ; Kinney, Michael D ;
> Kubacki, Michael A ; Chiu, Chasel
> ; Desimone, Nathaniel L
> ; Gao, Liming 
> Subject: [edk2-devel][edk2-platfoms][PATCH v2 06/22]
> Platform/CoreDxeInclude.dsc: Add ResetUtilityLib to dsc file
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772
> 
> ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
> So add it for the platform dsc file.
> 
> Cc: Ard Biesheuvel 
> Cc: Leif Lindholm 
> Cc: Michael D Kinney 
> Cc: Michael Kubacki 
> Cc: Chasel Chiu 
> Cc: Nate DeSimone 
> Cc: Liming Gao 
> Signed-off-by: Zhichao Gao 
> ---
>  Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> b/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> index f0e578f8cceb..9d043953b327 100644
> --- a/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> +++ b/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> @@ -58,7 +58,10 @@
>  !endif
>}
> 
> -  MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> +  MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf {
> +
> +  
> ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
> +  }
> 
>#UefiCpuPkg/CpuDxe/CpuDxe.inf
> 
> --
> 2.21.0.windows.1
> 
> 
> 


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

View/Reply Online (#45481): https://edk2.groups.io/g/devel/message/45481
Mute This Topic: https://groups.io/mt/32836868/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH 1/1] MdeModulePkg/DxeIplPeim: Relocate the operation of PageMapLevel5Entry++

2019-08-12 Thread Wu, Hao A
Hello Eric,

Could you help to take a look at this one as well?


> -Original Message-
> From: Zhang, Shenglei
> Sent: Monday, August 12, 2019 2:25 PM
> To: devel@edk2.groups.io
> Cc: Bi, Dandan; Gao, Liming; Wu, Hao A; Laszlo Ersek; Dong, Eric
> Subject: [PATCH 1/1] MdeModulePkg/DxeIplPeim: Relocate the operation of
> PageMapLevel5Entry++
> 
> PageMapLevel5Entry may be uninitialized in original code, which means
> uninitialized pointer will be modified at some circumstance.
> So relocate the operation of PageMapLevel5Entry++ in order to make sure
> the pointer could be modified only when it is uninitialized.
> 
> Cc: Dandan Bi 
> Cc: Liming Gao 
> Cc: Hao A Wu 
> Cc: Laszlo Ersek 
> Cc: Eric Dong 
> Signed-off-by: Shenglei Zhang 
> ---
>  MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
> b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
> index b40b7e0c9813..2389f3eb485b 100644
> --- a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
> +++ b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
> @@ -764,7 +764,7 @@ CreateIdentityMappingPageTables (
> 
>for ( IndexOfPml5Entries = 0
>; IndexOfPml5Entries < NumberOfPml5EntriesNeeded
> -  ; IndexOfPml5Entries++, PageMapLevel5Entry++) {
> +  ; IndexOfPml5Entries++) {
>  //
>  // Each PML5 entry points to a page of PML4 entires.
>  // So lets allocate space for them and fill them in in the
> IndexOfPml4Entries loop.
> @@ -780,6 +780,7 @@ CreateIdentityMappingPageTables (
>PageMapLevel5Entry->Uint64 = (UINT64) (UINTN) PageMapLevel4Entry |
> AddressEncMask;
>PageMapLevel5Entry->Bits.ReadWrite = 1;
>PageMapLevel5Entry->Bits.Present   = 1;
> +  PageMapLevel5Entry++;
>  }


I think the change is fine,
Reviewed-by: Hao A Wu 

Best Regards,
Hao Wu


> 
>  for ( IndexOfPml4Entries = 0
> --
> 2.18.0.windows.1


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

View/Reply Online (#45480): https://edk2.groups.io/g/devel/message/45480
Mute This Topic: https://groups.io/mt/32838114/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel][edk2-platfoms][PATCH v2 06/22] Platform/CoreDxeInclude.dsc: Add ResetUtilityLib to dsc file

2019-08-12 Thread Nate DeSimone
Reviewed-by: Nate DeSimone 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Gao, Zhichao
Sent: Sunday, August 11, 2019 8:05 PM
To: devel@edk2.groups.io
Cc: Ard Biesheuvel ; Leif Lindholm 
; Kinney, Michael D ; 
Kubacki, Michael A ; Chiu, Chasel 
; Desimone, Nathaniel L 
; Gao, Liming 
Subject: [edk2-devel][edk2-platfoms][PATCH v2 06/22] 
Platform/CoreDxeInclude.dsc: Add ResetUtilityLib to dsc file

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

ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
So add it for the platform dsc file.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Michael Kubacki 
Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
---
 Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc 
b/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
index f0e578f8cceb..9d043953b327 100644
--- a/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
+++ b/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
@@ -58,7 +58,10 @@
 !endif
   }
 
-  MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
+  MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf {
+
+  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
+  }
 
   #UefiCpuPkg/CpuDxe/CpuDxe.inf
 
-- 
2.21.0.windows.1





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

View/Reply Online (#45477): https://edk2.groups.io/g/devel/message/45477
Mute This Topic: https://groups.io/mt/32836868/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [edk2-platforms] [PATCH] ClevoOpenBoardPkg: Remove batch build scripts

2019-08-12 Thread Kubacki, Michael A
Reviewed-by: Michael Kubacki 

> -Original Message-
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> Agyeman, Prince
> Sent: Friday, August 9, 2019 9:35 AM
> To: devel@edk2.groups.io
> Subject: [edk2-devel] [edk2-platforms] [PATCH] ClevoOpenBoardPkg: Remove
> batch build scripts
> 
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1775
> 
> Removed batch build scripts as they are replaced
> 
> by build_bios.py
> 
> Signed-off-by: Agyeman 
> ---
>  .../ClevoOpenBoardPkg/N1xxWU/GitEdk2Clevo.bat |  79 ---
>  .../Intel/ClevoOpenBoardPkg/N1xxWU/bld.bat| 159 -
>  .../Intel/ClevoOpenBoardPkg/N1xxWU/cln.bat|  48 
>  .../ClevoOpenBoardPkg/N1xxWU/postbuild.bat|  39 
>  .../ClevoOpenBoardPkg/N1xxWU/prebuild.bat | 214 --
>  .../Intel/ClevoOpenBoardPkg/N1xxWU/prep.bat   |  79 ---
>  6 files changed, 618 deletions(-)
>  delete mode 100644
> Platform/Intel/ClevoOpenBoardPkg/N1xxWU/GitEdk2Clevo.bat
>  delete mode 100644 Platform/Intel/ClevoOpenBoardPkg/N1xxWU/bld.bat
>  delete mode 100644 Platform/Intel/ClevoOpenBoardPkg/N1xxWU/cln.bat
>  delete mode 100644
> Platform/Intel/ClevoOpenBoardPkg/N1xxWU/postbuild.bat
>  delete mode 100644
> Platform/Intel/ClevoOpenBoardPkg/N1xxWU/prebuild.bat
>  delete mode 100644 Platform/Intel/ClevoOpenBoardPkg/N1xxWU/prep.bat
> 
> diff --git a/Platform/Intel/ClevoOpenBoardPkg/N1xxWU/GitEdk2Clevo.bat
> b/Platform/Intel/ClevoOpenBoardPkg/N1xxWU/GitEdk2Clevo.bat
> deleted file mode 100644
> index 81f51b3785..00
> --- a/Platform/Intel/ClevoOpenBoardPkg/N1xxWU/GitEdk2Clevo.bat
> +++ /dev/null
> @@ -1,79 +0,0 @@
> -@REM @file
> -@REM
> -@REM Copyright (c) 2019, Intel Corporation. All rights reserved. -@REM
> SPDX-License-Identifier: BSD-2-Clause-Patent -@REM
> -
> -@echo off
> -
> -pushd ..\..\..\..\..\
> -
> -@REM Set WORKSPACE environment.
> -set WORKSPACE=%cd%
> -echo.
> -echo Set WORKSPACE as: %WORKSPACE%
> -echo.
> -
> -@REM Check whether Git has been installed and been added to system path.
> -git --help >nul 2>nul
> -if %ERRORLEVEL% NEQ 0 (
> -  echo.
> -  echo The 'git' command is not recognized.
> -  echo Please make sure that Git is installed and has been added to system 
> path.
> -  echo.
> -  goto :EOF
> -)
> -
> -@REM Create the Conf directory under WORKSPACE -if not exist
> %WORKSPACE%\Conf (
> -  mkdir Conf
> -)
> -
> -@REM Set other environments.
> -@REM Basic Rule:
> -@REM   Platform override Silicon override Core
> -@REM   Source override Binary
> -
> -set PACKAGES_PATH=%WORKSPACE%\edk2-
> platforms\Platform\Intel;%WORKSPACE%\edk2-
> platforms\Silicon\Intel;%WORKSPACE%\edk2-non-
> osi\Silicon\Intel;%WORKSPACE%\FSP;%WORKSPACE%\edk2;%WORKSPACE%
> -set EDK_TOOLS_BIN=%WORKSPACE%\edk2-BaseTools-win32
> -
> -@if not defined PYTHON_HOME (
> -  @if exist C:\Python27 (
> -set PYTHON_HOME=C:\Python27
> -  )
> -)
> -
> -set EDK_SETUP_OPTION=
> -@rem if python is installed, disable the binary base tools.
> -if defined PYTHON_HOME (
> -  set EDK_TOOLS_BIN=
> -  set EDK_SETUP_OPTION=--nt32
> -)
> -pushd %WORKSPACE%\edk2
> -call edksetup.bat %EDK_SETUP_OPTION%
> -popd
> -pushd %WORKSPACE%
> -@rem if python is installed, nmake BaseTools source and enable BaseTools
> source build -@if defined PYTHON_HOME (
> -  nmake -f %BASE_TOOLS_PATH%\Makefile
> -)
> -popd
> -
> -set openssl_path=%WORKSPACE%
> -
> -popd
> -
> -goto :EOF
> -
> -:Help
> -echo.
> -echo Usage:
> -echo GitEdk2.bat [-w Workspace_Directory] (optional) [-b Branch_Name]
> (optional) -echo.
> -echo -wA absolute/relative path to be the workspace.
> -echo   Default value is the current directory.
> -echo.
> -echo -bThe branch name of the repository. Currently, only master, 
> udk2015,
> -echo   trunk (same as master) and bp13 (same as udk2015) are supported.
> -echo   Default value is master.
> -echo.
> diff --git a/Platform/Intel/ClevoOpenBoardPkg/N1xxWU/bld.bat
> b/Platform/Intel/ClevoOpenBoardPkg/N1xxWU/bld.bat
> deleted file mode 100644
> index 606ce979a7..00
> --- a/Platform/Intel/ClevoOpenBoardPkg/N1xxWU/bld.bat
> +++ /dev/null
> @@ -1,159 +0,0 @@
> -@REM @file
> -@REM
> -@REM Copyright (c) 2019, Intel Corporation. All rights reserved. -@REM
> SPDX-License-Identifier: BSD-2-Clause-Patent -@REM
> -
> -:: Useage: bld [/s] [/f  ] [/r]
> -::
> -:: For a given build command, 3 options may be passed into this batch file 
> via
> command prompt:
> -:: 1) /s = Redirects all output to a file called EDK2.log(Prep.log must be 
> existed),
> which will be located at the root.
> -:: 2) /f = Defines the passing in of a single override to a feature PCD that 
> is used
> in the platform
> -::DSC file.  If this parameter is used, it is to be followed immediately 
> after by
> both the feature
> -::pcd name and value. FeaturePcd is the full PCD name, like
> gMinPlatformPkgTokenSpaceGuid.PcdOptimizeCompilerEnable
> -:: 3) /r = Useful for faster rebuilds when no changes have been made to .inf
> files. 

Re: [edk2-devel] [PATCH 0/3] Move MdeModulePkg/Include/Protocol/Dpc.h to NetworkPkg

2019-08-12 Thread Wu, Hao A
> -Original Message-
> From: Zhang, Shenglei
> Sent: Monday, August 12, 2019 4:37 PM
> To: devel@edk2.groups.io
> Cc: Fu, Siyuan; Wu, Jiaxin; Wang, Jian J; Wu, Hao A
> Subject: [PATCH 0/3] Move MdeModulePkg/Include/Protocol/Dpc.h to
> NetworkPkg
> 
> The file MdeModulePkg/Include/Protocol/Dpc.h is consumed
> by the modules in NetworkPkg.
> Hence, this protocol header file should be moved into NetworkPkg.
> https://bugzilla.tianocore.org/show_bug.cgi?id=1949
> 
> Cc: Siyuan Fu 
> Cc: Jiaxin Wu 
> Cc: Jian J Wang 
> Cc: Hao A Wu 
> Shenglei Zhang (3):
>   NetworkPkg: Add Dpc protocol
>   NetworkPkg: Move Dpc.h from MdeModulePkg to NetworkPkg
>   MdeModulePkg/MdeModulePkg.dec: Remove gEfiDpcProtocolGuid


I would recommend the below sequence:
Patch 1 (NetworkPkg): Duplicate the Dpc.h file in NetworkPkg, update 
NetworkPkg.dec
Patch 2 (NetworkPkg): Update the INF files in NetworkPkg to remove MdeModulePkg 
dependency
Patch 3 (MdeModulePkg): Remove the Dpc.h file in MdeModulePkg, update 
MdeModulePkg.dec

But if other reviewers are fine with the current series, I am okay with
the current one:
For patch 3/3 (MdeModulePkg part),
Reviewed-by: Hao A Wu 

Best Regards,
Hao Wu


> 
>  MdeModulePkg/MdeModulePkg.dec   | 3 ---
>  NetworkPkg/DpcDxe/DpcDxe.inf| 1 -
>  {MdeModulePkg => NetworkPkg}/Include/Protocol/Dpc.h | 0
>  NetworkPkg/Library/DxeDpcLib/DxeDpcLib.inf  | 1 -
>  NetworkPkg/NetworkPkg.dec   | 4 
>  5 files changed, 4 insertions(+), 5 deletions(-)
>  rename {MdeModulePkg => NetworkPkg}/Include/Protocol/Dpc.h (100%)
> 
> --
> 2.18.0.windows.1


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

View/Reply Online (#45476): https://edk2.groups.io/g/devel/message/45476
Mute This Topic: https://groups.io/mt/32838742/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [edk2-platforms] [PATCH v2] Platform/Intel: Update Readme.md to point to edk2-non-osi master branch

2019-08-12 Thread Nate DeSimone
Pushed: 
https://github.com/tianocore/edk2-platforms/commit/2c93b663817b69c809a329f4920f9584b1fe5eb8

-Original Message-
From: Kubacki, Michael A 
Sent: Monday, August 12, 2019 8:57 AM
To: Desimone, Nathaniel L ; devel@edk2.groups.io
Cc: Andrew Fish ; Laszlo Ersek ; Leif 
Lindholm ; Kinney, Michael D 
; Sinha, Ankit ; Chiu, 
Chasel 
Subject: RE: [edk2-platforms] [PATCH v2] Platform/Intel: Update Readme.md to 
point to edk2-non-osi master branch

Reviewed-by: Michael Kubacki 

> -Original Message-
> From: Desimone, Nathaniel L
> Sent: Sunday, August 11, 2019 4:45 PM
> To: devel@edk2.groups.io
> Cc: Andrew Fish ; Laszlo Ersek ; 
> Leif Lindholm ; Kinney, Michael D 
> ; Kubacki, Michael A 
> ; Sinha, Ankit ; 
> Chiu, Chasel 
> Subject: [edk2-platforms] [PATCH v2] Platform/Intel: Update Readme.md 
> to point to edk2-non-osi master branch
> 
> Updated Platform/Intel/Readme.md to point to master branch on 
> edk2-non-osi instead of devel-MinPlatform
> 
> Updated edk2-platforms/Readme.md to point to Platform/Intel/Readme.md 
> for build instructions on Intel based Minimum Platforms
> 
> Added a link to the EDK II Minimum Platform Draft Specification to 
> Platform/Intel/Readme.md
> 
> Cc: Andrew Fish 
> Cc: Laszlo Ersek 
> Cc: Leif Lindholm 
> Cc: Michael D Kinney 
> Cc: Michael Kubacki 
> Cc: Ankit Sinha 
> Cc: Chasel Chiu 
> Signed-off-by: Nate DeSimone 
> ---
>  Platform/Intel/Readme.md | 6 --
>  Readme.md| 4 ++--
>  2 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/Platform/Intel/Readme.md b/Platform/Intel/Readme.md index
> 0a0e8a8c80..00f42985a2 100644
> --- a/Platform/Intel/Readme.md
> +++ b/Platform/Intel/Readme.md
> @@ -1,7 +1,9 @@
>  # **EDK II Minimum Platform Firmware for Intel(R) Platforms**
> 
>  The Minimum Platform is a software architecture that guides uniform 
> delivery of Intel platforms enabling firmware -solutions for basic 
> boot functionality with extensibility built-in.
> +solutions for basic boot functionality with extensibility built-in.
> +Please see the [EDK II Minimum Platform Draft 
> +Specification](https://edk2-docs.gitbooks.io/edk-ii-minimum-platform-
> +sp
> +ecification/)
> +for more details.
> 
>  Package maintainers for the Minimum Platform projects are listed in 
> Maintainers.txt.
> 
> @@ -98,7 +100,7 @@ return back to the minimum platform caller.
>* ``git clone https://github.com/tianocore/edk2-platforms.git``
> 
>  * edk2-non-osi repository
> -  * ``git clone https://github.com/tianocore/edk2-non-osi.git -b 
> devel- MinPlatform``
> +  * ``git clone https://github.com/tianocore/edk2-non-osi.git``
> 
>  * FSP repository
>* ``git clone https://github.com/IntelFsp/FSP.git``
> diff --git a/Readme.md b/Readme.md
> index 63e59f60b4..1befd0b544 100644
> --- a/Readme.md
> +++ b/Readme.md
> @@ -223,8 +223,8 @@ they will be documented with the platform.
>  * [D05](Platform/Hisilicon/D05)
>  * [HiKey](Platform/Hisilicon/HiKey)
> 
> -## [Intel](Platform/Intel/Readme.md)
> -### Minimum Platforms
> +## Intel
> +### [Minimum Platforms](Platform/Intel/Readme.md)
>  * [Clevo](Platform/Intel/ClevoOpenBoardPkg)
>  * [Kaby Lake](Platform/Intel/KabylakeOpenBoardPkg)
>  * [Purley](Platform/Intel/PurleyOpenBoardPkg)
> --
> 2.17.1.windows.2


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

View/Reply Online (#45475): https://edk2.groups.io/g/devel/message/45475
Mute This Topic: https://groups.io/mt/32835408/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v2 0/3] Fix warning message issues

2019-08-12 Thread Carsey, Jaben
Thanks. I had not checked each of the patches in the set, only the one CC'd to 
me and this one.

Thanks
-Jaben


> -Original Message-
> From: Zhang, Shenglei
> Sent: Monday, August 12, 2019 5:53 PM
> To: Carsey, Jaben ; devel@edk2.groups.io
> Cc: Wang, Jian J ; Wu, Hao A
> ; Ni, Ray ; Gao, Zhichao
> ; Chiu, Chasel ; Desimone,
> Nathaniel L ; Zeng, Star
> 
> Subject: RE: [PATCH v2 0/3] Fix warning message issues
> 
> Jaben:
> 
> I add the v2 message below "---". And here is the link for v2 patch.
> https://edk2.groups.io/g/devel/message/45398?p=,,,20,0,0,0::Created,,Mde
> ModulePkg%3A+Add+missing+header+files+in+INF+files,20,2,0,32838103
> 
> Thanks,
> Shenglei
> 
> > -Original Message-
> > From: Carsey, Jaben
> > Sent: Monday, August 12, 2019 10:49 PM
> > To: Zhang, Shenglei ; devel@edk2.groups.io
> > Cc: Wang, Jian J ; Wu, Hao A
> ;
> > Ni, Ray ; Gao, Zhichao ; Chiu,
> > Chasel ; Desimone, Nathaniel L
> > ; Zeng, Star 
> > Subject: RE: [PATCH v2 0/3] Fix warning message issues
> >
> >  What changed in v2?
> >
> > Thanks
> > -Jaben
> >
> >
> > > -Original Message-
> > > From: Zhang, Shenglei
> > > Sent: Sunday, August 11, 2019 11:23 PM
> > > To: devel@edk2.groups.io
> > > Cc: Wang, Jian J ; Wu, Hao A
> > > ; Carsey, Jaben ; Ni,
> Ray
> > > ; Gao, Zhichao ; Chiu, Chasel
> > > ; Desimone, Nathaniel L
> > > ; Zeng, Star 
> > > Subject: [PATCH v2 0/3] Fix warning message issues
> > >
> > > There are some header files used but not included in INF
> > > files. This causes warings are generated when building the
> > > packages. So now add them into INF files.
> > > https://bugzilla.tianocore.org/show_bug.cgi?id=2036
> > >
> > > Cc: Jian J Wang 
> > > Cc: Hao A Wu 
> > > Cc: Jaben Carsey 
> > > Cc: Ray Ni 
> > > Cc: Zhichao Gao 
> > > Cc: Chasel Chiu 
> > > Cc: Nate DeSimone 
> > > Cc: Star Zeng 
> > > Shenglei Zhang (3):
> > >   MdeModulePkg: Add missing header files in INF files
> > >   ShellPkg/UefiShellAcpiViewCommandLib: Add missing header files in INF
> > >   IntelFsp2Pkg/FspSecCore: Add missing header file in INF file
> > >
> > >  IntelFsp2Pkg/FspSecCore/FspSecCoreS.inf  | 3 ++-
> > >  MdeModulePkg/Universal/CapsulePei/CapsulePei.inf | 3 ++-
> > >  MdeModulePkg/Universal/CapsulePei/CapsuleX64.inf | 1 +
> > >  MdeModulePkg/Universal/EbcDxe/EbcDebuggerConfig.inf  | 9
> > -
> > >  .../UefiShellAcpiViewCommandLib.inf  | 2 ++
> > >  5 files changed, 15 insertions(+), 3 deletions(-)
> > >
> > > --
> > > 2.18.0.windows.1


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

View/Reply Online (#45474): https://edk2.groups.io/g/devel/message/45474
Mute This Topic: https://groups.io/mt/32838102/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [RFC] BZ 1772 MdeModulePkg: Transfer reset data for 201908 stable tag

2019-08-12 Thread Gao, Zhichao
It is an recommended feature change. But the specific function isn't 
implemented with any platform yet. So it wouldn't affect any section of the 
edk2.
And it changed a lot of platform dsc files(or module package dsc files) in both 
edk2 and edk2-paltform. That may take time for the review work.
I think it is fine if this feature doesn't catch the end-line of the 
software-freeze.

Thanks,
Zhichao

From: Gao, Liming
Sent: Monday, August 12, 2019 4:55 PM
To: Gao, Zhichao ; r...@edk2.groups.io
Cc: devel@edk2.groups.io
Subject: RE: [RFC] BZ 1772 MdeModulePkg: Transfer reset data for 201908 stable 
tag

Zhichao:
  Do you propose this feature for 201908 stable tag?

From: Gao, Zhichao
Sent: Monday, August 12, 2019 4:33 PM
To: r...@edk2.groups.io
Cc: devel@edk2.groups.io; Gao, Liming 
mailto:liming@intel.com>>
Subject: [RFC] BZ 1772 MdeModulePkg: Transfer reset data

HI,

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

Before the ResetData of ResetSystem is limit by ResetType and ResetStatus. As 
the Uefi spec update to 2.8, there is no limit any longer.
Here we introduce a new API ResetSystemWithSubtype to transfer a null string 
and GUID data with all ResetType to reset system.
It is useful for capsule update to get a specific GUID to do some special 
operation with specific phase. That can be implemented in platform code thru 
Reset Notify protocol.
Here is the guids:
gEdkiiCapsuleArmedResetGuid= {0xc6b4eea7, 0xfce2, 0x4625, {0x9c, 
0x4f, 0xc4, 0xb0, 0x82, 0x37, 0xae, 0x23}}
gEdkiiCapsuleUpdateCompleteResetGuid   = {0x5d512714, 0xa4df, 0x4e46, {0xb6, 
0xc7, 0xbc, 0x9f, 0x97, 0x9d, 0x59, 0xa0}}

Thanks,
Zhichao



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

View/Reply Online (#45473): https://edk2.groups.io/g/devel/message/45473
Mute This Topic: https://groups.io/mt/32848299/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [RFC] BZ 1772 MdeModulePkg: Transfer reset data for 201908 stable tag

2019-08-12 Thread Liming Gao
Zhichao:
  Do you propose this feature for 201908 stable tag?

From: Gao, Zhichao
Sent: Monday, August 12, 2019 4:33 PM
To: r...@edk2.groups.io
Cc: devel@edk2.groups.io; Gao, Liming 
Subject: [RFC] BZ 1772 MdeModulePkg: Transfer reset data

HI,

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

Before the ResetData of ResetSystem is limit by ResetType and ResetStatus. As 
the Uefi spec update to 2.8, there is no limit any longer.
Here we introduce a new API ResetSystemWithSubtype to transfer a null string 
and GUID data with all ResetType to reset system.
It is useful for capsule update to get a specific GUID to do some special 
operation with specific phase. That can be implemented in platform code thru 
Reset Notify protocol.
Here is the guids:
gEdkiiCapsuleArmedResetGuid= {0xc6b4eea7, 0xfce2, 0x4625, {0x9c, 
0x4f, 0xc4, 0xb0, 0x82, 0x37, 0xae, 0x23}}
gEdkiiCapsuleUpdateCompleteResetGuid   = {0x5d512714, 0xa4df, 0x4e46, {0xb6, 
0xc7, 0xbc, 0x9f, 0x97, 0x9d, 0x59, 0xa0}}

Thanks,
Zhichao



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

View/Reply Online (#45472): https://edk2.groups.io/g/devel/message/45472
Mute This Topic: https://groups.io/mt/32848299/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] ovmf build fail with gcc 4.8.5

2019-08-12 Thread Chen, Farrah
Hi,

When build ovmf with the latest two commits of master branch, we meet error on 
Red Hat 7.6 with gcc version 4.8.5, but succeed on Red Hat 8.0 with gcc version 
8.2.1.

Steps:
git clone https://github.com/tianocore/edk2.git
cd edk2
git submodule init
git submodule update -recursive
OvmfPkg/build.sh -a X64 -n 64

Error log:
...
/home/build/kvm_build/nightly/kvm_qemu/kvm-next-20190813010558-a738b5e7-5e7bcdcf/edk2/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c:641:50:
 error: 'PageMapLevel5Entry' may be used uninitialized in this function 
[-Werror=maybe-uninitialized]
   PAGE_MAP_AND_DIRECTORY_POINTER*PageMapLevel5Entry;
  ^
cc1: all warnings being treated as errors
"objcopy"  
/home/build/kvm_build/nightly/kvm_qemu/kvm-next-20190813010558-a738b5e7-5e7bcdcf/edk2/Build/OvmfX64/DEBUG_GCC48/X64/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe/DEBUG/PciHostBridgeDxe.dll
"GenFw" -e UEFI_DRIVER -o 
/home/build/kvm_build/nightly/kvm_qemu/kvm-next-20190813010558-a738b5e7-5e7bcdcf/edk2/Build/OvmfX64/DEBUG_GCC48/X64/OvmfPkg/XenBusDxe/XenBusDxe/OUTPUT/XenBusDxe.efi
 
/home/build/kvm_build/nightly/kvm_qemu/kvm-next-20190813010558-a738b5e7-5e7bcdcf/edk2/Build/OvmfX64/DEBUG_GCC48/X64/OvmfPkg/XenBusDxe/XenBusDxe/DEBUG/XenBusDxe.dll
make: *** 
[/home/build/kvm_build/nightly/kvm_qemu/kvm-next-20190813010558-a738b5e7-5e7bcdcf/edk2/Build/OvmfX64/DEBUG_GCC48/X64/MdeModulePkg/Core/DxeIplPeim/DxeIpl/OUTPUT/X64/VirtualMemory.obj]
 Error 1
cp -f 
/home/build/kvm_build/nightly/kvm_qemu/kvm-next-20190813010558-a738b5e7-5e7bcdcf/edk2/Build/OvmfX64/DEBUG_GCC48/X64/OvmfPkg/XenBusDxe/XenBusDxe/OUTPUT/XenBusDxe.efi
 
/home/build/kvm_build/nightly/kvm_qemu/kvm-next-20190813010558-a738b5e7-5e7bcdcf/edk2/Build/OvmfX64/DEBUG_GCC48/X64/OvmfPkg/XenBusDxe/XenBusDxe/DEBUG


build.py...
: error 7000: Failed to execute command
make tbuild 
[/home/build/kvm_build/nightly/kvm_qemu/kvm-next-20190813010558-a738b5e7-5e7bcdcf/edk2/Build/OvmfX64/DEBUG_GCC48/X64/MdeModulePkg/Core/DxeIplPeim/DxeIpl]




build.py...
: error F002: Failed to build module

/home/build/kvm_build/nightly/kvm_qemu/kvm-next-20190813010558-a738b5e7-5e7bcdcf/edk2/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
 [X64, GCC48, DEBUG]

- Failed -
Build end time: 08:46:33, Aug.13 2019
Build total time: 00:01:15

GCC:
gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Thanks,
Fan


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

View/Reply Online (#45471): https://edk2.groups.io/g/devel/message/45471
Mute This Topic: https://groups.io/mt/32848232/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v6 1/1] Platform: Intel: Add Stratix 10 platform support

2019-08-12 Thread Loh, Tien Hock
Hi Leif,

I'll update it and send another patch on top of the previously reviewed patch.

Thanks! 

> -Original Message-
> From: Leif Lindholm 
> Sent: Friday, August 9, 2019 6:16 PM
> To: Loh, Tien Hock 
> Cc: Kinney, Michael D ; devel@edk2.groups.io;
> thlo...@gmail.com; Ard Biesheuvel 
> Subject: Re: [PATCH v6 1/1] Platform: Intel: Add Stratix 10 platform support
> 
> Hi Tien Hock,
> 
> Given Mike's review, could you roll a v7 with all of the incorporated feedback
> from Mike based on this (instead of submitting the v6 updates as a separate
> patch, which I previously requested)?
> 
> Could you also roll in the following in that patch?:
> diff --git a/Maintainers.txt b/Maintainers.txt index
> 876ae5612ad8..47d58ffa0b2c 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -98,6 +98,11 @@ M: Shifei A Lu 
>  M: Xiaohu Zhou 
>  M: Isaac W Oram 
> 
> +Platform/Intel/Stratix10SocPkg
> +M: Leif Lindholm 
> +M: Michael D Kinney 
> +R: Tien Hock Loh 
> +
>  Platform/Intel/Tools
>  M: Bob Feng 
>  M: Liming Gao 
> 
> Best Regards,
> 
> Leif
> 
> On Fri, Aug 09, 2019 at 02:17:42AM +, Loh, Tien Hock wrote:
> > > -Original Message-
> > > From: Kinney, Michael D
> > > Sent: Friday, August 9, 2019 3:50 AM
> > > To: Leif Lindholm ; Loh, Tien Hock
> > > ; Kinney, Michael D
> > > 
> > > Cc: devel@edk2.groups.io; thlo...@gmail.com; Ard Biesheuvel
> > > 
> > > Subject: RE: [PATCH v6 1/1] Platform: Intel: Add Stratix 10 platform
> > > support
> > >
> > > Tien Hock,
> > >
> > > I have a few comments:
> > >
> > > 1) Recommend change name of directory
> > >
> > > Platform/Intel/Startix10 -> Platform/Intel/Startix10SocPkg.
> > OK will do that.
> >
> > >
> > > 2) S10ClockManager.c is missing file header with license and
> > > copyright
> > > 3) S10ClockManager.h is missing file header with license and
> > > copyright
> > Yeah, I'll submit a fix to that
> >
> > > 4) PlatformHookLib.inf uses '..' to access sources in a different 
> > > directory.
> > >'..' should never be used in an INF.  This INF also lists many
> > >PCDs that are not used by PlatformHookLib.c
> > OK I'll remove the dependencies.
> >
> > > 5) PlatformHookLib.c also uses '..' in an include that should not
> > >be used.
> > > 6) Can the following files be updated to a BSD+Patent license and
> > >use an SPDX identifier?
> > >
> > >  IntelPlatformDxe.inf
> > >  IntelPlatformDxe.c
> > >
> > >  IntelPlatformLib.inf
> > >  Stratix10PlatformLib.c
> > >  Startix10Mmu.c
> > >  ArmPlatformHelper.S
> > >
> > OK. Noted, I missed changing these license headers.
> >
> > > If S10ClockManager is only used by the PlatformHookLib, then I
> > > recommend you move the S10ClockManager sources into the
> > > PlatformHookLib directory or a subdirectory below PlatformHookLib.
> > >
> > The S10ClockManager is also being used by
> Drivers/IntelPlatformDxe/IntelPlatformDxe.c, so I'm wondering what's the
> best approach to this?
> >
> > > Thanks,
> > >
> > > Mike

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

View/Reply Online (#45470): https://edk2.groups.io/g/devel/message/45470
Mute This Topic: https://groups.io/mt/32677389/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v2 0/3] Fix warning message issues

2019-08-12 Thread Zhang, Shenglei
Jaben:

I add the v2 message below "---". And here is the link for v2 patch.
https://edk2.groups.io/g/devel/message/45398?p=,,,20,0,0,0::Created,,MdeModulePkg%3A+Add+missing+header+files+in+INF+files,20,2,0,32838103

Thanks,
Shenglei

> -Original Message-
> From: Carsey, Jaben
> Sent: Monday, August 12, 2019 10:49 PM
> To: Zhang, Shenglei ; devel@edk2.groups.io
> Cc: Wang, Jian J ; Wu, Hao A ;
> Ni, Ray ; Gao, Zhichao ; Chiu,
> Chasel ; Desimone, Nathaniel L
> ; Zeng, Star 
> Subject: RE: [PATCH v2 0/3] Fix warning message issues
> 
>  What changed in v2?
> 
> Thanks
> -Jaben
> 
> 
> > -Original Message-
> > From: Zhang, Shenglei
> > Sent: Sunday, August 11, 2019 11:23 PM
> > To: devel@edk2.groups.io
> > Cc: Wang, Jian J ; Wu, Hao A
> > ; Carsey, Jaben ; Ni, Ray
> > ; Gao, Zhichao ; Chiu, Chasel
> > ; Desimone, Nathaniel L
> > ; Zeng, Star 
> > Subject: [PATCH v2 0/3] Fix warning message issues
> >
> > There are some header files used but not included in INF
> > files. This causes warings are generated when building the
> > packages. So now add them into INF files.
> > https://bugzilla.tianocore.org/show_bug.cgi?id=2036
> >
> > Cc: Jian J Wang 
> > Cc: Hao A Wu 
> > Cc: Jaben Carsey 
> > Cc: Ray Ni 
> > Cc: Zhichao Gao 
> > Cc: Chasel Chiu 
> > Cc: Nate DeSimone 
> > Cc: Star Zeng 
> > Shenglei Zhang (3):
> >   MdeModulePkg: Add missing header files in INF files
> >   ShellPkg/UefiShellAcpiViewCommandLib: Add missing header files in INF
> >   IntelFsp2Pkg/FspSecCore: Add missing header file in INF file
> >
> >  IntelFsp2Pkg/FspSecCore/FspSecCoreS.inf  | 3 ++-
> >  MdeModulePkg/Universal/CapsulePei/CapsulePei.inf | 3 ++-
> >  MdeModulePkg/Universal/CapsulePei/CapsuleX64.inf | 1 +
> >  MdeModulePkg/Universal/EbcDxe/EbcDebuggerConfig.inf  | 9
> -
> >  .../UefiShellAcpiViewCommandLib.inf  | 2 ++
> >  5 files changed, 15 insertions(+), 3 deletions(-)
> >
> > --
> > 2.18.0.windows.1


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

View/Reply Online (#45469): https://edk2.groups.io/g/devel/message/45469
Mute This Topic: https://groups.io/mt/32838102/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [Patch] MdeModulePkg DxeCore: Fix for missing MAT update

2019-08-12 Thread Michael D Kinney


> -Original Message-
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io]
> On Behalf Of Laszlo Ersek
> Sent: Monday, August 12, 2019 9:24 AM
> To: devel@edk2.groups.io; Gao, Liming
> 
> Cc: Mike Turner ; Wang, Jian J
> ; Wu, Hao A ;
> Bi, Dandan 
> Subject: Re: [edk2-devel] [Patch] MdeModulePkg DxeCore:
> Fix for missing MAT update
> 
> On 08/10/19 16:10, Liming Gao wrote:
> > From: Mike Turner 
> >
> > The Fpdt driver (FirmwarePerformanceDxe) saves a memory
> address across
> > reboots, and then does an AllocatePage for that memory
> address.
> > If, on this boot, that memory comes from a Runtime
> memory bucket, the
> > MAT table is not updated. This causes Windows to boot
> into Recovery.
> 
> (1) What is "MAT"?

Memory Attributes Table (EFI_MEMORY_ATTRIBUTES_TABLE)

> 
> > This patch blocks the memory manager from changing the
> page from a
> > special bucket to a different memory type.  Once the
> buckets are
> > allocated, we freeze the memory ranges for the OS, and
> fragmenting the
> > special buckets will cause errors resuming from
> hibernate.
> 
> (2) My understanding is that CoreConvertPages() will only
> hand out the requested pages if those pages are currently
> free. I suggest clarifying the commit message that the
> intent is to prevent the allocation of otherwise *free*
> pages, if the allocation would fragment special buckets.
> 
> (3) I don't understand the conjunction "and". I would
> understand if the statement were:
> 
> Once the buckets are allocated, we freeze the memory
> ranges for the
> OS, *because* fragmenting the special buckets *would*
> cause errors
> resuming from hibernate.
> 
> Is this the intent?
> 
> >
> > This patch is cherry pick from Project Mu:
> >
> https://github.com/microsoft/mu_basecore/commit/a9be767d9
> be96af94016eb
> > d391ea6f340920735a
> > With the minor change,
> > 1. Update commit message format to keep the message in
> 80 characters one line.
> > 2. Remove // MU_CHANGE comments in source code.
> >
> > Cc: Jian J Wang 
> > Cc: Hao A Wu 
> > Cc: Dandan Bi 
> > Signed-off-by: Liming Gao 
> > ---
> >  MdeModulePkg/Core/Dxe/Mem/Page.c | 43
> > ++--
> >  1 file changed, 37 insertions(+), 6 deletions(-)
> >
> > diff --git a/MdeModulePkg/Core/Dxe/Mem/Page.c
> > b/MdeModulePkg/Core/Dxe/Mem/Page.c
> > index bd9e116aa5..637518889d 100644
> > --- a/MdeModulePkg/Core/Dxe/Mem/Page.c
> > +++ b/MdeModulePkg/Core/Dxe/Mem/Page.c
> > @@ -1265,12 +1265,13 @@ CoreInternalAllocatePages (
> >IN BOOLEANNeedGuard
> >)
> >  {
> > -  EFI_STATUS  Status;
> > -  UINT64  Start;
> > -  UINT64  NumberOfBytes;
> > -  UINT64  End;
> > -  UINT64  MaxAddress;
> > -  UINTN   Alignment;
> > +  EFI_STATUS   Status;
> > +  UINT64   Start;
> > +  UINT64   NumberOfBytes;
> > +  UINT64   End;
> > +  UINT64   MaxAddress;
> > +  UINTNAlignment;
> > +  EFI_MEMORY_TYPE  CheckType;
> >
> >if ((UINT32)Type >= MaxAllocateType) {
> >  return EFI_INVALID_PARAMETER;
> > @@ -1321,6 +1322,7 @@ CoreInternalAllocatePages (
> >// if (Start + NumberOfBytes) rolls over 0 or
> >// if Start is above MAX_ALLOC_ADDRESS or
> >// if End is above MAX_ALLOC_ADDRESS,
> > +  // if Start..End overlaps any tracked
> MemoryTypeStatistics range
> >// return EFI_NOT_FOUND.
> >//
> >if (Type == AllocateAddress) {
> > @@ -1336,6 +1338,35 @@ CoreInternalAllocatePages (
> >  (End > MaxAddress)) {
> >return EFI_NOT_FOUND;
> >  }
> > +
> > +// Problem summary
> > +
> > +/*
> > +A driver is allowed to call AllocatePages using an
> AllocateAddress type.  This type of
> > +AllocatePage request the exact physical address if
> it is not used.  The existing code
> > +will allow this request even in 'special' pages.
> The problem with this is that the
> > +reason to have 'special' pages for OS
> hibernate/resume is defeated as memory is
> > +fragmented.
> > +*/
> 
> (4) This comment style is not native to edk2.
> 
> I think the "problem summary" line should be removed, and
> the actual problem statement should use the following
> comment style:
> 
>   //
>   // blah
>   //
> 
> 
> > +
> > +for (CheckType = (EFI_MEMORY_TYPE) 0; CheckType <
> EfiMaxMemoryType; CheckType++) {
> > +  if (MemoryType != CheckType &&
> > +  mMemoryTypeStatistics[CheckType].Special &&
> > +
> mMemoryTypeStatistics[CheckType].NumberOfPages > 0) {
> > +if (Start >=
> mMemoryTypeStatistics[CheckType].BaseAddress &&
> > +Start <=
> mMemoryTypeStatistics[CheckType].MaximumAddress) {
> > +  return EFI_NOT_FOUND;
> > +}
> > +if (End >=
> mMemoryTypeStatistics[CheckType].BaseAddress &&
> > +End <=
> mMemoryTypeStatistics[CheckType].MaximumAddress) {
> > +  return EFI_NOT_FOUND;
> > +}
> > +if (Start <
> 

Re: [edk2-devel] [PATCH] MdePkg: Add STATIC_ASSERT macro

2019-08-12 Thread Michael D Kinney
Hi Vitaly,

Thanks for the contribution.  I see you are using _MSC_VER.  
The rest of Base.h uses _MSC_EXTENSIONs and only if that is
defined is _MSC_VER used and _MSC_VER is only used if a specific
version value check is required.  What version of VS introduced
this feature?  We can define this macro to nothing of the
version is too small.  Also, is the mapping for both GCC and
XCODE5 the same?

For the next version of this patch, can you use the ‘git send-email’
feature instead of attaching a patch file?  A couple useful links:

https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Development-Process

https://github.com/tianocore/tianocore.github.io/wiki/Laszlo's-unkempt-git-guide-for-edk2-contributors-and-maintainers

Thanks,

Mike



From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of via 
Groups.Io
Sent: Monday, August 12, 2019 3:06 AM
To: devel@edk2.groups.io
Subject: [edk2-devel] [PATCH] MdePkg: Add STATIC_ASSERT macro

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

Best regards,
Vitaly Cheptsov


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

View/Reply Online (#45467): https://edk2.groups.io/g/devel/message/45467
Mute This Topic: https://groups.io/mt/32841448/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] static data in dxe_runtime modules

2019-08-12 Thread Roman Kagan
On Fri, Aug 09, 2019 at 04:07:00PM +, Roman Kagan via Groups.Io wrote:
> On Thu, Aug 08, 2019 at 07:39:14PM +0200, Laszlo Ersek wrote:
> > On 08/07/19 19:41, Andrew Fish wrote:
> > >> On Aug 7, 2019, at 10:29 AM, Laszlo Ersek  wrote:
> > >> On 08/05/19 12:18, Roman Kagan wrote:
> > >>> On Sat, Aug 03, 2019 at 04:03:04AM +0200, Laszlo Ersek via Groups.Io 
> > >>> wrote:
> >  On 08/01/19 21:16, Roman Kagan wrote:
> > >> I'm convinced that OpenSSL needs to expose a new API for this particular
> > >> problem.
> 
> Since, as you point out below, the problem only affects the essentially
> broken configuration (SECURE_BOOT_ENABLE && !SMM_REQUIRE), I'm fine with
> saving time and effort and sticking to the hack-ish approach proposed in
> the bugzilla issue, which is to iterate over "thread-local" pointers and
> EfiConvertPointer() on each.  (As long as it fixes the problem of
> course; I'll test and report back.)

It doesn't :(  It just gets slightly further and hits another static
pointer variable which is not part of the thread-local array:

...
  Pkcs7Verify
EVP_add_digest
  OBJ_NAME_add

this one uses a few static pointer variables that are also initialized
on demand and become stale upon SetVirtualAddressMap().

> So we should be good without a new API from OpenSSL.

> > In other words, the problem doesn't exist when OpenSSL (with the rest of
> > the variable driver stack) is protected with SMM, as pointers into SMRAM
> > remain valid "forever", after the initial SMM driver dispatch.
> 
> Makes perfect sense.  We happen to build this broken configuration for
> some historical reasons, I'm failing to recall exactly which.  Will try
> to get rid of it.

We appear to have some i440fx-based VMs with SecureBoot in the field
(dunno about their origin) and those don't allow SMM.

Thanks,
Roman.

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

View/Reply Online (#45466): https://edk2.groups.io/g/devel/message/45466
Mute This Topic: https://groups.io/mt/32686575/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v1 1/1] ShellPkg/UefiShellBcfgCommandLib: Fix '-opt' option

2019-08-12 Thread Jonathan Watt
I see this landed last week. Many thanks to everyone for their input and for
getting this landed.

Jonathan

On 05/08/2019 01:51, Gao, Zhichao wrote:
> Agree. I would prepare this patch for push.
> 
> Thanks,
> Zhichao
> 
>> -Original Message-
>> From: Carsey, Jaben
>> Sent: Saturday, August 3, 2019 5:24 AM
>> To: devel@edk2.groups.io; jw...@jwatt.org
>> Cc: tim.le...@insyde.com; Gao, Zhichao ; Ni, Ray
>> ; Bi, Dandan ; Rothman, Michael
>> A 
>> Subject: RE: [edk2-devel] [PATCH v1 1/1] ShellPkg/UefiShellBcfgCommandLib:
>> Fix '-opt' option
>>
>> I think we can push this in now.
>>
>> Zhichao,
>> Do you agree? If yes, can you prep this for merging?
>>
>> Thanks
>> -Jaben
>>

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

View/Reply Online (#45465): https://edk2.groups.io/g/devel/message/45465
Mute This Topic: https://groups.io/mt/31520134/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [Patch] MdeModulePkg DxeCore: Fix for missing MAT update

2019-08-12 Thread Laszlo Ersek
On 08/10/19 16:10, Liming Gao wrote:
> From: Mike Turner 
> 
> The Fpdt driver (FirmwarePerformanceDxe) saves a memory address across
> reboots, and then does an AllocatePage for that memory address.
> If, on this boot, that memory comes from a Runtime memory bucket,
> the MAT table is not updated. This causes Windows to boot into Recovery.

(1) What is "MAT"?

> This patch blocks the memory manager from changing the page
> from a special bucket to a different memory type.  Once the buckets are
> allocated, we freeze the memory ranges for the OS, and fragmenting
> the special buckets will cause errors resuming from hibernate.

(2) My understanding is that CoreConvertPages() will only hand out the
requested pages if those pages are currently free. I suggest clarifying
the commit message that the intent is to prevent the allocation of
otherwise *free* pages, if the allocation would fragment special buckets.

(3) I don't understand the conjunction "and". I would understand if the
statement were:

Once the buckets are allocated, we freeze the memory ranges for the
OS, *because* fragmenting the special buckets *would* cause errors
resuming from hibernate.

Is this the intent?

> 
> This patch is cherry pick from Project Mu:
> https://github.com/microsoft/mu_basecore/commit/a9be767d9be96af94016ebd391ea6f340920735a
> With the minor change,
> 1. Update commit message format to keep the message in 80 characters one line.
> 2. Remove // MU_CHANGE comments in source code.
> 
> Cc: Jian J Wang 
> Cc: Hao A Wu 
> Cc: Dandan Bi 
> Signed-off-by: Liming Gao 
> ---
>  MdeModulePkg/Core/Dxe/Mem/Page.c | 43 
> ++--
>  1 file changed, 37 insertions(+), 6 deletions(-)
> 
> diff --git a/MdeModulePkg/Core/Dxe/Mem/Page.c 
> b/MdeModulePkg/Core/Dxe/Mem/Page.c
> index bd9e116aa5..637518889d 100644
> --- a/MdeModulePkg/Core/Dxe/Mem/Page.c
> +++ b/MdeModulePkg/Core/Dxe/Mem/Page.c
> @@ -1265,12 +1265,13 @@ CoreInternalAllocatePages (
>IN BOOLEANNeedGuard
>)
>  {
> -  EFI_STATUS  Status;
> -  UINT64  Start;
> -  UINT64  NumberOfBytes;
> -  UINT64  End;
> -  UINT64  MaxAddress;
> -  UINTN   Alignment;
> +  EFI_STATUS   Status;
> +  UINT64   Start;
> +  UINT64   NumberOfBytes;
> +  UINT64   End;
> +  UINT64   MaxAddress;
> +  UINTNAlignment;
> +  EFI_MEMORY_TYPE  CheckType;
>  
>if ((UINT32)Type >= MaxAllocateType) {
>  return EFI_INVALID_PARAMETER;
> @@ -1321,6 +1322,7 @@ CoreInternalAllocatePages (
>// if (Start + NumberOfBytes) rolls over 0 or
>// if Start is above MAX_ALLOC_ADDRESS or
>// if End is above MAX_ALLOC_ADDRESS,
> +  // if Start..End overlaps any tracked MemoryTypeStatistics range
>// return EFI_NOT_FOUND.
>//
>if (Type == AllocateAddress) {
> @@ -1336,6 +1338,35 @@ CoreInternalAllocatePages (
>  (End > MaxAddress)) {
>return EFI_NOT_FOUND;
>  }
> +
> +// Problem summary
> +
> +/*
> +A driver is allowed to call AllocatePages using an AllocateAddress type. 
>  This type of
> +AllocatePage request the exact physical address if it is not used.  The 
> existing code
> +will allow this request even in 'special' pages.  The problem with this 
> is that the
> +reason to have 'special' pages for OS hibernate/resume is defeated as 
> memory is
> +fragmented.
> +*/

(4) This comment style is not native to edk2.

I think the "problem summary" line should be removed, and the actual
problem statement should use the following comment style:

  //
  // blah
  //


> +
> +for (CheckType = (EFI_MEMORY_TYPE) 0; CheckType < EfiMaxMemoryType; 
> CheckType++) {
> +  if (MemoryType != CheckType &&
> +  mMemoryTypeStatistics[CheckType].Special &&
> +  mMemoryTypeStatistics[CheckType].NumberOfPages > 0) {
> +if (Start >= mMemoryTypeStatistics[CheckType].BaseAddress &&
> +Start <= mMemoryTypeStatistics[CheckType].MaximumAddress) {
> +  return EFI_NOT_FOUND;
> +}
> +if (End >= mMemoryTypeStatistics[CheckType].BaseAddress &&
> +End <= mMemoryTypeStatistics[CheckType].MaximumAddress) {
> +  return EFI_NOT_FOUND;
> +}
> +if (Start < mMemoryTypeStatistics[CheckType].BaseAddress &&
> +End   > mMemoryTypeStatistics[CheckType].MaximumAddress) {
> +  return EFI_NOT_FOUND;
> +}
> +  }
> +}
>}

(5) Checking for overlap (i.e., whether the intersection is non-empty)
can be done more simply (i.e., with fewer comparisons in the worst case,
and with less code):

  if (MAX (Start, mMemoryTypeStatistics[CheckType].BaseAddress) <=
  MIN (End, mMemoryTypeStatistics[CheckType].MaximumAddress)) {
return EFI_NOT_FOUND;
  }

but the proposed intersection check is technically right already, IMO,
so there's no strong need to update it.

(Somewhat unusually for this kind of 

Re: [edk2-devel] [edk2-platforms] [PATCH] Platform/Intel: Update Readme.md to point to edk2-non-osi master branch

2019-08-12 Thread Kubacki, Michael A
I also support moving the MinPlatform platforms to a dedicated directory.

Leif, please let me know if I can be of any help to prepare the RFC.

Thanks,
Michael

> -Original Message-
> From: Desimone, Nathaniel L
> Sent: Sunday, August 11, 2019 4:53 PM
> To: Leif Lindholm 
> Cc: devel@edk2.groups.io; Andrew Fish ; Laszlo Ersek
> ; Kinney, Michael D ;
> Kubacki, Michael A ; Sinha, Ankit
> ; Chiu, Chasel 
> Subject: RE: [edk2-platforms] [PATCH] Platform/Intel: Update Readme.md to
> point to edk2-non-osi master branch
> 
> Hi Leif,
> 
> > I am well aware that there are platform-specific steps required to
> > achieve the final firmware image for some systems. But we need to work
> > to address that. There have been discussions about implementing support for
> hooking pre/post-build python scripts into the .dsc format - has there been 
> any
> progress on that?
> 
> I'm not sure. Liming would know more on that than I. For now, our
> MinPlatform... platforms are using the build_bios.py script written by Prince 
> as
> a substitute.
> 
> > For this patch, I would prefer if instead of adding these notes we
> > changed the ## [Intel](Platform/Intel/Readme.md) ### Minimum Platforms
> 
> Done. Please see patch V2.
> 
> > Arguably, it would make sense to move all of the MinPlatform ...
> > platforms ... and the Readme.md to a separate subdirectory and link to
> > that directory. Not everything under Platform/Intel is a MinPlatform 
> > platform
> - soon there'll even be an ARM one.
> 
> I totally agree with you that would make more sense. Could you perhaps send
> an RFC and then we can start the reorganization process?
> 
> Thanks,
> Nate

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

View/Reply Online (#45463): https://edk2.groups.io/g/devel/message/45463
Mute This Topic: https://groups.io/mt/32803353/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [edk2-platforms] [PATCH v2] Platform/Intel: Update Readme.md to point to edk2-non-osi master branch

2019-08-12 Thread Kubacki, Michael A
Reviewed-by: Michael Kubacki 

> -Original Message-
> From: Desimone, Nathaniel L
> Sent: Sunday, August 11, 2019 4:45 PM
> To: devel@edk2.groups.io
> Cc: Andrew Fish ; Laszlo Ersek ; Leif
> Lindholm ; Kinney, Michael D
> ; Kubacki, Michael A
> ; Sinha, Ankit ; Chiu,
> Chasel 
> Subject: [edk2-platforms] [PATCH v2] Platform/Intel: Update Readme.md to
> point to edk2-non-osi master branch
> 
> Updated Platform/Intel/Readme.md to point to master branch on edk2-non-osi
> instead of devel-MinPlatform
> 
> Updated edk2-platforms/Readme.md to point to Platform/Intel/Readme.md for
> build instructions on Intel based Minimum Platforms
> 
> Added a link to the EDK II Minimum Platform Draft Specification to
> Platform/Intel/Readme.md
> 
> Cc: Andrew Fish 
> Cc: Laszlo Ersek 
> Cc: Leif Lindholm 
> Cc: Michael D Kinney 
> Cc: Michael Kubacki 
> Cc: Ankit Sinha 
> Cc: Chasel Chiu 
> Signed-off-by: Nate DeSimone 
> ---
>  Platform/Intel/Readme.md | 6 --
>  Readme.md| 4 ++--
>  2 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/Platform/Intel/Readme.md b/Platform/Intel/Readme.md index
> 0a0e8a8c80..00f42985a2 100644
> --- a/Platform/Intel/Readme.md
> +++ b/Platform/Intel/Readme.md
> @@ -1,7 +1,9 @@
>  # **EDK II Minimum Platform Firmware for Intel(R) Platforms**
> 
>  The Minimum Platform is a software architecture that guides uniform delivery
> of Intel platforms enabling firmware -solutions for basic boot functionality 
> with
> extensibility built-in.
> +solutions for basic boot functionality with extensibility built-in.
> +Please see the [EDK II Minimum Platform Draft
> +Specification](https://edk2-docs.gitbooks.io/edk-ii-minimum-platform-sp
> +ecification/)
> +for more details.
> 
>  Package maintainers for the Minimum Platform projects are listed in
> Maintainers.txt.
> 
> @@ -98,7 +100,7 @@ return back to the minimum platform caller.
>* ``git clone https://github.com/tianocore/edk2-platforms.git``
> 
>  * edk2-non-osi repository
> -  * ``git clone https://github.com/tianocore/edk2-non-osi.git -b devel-
> MinPlatform``
> +  * ``git clone https://github.com/tianocore/edk2-non-osi.git``
> 
>  * FSP repository
>* ``git clone https://github.com/IntelFsp/FSP.git``
> diff --git a/Readme.md b/Readme.md
> index 63e59f60b4..1befd0b544 100644
> --- a/Readme.md
> +++ b/Readme.md
> @@ -223,8 +223,8 @@ they will be documented with the platform.
>  * [D05](Platform/Hisilicon/D05)
>  * [HiKey](Platform/Hisilicon/HiKey)
> 
> -## [Intel](Platform/Intel/Readme.md)
> -### Minimum Platforms
> +## Intel
> +### [Minimum Platforms](Platform/Intel/Readme.md)
>  * [Clevo](Platform/Intel/ClevoOpenBoardPkg)
>  * [Kaby Lake](Platform/Intel/KabylakeOpenBoardPkg)
>  * [Purley](Platform/Intel/PurleyOpenBoardPkg)
> --
> 2.17.1.windows.2


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

View/Reply Online (#45462): https://edk2.groups.io/g/devel/message/45462
Mute This Topic: https://groups.io/mt/32835408/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [Patch V3] BaseTools: Fix checking for Sources section in INF file

2019-08-12 Thread Liming Gao
Tested-by: Liming Gao 

> -Original Message-
> From: Rodriguez, Christian
> Sent: Monday, August 12, 2019 11:32 PM
> To: devel@edk2.groups.io
> Cc: Feng, Bob C ; Gao, Liming 
> Subject: [Patch V3] BaseTools: Fix checking for Sources section in INF file
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1804
> 
> The check to see if [Sources] section lists all the header type
> files of a module is missing the exclusion of source files that
> fall under the scope of Package includes. This change adds the
> exclusions.
> 
> Signed-off-by: Christian Rodriguez 
> Cc: Bob Feng 
> Cc: Liming Gao 
> ---
>  BaseTools/Source/Python/AutoGen/GenMake.py   | 25 
> ++---
>  BaseTools/Source/Python/AutoGen/ModuleAutoGen.py | 15 +++
>  2 files changed, 37 insertions(+), 3 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py 
> b/BaseTools/Source/Python/AutoGen/GenMake.py
> index 5802ae5ae4..499ef82aea 100644
> --- a/BaseTools/Source/Python/AutoGen/GenMake.py
> +++ b/BaseTools/Source/Python/AutoGen/GenMake.py
> @@ -906,8 +906,14 @@ cleanlib:
>  self._AutoGenObject.IncludePathList + 
> self._AutoGenObject.BuildOptionIncPathList
> 
>  )
> 
> 
> 
> +# Get a set of unique package includes from MetaFile
> 
> +parentMetaFileIncludes = set()
> 
> +for aInclude in self._AutoGenObject.PackageIncludePathList:
> 
> +aIncludeName = str(aInclude)
> 
> +parentMetaFileIncludes.add(aIncludeName.lower())
> 
> +
> 
>  # Check if header files are listed in metafile
> 
> -# Get a list of unique module header source files from MetaFile
> 
> +# Get a set of unique module header source files from MetaFile
> 
>  headerFilesInMetaFileSet = set()
> 
>  for aFile in self._AutoGenObject.SourceFileList:
> 
>  aFileName = str(aFile)
> 
> @@ -915,24 +921,37 @@ cleanlib:
>  continue
> 
>  headerFilesInMetaFileSet.add(aFileName.lower())
> 
> 
> 
> -# Get a list of unique module autogen files
> 
> +# Get a set of unique module autogen files
> 
>  localAutoGenFileSet = set()
> 
>  for aFile in self._AutoGenObject.AutoGenFileList:
> 
>  localAutoGenFileSet.add(str(aFile).lower())
> 
> 
> 
> -# Get a list of unique module dependency header files
> 
> +# Get a set of unique module dependency header files
> 
>  # Exclude autogen files and files not in the source directory
> 
> +# and files that are under the package include list
> 
>  headerFileDependencySet = set()
> 
>  localSourceDir = str(self._AutoGenObject.SourceDir).lower()
> 
>  for Dependency in FileDependencyDict.values():
> 
>  for aFile in Dependency:
> 
>  aFileName = str(aFile).lower()
> 
> +# Exclude non-header files
> 
>  if not aFileName.endswith('.h'):
> 
>  continue
> 
> +# Exclude autogen files
> 
>  if aFileName in localAutoGenFileSet:
> 
>  continue
> 
> +# Exclude include out of local scope
> 
>  if localSourceDir not in aFileName:
> 
>  continue
> 
> +# Exclude files covered by package includes
> 
> +pathNeeded = True
> 
> +for aIncludePath in parentMetaFileIncludes:
> 
> +if aIncludePath in aFileName:
> 
> +pathNeeded = False
> 
> +break
> 
> +if not pathNeeded:
> 
> +continue
> 
> +# Keep the file to be checked
> 
>  headerFileDependencySet.add(aFileName)
> 
> 
> 
>  # Ensure that gModuleBuildTracking has been initialized per 
> architecture
> 
> diff --git a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py 
> b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
> index ed6822334e..aaea8767ef 100644
> --- a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
> +++ b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
> @@ -1114,6 +1114,21 @@ class ModuleAutoGen(AutoGen):
>  def IncludePathLength(self):
> 
>  return sum(len(inc)+1 for inc in self.IncludePathList)
> 
> 
> 
> +## Get the list of include paths from the packages
> 
> +#
> 
> +#   @IncludesList list The list path
> 
> +#
> 
> +@cached_property
> 
> +def PackageIncludePathList(self):
> 
> +IncludesList = []
> 
> +for Package in self.Module.Packages:
> 
> +PackageDir = mws.join(self.WorkspaceDir, Package.MetaFile.Dir)
> 
> +IncludesList = Package.Includes
> 
> +if Package._PrivateIncludes:
> 
> +if not self.MetaFile.Path.startswith(PackageDir):
> 
> +IncludesList = 

[edk2-devel] [Patch V3] BaseTools: Fix checking for Sources section in INF file

2019-08-12 Thread Christian Rodriguez
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1804

The check to see if [Sources] section lists all the header type
files of a module is missing the exclusion of source files that
fall under the scope of Package includes. This change adds the
exclusions.

Signed-off-by: Christian Rodriguez 
Cc: Bob Feng 
Cc: Liming Gao 
---
 BaseTools/Source/Python/AutoGen/GenMake.py   | 25 ++---
 BaseTools/Source/Python/AutoGen/ModuleAutoGen.py | 15 +++
 2 files changed, 37 insertions(+), 3 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py 
b/BaseTools/Source/Python/AutoGen/GenMake.py
index 5802ae5ae4..499ef82aea 100644
--- a/BaseTools/Source/Python/AutoGen/GenMake.py
+++ b/BaseTools/Source/Python/AutoGen/GenMake.py
@@ -906,8 +906,14 @@ cleanlib:
 self._AutoGenObject.IncludePathList + 
self._AutoGenObject.BuildOptionIncPathList
 )
 
+# Get a set of unique package includes from MetaFile
+parentMetaFileIncludes = set()
+for aInclude in self._AutoGenObject.PackageIncludePathList:
+aIncludeName = str(aInclude)
+parentMetaFileIncludes.add(aIncludeName.lower())
+
 # Check if header files are listed in metafile
-# Get a list of unique module header source files from MetaFile
+# Get a set of unique module header source files from MetaFile
 headerFilesInMetaFileSet = set()
 for aFile in self._AutoGenObject.SourceFileList:
 aFileName = str(aFile)
@@ -915,24 +921,37 @@ cleanlib:
 continue
 headerFilesInMetaFileSet.add(aFileName.lower())
 
-# Get a list of unique module autogen files
+# Get a set of unique module autogen files
 localAutoGenFileSet = set()
 for aFile in self._AutoGenObject.AutoGenFileList:
 localAutoGenFileSet.add(str(aFile).lower())
 
-# Get a list of unique module dependency header files
+# Get a set of unique module dependency header files
 # Exclude autogen files and files not in the source directory
+# and files that are under the package include list
 headerFileDependencySet = set()
 localSourceDir = str(self._AutoGenObject.SourceDir).lower()
 for Dependency in FileDependencyDict.values():
 for aFile in Dependency:
 aFileName = str(aFile).lower()
+# Exclude non-header files
 if not aFileName.endswith('.h'):
 continue
+# Exclude autogen files
 if aFileName in localAutoGenFileSet:
 continue
+# Exclude include out of local scope
 if localSourceDir not in aFileName:
 continue
+# Exclude files covered by package includes
+pathNeeded = True
+for aIncludePath in parentMetaFileIncludes:
+if aIncludePath in aFileName:
+pathNeeded = False
+break
+if not pathNeeded:
+continue
+# Keep the file to be checked
 headerFileDependencySet.add(aFileName)
 
 # Ensure that gModuleBuildTracking has been initialized per 
architecture
diff --git a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py 
b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
index ed6822334e..aaea8767ef 100644
--- a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
@@ -1114,6 +1114,21 @@ class ModuleAutoGen(AutoGen):
 def IncludePathLength(self):
 return sum(len(inc)+1 for inc in self.IncludePathList)
 
+## Get the list of include paths from the packages
+#
+#   @IncludesList list The list path
+#
+@cached_property
+def PackageIncludePathList(self):
+IncludesList = []
+for Package in self.Module.Packages:
+PackageDir = mws.join(self.WorkspaceDir, Package.MetaFile.Dir)
+IncludesList = Package.Includes
+if Package._PrivateIncludes:
+if not self.MetaFile.Path.startswith(PackageDir):
+IncludesList = 
list(set(Package.Includes).difference(set(Package._PrivateIncludes)))
+return IncludesList
+
 ## Get HII EX PCDs which maybe used by VFR
 #
 #  efivarstore used by VFR may relate with HII EX PCDs
-- 
2.22.0.windows.1


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

View/Reply Online (#45460): https://edk2.groups.io/g/devel/message/45460
Mute This Topic: https://groups.io/mt/32841936/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v4 11/15] UefiPayloadPkg: Add ResetUtilityLib to UefiPayloadPkgIa32X64.dsc

2019-08-12 Thread Guo Dong


Reviewed-by: Dong, Guo 

Thanks,
Guo

> -Original Message-
> From: Gao, Zhichao
> Sent: Sunday, August 11, 2019 8:08 PM
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; Dong, Guo
> ; You, Benjamin ; Gao,
> Liming 
> Subject: [PATCH v4 11/15] UefiPayloadPkg: Add ResetUtilityLib to
> UefiPayloadPkgIa32X64.dsc
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772
> 
> ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
> So add it for the platform dsc file.
> 
> Cc: Maurice Ma 
> Cc: Guo Dong 
> Cc: Benjamin You 
> Cc: Liming Gao 
> Signed-off-by: Zhichao Gao 
> Reviewed-by: Maurice Ma 
> ---
>  UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> index 5b7994a62cda..ec6d5b71621e 100644
> --- a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> @@ -205,6 +205,8 @@ [LibraryClasses]
> 
> TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/Tp
> mMeasurementLibNull.inf
>VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
> 
> +  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
> +
>  [LibraryClasses.IA32.SEC]
>DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
>PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
> --
> 2.21.0.windows.1


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

View/Reply Online (#45459): https://edk2.groups.io/g/devel/message/45459
Mute This Topic: https://groups.io/mt/32836905/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH V2 00/10] Multiple Controllers Support solution

2019-08-12 Thread Eric Jin
Liming, 

Thank you for comment.
We will update GetLowestSupportedVersion() API function header to include 
Private param when we push the code to repo. Thanks.

Best Regards
Eric

-Original Message-
From: Gao, Liming 
Sent: Monday, August 12, 2019 5:24 PM
To: Jin, Eric ; devel@edk2.groups.io
Subject: RE: [edk2-devel] [PATCH V2 00/10] Multiple Controllers Support solution

That's good information. 

In patch 5, GetLowestSupportedVersion() API function header should be updated 
to include Private param. I have no other comments. 

With this change, Reviewed-by: Liming Gao 

///
@@ -193,7 +200,7 @@ GetImageTypeNameString (  **/
 UINT32
 GetLowestSupportedVersion (
-  VOID
+  FIRMWARE_MANAGEMENT_PRIVATE_DATA  *Private
   )

Thanks
Liming
>-Original Message-
>From: Jin, Eric
>Sent: Monday, August 12, 2019 3:14 PM
>To: Gao, Liming ; devel@edk2.groups.io
>Subject: RE: [edk2-devel] [PATCH V2 00/10] Multiple Controllers Support 
>solution
>
>Liming,
>
>The differences between V2 and V1 are listed below.
>
>1) The series is composed of 10 patches in V2 (14 in V1). patch 14 is 
>merged into patch 4, and patch 11/12/13 are merged into patch 5.
>2) Try to fix the issue exposed by ECC.
>
>Btw, the patch of edk2-platform
>Platform\Intel\Vlv2TbltDevicePkg\Feature\Capsule\Library\FmpDeviceLib 
>to support new APIs is provided in separated patch
>https://edk2.groups.io/g/devel/message/45328
>
>Best Regards
>Eric
>
>-Original Message-
>From: Gao, Liming
>Sent: Monday, August 12, 2019 1:19 PM
>To: devel@edk2.groups.io; Jin, Eric 
>Subject: RE: [edk2-devel] [PATCH V2 00/10] Multiple Controllers Support 
>solution
>
>Eric:
>  Can you list the difference compared to version 1?
>
>Thanks
>Liming
>>-Original Message-
>>From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of 
>>Eric Jin
>>Sent: Monday, August 12, 2019 9:46 AM
>>To: devel@edk2.groups.io
>>Subject: [edk2-devel] [PATCH V2 00/10] Multiple Controllers Support 
>>solution
>>
>>REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1525
>>
>>The patch set is to support drivers that manage multiple controllers 
>>and also provide a firmware update capability to each managed controller.
>>
>>The following modules are related to Multiple Controllers Support 
>>solution
>>
>>FmpDevicePkg\FmpDxe\FmpDxe.inf - Driver to manage multiple controllers 
>>and provide the firmware update capability to each managed controller.
>>FmpDevicePkg\CapsuleUpdatePolicyDxe\CapsuleUpdatePolicyDxe.inf -
>Driver
>>to produce the Capsule Update Policy Protocol using the services of 
>>the CapsuleUpdatePolicyLib class. The protocol is a private interface 
>>to the FmpDevicePkg 
>>FmpDevicePkg\Library\CapsuleUpdatePolicyLibOnProtocol\CapsuleUpdateP
>o
>>licyLibOnProtocol.inf -
>>CapsuleUpdatePolicyLib instance that uses the services of the Capsule 
>>Update Policy Protocol produced by CapsuleUpdatePolicyDxe 
>>FmpDevicePkg\Library\CapsuleUpdatePolicyLibNull\CapsuleUpdatePolicyLib
>N
>>ull.inf -
>>Null CapsuleUpdatePolicyLib instance and the template for platform 
>>specific implementation 
>>FmpDevicePkg\Library\FmpDeviceLibNull\FmpDeviceLibNull.inf - Null 
>>FmpDeviceLib instance and the template for platform specific 
>>implementation
>>
>>Eric Jin (10):
>>  FmpDevicePkg: Add UEFI_DRIVER support
>>  FmpDevicePkg: Add APIs to FmpDeviceLib
>>  FmpDEvicePkg/FmpDeviceLibNull: Implement new APIs
>>  FmpDevicePkg/FmpDxe: Use new FmpDeviceLib APIs
>>  FmpDevicePkg/FmpDxe: Different variable for each FMP Descriptor
>>  FmpDevicePkg: Add Capsule Update Policy Protocol
>>  FmpDevicePkg/FmpDxe: Improve all DEBUG() messages
>>  FmpDevicePkg/FmpDxe: Add PcdFmpDeviceImageTypeIdGuid
>>  FmpDevicePkg/FmpDxe: Add PcdFmpDeviceStorageAccessEnable
>>  FmpDevicePkg/FmpDxe: Remove use of CatSprint()
>>
>> .../CapsuleUpdatePolicyDxe.c  | 173 
>> .../CapsuleUpdatePolicyDxe.h  | 140 +++
>> .../CapsuleUpdatePolicyDxe.inf|  48 +
>> .../CapsuleUpdatePolicyDxe.uni|  14 +
>> .../CapsuleUpdatePolicyDxeExtra.uni   |  14 +
>> FmpDevicePkg/FmpDevicePkg.dec |  43 +-
>> FmpDevicePkg/FmpDevicePkg.dsc |  64 +-
>> FmpDevicePkg/FmpDevicePkg.uni |  16 +-
>> FmpDevicePkg/FmpDxe/DetectTestKey.c   |  16 +-
>> FmpDevicePkg/FmpDxe/FmpDxe.c  | 792 ++--
>> FmpDevicePkg/FmpDxe/FmpDxe.h  | 355 
>> FmpDevicePkg/FmpDxe/FmpDxe.inf|   7 +-
>> FmpDevicePkg/FmpDxe/FmpDxeLib.inf |   7 +-
>> FmpDevicePkg/FmpDxe/VariableSupport.c | 844 +-
>> FmpDevicePkg/FmpDxe/VariableSupport.h | 135 ++-
>> FmpDevicePkg/Include/Library/FmpDeviceLib.h   | 104 ++-
>> .../CapsuleUpdatePolicyLibOnProtocol.c| 171 
>> .../CapsuleUpdatePolicyLibOnProtocol.inf  |  40 +
>> .../CapsuleUpdatePolicyLibOnProtocol.uni  |  15 +
>> .../Library/FmpDeviceLibNull/FmpDeviceLib.c   |  93 

Re: [edk2-devel] [PATCH v4 00/35] Specific platform to run OVMF in Xen PVH and HVM guests

2019-08-12 Thread Anthony PERARD
On Tue, Jul 30, 2019 at 03:10:13PM +0200, Laszlo Ersek wrote:
> Hi Anthony,
> 
> On 07/29/19 17:39, Anthony PERARD wrote:
> > Patch series available in this git branch:
> > https://xenbits.xen.org/git-http/people/aperard/ovmf.git 
> > br.platform-xen-pvh-v4
> > 
> > Changes in v4:
> > - patch "OvmfPkg/XenPlatformPei: Reserve hvmloader's memory only when it has
> >   run" was removed, and instead a different change is done in
> >   "OvmfPkg/XenPlatformPei: Rework memory detection"
> > - other changes detailed in the notes of each patch
> 
> I've gone through the v4 series. If reviewers on the xen-devel list
> think v4 is okay to merge, I can do that (with the small fixups I
> offered here and there). I suggest that we wait a few days -- please
> ping me when you believe the review on xen-devel has concluded.
> 
> If you prefer to post v5, that works as well of course.

There's a few more small fixup proposed by Roger, should I post a v5 for
them? (and maybe only CC you and the lists.)

Otherwise, I've pushed the branch br.platform-xen-pvh-v4.1 to my repo [1]
where I believe I've collected all the small fixups.
[1] https://xenbits.xen.org/git-http/people/aperard/ovmf.git  
br.platform-xen-pvh-v4.1

Thanks,

-- 
Anthony PERARD

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

View/Reply Online (#45456): https://edk2.groups.io/g/devel/message/45456
Mute This Topic: https://groups.io/mt/32643834/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v2 0/3] Fix warning message issues

2019-08-12 Thread Carsey, Jaben
 What changed in v2?

Thanks
-Jaben


> -Original Message-
> From: Zhang, Shenglei
> Sent: Sunday, August 11, 2019 11:23 PM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J ; Wu, Hao A
> ; Carsey, Jaben ; Ni, Ray
> ; Gao, Zhichao ; Chiu, Chasel
> ; Desimone, Nathaniel L
> ; Zeng, Star 
> Subject: [PATCH v2 0/3] Fix warning message issues
> 
> There are some header files used but not included in INF
> files. This causes warings are generated when building the
> packages. So now add them into INF files.
> https://bugzilla.tianocore.org/show_bug.cgi?id=2036
> 
> Cc: Jian J Wang 
> Cc: Hao A Wu 
> Cc: Jaben Carsey 
> Cc: Ray Ni 
> Cc: Zhichao Gao 
> Cc: Chasel Chiu 
> Cc: Nate DeSimone 
> Cc: Star Zeng 
> Shenglei Zhang (3):
>   MdeModulePkg: Add missing header files in INF files
>   ShellPkg/UefiShellAcpiViewCommandLib: Add missing header files in INF
>   IntelFsp2Pkg/FspSecCore: Add missing header file in INF file
> 
>  IntelFsp2Pkg/FspSecCore/FspSecCoreS.inf  | 3 ++-
>  MdeModulePkg/Universal/CapsulePei/CapsulePei.inf | 3 ++-
>  MdeModulePkg/Universal/CapsulePei/CapsuleX64.inf | 1 +
>  MdeModulePkg/Universal/EbcDxe/EbcDebuggerConfig.inf  | 9 -
>  .../UefiShellAcpiViewCommandLib.inf  | 2 ++
>  5 files changed, 15 insertions(+), 3 deletions(-)
> 
> --
> 2.18.0.windows.1


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

View/Reply Online (#45455): https://edk2.groups.io/g/devel/message/45455
Mute This Topic: https://groups.io/mt/32838102/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v4 29/35] OvmfPkg/OvmfXen: Override PcdFSBClock to Xen vLAPIC timer frequency

2019-08-12 Thread Anthony PERARD
On Thu, Aug 08, 2019 at 05:18:15PM +0200, Roger Pau Monné wrote:
> On Thu, Aug 08, 2019 at 03:26:41PM +0100, Anthony PERARD wrote:
> > So EDKII doesn't have that capability, FSBClock is a build time value
> > and can't be changed at run time. But OVMF (on KVM or HVM) doesn't use
> > that value at all, it uses the ACPI timer instead.
> 
> But after your series both PVH and HVM will use the lapic timer
> instead of the ACPI timer, and thus rely on the value of FSBClock?

Short answer, Yes.

Longuer answer, after the series is applied, there will be a new
platform, "OvmfXen" which will be for both Xen PVH and Xen HVM, but the
OVMF that we know (OvmfPkgX64 that xen.git builds) will still be
capable of running on Xen HVM for a short while and will still use the
ACPI timer.

-- 
Anthony PERARD

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

View/Reply Online (#45454): https://edk2.groups.io/g/devel/message/45454
Mute This Topic: https://groups.io/mt/32644083/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH] ShellPkg/UefiShellLevel2CommansLib: Pointer Resonse should be checked

2019-08-12 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

Thanks
-Jaben

> -Original Message-
> From: Gao, Zhichao
> Sent: Sunday, August 11, 2019 5:36 PM
> To: devel@edk2.groups.io
> Cc: Carsey, Jaben ; Ni, Ray 
> Subject: [PATCH] ShellPkg/UefiShellLevel2CommansLib: Pointer Resonse
> should be checked
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2049
> 
> ShellPkg\Library\UefiShellLevel2CommandsLib\Cp.c line 104 and
> ShellPkg\Library\UefiShellLevel2CommandsLib\Mv.c line 640, the
> pointer variable Response may be a NULL pointer. So we should
> make sure that it isn't NULL before dereference it.
> 
> If Response is NULL that indicates a EFI_OUT_OF_RESOURCES
> error, directly return SHELL_ABORTED.
> 
> Cc: Jaben Carsey 
> Cc: Ray Ni 
> Signed-off-by: Zhichao Gao 
> ---
>  ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c | 5 -
>  ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c | 5 -
>  2 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c
> b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c
> index 18b05b5803..4a2c2cfe64 100644
> --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c
> +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c
> @@ -2,7 +2,7 @@
>Main file for cp shell level 2 function.
> 
>(C) Copyright 2015 Hewlett-Packard Development Company, L.P.
> -  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
> +  Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.
>SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> @@ -101,6 +101,9 @@ CopySingleFile(
>  // possibly return based on response
>  //
>  if (!SilentMode) {
> +  if (Response == NULL) {
> +return SHELL_ABORTED;
> +  }
>switch (*(SHELL_PROMPT_RESPONSE*)Response) {
>  case ShellPromptResponseNo:
>//
> diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c
> b/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c
> index 8c2852d7eb..f50c1e4c20 100644
> --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c
> +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c
> @@ -2,7 +2,7 @@
>Main file for mv shell level 2 function.
> 
>(C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
> -  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
> +  Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.
>SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> @@ -637,6 +637,9 @@ ValidateAndMoveFiles(
>if (Response == NULL) {
>  ShellPromptForResponseHii(ShellPromptResponseTypeYesNoAllCancel,
> STRING_TOKEN (STR_GEN_DEST_EXIST_OVR), gShellLevel2HiiHandle,
> );
>}
> +  if (Response == NULL) {
> +return SHELL_ABORTED;
> +  }
>switch (*(SHELL_PROMPT_RESPONSE*)Response) {
>  case ShellPromptResponseNo:
>FreePool(Response);
> --
> 2.21.0.windows.1


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

View/Reply Online (#45453): https://edk2.groups.io/g/devel/message/45453
Mute This Topic: https://groups.io/mt/32835761/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH] UefiCpuPkg: Adding a new TSC library by using CPUID(0x15) TSC leaf

2019-08-12 Thread Donald Kuo
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1909

Cc: Ray Ni 
Cc: Star Zeng 
Cc: Eric Dong 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Donald Kuo 
---
 .../Library/BaseCpuTimerLib/BaseCpuTimerLib.c  |  40 +++
 .../Library/BaseCpuTimerLib/BaseCpuTimerLib.inf|  35 +++
 .../Library/BaseCpuTimerLib/BaseCpuTimerLib.uni|  17 ++
 UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c   | 290 +
 UefiCpuPkg/UefiCpuPkg.dec  |   8 +
 UefiCpuPkg/UefiCpuPkg.dsc  |   4 +-
 6 files changed, 393 insertions(+), 1 deletion(-)
 create mode 100644 UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
 create mode 100644 UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
 create mode 100644 UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni
 create mode 100644 UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c

diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c 
b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
new file mode 100644
index 00..ccb92a95d3
--- /dev/null
+++ b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
@@ -0,0 +1,40 @@
+/** @file
+  CPUID Leaf 0x15 for Core Crystal Clock frequency instance of Timer Library.
+
+  Copyright (c) 2019 Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+#include 
+#include 
+
+/**
+  CPUID Leaf 0x15 for Core Crystal Clock Frequency.
+
+  The TSC counting frequency is determined by using CPUID leaf 0x15. Frequency 
in MHz = Core XTAL frequency * EBX/EAX.
+  In newer flavors of the CPU, core xtal frequency is returned in ECX or 0 if 
not supported.
+  @return The number of TSC counts per second.
+
+**/
+UINT64
+CpuidCoreClockCalculateTscFrequency (
+  VOID
+  );
+
+/**
+  Internal function to retrieves the 64-bit frequency in Hz.
+
+  Internal function to retrieves the 64-bit frequency in Hz.
+
+  @return The frequency in Hz.
+
+**/
+UINT64
+InternalGetPerformanceCounterFrequency (
+  VOID
+  )
+{
+  return CpuidCoreClockCalculateTscFrequency ();
+}
diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf 
b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
new file mode 100644
index 00..c31dacd57a
--- /dev/null
+++ b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
@@ -0,0 +1,35 @@
+## @file
+#  Base CPU Timer Library
+#
+#  Provides basic timer support using CPUID Leaf 0x15 XTAL frequency. The 
performance
+#  counter features are provided by the processors time stamp counter.
+#
+#  Copyright (c) 2019, Intel Corporation. All rights reserved.
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = BaseCpuTimerLib
+  FILE_GUID  = F10B5B91-D15A-496C-B044-B5235721AA08
+  MODULE_TYPE= BASE
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = TimerLib
+  MODULE_UNI_FILE= BaseCpuTimerLib.uni
+
+[Sources]
+  CpuTimerLib.c
+  BaseCpuTimerLib.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  UefiCpuPkg/UefiCpuPkg.dec
+
+[LibraryClasses]
+  BaseLib
+  PcdLib
+  DebugLib
+
+[Pcd]
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuCoreCrystalClockFrequency  ## CONSUMES
\ No newline at end of file
diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni 
b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni
new file mode 100644
index 00..fcf2b0fbcb
--- /dev/null
+++ b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni
@@ -0,0 +1,17 @@
+// /** @file
+// Base CPU Timer Library
+//
+// Provides basic timer support using CPUID Leaf 0x15 XTAL frequency.  The 
performance
+// counter features are provided by the processors time stamp counter.
+//
+// Copyright (c) 2019, Intel Corporation. All rights reserved.
+//
+// SPDX-License-Identifier: BSD-2-Clause-Patent
+//
+// **/
+
+
+#string STR_MODULE_ABSTRACT #language en-US "CPU Timer Library"
+
+#string STR_MODULE_DESCRIPTION  #language en-US "Provides basic timer 
support using CPUID Leaf 0x15 XTAL frequency."
+
diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c 
b/UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c
new file mode 100644
index 00..5ed01146cf
--- /dev/null
+++ b/UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c
@@ -0,0 +1,290 @@
+/** @file
+  CPUID Leaf 0x15 for Core Crystal Clock frequency instance of Timer Library.
+
+  Copyright (c) 2019 Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/**
+  Internal function to retrieves the 64-bit frequency in Hz.
+
+  Internal function to retrieves the 64-bit frequency in Hz.
+
+  @return The frequency in Hz.
+
+**/
+UINT64
+InternalGetPerformanceCounterFrequency (
+  VOID
+  );
+
+/**
+  CPUID Leaf 0x15 for Core Crystal Clock Frequency.
+
+  

[edk2-devel] [PATCH] UefiCpuPkg: Add new TimerLib for CPUID Leaf 0x15 Core Crystal Clock Frequency

2019-08-12 Thread Donald Kuo
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1909

Cc: Ray Ni 
Cc: Star Zeng 
Cc: Eric Dong 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Donald Kuo 
---
 .../Library/BaseCpuTimerLib/BaseCpuTimerLib.c  |  40 +++
 .../Library/BaseCpuTimerLib/BaseCpuTimerLib.inf|  35 +++
 .../Library/BaseCpuTimerLib/BaseCpuTimerLib.uni|  17 ++
 UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c   | 290 +
 UefiCpuPkg/UefiCpuPkg.dec  |   8 +
 UefiCpuPkg/UefiCpuPkg.dsc  |   4 +-
 6 files changed, 393 insertions(+), 1 deletion(-)
 create mode 100644 UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
 create mode 100644 UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
 create mode 100644 UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni
 create mode 100644 UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c

diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c 
b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
new file mode 100644
index 00..ccb92a95d3
--- /dev/null
+++ b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
@@ -0,0 +1,40 @@
+/** @file
+  CPUID Leaf 0x15 for Core Crystal Clock frequency instance of Timer Library.
+
+  Copyright (c) 2019 Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+#include 
+#include 
+
+/**
+  CPUID Leaf 0x15 for Core Crystal Clock Frequency.
+
+  The TSC counting frequency is determined by using CPUID leaf 0x15. Frequency 
in MHz = Core XTAL frequency * EBX/EAX.
+  In newer flavors of the CPU, core xtal frequency is returned in ECX or 0 if 
not supported.
+  @return The number of TSC counts per second.
+
+**/
+UINT64
+CpuidCoreClockCalculateTscFrequency (
+  VOID
+  );
+
+/**
+  Internal function to retrieves the 64-bit frequency in Hz.
+
+  Internal function to retrieves the 64-bit frequency in Hz.
+
+  @return The frequency in Hz.
+
+**/
+UINT64
+InternalGetPerformanceCounterFrequency (
+  VOID
+  )
+{
+  return CpuidCoreClockCalculateTscFrequency ();
+}
diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf 
b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
new file mode 100644
index 00..c31dacd57a
--- /dev/null
+++ b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
@@ -0,0 +1,35 @@
+## @file
+#  Base CPU Timer Library
+#
+#  Provides basic timer support using CPUID Leaf 0x15 XTAL frequency. The 
performance
+#  counter features are provided by the processors time stamp counter.
+#
+#  Copyright (c) 2019, Intel Corporation. All rights reserved.
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = BaseCpuTimerLib
+  FILE_GUID  = F10B5B91-D15A-496C-B044-B5235721AA08
+  MODULE_TYPE= BASE
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = TimerLib
+  MODULE_UNI_FILE= BaseCpuTimerLib.uni
+
+[Sources]
+  CpuTimerLib.c
+  BaseCpuTimerLib.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  UefiCpuPkg/UefiCpuPkg.dec
+
+[LibraryClasses]
+  BaseLib
+  PcdLib
+  DebugLib
+
+[Pcd]
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuCoreCrystalClockFrequency  ## CONSUMES
\ No newline at end of file
diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni 
b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni
new file mode 100644
index 00..fcf2b0fbcb
--- /dev/null
+++ b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni
@@ -0,0 +1,17 @@
+// /** @file
+// Base CPU Timer Library
+//
+// Provides basic timer support using CPUID Leaf 0x15 XTAL frequency.  The 
performance
+// counter features are provided by the processors time stamp counter.
+//
+// Copyright (c) 2019, Intel Corporation. All rights reserved.
+//
+// SPDX-License-Identifier: BSD-2-Clause-Patent
+//
+// **/
+
+
+#string STR_MODULE_ABSTRACT #language en-US "CPU Timer Library"
+
+#string STR_MODULE_DESCRIPTION  #language en-US "Provides basic timer 
support using CPUID Leaf 0x15 XTAL frequency."
+
diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c 
b/UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c
new file mode 100644
index 00..5ed01146cf
--- /dev/null
+++ b/UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c
@@ -0,0 +1,290 @@
+/** @file
+  CPUID Leaf 0x15 for Core Crystal Clock frequency instance of Timer Library.
+
+  Copyright (c) 2019 Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/**
+  Internal function to retrieves the 64-bit frequency in Hz.
+
+  Internal function to retrieves the 64-bit frequency in Hz.
+
+  @return The frequency in Hz.
+
+**/
+UINT64
+InternalGetPerformanceCounterFrequency (
+  VOID
+  );
+
+/**
+  CPUID Leaf 0x15 for Core Crystal Clock Frequency.
+
+  

[edk2-devel] [PATCH] UefiCpuPkg: Adding a new TSC library by using CPUID(0x15) TSC leaf

2019-08-12 Thread Donald Kuo
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1909

Cc: Ray Ni 
Cc: Star Zeng 
Cc: Eric Dong 
Signed-off-by: Donald Kuo 
---
 .../Library/BaseCpuTimerLib/BaseCpuTimerLib.c  |  40 +++
 .../Library/BaseCpuTimerLib/BaseCpuTimerLib.inf|  35 +++
 .../Library/BaseCpuTimerLib/BaseCpuTimerLib.uni|  17 ++
 UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c   | 290 +
 UefiCpuPkg/UefiCpuPkg.dec  |   8 +
 UefiCpuPkg/UefiCpuPkg.dsc  |   4 +-
 6 files changed, 393 insertions(+), 1 deletion(-)
 create mode 100644 UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
 create mode 100644 UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
 create mode 100644 UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni
 create mode 100644 UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c

diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c 
b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
new file mode 100644
index 00..ccb92a95d3
--- /dev/null
+++ b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
@@ -0,0 +1,40 @@
+/** @file
+  CPUID Leaf 0x15 for Core Crystal Clock frequency instance of Timer Library.
+
+  Copyright (c) 2019 Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+#include 
+#include 
+
+/**
+  CPUID Leaf 0x15 for Core Crystal Clock Frequency.
+
+  The TSC counting frequency is determined by using CPUID leaf 0x15. Frequency 
in MHz = Core XTAL frequency * EBX/EAX.
+  In newer flavors of the CPU, core xtal frequency is returned in ECX or 0 if 
not supported.
+  @return The number of TSC counts per second.
+
+**/
+UINT64
+CpuidCoreClockCalculateTscFrequency (
+  VOID
+  );
+
+/**
+  Internal function to retrieves the 64-bit frequency in Hz.
+
+  Internal function to retrieves the 64-bit frequency in Hz.
+
+  @return The frequency in Hz.
+
+**/
+UINT64
+InternalGetPerformanceCounterFrequency (
+  VOID
+  )
+{
+  return CpuidCoreClockCalculateTscFrequency ();
+}
diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf 
b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
new file mode 100644
index 00..c31dacd57a
--- /dev/null
+++ b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
@@ -0,0 +1,35 @@
+## @file
+#  Base CPU Timer Library
+#
+#  Provides basic timer support using CPUID Leaf 0x15 XTAL frequency. The 
performance
+#  counter features are provided by the processors time stamp counter.
+#
+#  Copyright (c) 2019, Intel Corporation. All rights reserved.
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = BaseCpuTimerLib
+  FILE_GUID  = F10B5B91-D15A-496C-B044-B5235721AA08
+  MODULE_TYPE= BASE
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = TimerLib
+  MODULE_UNI_FILE= BaseCpuTimerLib.uni
+
+[Sources]
+  CpuTimerLib.c
+  BaseCpuTimerLib.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  UefiCpuPkg/UefiCpuPkg.dec
+
+[LibraryClasses]
+  BaseLib
+  PcdLib
+  DebugLib
+
+[Pcd]
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuCoreCrystalClockFrequency  ## CONSUMES
\ No newline at end of file
diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni 
b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni
new file mode 100644
index 00..fcf2b0fbcb
--- /dev/null
+++ b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni
@@ -0,0 +1,17 @@
+// /** @file
+// Base CPU Timer Library
+//
+// Provides basic timer support using CPUID Leaf 0x15 XTAL frequency.  The 
performance
+// counter features are provided by the processors time stamp counter.
+//
+// Copyright (c) 2019, Intel Corporation. All rights reserved.
+//
+// SPDX-License-Identifier: BSD-2-Clause-Patent
+//
+// **/
+
+
+#string STR_MODULE_ABSTRACT #language en-US "CPU Timer Library"
+
+#string STR_MODULE_DESCRIPTION  #language en-US "Provides basic timer 
support using CPUID Leaf 0x15 XTAL frequency."
+
diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c 
b/UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c
new file mode 100644
index 00..5ed01146cf
--- /dev/null
+++ b/UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c
@@ -0,0 +1,290 @@
+/** @file
+  CPUID Leaf 0x15 for Core Crystal Clock frequency instance of Timer Library.
+
+  Copyright (c) 2019 Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/**
+  Internal function to retrieves the 64-bit frequency in Hz.
+
+  Internal function to retrieves the 64-bit frequency in Hz.
+
+  @return The frequency in Hz.
+
+**/
+UINT64
+InternalGetPerformanceCounterFrequency (
+  VOID
+  );
+
+/**
+  CPUID Leaf 0x15 for Core Crystal Clock Frequency.
+
+  The TSC counting frequency is determined by using CPUID 

[edk2-devel] [PATCH] UefiCpuPkg: Adding a new TSC library by using CPUID(0x15) TSC leaf

2019-08-12 Thread Donald Kuo
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1909

Cc: Ray Ni 
Cc: Star Zeng 
Cc: Eric Dong 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Donald Kuo 
---
 .../Library/BaseCpuTimerLib/BaseCpuTimerLib.c  |  40 +++
 .../Library/BaseCpuTimerLib/BaseCpuTimerLib.inf|  35 +++
 .../Library/BaseCpuTimerLib/BaseCpuTimerLib.uni|  17 ++
 UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c   | 290 +
 UefiCpuPkg/UefiCpuPkg.dec  |   8 +
 UefiCpuPkg/UefiCpuPkg.dsc  |   4 +-
 6 files changed, 393 insertions(+), 1 deletion(-)
 create mode 100644 UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
 create mode 100644 UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
 create mode 100644 UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni
 create mode 100644 UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c

diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c 
b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
new file mode 100644
index 00..ccb92a95d3
--- /dev/null
+++ b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
@@ -0,0 +1,40 @@
+/** @file
+  CPUID Leaf 0x15 for Core Crystal Clock frequency instance of Timer Library.
+
+  Copyright (c) 2019 Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+#include 
+#include 
+
+/**
+  CPUID Leaf 0x15 for Core Crystal Clock Frequency.
+
+  The TSC counting frequency is determined by using CPUID leaf 0x15. Frequency 
in MHz = Core XTAL frequency * EBX/EAX.
+  In newer flavors of the CPU, core xtal frequency is returned in ECX or 0 if 
not supported.
+  @return The number of TSC counts per second.
+
+**/
+UINT64
+CpuidCoreClockCalculateTscFrequency (
+  VOID
+  );
+
+/**
+  Internal function to retrieves the 64-bit frequency in Hz.
+
+  Internal function to retrieves the 64-bit frequency in Hz.
+
+  @return The frequency in Hz.
+
+**/
+UINT64
+InternalGetPerformanceCounterFrequency (
+  VOID
+  )
+{
+  return CpuidCoreClockCalculateTscFrequency ();
+}
diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf 
b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
new file mode 100644
index 00..c31dacd57a
--- /dev/null
+++ b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
@@ -0,0 +1,35 @@
+## @file
+#  Base CPU Timer Library
+#
+#  Provides basic timer support using CPUID Leaf 0x15 XTAL frequency. The 
performance
+#  counter features are provided by the processors time stamp counter.
+#
+#  Copyright (c) 2019, Intel Corporation. All rights reserved.
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = BaseCpuTimerLib
+  FILE_GUID  = F10B5B91-D15A-496C-B044-B5235721AA08
+  MODULE_TYPE= BASE
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = TimerLib
+  MODULE_UNI_FILE= BaseCpuTimerLib.uni
+
+[Sources]
+  CpuTimerLib.c
+  BaseCpuTimerLib.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  UefiCpuPkg/UefiCpuPkg.dec
+
+[LibraryClasses]
+  BaseLib
+  PcdLib
+  DebugLib
+
+[Pcd]
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuCoreCrystalClockFrequency  ## CONSUMES
\ No newline at end of file
diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni 
b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni
new file mode 100644
index 00..fcf2b0fbcb
--- /dev/null
+++ b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni
@@ -0,0 +1,17 @@
+// /** @file
+// Base CPU Timer Library
+//
+// Provides basic timer support using CPUID Leaf 0x15 XTAL frequency.  The 
performance
+// counter features are provided by the processors time stamp counter.
+//
+// Copyright (c) 2019, Intel Corporation. All rights reserved.
+//
+// SPDX-License-Identifier: BSD-2-Clause-Patent
+//
+// **/
+
+
+#string STR_MODULE_ABSTRACT #language en-US "CPU Timer Library"
+
+#string STR_MODULE_DESCRIPTION  #language en-US "Provides basic timer 
support using CPUID Leaf 0x15 XTAL frequency."
+
diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c 
b/UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c
new file mode 100644
index 00..5ed01146cf
--- /dev/null
+++ b/UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c
@@ -0,0 +1,290 @@
+/** @file
+  CPUID Leaf 0x15 for Core Crystal Clock frequency instance of Timer Library.
+
+  Copyright (c) 2019 Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/**
+  Internal function to retrieves the 64-bit frequency in Hz.
+
+  Internal function to retrieves the 64-bit frequency in Hz.
+
+  @return The frequency in Hz.
+
+**/
+UINT64
+InternalGetPerformanceCounterFrequency (
+  VOID
+  );
+
+/**
+  CPUID Leaf 0x15 for Core Crystal Clock Frequency.
+
+  

[edk2-devel] [PATCH] UefiCpuPkg: Adding a new TSC library by using CPUID(0x15) TSC leaf

2019-08-12 Thread Donald Kuo
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1909

Cc: Ray Ni 
Cc: Star Zeng 
Cc: Eric Dong 
Cc: Amy Chan 
Cc: Rangasai V Chaganty 
Signed-off-by: Donald Kuo 
---
 .../Library/BaseCpuTimerLib/BaseCpuTimerLib.c  |  40 +++
 .../Library/BaseCpuTimerLib/BaseCpuTimerLib.inf|  35 +++
 .../Library/BaseCpuTimerLib/BaseCpuTimerLib.uni|  16 ++
 UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c   | 272 +
 UefiCpuPkg/UefiCpuPkg.dec  |   8 +
 UefiCpuPkg/UefiCpuPkg.dsc  |   1 +
 6 files changed, 372 insertions(+)
 create mode 100644 UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
 create mode 100644 UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
 create mode 100644 UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni
 create mode 100644 UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c

diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c 
b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
new file mode 100644
index 00..ccb92a95d3
--- /dev/null
+++ b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
@@ -0,0 +1,40 @@
+/** @file
+  CPUID Leaf 0x15 for Core Crystal Clock frequency instance of Timer Library.
+
+  Copyright (c) 2019 Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+#include 
+#include 
+
+/**
+  CPUID Leaf 0x15 for Core Crystal Clock Frequency.
+
+  The TSC counting frequency is determined by using CPUID leaf 0x15. Frequency 
in MHz = Core XTAL frequency * EBX/EAX.
+  In newer flavors of the CPU, core xtal frequency is returned in ECX or 0 if 
not supported.
+  @return The number of TSC counts per second.
+
+**/
+UINT64
+CpuidCoreClockCalculateTscFrequency (
+  VOID
+  );
+
+/**
+  Internal function to retrieves the 64-bit frequency in Hz.
+
+  Internal function to retrieves the 64-bit frequency in Hz.
+
+  @return The frequency in Hz.
+
+**/
+UINT64
+InternalGetPerformanceCounterFrequency (
+  VOID
+  )
+{
+  return CpuidCoreClockCalculateTscFrequency ();
+}
diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf 
b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
new file mode 100644
index 00..7e27a55c90
--- /dev/null
+++ b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
@@ -0,0 +1,35 @@
+## @file
+#  Base CPU Timer Library
+#
+#  Provides basic timer support using CPUID Leaf 0x15 XTAL frequency. The 
performance
+#  counter features are provided by the processors time stamp counter.
+#
+#  Copyright (c) 2019, Intel Corporation. All rights reserved.
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = BaseCpuTimerLib
+  FILE_GUID  = F10B5B91-D15A-496C-B044-B5235721AA08
+  MODULE_TYPE= BASE
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = TimerLib
+  MODULE_UNI_FILE= BaseCpuTimerLib.uni
+
+[Sources]
+  CpuTimerLib.c
+  BaseCpuTimerLib.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  UefiCpuPkg/UefiCpuPkg.dec
+
+[LibraryClasses]
+  BaseLib
+  PcdLib
+  DebugLib
+
+[Pcd]
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuCoreCrystalClockFrequency  ## CONSUMES
diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni 
b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni
new file mode 100644
index 00..6e5c3ef70e
--- /dev/null
+++ b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni
@@ -0,0 +1,16 @@
+// /** @file
+// Base CPU Timer Library
+//
+// Provides basic timer support using CPUID Leaf 0x15 XTAL frequency.  The 
performance
+// counter features are provided by the processors time stamp counter.
+//
+// Copyright (c) 2019, Intel Corporation. All rights reserved.
+//
+// SPDX-License-Identifier: BSD-2-Clause-Patent
+//
+// **/
+
+
+#string STR_MODULE_ABSTRACT #language en-US "CPU Timer Library"
+
+#string STR_MODULE_DESCRIPTION  #language en-US "Provides basic timer 
support using CPUID Leaf 0x15 XTAL frequency."
diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c 
b/UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c
new file mode 100644
index 00..39492acd8e
--- /dev/null
+++ b/UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c
@@ -0,0 +1,272 @@
+/** @file
+  CPUID Leaf 0x15 for Core Crystal Clock frequency instance of Timer Library.
+
+  Copyright (c) 2019 Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/**
+  Internal function to retrieves the 64-bit frequency in Hz.
+
+  Internal function to retrieves the 64-bit frequency in Hz.
+
+  @return The frequency in Hz.
+
+**/
+UINT64
+InternalGetPerformanceCounterFrequency (
+  VOID
+  );
+
+/**
+  CPUID Leaf 0x15 for Core Crystal Clock Frequency.
+
+  The TSC counting frequency is determined by using CPUID leaf 

[edk2-devel] [PATCH] UefiCpuPkg: Adding a new TSC library by using CPUID(0x15) TSC leaf

2019-08-12 Thread Donald Kuo
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1909

Cc: Ray Ni 
Cc: Star Zeng 
Cc: Eric Dong 
Cc: Amy Chan 
Cc: Rangasai V Chaganty 
Signed-off-by: Donald Kuo 
---
 .../Library/BaseCpuTimerLib/BaseCpuTimerLib.c  |  40 +++
 .../Library/BaseCpuTimerLib/BaseCpuTimerLib.inf|  35 +++
 .../Library/BaseCpuTimerLib/BaseCpuTimerLib.uni|  16 ++
 UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c   | 274 +
 UefiCpuPkg/UefiCpuPkg.dec  |   8 +
 UefiCpuPkg/UefiCpuPkg.dsc  |   1 +
 6 files changed, 374 insertions(+)
 create mode 100644 UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
 create mode 100644 UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
 create mode 100644 UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni
 create mode 100644 UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c

diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c 
b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
new file mode 100644
index 00..ccb92a95d3
--- /dev/null
+++ b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
@@ -0,0 +1,40 @@
+/** @file
+  CPUID Leaf 0x15 for Core Crystal Clock frequency instance of Timer Library.
+
+  Copyright (c) 2019 Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+#include 
+#include 
+
+/**
+  CPUID Leaf 0x15 for Core Crystal Clock Frequency.
+
+  The TSC counting frequency is determined by using CPUID leaf 0x15. Frequency 
in MHz = Core XTAL frequency * EBX/EAX.
+  In newer flavors of the CPU, core xtal frequency is returned in ECX or 0 if 
not supported.
+  @return The number of TSC counts per second.
+
+**/
+UINT64
+CpuidCoreClockCalculateTscFrequency (
+  VOID
+  );
+
+/**
+  Internal function to retrieves the 64-bit frequency in Hz.
+
+  Internal function to retrieves the 64-bit frequency in Hz.
+
+  @return The frequency in Hz.
+
+**/
+UINT64
+InternalGetPerformanceCounterFrequency (
+  VOID
+  )
+{
+  return CpuidCoreClockCalculateTscFrequency ();
+}
diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf 
b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
new file mode 100644
index 00..7e27a55c90
--- /dev/null
+++ b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
@@ -0,0 +1,35 @@
+## @file
+#  Base CPU Timer Library
+#
+#  Provides basic timer support using CPUID Leaf 0x15 XTAL frequency. The 
performance
+#  counter features are provided by the processors time stamp counter.
+#
+#  Copyright (c) 2019, Intel Corporation. All rights reserved.
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = BaseCpuTimerLib
+  FILE_GUID  = F10B5B91-D15A-496C-B044-B5235721AA08
+  MODULE_TYPE= BASE
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = TimerLib
+  MODULE_UNI_FILE= BaseCpuTimerLib.uni
+
+[Sources]
+  CpuTimerLib.c
+  BaseCpuTimerLib.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  UefiCpuPkg/UefiCpuPkg.dec
+
+[LibraryClasses]
+  BaseLib
+  PcdLib
+  DebugLib
+
+[Pcd]
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuCoreCrystalClockFrequency  ## CONSUMES
diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni 
b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni
new file mode 100644
index 00..6e5c3ef70e
--- /dev/null
+++ b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni
@@ -0,0 +1,16 @@
+// /** @file
+// Base CPU Timer Library
+//
+// Provides basic timer support using CPUID Leaf 0x15 XTAL frequency.  The 
performance
+// counter features are provided by the processors time stamp counter.
+//
+// Copyright (c) 2019, Intel Corporation. All rights reserved.
+//
+// SPDX-License-Identifier: BSD-2-Clause-Patent
+//
+// **/
+
+
+#string STR_MODULE_ABSTRACT #language en-US "CPU Timer Library"
+
+#string STR_MODULE_DESCRIPTION  #language en-US "Provides basic timer 
support using CPUID Leaf 0x15 XTAL frequency."
diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c 
b/UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c
new file mode 100644
index 00..965e206d7d
--- /dev/null
+++ b/UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c
@@ -0,0 +1,274 @@
+/** @file
+  CPUID Leaf 0x15 for Core Crystal Clock frequency instance of Timer Library.
+
+  Copyright (c) 2019 Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/**
+  Internal function to retrieves the 64-bit frequency in Hz.
+
+  Internal function to retrieves the 64-bit frequency in Hz.
+
+  @return The frequency in Hz.
+
+**/
+UINT64
+InternalGetPerformanceCounterFrequency (
+  VOID
+  );
+
+/**
+  CPUID Leaf 0x15 for Core Crystal Clock Frequency.
+
+  The TSC counting frequency is determined by using CPUID leaf 

[edk2-devel] [PATCH] MdePkg: Add STATIC_ASSERT macro

2019-08-12 Thread vit9696 via Groups.Io
Implements https://bugzilla.tianocore.org/show_bug.cgi?id=2048.

Best regards,
Vitaly Cheptsov

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

View/Reply Online (#45451): https://edk2.groups.io/g/devel/message/45451
Mute This Topic: https://groups.io/mt/32841448/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



0001-MdePkg-Add-STATIC_ASSERT-macro.patch
Description: Binary data


publickey - vit9696@protonmail.com - 0x44529644.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


[edk2-devel] [PATCH] UefiCpuPkg: Adding a new TSC library by using CPUID(0x15) TSC leaf

2019-08-12 Thread Donald Kuo
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1909

Cc: Ray Ni 
Cc: Star Zeng 
Cc: Eric Dong 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Donald Kuo 
---
 .../Library/BaseCpuTimerLib/BaseCpuTimerLib.c  |  40 +++
 .../Library/BaseCpuTimerLib/BaseCpuTimerLib.inf|  35 +++
 .../Library/BaseCpuTimerLib/BaseCpuTimerLib.uni|  17 ++
 UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c   | 290 +
 UefiCpuPkg/UefiCpuPkg.dec  |   8 +
 UefiCpuPkg/UefiCpuPkg.dsc  |   4 +-
 6 files changed, 393 insertions(+), 1 deletion(-)
 create mode 100644 UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
 create mode 100644 UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
 create mode 100644 UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni
 create mode 100644 UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c

diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c 
b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
new file mode 100644
index 00..ccb92a95d3
--- /dev/null
+++ b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
@@ -0,0 +1,40 @@
+/** @file
+  CPUID Leaf 0x15 for Core Crystal Clock frequency instance of Timer Library.
+
+  Copyright (c) 2019 Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+#include 
+#include 
+
+/**
+  CPUID Leaf 0x15 for Core Crystal Clock Frequency.
+
+  The TSC counting frequency is determined by using CPUID leaf 0x15. Frequency 
in MHz = Core XTAL frequency * EBX/EAX.
+  In newer flavors of the CPU, core xtal frequency is returned in ECX or 0 if 
not supported.
+  @return The number of TSC counts per second.
+
+**/
+UINT64
+CpuidCoreClockCalculateTscFrequency (
+  VOID
+  );
+
+/**
+  Internal function to retrieves the 64-bit frequency in Hz.
+
+  Internal function to retrieves the 64-bit frequency in Hz.
+
+  @return The frequency in Hz.
+
+**/
+UINT64
+InternalGetPerformanceCounterFrequency (
+  VOID
+  )
+{
+  return CpuidCoreClockCalculateTscFrequency ();
+}
diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf 
b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
new file mode 100644
index 00..c31dacd57a
--- /dev/null
+++ b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
@@ -0,0 +1,35 @@
+## @file
+#  Base CPU Timer Library
+#
+#  Provides basic timer support using CPUID Leaf 0x15 XTAL frequency. The 
performance
+#  counter features are provided by the processors time stamp counter.
+#
+#  Copyright (c) 2019, Intel Corporation. All rights reserved.
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = BaseCpuTimerLib
+  FILE_GUID  = F10B5B91-D15A-496C-B044-B5235721AA08
+  MODULE_TYPE= BASE
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = TimerLib
+  MODULE_UNI_FILE= BaseCpuTimerLib.uni
+
+[Sources]
+  CpuTimerLib.c
+  BaseCpuTimerLib.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  UefiCpuPkg/UefiCpuPkg.dec
+
+[LibraryClasses]
+  BaseLib
+  PcdLib
+  DebugLib
+
+[Pcd]
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuCoreCrystalClockFrequency  ## CONSUMES
\ No newline at end of file
diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni 
b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni
new file mode 100644
index 00..fcf2b0fbcb
--- /dev/null
+++ b/UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni
@@ -0,0 +1,17 @@
+// /** @file
+// Base CPU Timer Library
+//
+// Provides basic timer support using CPUID Leaf 0x15 XTAL frequency.  The 
performance
+// counter features are provided by the processors time stamp counter.
+//
+// Copyright (c) 2019, Intel Corporation. All rights reserved.
+//
+// SPDX-License-Identifier: BSD-2-Clause-Patent
+//
+// **/
+
+
+#string STR_MODULE_ABSTRACT #language en-US "CPU Timer Library"
+
+#string STR_MODULE_DESCRIPTION  #language en-US "Provides basic timer 
support using CPUID Leaf 0x15 XTAL frequency."
+
diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c 
b/UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c
new file mode 100644
index 00..5ed01146cf
--- /dev/null
+++ b/UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c
@@ -0,0 +1,290 @@
+/** @file
+  CPUID Leaf 0x15 for Core Crystal Clock frequency instance of Timer Library.
+
+  Copyright (c) 2019 Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/**
+  Internal function to retrieves the 64-bit frequency in Hz.
+
+  Internal function to retrieves the 64-bit frequency in Hz.
+
+  @return The frequency in Hz.
+
+**/
+UINT64
+InternalGetPerformanceCounterFrequency (
+  VOID
+  );
+
+/**
+  CPUID Leaf 0x15 for Core Crystal Clock Frequency.
+
+  

[edk2-devel] [PATCH v2] IntelSiliconPkg-Vtd: A new PMR interface

2019-08-12 Thread Evelyn Wang
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1770

1) IOMMU PMR feature should be generic to support different hardware
architecture. Platforms may request no overlap between PMR regions
and system reserve memory. Create an interface to control PLMR/PHMR
regions. It allows silicon code to adjust PLMR/PHMR region base on
the project needs.

2) DisableDMAr Function Code Optimization
Optimize the flow to follow the VT-d spec requirements.

3) Renamed InitDmar() to InitGlobalVtd()
The oringal function name is misleading

4) A new GetVtdPmrAlignmentLib for silicon code to get
PMR alignment values.

Signed-off-by: Evelyn Wang 
Cc: Jenny Huang 
Cc: More Shih 
Cc: Ray Ni 
Cc: Rangasai V Chaganty 

---
In V2:
1) Fixed the EFIAPI is missing in library API issue
2) Logs will be provided to make sure the backwards compatibility
3) Replaced BIT0 with EFI_ACPI_DMAR_DRHD_FLAGS_INCLUDE_PCI_ALL
4) Renamed GetVtdPmrAlignmentLib to PeiGetVtdPmrAlignmentLib
5) Fixed the indent in IntelVTdPmrPei.c
6) Follow VTd spec to define the data type of the SYSTEM_MEM_INFO_HOB
   Applied few changes coordinately
---
 Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/VtdReg.c 
   |  30 +++---
 Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmr.c 
   |   4 ++--
 Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c  
   |  72 
+---
 Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/VtdReg.c  
   |  29 ++---
 
Silicon/Intel/IntelSiliconPkg/Feature/VTd/PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePei.c
 |   9 +
 
Silicon/Intel/IntelSiliconPkg/Library/PeiGetVtdPmrAlignmentLib/PeiGetVtdPmrAlignmentLib.c
 | 166 
++
 Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.inf
   |   5 -
 Silicon/Intel/IntelSiliconPkg/Include/Library/PeiGetVtdPmrAlignmentLib.h   
   |  31 +++
 Silicon/Intel/IntelSiliconPkg/Include/SysMemInfoHob.h  
   |  25 +
 Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec  
   |  11 +--
 Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc  
   |   3 ++-
 
Silicon/Intel/IntelSiliconPkg/Library/PeiGetVtdPmrAlignmentLib/PeiGetVtdPmrAlignmentLib.inf
   |  32 
 12 files changed, 378 insertions(+), 39 deletions(-)

diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/VtdReg.c 
b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/VtdReg.c
index 22bf821d2b..699639ba88 100644
--- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/VtdReg.c
+++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/VtdReg.c
@@ -1,6 +1,6 @@
 /** @file
 
-  Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.
+  Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -309,6 +309,8 @@ DisableDmar (
   UINTN Index;
   UINTN SubIndex;
   UINT32Reg32;
+  UINT32Status;
+  UINT32Command;
 
   for (Index = 0; Index < mVtdUnitNumber; Index++) {
 DEBUG((DEBUG_INFO, ">>DisableDmar() for engine [%d] \n", Index));
@@ -319,9 +321,31 @@ DisableDmar (
 FlushWriteBuffer (Index);
 
 //
-// Disable VTd
+// Disable Dmar
 //
-MmioWrite32 (mVtdUnitInformation[Index].VtdUnitBaseAddress + R_GCMD_REG, 
B_GMCD_REG_SRTP);
+//
+// Set TE (Translation Enable: BIT31) of Global command register to zero
+//
+Reg32 = MmioRead32 (mVtdUnitInformation[Index].VtdUnitBaseAddress + 
R_GSTS_REG);
+Status = (Reg32 & 0x96FF);   // Reset the one-shot bits
+Command = (Status & ~B_GMCD_REG_TE);
+MmioWrite32 (mVtdUnitInformation[Index].VtdUnitBaseAddress + R_GCMD_REG, 
Command);
+
+//
+// Poll on TE Status bit of Global status register to become zero
+//
+do {
+  Reg32 = MmioRead32 (mVtdUnitInformation[Index].VtdUnitBaseAddress + 
R_GSTS_REG);
+} while ((Reg32 & B_GSTS_REG_TE) == B_GSTS_REG_TE);
+
+//
+// Set SRTP (Set Root Table Pointer: BIT30) of Global command register in 
order to update the root table pointerDisable VTd
+//
+Reg32 = MmioRead32 (mVtdUnitInformation[Index].VtdUnitBaseAddress + 
R_GSTS_REG);
+Status = (Reg32 & 0x96FF);   // Reset the one-shot bits
+Command = (Status | B_GMCD_REG_SRTP);
+MmioWrite32 (mVtdUnitInformation[Index].VtdUnitBaseAddress + R_GCMD_REG, 
Command);
+
 do {
   Reg32 = MmioRead32 

[edk2-devel] [PATCH] MdePkg: Add STATIC_ASSERT macro

2019-08-12 Thread via Groups.Io
Implements https://bugzilla.tianocore.org/show_bug.cgi?id=2048.

Best regards,
Vitaly Cheptsov

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

View/Reply Online (#45445): https://edk2.groups.io/g/devel/message/45445
Mute This Topic: https://groups.io/mt/32841448/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



0001-MdePkg-Add-STATIC_ASSERT-macro.patch
Description: Binary data


publickey - vit9696@protonmail.com - 0x44529644.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Re: [edk2-devel] [Patch v2 0/6] Add "test then write" mechanism.

2019-08-12 Thread Laszlo Ersek
On 08/12/19 12:31, Eric Dong wrote:
> V2 changes:
> 1. Split CR read/write action in to one discrete patch
> 2. Keep the old logic which continue the process if error found.
> 
> Below code is current implementation:
>   if (MsrRegister[ProcessorNumber].Bits.Lock == 0) {
> CPU_REGISTER_TABLE_WRITE_FIELD (
>   ProcessorNumber,
>   Msr,
>   MSR_IA32_FEATURE_CONTROL,
>   MSR_IA32_FEATURE_CONTROL_REGISTER,
>   Bits.Lock,
>   1
> );
>   }
> 
> With below steps, the Bits.Lock bit will lose its value:
> 1. Trig normal boot, the Bits.Lock is 0. 1 will be added
>into the register table and then will set to the MSR.
> 2. Trig warm reboot, MSR value preserves. After normal boot phase,
>the Bits.Lock is 1, so it will not be added into the register
>table during the warm reboot phase.
> 3. Trig S3 then resume, the Bits.Lock change to 0 and Bits.Lock is
>not added in register table during normal boot phase. so it's
>still 0 after resume. 
> This is not an expect behavior. The expect result is the value should
> always 1 after booting or resuming from S3.
> 
> The root cause for this issue is
> 1. driver bases on current value to insert the "set value action" to
>the register table.
> 2. Some MSRs may reserve their value during warm reboot. So the insert
>action may be skip after warm reboot.
> 
> The solution for this issue is:
> 1. Always add "Test then Set" action for above referred MSRs.
> 2. Detect current value before set new value. Only set new value when
>current value not same as new value.
> 
> Cc: Ray Ni 
> Cc: Laszlo Ersek 
> 
> Eric Dong (6):
>   UefiCpuPkg/RegisterCpuFeaturesLib: Add "Test Then Write" Macros.
>   UefiCpuPkg/PiSmmCpuDxeSmm: Combine CR read/write action in one
> function.
>   UefiCpuPkg/PiSmmCpuDxeSmm: Supports test then write new value logic.
>   UefiCpuPkg/RegisterCpuFeaturesLib: Combine CR read/write action in one
> function.
>   UefiCpuPkg/RegisterCpuFeaturesLib: Supports test then write new value
> logic.
>   UefiCpuPkg/CpuCommonFeaturesLib: Use new macros.
> 
>  UefiCpuPkg/Include/AcpiCpuData.h  |   1 +
>  .../Include/Library/RegisterCpuFeaturesLib.h  |  77 +-
>  .../CpuCommonFeaturesLib/CpuCommonFeatures.h  |  15 --
>  .../CpuCommonFeaturesLib.c|   8 +-
>  .../CpuCommonFeaturesLib/FeatureControl.c | 141 ++
>  .../CpuCommonFeaturesLib/MachineCheck.c   |  23 ++-
>  .../CpuFeaturesInitialize.c   | 141 --
>  .../RegisterCpuFeaturesLib.c  |  14 +-
>  UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c | 135 +++--
>  9 files changed, 323 insertions(+), 232 deletions(-)
> 

Please don't forget to build-test this series for IA32 too.

Thanks
Laszlo

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

View/Reply Online (#45442): https://edk2.groups.io/g/devel/message/45442
Mute This Topic: https://groups.io/mt/32839204/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [Patch v2 3/6] UefiCpuPkg/PiSmmCpuDxeSmm: Supports test then write new value logic.

2019-08-12 Thread Laszlo Ersek
On 08/12/19 12:31, Eric Dong wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2040
> 
> Supports new logic which test current value before write new value.
> Only write new value when current value not same as new value.
> 
> Signed-off-by: Eric Dong 
> Cc: Ray Ni 
> Cc: Laszlo Ersek 
> ---
>  UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c | 29 +
>  1 file changed, 29 insertions(+)
> 
> diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c 
> b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
> index b20992d5ab..61541838e8 100644
> --- a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
> +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
> @@ -241,6 +241,7 @@ ProgramProcessorRegister (
>UINTN ValidThreadCount;
>UINT32*ValidCoreCountPerPackage;
>EFI_STATUSStatus;
> +  UINT64CurrentValue;
>  
>//
>// Traverse Register Table of this logical processor
> @@ -263,6 +264,16 @@ ProgramProcessorRegister (
>if (EFI_ERROR (Status)) {
>  continue;
>}
> +  if (RegisterTableEntry->TestThenWrite) {
> +CurrentValue = BitFieldRead64 (
> + Value,
> + RegisterTableEntry->ValidBitStart,
> + RegisterTableEntry->ValidBitStart + 
> RegisterTableEntry->ValidBitLength - 1
> + );
> +if (CurrentValue == RegisterTableEntry->Value) {
> +  continue;
> +}
> +  }
>Value = (UINTN) BitFieldWrite64 (
>  Value,
>  RegisterTableEntry->ValidBitStart,
> @@ -275,6 +286,24 @@ ProgramProcessorRegister (
>  // The specified register is Model Specific Register
>  //
>  case Msr:
> +  if (RegisterTableEntry->TestThenWrite) {
> +Value = (UINTN)AsmReadMsr64 (RegisterTableEntry->Index);
> +if (RegisterTableEntry->ValidBitLength >= 64) {
> +  if (Value == RegisterTableEntry->Value) {
> +continue;
> +  }
> +} else {
> +  CurrentValue = BitFieldRead64 (
> +   Value,
> +   RegisterTableEntry->ValidBitStart,
> +   RegisterTableEntry->ValidBitStart + 
> RegisterTableEntry->ValidBitLength - 1
> +   );
> +  if (CurrentValue == RegisterTableEntry->Value) {
> +continue;
> +  }
> +}
> +  }
> +
>//
>// If this function is called to restore register setting after INIT 
> signal,
>// there is no need to restore MSRs in register table.
> 

I assume that "RegisterTableEntry->Value" has all bits clear that fall
outside of the bitmask defined by ValidBitStart and ValidBitLength.

With that assumption:

Reviewed-by: Laszlo Ersek 

Thanks
Laszlo

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

View/Reply Online (#45441): https://edk2.groups.io/g/devel/message/45441
Mute This Topic: https://groups.io/mt/32839207/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [Patch v2 2/6] UefiCpuPkg/PiSmmCpuDxeSmm: Combine CR read/write action in one function.

2019-08-12 Thread Laszlo Ersek
On 08/12/19 12:31, Eric Dong wrote:
> Signed-off-by: Eric Dong 
> Cc: Ray Ni 
> Cc: Laszlo Ersek 
> ---
>  UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c | 106 ++
>  1 file changed, 63 insertions(+), 43 deletions(-)
> 
> diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c 
> b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
> index d8c6b19ead..b20992d5ab 100644
> --- a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
> +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
> @@ -159,6 +159,58 @@ S3WaitForSemaphore (
>   ) != Value);
>  }
>  
> +/**
> +  Read / write CR value.
> +
> +  @param[in]  CrIndex The CR index which need to read/write.
> +  @param[in]  ReadRead or write. TRUE is read.
> +  @param[in,out]  CrValue CR value.
> +
> +  @retvalEFI_SUCCESS means read/write success, else return 
> EFI_UNSUPPORTED.
> +**/
> +UINTN
> +ReadWriteCr (
> +  IN UINT32   CrIndex,
> +  IN BOOLEAN  Read,
> +  IN OUT UINTN*CrValue
> +  )
> +{
> +  switch (CrIndex) {
> +  case 0:
> +if (Read) {
> +  *CrValue = AsmReadCr0 ();
> +} else {
> +  AsmWriteCr0 (*CrValue);
> +}
> +break;
> +  case 2:
> +if (Read) {
> +  *CrValue = AsmReadCr2 ();
> +} else {
> +  AsmWriteCr2 (*CrValue);
> +}
> +break;
> +  case 3:
> +if (Read) {
> +  *CrValue = AsmReadCr3 ();
> +} else {
> +  AsmWriteCr3 (*CrValue);
> +}
> +break;
> +  case 4:
> +if (Read) {
> +  *CrValue = AsmReadCr4 ();
> +} else {
> +  AsmWriteCr4 (*CrValue);
> +}
> +break;
> +  default:
> +return EFI_UNSUPPORTED;;
> +  }
> +
> +  return EFI_SUCCESS;
> +}
> +
>  /**
>Initialize the CPU registers from a register table.
>  
> @@ -188,6 +240,7 @@ ProgramProcessorRegister (
>UINTN ProcessorIndex;
>UINTN ValidThreadCount;
>UINT32*ValidCoreCountPerPackage;
> +  EFI_STATUSStatus;
>  
>//
>// Traverse Register Table of this logical processor
> @@ -206,50 +259,17 @@ ProgramProcessorRegister (
>  // The specified register is Control Register
>  //
>  case ControlRegister:
> -  switch (RegisterTableEntry->Index) {
> -  case 0:
> -Value = AsmReadCr0 ();
> -Value = (UINTN) BitFieldWrite64 (
> -  Value,
> -  RegisterTableEntry->ValidBitStart,
> -  RegisterTableEntry->ValidBitStart + 
> RegisterTableEntry->ValidBitLength - 1,
> -  (UINTN) RegisterTableEntry->Value
> -  );
> -AsmWriteCr0 (Value);
> -break;
> -  case 2:
> -Value = AsmReadCr2 ();
> -Value = (UINTN) BitFieldWrite64 (
> -  Value,
> -  RegisterTableEntry->ValidBitStart,
> -  RegisterTableEntry->ValidBitStart + 
> RegisterTableEntry->ValidBitLength - 1,
> -  (UINTN) RegisterTableEntry->Value
> -  );
> -AsmWriteCr2 (Value);
> -break;
> -  case 3:
> -Value = AsmReadCr3 ();
> -Value = (UINTN) BitFieldWrite64 (
> -  Value,
> -  RegisterTableEntry->ValidBitStart,
> -  RegisterTableEntry->ValidBitStart + 
> RegisterTableEntry->ValidBitLength - 1,
> -  (UINTN) RegisterTableEntry->Value
> -  );
> -AsmWriteCr3 (Value);
> -break;
> -  case 4:
> -Value = AsmReadCr4 ();
> -Value = (UINTN) BitFieldWrite64 (
> -  Value,
> -  RegisterTableEntry->ValidBitStart,
> -  RegisterTableEntry->ValidBitStart + 
> RegisterTableEntry->ValidBitLength - 1,
> -  (UINTN) RegisterTableEntry->Value
> -  );
> -AsmWriteCr4 (Value);
> -break;
> -  default:
> -break;
> +  Status = ReadWriteCr (RegisterTableEntry->Index, TRUE, );
> +  if (EFI_ERROR (Status)) {
> +continue;
>}
> +  Value = (UINTN) BitFieldWrite64 (
> +Value,
> +RegisterTableEntry->ValidBitStart,
> +RegisterTableEntry->ValidBitStart + 
> RegisterTableEntry->ValidBitLength - 1,
> +RegisterTableEntry->Value
> +);
> +  ReadWriteCr (RegisterTableEntry->Index, FALSE, );
>break;
>  //
>  // The specified register is Model Specific Register
> 

Using a "break" rather than a "continue" would be more consistent with
the current code, and it would have the same effect. But, there's no
need to repost just because of that.

Reviewed-by: Laszlo Ersek 

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

View/Reply Online (#45440): 

Re: [edk2-devel] [PATCH v4 15/15] MdePkg/UefiRuntimeLib: Change the comment

2019-08-12 Thread Laszlo Ersek
Hi,

On 08/12/19 05:07, Gao, Zhichao wrote:
> Change the comment of EfiResetSystem base on the
> UEFI spec 2.8
> 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Signed-off-by: Zhichao Gao 
> ---
>  MdePkg/Library/UefiRuntimeLib/RuntimeLib.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/MdePkg/Library/UefiRuntimeLib/RuntimeLib.c 
> b/MdePkg/Library/UefiRuntimeLib/RuntimeLib.c
> index 933e0099ceed..28cbf493b665 100644
> --- a/MdePkg/Library/UefiRuntimeLib/RuntimeLib.c
> +++ b/MdePkg/Library/UefiRuntimeLib/RuntimeLib.c
> @@ -218,10 +218,10 @@ EfiGoneVirtual (
>@param  DataSizeThe size, in bytes, of ResetData.
>@param  ResetData   For a ResetType of EfiResetCold, EfiResetWarm, or 
> EfiResetShutdown the data buffer starts with a
>Null-terminated Unicode string, optionally followed by 
> additional binary data. The string is a
> -  description that the caller may use to further 
> indicate the reason for the system reset. ResetData
> -  is only valid if ResetStatus is something other then 
> EFI_SUCCESS. This pointer must be a physical
> -  address. For a ResetType of EfiRestUpdate the data 
> buffer also starts with a Null-terminated string
> -  that is followed by a physical VOID * to an 
> EFI_CAPSULE_HEADER.
> +  description that the caller may use to further 
> indicate the reason for the system reset. This
> +  pointer must be a physical address. For a ResetType of 
> EfiResetPlatformSpecific the data buffer
> +  also starts with a Null-terminated string that is 
> followed by an EFI_GUID that describes the
> +  specific type of reset to perform.
>  
>  **/
>  VOID
> 

given that UefiRuntimeLib is a single-instance library class -- that is,
my understanding is that we never plan to introduce a different instance
for this class --, I would suggest fusing the following two patches into
one:

- [PATCH v4 14/15] MdePkg/UefiRuntimeLib.h: Change the comment
- [PATCH v4 15/15] MdePkg/UefiRuntimeLib: Change the comment

Also, can we please use a better (more specific) subject line?


Obviously I'm not an MdePkg maintainer (or even reviewer), so I defer to
Liming and Mike.

Thanks
Laszlo

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

View/Reply Online (#45439): https://edk2.groups.io/g/devel/message/45439
Mute This Topic: https://groups.io/mt/32836909/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v4 08/15] OvmfPkg/OvmfPkgIa32X64.dsc: Add ResetUtilityLib to dsc file

2019-08-12 Thread Laszlo Ersek
On 08/12/19 05:07, Zhichao Gao wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772
> 
> ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
> So add it for the platform dsc file.
> 
> Cc: Jordan Justen 
> Cc: Laszlo Ersek 
> Cc: Ard Biesheuvel 
> Cc: Liming Gao 
> Signed-off-by: Zhichao Gao 
> ---
>  OvmfPkg/OvmfPkgIa32X64.dsc | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
> index f163aa267132..a9f69eab8c06 100644
> --- a/OvmfPkg/OvmfPkgIa32X64.dsc
> +++ b/OvmfPkg/OvmfPkgIa32X64.dsc
> @@ -189,6 +189,7 @@ [LibraryClasses]
>  !endif
>VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
>  
> +  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
>  
>#
># Network libraries
> 

This patch is inconsistent with the other two OvmfPkg patches (different
amounts of whitespace are introduced).

However, rather than adapting the whitespace here, please do the
following instead, in all three OVMF DSC files: please resolve the
ResetUtilityLib class just under the "ResetSystemLib" class. (That one
belongs to [LibraryClasses] too.)

Thanks,
Laszlo

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

View/Reply Online (#45438): https://edk2.groups.io/g/devel/message/45438
Mute This Topic: https://groups.io/mt/32836902/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v4 03/15] ArmVirtPkg/ArmVirtQemu.dsc: Add ResetUtilityLib to dsc file

2019-08-12 Thread Laszlo Ersek
On 08/12/19 15:49, Laszlo Ersek wrote:
> Hi,
> 
> On 08/12/19 05:07, Zhichao Gao wrote:
>> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772
>>
>> ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
>> So add it for the platform dsc file.
>>
>> Cc: Laszlo Ersek 
>> Cc: Ard Biesheuvel 
>> Cc: Leif Lindholm 
>> Cc: Liming Gao 
>> Signed-off-by: Zhichao Gao 
>> ---
>>  ArmVirtPkg/ArmVirtQemu.dsc | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
>> index 7ae6702ac1f0..4b8130f8e7fe 100644
>> --- a/ArmVirtPkg/ArmVirtQemu.dsc
>> +++ b/ArmVirtPkg/ArmVirtQemu.dsc
>> @@ -73,6 +73,7 @@ [LibraryClasses.common]
>>
>> PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>>PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
>>
>> PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
>> +  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
>>  
>>  [LibraryClasses.common.PEIM]
>>
>> ArmVirtMemInfoLib|ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLib.inf
>>
> 
> thanks for updating your git config; these patches are a lot easier to read.
> 
> Under ArmVirtPkg, there are three platform DSC files that include
> CapsuleRuntimeDxe:
> 
> - ArmVirtPkg/ArmVirtQemu.dsc
> - ArmVirtPkg/ArmVirtQemuKernel.dsc
> - ArmVirtPkg/ArmVirtXen.dsc
> 
> In this v4 patch series, the last platform above doesn't seem to be updated.
> 
> I suggest dropping patches #3 and #4 from the v4 series, and adding a
> single patch that modifies "ArmVirtPkg/ArmVirt.dsc.inc".

When you update "ArmVirtPkg/ArmVirt.dsc.inc", please add the new
ResetUtilityLib class resolution just under the ResetSystemLib
resolution. (That one is also part of [LibraryClasses.common].)

Thanks
Laszlo

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

View/Reply Online (#45437): https://edk2.groups.io/g/devel/message/45437
Mute This Topic: https://groups.io/mt/32836894/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v4 03/15] ArmVirtPkg/ArmVirtQemu.dsc: Add ResetUtilityLib to dsc file

2019-08-12 Thread Laszlo Ersek
Hi,

On 08/12/19 05:07, Zhichao Gao wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772
> 
> ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
> So add it for the platform dsc file.
> 
> Cc: Laszlo Ersek 
> Cc: Ard Biesheuvel 
> Cc: Leif Lindholm 
> Cc: Liming Gao 
> Signed-off-by: Zhichao Gao 
> ---
>  ArmVirtPkg/ArmVirtQemu.dsc | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
> index 7ae6702ac1f0..4b8130f8e7fe 100644
> --- a/ArmVirtPkg/ArmVirtQemu.dsc
> +++ b/ArmVirtPkg/ArmVirtQemu.dsc
> @@ -73,6 +73,7 @@ [LibraryClasses.common]
>
> PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
>
> PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
> +  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
>  
>  [LibraryClasses.common.PEIM]
>
> ArmVirtMemInfoLib|ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLib.inf
> 

thanks for updating your git config; these patches are a lot easier to read.

Under ArmVirtPkg, there are three platform DSC files that include
CapsuleRuntimeDxe:

- ArmVirtPkg/ArmVirtQemu.dsc
- ArmVirtPkg/ArmVirtQemuKernel.dsc
- ArmVirtPkg/ArmVirtXen.dsc

In this v4 patch series, the last platform above doesn't seem to be updated.

I suggest dropping patches #3 and #4 from the v4 series, and adding a
single patch that modifies "ArmVirtPkg/ArmVirt.dsc.inc".

Thanks
Laszlo

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

View/Reply Online (#45436): https://edk2.groups.io/g/devel/message/45436
Mute This Topic: https://groups.io/mt/32836894/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [edk2-platforms: PATCH 0/1] Platforms/RPi3: Add multiple embedded Device Tree selection

2019-08-12 Thread Pete Batard
The purpose of this patch is to enable the automatic provision of a relevant
Raspberry Pi 3 Device Tree at runtime, as there currently exists 2 models of
Raspberry Pi 3 (model B and model B+) but we only embed the Device Tree for a
single one (model B).

Obviously, the provision of only a single Device Tree is inconvenient, as it
currently forces users of the model B+ to locate and provide their own Device
Tree in config.txt, which might not be a straightforward operation. It also
adds to the number of extra files that must be copied to the boot media.

With this patch, both Device Tree binaries are embedded in the firmware, with
the relevant being served at runtime according to the detected hardware.

Note that we tried to future-proof the modified code with regards to expected
introduction of new Raspberry Pi platforms (such as the Pi 4). Therefore,
while the switch in FdtDxe.c may seem like overkill for now (with cases that
could be merged), it should make the reuse of that driver easier.

We also tried to harmonize debug output if FtdDxe (avoid acronyms and provide
human readable error codes).

Pete Batard (1):
  Platforms/RPi3: Add multiple embedded Device Tree selection

 Platform/RaspberryPi/RPi3/Drivers/FdtDxe/FdtDxe.c   | 54 
 Platform/RaspberryPi/RPi3/Drivers/FdtDxe/FdtDxe.inf |  3 +-
 Platform/RaspberryPi/RPi3/RPi3.dec  |  3 +-
 Platform/RaspberryPi/RPi3/RPi3.fdf  |  6 ++-
 4 files changed, 52 insertions(+), 14 deletions(-)

-- 
2.21.0.windows.1


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

View/Reply Online (#45434): https://edk2.groups.io/g/devel/message/45434
Mute This Topic: https://groups.io/mt/32840410/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [edk2-platforms: PATCH 1/1] Platforms/RPi3: Add multiple embedded Device Tree selection

2019-08-12 Thread Pete Batard
The Raspberry Pi 3 platform currently has 2 different models, each with a
different Device Tree. Rather than embedding a single one, and requiring
users to manually provide the other, this patch ensures that we now embed
both and and serve the relevant one at runtime.

Signed-off-by: Pete Batard 
---
 Platform/RaspberryPi/RPi3/Drivers/FdtDxe/FdtDxe.c   | 57 
 Platform/RaspberryPi/RPi3/Drivers/FdtDxe/FdtDxe.inf |  3 +-
 Platform/RaspberryPi/RPi3/RPi3.dec  |  3 +-
 Platform/RaspberryPi/RPi3/RPi3.fdf  |  6 ++-
 4 files changed, 55 insertions(+), 14 deletions(-)

diff --git a/Platform/RaspberryPi/RPi3/Drivers/FdtDxe/FdtDxe.c 
b/Platform/RaspberryPi/RPi3/Drivers/FdtDxe/FdtDxe.c
index c84e5b2767e2..7c0ab75e7cb1 100644
--- a/Platform/RaspberryPi/RPi3/Drivers/FdtDxe/FdtDxe.c
+++ b/Platform/RaspberryPi/RPi3/Drivers/FdtDxe/FdtDxe.c
@@ -20,6 +20,11 @@
 
 #include 
 
+CONST  EFI_GUID *mFdtGuid[] = {
+   ,
+   ,
+};
+
 STATIC VOID *mFdtImage;
 
 STATIC RASPBERRY_PI_FIRMWARE_PROTOCOL   *mFwProtocol;
@@ -368,7 +373,9 @@ FdtDxeInitialize (
   EFI_STATUS Status;
   VOID   *FdtImage;
   UINTN  FdtSize;
+  UINTN  FdtIndex;
   INT32  Retval;
+  UINT32 BoardRevision;
   BOOLEANInternal;
 
   Status = gBS->LocateProtocol (, NULL,
@@ -383,13 +390,41 @@ FdtDxeInitialize (
  * Have FDT passed via config.txt.
  */
 FdtSize = fdt_totalsize (FdtImage);
-DEBUG ((DEBUG_INFO, "DTB passed via config.txt of 0x%lx bytes\n", 
FdtSize));
+DEBUG ((DEBUG_INFO, "Device Tree passed via config.txt (0x%lx bytes)\n", 
FdtSize));
 Status = EFI_SUCCESS;
   } else {
+/*
+ * Use one of the embedded FDT's.
+ */
 Internal = TRUE;
-DEBUG ((DEBUG_INFO, "No/bad FDT at %p (%a), trying internal DTB...\n",
-  FdtImage, fdt_strerror (Retval)));
-Status = GetSectionFromAnyFv (, EFI_SECTION_RAW, 0,
+DEBUG ((DEBUG_INFO, "No/Bad Device Tree found at address 0x%p (%a), "
+  "looking up internal one...\n", FdtImage, fdt_strerror (Retval)));
+/*
+ * Query the board revision to differentiate between models.
+ */
+Status = mFwProtocol->GetModelRevision ();
+if (EFI_ERROR (Status)) {
+  FdtIndex = 0;
+  DEBUG ((DEBUG_ERROR, "Failed to get board type: %r\n", Status));
+} else {
+  // 
www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md
+  switch ((BoardRevision >> 4) & 0xFF) {
+  case 0x08:  // Raspberry 3 Model B
+DEBUG ((DEBUG_INFO, "Using RPi3 Model B internal Device Tree\n"));
+FdtIndex = 0;
+break;
+  case 0x0D:  // Raspberry 3 Model B+
+DEBUG ((DEBUG_INFO, "Using RPi3 Model B+ internal Device Tree\n"));
+FdtIndex = 1;
+break;
+  default:
+DEBUG ((DEBUG_INFO, "Using default internal Device Tree\n"));
+FdtIndex = 0;
+break;
+  }
+}
+ASSERT (FdtIndex < ARRAY_SIZE (mFdtGuid));
+Status = GetSectionFromAnyFv (mFdtGuid[FdtIndex], EFI_SECTION_RAW, 0,
, );
 if (Status == EFI_SUCCESS) {
   if (fdt_check_header (FdtImage) != 0) {
@@ -419,27 +454,27 @@ FdtDxeInitialize (
 
   Status = SanitizePSCI ();
   if (EFI_ERROR (Status)) {
-Print (L"Failed to sanitize PSCI (error %d)\n", Status);
+Print (L"Failed to sanitize PSCI: %r\n", Status);
   }
 
   Status = CleanMemoryNodes ();
   if (EFI_ERROR (Status)) {
-Print (L"Failed to clean memory nodes (error %d)\n", Status);
+Print (L"Failed to clean memory nodes: %r\n", Status);
   }
 
   Status = CleanSimpleFramebuffer ();
   if (EFI_ERROR (Status)) {
-Print (L"Failed to clean frame buffer (error %d)\n", Status);
+Print (L"Failed to clean frame buffer: %r\n", Status);
   }
 
   Status = FixEthernetAliases ();
   if (EFI_ERROR (Status)) {
-Print (L"Failed to fix ethernet aliases (error %d)\n", Status);
+Print (L"Failed to fix ethernet aliases: %r\n", Status);
   }
 
   Status = UpdateMacAddress ();
   if (EFI_ERROR (Status)) {
-Print (L"Failed to update MAC address (error %d)\n", Status);
+Print (L"Failed to update MAC address: %r\n", Status);
   }
 
   if (Internal) {
@@ -448,11 +483,11 @@ FdtDxeInitialize (
  */
 Status = UpdateBootArgs ();
 if (EFI_ERROR (Status)) {
-  Print (L"Failed to update boot arguments (error %d)\n", Status);
+  Print (L"Failed to update boot arguments: %r\n", Status);
 }
   }
 
-  DEBUG ((DEBUG_INFO, "Installed FDT is at %p\n", mFdtImage));
+  DEBUG ((DEBUG_INFO, "Installed Device Tree at address 0x%p\n", mFdtImage));
   Status = gBS->InstallConfigurationTable (, mFdtImage);
   ASSERT_EFI_ERROR (Status);
 
diff --git a/Platform/RaspberryPi/RPi3/Drivers/FdtDxe/FdtDxe.inf 
b/Platform/RaspberryPi/RPi3/Drivers/FdtDxe/FdtDxe.inf
index 

Re: [edk2-devel] [PATCH 1/1] MdeModulePkg/DxeIplPeim: Relocate the operation of PageMapLevel5Entry++

2019-08-12 Thread Laszlo Ersek
Hello Shenglei,

On 08/12/19 08:24, Shenglei Zhang wrote:
> PageMapLevel5Entry may be uninitialized in original code, which means
> uninitialized pointer will be modified at some circumstance.
> So relocate the operation of PageMapLevel5Entry++ in order to make sure
> the pointer could be modified only when it is uninitialized.
> 
> Cc: Dandan Bi 
> Cc: Liming Gao 
> Cc: Hao A Wu 
> Cc: Laszlo Ersek 
> Cc: Eric Dong 
> Signed-off-by: Shenglei Zhang 
> ---
>  MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c 
> b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
> index b40b7e0c9813..2389f3eb485b 100644
> --- a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
> +++ b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
> @@ -764,7 +764,7 @@ CreateIdentityMappingPageTables (
>  
>for ( IndexOfPml5Entries = 0
>; IndexOfPml5Entries < NumberOfPml5EntriesNeeded
> -  ; IndexOfPml5Entries++, PageMapLevel5Entry++) {
> +  ; IndexOfPml5Entries++) {
>  //
>  // Each PML5 entry points to a page of PML4 entires.
>  // So lets allocate space for them and fill them in in the 
> IndexOfPml4Entries loop.
> @@ -780,6 +780,7 @@ CreateIdentityMappingPageTables (
>PageMapLevel5Entry->Uint64 = (UINT64) (UINTN) PageMapLevel4Entry | 
> AddressEncMask;
>PageMapLevel5Entry->Bits.ReadWrite = 1;
>PageMapLevel5Entry->Bits.Present   = 1;
> +  PageMapLevel5Entry++;
>  }
>  
>  for ( IndexOfPml4Entries = 0
> 

I prefer to leave this to the other people on CC.

Thanks
Laszlo

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

View/Reply Online (#45433): https://edk2.groups.io/g/devel/message/45433
Mute This Topic: https://groups.io/mt/32838114/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [Patch 1/4] UefiCpuPkg/RegisterCpuFeaturesLib: Add "detect before set" Micros.

2019-08-12 Thread Laszlo Ersek
On 08/12/19 09:46, Dong, Eric wrote:
> Hi Laszlo,
> 
>> -Original Message-
>> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
>> Laszlo Ersek
>> Sent: Friday, August 9, 2019 11:14 PM
>> To: Dong, Eric ; devel@edk2.groups.io
>> Cc: Ni, Ray 
>> Subject: Re: [edk2-devel] [Patch 1/4] UefiCpuPkg/RegisterCpuFeaturesLib:
>> Add "detect before set" Micros.
>>
>> On 08/09/19 08:11, Eric Dong wrote:
>>> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2040
>>>
>>> Add below new micros which test the current value before set the new
>>> value. Only set new value when current value not same as new value.
>>>   CPU_REGISTER_TABLE_TEST_THEN_WRITE32
>>>   CPU_REGISTER_TABLE_TEST_THEN_WRITE64
>>>   CPU_REGISTER_TABLE_TEST_THEN_WRITE_FIELD
>>>
>>> Signed-off-by: Eric Dong 
>>> Cc: Ray Ni 
>>> Cc: Laszlo Ersek 
>>> ---
>>>  UefiCpuPkg/Include/AcpiCpuData.h  |  1 +
>>>  .../Include/Library/RegisterCpuFeaturesLib.h  | 77 +--
>>>  .../RegisterCpuFeaturesLib.c  | 14 +++-
>>>  3 files changed, 80 insertions(+), 12 deletions(-)
>>
>> (1) When you format your patch sets, can you please use the following two
>> options:
>>
>>  --stat=1000 --stat-graph-width=20
>>
>> Otherwise the diffstats are truncated (on the left) and hard to understand.
>>
> 
> 1. I use TortoiseGit to create patch, do you know how to enable these setting 
> in TortoiseGit?

Sorry, no clue :(

>  
>>>
>>> diff --git a/UefiCpuPkg/Include/AcpiCpuData.h
>>> b/UefiCpuPkg/Include/AcpiCpuData.h
>>> index b963a2f592..c764e209cf 100644
>>> --- a/UefiCpuPkg/Include/AcpiCpuData.h
>>> +++ b/UefiCpuPkg/Include/AcpiCpuData.h
>>> @@ -81,6 +81,7 @@ typedef struct {
>>>UINT16 Reserved;  // offset 10 - 11
>>>UINT32 HighIndex; // offset 12-15, only valid for
>> MemoryMapped
>>>UINT64 Value; // offset 16-23
>>> +  UINT8  DetectIt;  // 0ffset 24
>>>  } CPU_REGISTER_TABLE_ENTRY;
>>
>> (2) Another quite generic comment -- "DetectIt" does not look helpful.
>> Somehow the verb "detect" does not communicate the right action to me.
>>
>> How about using a more established name, such as:
>>
>> - CompareAndSwap
>> - CompareAndSet
>> - TestAndSet
>>
>> ?
>>
>> If you agree, then I suggest updating the parameter names, and their
>> comments too, below.
> 
> 2.  Yes, I change from "TestIt" to "DetectIt" because I think it's better. 
> Seems like this is not a correct change. 
> I will use "TestThenWrite" as the new name which align our new macro " 
> CPU_REGISTER_TABLE_TEST_THEN_WRITE". What do you think?

Sounds good, thanks.

Laszlo

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

View/Reply Online (#45432): https://edk2.groups.io/g/devel/message/45432
Mute This Topic: https://groups.io/mt/32807819/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [Patch] Readme.md: Remove tag release from Readme

2019-08-12 Thread Laszlo Ersek
On 08/12/19 04:09, Liming Gao wrote:
> The latest tag release can be found in Release Planning.
> They are not required to be listed here.
> 
> Cc: Andrew Fish 
> Cc: Laszlo Ersek 
> Cc: Leif Lindholm 
> Cc: Michael D Kinney 
> Signed-off-by: Liming Gao 
> ---
>  Readme.md | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/Readme.md b/Readme.md
> index e564c6c09b..7c873759a5 100644
> --- a/Readme.md
> +++ b/Readme.md
> @@ -28,9 +28,6 @@ are listed in [Maintainers.txt](Maintainers.txt).
>  * [TianoCore Bugzilla](https://bugzilla.tianocore.org)
>  * [How To 
> Contribute](https://github.com/tianocore/tianocore.github.io/wiki/How-To-Contribute)
>  * [Release 
> Planning](https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Release-Planning)
> -* [UDK2017](https://github.com/tianocore/edk2/releases/tag/vUDK2017)
> -* [UDK2018](https://github.com/tianocore/edk2/releases/tag/vUDK2018)
> -* 
> [edk2-stable201811](https://github.com/tianocore/edk2/releases/tag/edk2-stable201811)
>  
>  # Code Contributions
>  To make a contribution to a TianoCore project, follow these steps.
> 

Reviewed-by: Laszlo Ersek 

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

View/Reply Online (#45431): https://edk2.groups.io/g/devel/message/45431
Mute This Topic: https://groups.io/mt/32836513/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [Patch v2 3/6] UefiCpuPkg/PiSmmCpuDxeSmm: Supports test then write new value logic.

2019-08-12 Thread Dong, Eric
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2040

Supports new logic which test current value before write new value.
Only write new value when current value not same as new value.

Signed-off-by: Eric Dong 
Cc: Ray Ni 
Cc: Laszlo Ersek 
---
 UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c | 29 +
 1 file changed, 29 insertions(+)

diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c 
b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
index b20992d5ab..61541838e8 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
@@ -241,6 +241,7 @@ ProgramProcessorRegister (
   UINTN ValidThreadCount;
   UINT32*ValidCoreCountPerPackage;
   EFI_STATUSStatus;
+  UINT64CurrentValue;
 
   //
   // Traverse Register Table of this logical processor
@@ -263,6 +264,16 @@ ProgramProcessorRegister (
   if (EFI_ERROR (Status)) {
 continue;
   }
+  if (RegisterTableEntry->TestThenWrite) {
+CurrentValue = BitFieldRead64 (
+ Value,
+ RegisterTableEntry->ValidBitStart,
+ RegisterTableEntry->ValidBitStart + 
RegisterTableEntry->ValidBitLength - 1
+ );
+if (CurrentValue == RegisterTableEntry->Value) {
+  continue;
+}
+  }
   Value = (UINTN) BitFieldWrite64 (
 Value,
 RegisterTableEntry->ValidBitStart,
@@ -275,6 +286,24 @@ ProgramProcessorRegister (
 // The specified register is Model Specific Register
 //
 case Msr:
+  if (RegisterTableEntry->TestThenWrite) {
+Value = (UINTN)AsmReadMsr64 (RegisterTableEntry->Index);
+if (RegisterTableEntry->ValidBitLength >= 64) {
+  if (Value == RegisterTableEntry->Value) {
+continue;
+  }
+} else {
+  CurrentValue = BitFieldRead64 (
+   Value,
+   RegisterTableEntry->ValidBitStart,
+   RegisterTableEntry->ValidBitStart + 
RegisterTableEntry->ValidBitLength - 1
+   );
+  if (CurrentValue == RegisterTableEntry->Value) {
+continue;
+  }
+}
+  }
+
   //
   // If this function is called to restore register setting after INIT 
signal,
   // there is no need to restore MSRs in register table.
-- 
2.21.0.windows.1


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

View/Reply Online (#45427): https://edk2.groups.io/g/devel/message/45427
Mute This Topic: https://groups.io/mt/32839207/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [Patch v2 5/6] UefiCpuPkg/RegisterCpuFeaturesLib: Supports test then write new value logic.

2019-08-12 Thread Dong, Eric
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2040

Supports new logic which test current value before write new value.
Only write new value when current value not same as new value.

Signed-off-by: Eric Dong 
Cc: Ray Ni 
Cc: Laszlo Ersek 
---
 .../CpuFeaturesInitialize.c   | 31 ++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c 
b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
index ef7452e2b8..6988a75bfe 100644
--- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
+++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
@@ -826,6 +826,7 @@ ProgramProcessorRegister (
   UINTN ValidThreadCount;
   UINT32*ValidCoreCountPerPackage;
   EFI_STATUSStatus;
+  UINT64CurrentValue;
 
   //
   // Traverse Register Table of this logical processor
@@ -848,7 +849,16 @@ ProgramProcessorRegister (
   if (EFI_ERROR (Status)) {
 continue;
   }
-
+  if (RegisterTableEntry->TestThenWrite) {
+CurrentValue = BitFieldRead64 (
+ Value,
+ RegisterTableEntry->ValidBitStart,
+ RegisterTableEntry->ValidBitStart + 
RegisterTableEntry->ValidBitLength - 1
+ );
+if (CurrentValue == RegisterTableEntry->Value) {
+  continue;
+}
+  }
   Value = (UINTN) BitFieldWrite64 (
 Value,
 RegisterTableEntry->ValidBitStart,
@@ -857,10 +867,29 @@ ProgramProcessorRegister (
 );
   ReadWriteCr (RegisterTableEntry->Index, FALSE, );
   break;
+
 //
 // The specified register is Model Specific Register
 //
 case Msr:
+  if (RegisterTableEntry->TestThenWrite) {
+Value = (UINTN)AsmReadMsr64 (RegisterTableEntry->Index);
+if (RegisterTableEntry->ValidBitLength >= 64) {
+  if (Value == RegisterTableEntry->Value) {
+continue;
+  }
+} else {
+  CurrentValue = BitFieldRead64 (
+   Value,
+   RegisterTableEntry->ValidBitStart,
+   RegisterTableEntry->ValidBitStart + 
RegisterTableEntry->ValidBitLength - 1
+   );
+  if (CurrentValue == RegisterTableEntry->Value) {
+continue;
+  }
+}
+  }
+
   if (RegisterTableEntry->ValidBitLength >= 64) {
 //
 // If length is not less than 64 bits, then directly write without 
reading
-- 
2.21.0.windows.1


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

View/Reply Online (#45429): https://edk2.groups.io/g/devel/message/45429
Mute This Topic: https://groups.io/mt/32839209/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [Patch v2 1/6] UefiCpuPkg/RegisterCpuFeaturesLib: Add "Test Then Write" Macros.

2019-08-12 Thread Dong, Eric
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2040

Add below new micros which test the current value before write
the new value. Only write new value when current value not
same as new value.
  CPU_REGISTER_TABLE_TEST_THEN_WRITE32
  CPU_REGISTER_TABLE_TEST_THEN_WRITE64
  CPU_REGISTER_TABLE_TEST_THEN_WRITE_FIELD

Signed-off-by: Eric Dong 
Cc: Ray Ni 
Cc: Laszlo Ersek 
---
 UefiCpuPkg/Include/AcpiCpuData.h  |  1 +
 .../Include/Library/RegisterCpuFeaturesLib.h  | 77 +--
 .../RegisterCpuFeaturesLib.c  | 14 +++-
 3 files changed, 80 insertions(+), 12 deletions(-)

diff --git a/UefiCpuPkg/Include/AcpiCpuData.h b/UefiCpuPkg/Include/AcpiCpuData.h
index b963a2f592..472a1a8070 100644
--- a/UefiCpuPkg/Include/AcpiCpuData.h
+++ b/UefiCpuPkg/Include/AcpiCpuData.h
@@ -81,6 +81,7 @@ typedef struct {
   UINT16 Reserved;  // offset 10 - 11
   UINT32 HighIndex; // offset 12-15, only valid for 
MemoryMapped
   UINT64 Value; // offset 16-23
+  UINT8  TestThenWrite;   // 0ffset 24
 } CPU_REGISTER_TABLE_ENTRY;
 
 //
diff --git a/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h 
b/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
index e420e7f075..7e613d883e 100644
--- a/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
+++ b/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
@@ -335,6 +335,7 @@ SwitchBspAfterFeaturesInitialize (
   @param[in]  IndexIndex of the register to program
   @param[in]  ValueMaskMask of bits in register to write
   @param[in]  ValueValue to write
+  @param[in]  TestThenWriteWhether need to test current Value before 
writing.
 
   @note This service could be called by BSP only.
 **/
@@ -345,7 +346,8 @@ CpuRegisterTableWrite (
   IN REGISTER_TYPE   RegisterType,
   IN UINT64  Index,
   IN UINT64  ValueMask,
-  IN UINT64  Value
+  IN UINT64  Value,
+  IN UINT8   TestThenWrite
   );
 
 /**
@@ -385,9 +387,45 @@ PreSmmCpuRegisterTableWrite (
 
   @note This service could be called by BSP only.
 **/
-#define CPU_REGISTER_TABLE_WRITE32(ProcessorNumber, RegisterType, Index, 
Value)   \
-  do { 
   \
-CpuRegisterTableWrite (ProcessorNumber, RegisterType, Index, MAX_UINT32, 
Value);  \
+#define CPU_REGISTER_TABLE_WRITE32(ProcessorNumber, RegisterType, Index, 
Value)  \
+  do { 
  \
+CpuRegisterTableWrite (ProcessorNumber, RegisterType, Index, MAX_UINT32, 
Value, FALSE);  \
+  } while(FALSE);
+
+/**
+  Adds a 32-bit register write entry in specified register table.
+
+  This macro adds an entry in specified register table, with given register 
type,
+  register index, and value.
+
+  @param[in]  ProcessorNumber  The index of the CPU to add a register table 
entry.
+  @param[in]  RegisterType Type of the register to program
+  @param[in]  IndexIndex of the register to program
+  @param[in]  ValueValue to write
+
+  @note This service could be called by BSP only.
+**/
+#define CPU_REGISTER_TABLE_TEST_THEN_WRITE32(ProcessorNumber, RegisterType, 
Index, Value)   \
+  do { 
 \
+CpuRegisterTableWrite (ProcessorNumber, RegisterType, Index, MAX_UINT32, 
Value, TRUE);  \
+  } while(FALSE);
+
+/**
+  Adds a 64-bit register write entry in specified register table.
+
+  This macro adds an entry in specified register table, with given register 
type,
+  register index, and value.
+
+  @param[in]  ProcessorNumber  The index of the CPU to add a register table 
entry.
+  @param[in]  RegisterType Type of the register to program
+  @param[in]  IndexIndex of the register to program
+  @param[in]  ValueValue to write
+
+  @note This service could be called by BSP only.
+**/
+#define CPU_REGISTER_TABLE_WRITE64(ProcessorNumber, RegisterType, Index, 
Value)  \
+  do { 
  \
+CpuRegisterTableWrite (ProcessorNumber, RegisterType, Index, MAX_UINT64, 
Value, FALSE);  \
   } while(FALSE);
 
 /**
@@ -403,9 +441,9 @@ PreSmmCpuRegisterTableWrite (
 
   @note This service could be called by BSP only.
 **/
-#define CPU_REGISTER_TABLE_WRITE64(ProcessorNumber, RegisterType, Index, 
Value)   \
-  do { 
   \
-CpuRegisterTableWrite (ProcessorNumber, RegisterType, Index, MAX_UINT64, 
Value);  \
+#define CPU_REGISTER_TABLE_TEST_THEN_WRITE64(ProcessorNumber, RegisterType, 
Index, Value)   \
+  do { 
 \
+CpuRegisterTableWrite 

[edk2-devel] [Patch v2 6/6] UefiCpuPkg/CpuCommonFeaturesLib: Use new macros.

2019-08-12 Thread Dong, Eric
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2040

Below code is current implementation:
  if (MsrRegister[ProcessorNumber].Bits.Lock == 0) {
CPU_REGISTER_TABLE_WRITE_FIELD (
  ProcessorNumber,
  Msr,
  MSR_IA32_FEATURE_CONTROL,
  MSR_IA32_FEATURE_CONTROL_REGISTER,
  Bits.Lock,
  1
);
  }

1. In first normal boot, the Bits.Lock is 0, 1 will be added
   into the register table and then will set to the MSR.
2. Trig warm reboot, MSR value preserves. After normal boot phase,
   the Bits.Lock is 1, so it will not be added into the register
   table during the warm reboot phase.
3. Trig S3 then resume, the Bits.Lock change to 0 and Bits.Lock is
   not added in register table, so it's still 0 after resume. This
   is not an expect behavior. The expect value is the value should
   always 1 after booting or resuming from S3.

The root cause for this issue is
1. driver bases on current value to insert the "set value action" to
   the register table.
2. Some MSRs may reserve their value during warm reboot.

The solution for this issue is using new added macros for the MSRs which
preserve value during warm reboot.

Signed-off-by: Eric Dong 
Cc: Ray Ni 
Cc: Laszlo Ersek 
---
 .../CpuCommonFeaturesLib/CpuCommonFeatures.h  |  15 --
 .../CpuCommonFeaturesLib.c|   8 +-
 .../CpuCommonFeaturesLib/FeatureControl.c | 141 ++
 .../CpuCommonFeaturesLib/MachineCheck.c   |  23 ++-
 4 files changed, 58 insertions(+), 129 deletions(-)

diff --git a/UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeatures.h 
b/UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeatures.h
index 25d0174727..b2390e6c39 100644
--- a/UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeatures.h
+++ b/UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeatures.h
@@ -848,21 +848,6 @@ X2ApicInitialize (
   IN BOOLEAN   State
   );
 
-/**
-  Prepares for the data used by CPU feature detection and initialization.
-
-  @param[in]  NumberOfProcessors  The number of CPUs in the platform.
-
-  @return  Pointer to a buffer of CPU related configuration data.
-
-  @note This service could be called by BSP only.
-**/
-VOID *
-EFIAPI
-FeatureControlGetConfigData (
-  IN UINTN   NumberOfProcessors
-  );
-
 /**
   Prepares for the data used by CPU feature detection and initialization.
 
diff --git a/UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeaturesLib.c 
b/UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeaturesLib.c
index fd43b8d662..f0dd3a3b43 100644
--- a/UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeaturesLib.c
+++ b/UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeaturesLib.c
@@ -91,7 +91,7 @@ CpuCommonFeaturesLibConstructor (
   if (IsCpuFeatureSupported (CPU_FEATURE_LOCK_FEATURE_CONTROL_REGISTER)) {
 Status = RegisterCpuFeature (
"Lock Feature Control Register",
-   FeatureControlGetConfigData,
+   NULL,
LockFeatureControlRegisterSupport,
LockFeatureControlRegisterInitialize,
CPU_FEATURE_LOCK_FEATURE_CONTROL_REGISTER,
@@ -102,7 +102,7 @@ CpuCommonFeaturesLibConstructor (
   if (IsCpuFeatureSupported (CPU_FEATURE_SMX)) {
 Status = RegisterCpuFeature (
"SMX",
-   FeatureControlGetConfigData,
+   NULL,
SmxSupport,
SmxInitialize,
CPU_FEATURE_SMX,
@@ -114,7 +114,7 @@ CpuCommonFeaturesLibConstructor (
   if (IsCpuFeatureSupported (CPU_FEATURE_VMX)) {
 Status = RegisterCpuFeature (
"VMX",
-   FeatureControlGetConfigData,
+   NULL,
VmxSupport,
VmxInitialize,
CPU_FEATURE_VMX,
@@ -214,7 +214,7 @@ CpuCommonFeaturesLibConstructor (
   if (IsCpuFeatureSupported (CPU_FEATURE_LMCE)) {
 Status = RegisterCpuFeature (
"LMCE",
-   FeatureControlGetConfigData,
+   NULL,
LmceSupport,
LmceInitialize,
CPU_FEATURE_LMCE,
diff --git a/UefiCpuPkg/Library/CpuCommonFeaturesLib/FeatureControl.c 
b/UefiCpuPkg/Library/CpuCommonFeaturesLib/FeatureControl.c
index 3712ef1e5c..6679df8ba4 100644
--- a/UefiCpuPkg/Library/CpuCommonFeaturesLib/FeatureControl.c
+++ b/UefiCpuPkg/Library/CpuCommonFeaturesLib/FeatureControl.c
@@ -8,28 +8,6 @@
 
 #include "CpuCommonFeatures.h"
 
-/**
-  Prepares for the data used by CPU feature detection and initialization.
-
-  @param[in]  NumberOfProcessors  The number of CPUs in the platform.
-
-  @return  Pointer to a buffer of CPU related configuration data.
-
-  @note This service could be called by BSP only.
-**/
-VOID *
-EFIAPI
-FeatureControlGetConfigData (
-  IN UINTN   NumberOfProcessors
-  )
-{
-  VOID  *ConfigData;
-
-  ConfigData = AllocateZeroPool (sizeof (MSR_IA32_FEATURE_CONTROL_REGISTER) * 
NumberOfProcessors);
-  ASSERT (ConfigData != NULL);
-  

[edk2-devel] [Patch v2 0/6] Add "test then write" mechanism.

2019-08-12 Thread Dong, Eric
V2 changes:
1. Split CR read/write action in to one discrete patch
2. Keep the old logic which continue the process if error found.

Below code is current implementation:
  if (MsrRegister[ProcessorNumber].Bits.Lock == 0) {
CPU_REGISTER_TABLE_WRITE_FIELD (
  ProcessorNumber,
  Msr,
  MSR_IA32_FEATURE_CONTROL,
  MSR_IA32_FEATURE_CONTROL_REGISTER,
  Bits.Lock,
  1
);
  }

With below steps, the Bits.Lock bit will lose its value:
1. Trig normal boot, the Bits.Lock is 0. 1 will be added
   into the register table and then will set to the MSR.
2. Trig warm reboot, MSR value preserves. After normal boot phase,
   the Bits.Lock is 1, so it will not be added into the register
   table during the warm reboot phase.
3. Trig S3 then resume, the Bits.Lock change to 0 and Bits.Lock is
   not added in register table during normal boot phase. so it's
   still 0 after resume. 
This is not an expect behavior. The expect result is the value should
always 1 after booting or resuming from S3.

The root cause for this issue is
1. driver bases on current value to insert the "set value action" to
   the register table.
2. Some MSRs may reserve their value during warm reboot. So the insert
   action may be skip after warm reboot.

The solution for this issue is:
1. Always add "Test then Set" action for above referred MSRs.
2. Detect current value before set new value. Only set new value when
   current value not same as new value.

Cc: Ray Ni 
Cc: Laszlo Ersek 

Eric Dong (6):
  UefiCpuPkg/RegisterCpuFeaturesLib: Add "Test Then Write" Macros.
  UefiCpuPkg/PiSmmCpuDxeSmm: Combine CR read/write action in one
function.
  UefiCpuPkg/PiSmmCpuDxeSmm: Supports test then write new value logic.
  UefiCpuPkg/RegisterCpuFeaturesLib: Combine CR read/write action in one
function.
  UefiCpuPkg/RegisterCpuFeaturesLib: Supports test then write new value
logic.
  UefiCpuPkg/CpuCommonFeaturesLib: Use new macros.

 UefiCpuPkg/Include/AcpiCpuData.h  |   1 +
 .../Include/Library/RegisterCpuFeaturesLib.h  |  77 +-
 .../CpuCommonFeaturesLib/CpuCommonFeatures.h  |  15 --
 .../CpuCommonFeaturesLib.c|   8 +-
 .../CpuCommonFeaturesLib/FeatureControl.c | 141 ++
 .../CpuCommonFeaturesLib/MachineCheck.c   |  23 ++-
 .../CpuFeaturesInitialize.c   | 141 --
 .../RegisterCpuFeaturesLib.c  |  14 +-
 UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c | 135 +++--
 9 files changed, 323 insertions(+), 232 deletions(-)

-- 
2.21.0.windows.1


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

View/Reply Online (#45424): https://edk2.groups.io/g/devel/message/45424
Mute This Topic: https://groups.io/mt/32839204/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [Patch v2 4/6] UefiCpuPkg/RegisterCpuFeaturesLib: Combine CR read/write action in one function.

2019-08-12 Thread Dong, Eric
Signed-off-by: Eric Dong 
Cc: Ray Ni 
Cc: Laszlo Ersek 
---
 .../CpuFeaturesInitialize.c   | 112 ++
 1 file changed, 64 insertions(+), 48 deletions(-)

diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c 
b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
index fb0535edd6..ef7452e2b8 100644
--- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
+++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
@@ -744,6 +744,58 @@ LibWaitForSemaphore (
  ) != Value);
 }
 
+/**
+  Read / write CR value.
+
+  @param[in]  CrIndex The CR index which need to read/write.
+  @param[in]  ReadRead or write. TRUE is read.
+  @param[in,out]  CrValue CR value.
+
+  @retvalEFI_SUCCESS means read/write success, else return EFI_UNSUPPORTED.
+**/
+UINTN
+ReadWriteCr (
+  IN UINT32   CrIndex,
+  IN BOOLEAN  Read,
+  IN OUT UINTN*CrValue
+  )
+{
+  switch (CrIndex) {
+  case 0:
+if (Read) {
+  *CrValue = AsmReadCr0 ();
+} else {
+  AsmWriteCr0 (*CrValue);
+}
+break;
+  case 2:
+if (Read) {
+  *CrValue = AsmReadCr2 ();
+} else {
+  AsmWriteCr2 (*CrValue);
+}
+break;
+  case 3:
+if (Read) {
+  *CrValue = AsmReadCr3 ();
+} else {
+  AsmWriteCr3 (*CrValue);
+}
+break;
+  case 4:
+if (Read) {
+  *CrValue = AsmReadCr4 ();
+} else {
+  AsmWriteCr4 (*CrValue);
+}
+break;
+  default:
+return EFI_UNSUPPORTED;;
+  }
+
+  return EFI_SUCCESS;
+}
+
 /**
   Initialize the CPU registers from a register table.
 
@@ -773,6 +825,7 @@ ProgramProcessorRegister (
   UINTN ProcessorIndex;
   UINTN ValidThreadCount;
   UINT32*ValidCoreCountPerPackage;
+  EFI_STATUSStatus;
 
   //
   // Traverse Register Table of this logical processor
@@ -791,55 +844,18 @@ ProgramProcessorRegister (
 // The specified register is Control Register
 //
 case ControlRegister:
-  switch (RegisterTableEntry->Index) {
-  case 0:
-Value = AsmReadCr0 ();
-Value = (UINTN) BitFieldWrite64 (
-  Value,
-  RegisterTableEntry->ValidBitStart,
-  RegisterTableEntry->ValidBitStart + 
RegisterTableEntry->ValidBitLength - 1,
-  RegisterTableEntry->Value
-  );
-AsmWriteCr0 (Value);
-break;
-  case 2:
-Value = AsmReadCr2 ();
-Value = (UINTN) BitFieldWrite64 (
-  Value,
-  RegisterTableEntry->ValidBitStart,
-  RegisterTableEntry->ValidBitStart + 
RegisterTableEntry->ValidBitLength - 1,
-  RegisterTableEntry->Value
-  );
-AsmWriteCr2 (Value);
-break;
-  case 3:
-Value = AsmReadCr3 ();
-Value = (UINTN) BitFieldWrite64 (
-  Value,
-  RegisterTableEntry->ValidBitStart,
-  RegisterTableEntry->ValidBitStart + 
RegisterTableEntry->ValidBitLength - 1,
-  RegisterTableEntry->Value
-  );
-AsmWriteCr3 (Value);
-break;
-  case 4:
-Value = AsmReadCr4 ();
-Value = (UINTN) BitFieldWrite64 (
-  Value,
-  RegisterTableEntry->ValidBitStart,
-  RegisterTableEntry->ValidBitStart + 
RegisterTableEntry->ValidBitLength - 1,
-  RegisterTableEntry->Value
-  );
-AsmWriteCr4 (Value);
-break;
-  case 8:
-//
-//  Do we need to support CR8?
-//
-break;
-  default:
-break;
+  Status = ReadWriteCr (RegisterTableEntry->Index, TRUE, );
+  if (EFI_ERROR (Status)) {
+continue;
   }
+
+  Value = (UINTN) BitFieldWrite64 (
+Value,
+RegisterTableEntry->ValidBitStart,
+RegisterTableEntry->ValidBitStart + 
RegisterTableEntry->ValidBitLength - 1,
+RegisterTableEntry->Value
+);
+  ReadWriteCr (RegisterTableEntry->Index, FALSE, );
   break;
 //
 // The specified register is Model Specific Register
-- 
2.21.0.windows.1


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

View/Reply Online (#45428): https://edk2.groups.io/g/devel/message/45428
Mute This Topic: https://groups.io/mt/32839208/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH] UefiCpuPkg: Adding a new TSC library by using CPUID(0x15) TSC leaf

2019-08-12 Thread Zeng, Star
Some comments below.

> -Original Message-
> From: Kuo, Donald
> Sent: Monday, August 12, 2019 1:57 PM
> To: devel@edk2.groups.io
> Cc: Ni, Ray ; Zeng, Star ; Dong, Eric
> 
> Subject: [PATCH] UefiCpuPkg: Adding a new TSC library by using CPUID(0x15)
> TSC leaf
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1909
> 
> Cc: Ray Ni 
> Cc: Star Zeng 
> Cc: Eric Dong 
> Signed-off-by: Donald Kuo 
> ---
>  .../Library/BaseCpuTimerLib/BaseCpuTimerLib.c  |  40 +++
>  .../Library/BaseCpuTimerLib/BaseCpuTimerLib.inf|  35 +++
>  .../Library/BaseCpuTimerLib/BaseCpuTimerLib.uni|  17 ++
>  UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c   | 290
> +
>  UefiCpuPkg/UefiCpuPkg.dec  |   8 +
>  UefiCpuPkg/UefiCpuPkg.dsc  |   4 +-
>  6 files changed, 393 insertions(+), 1 deletion(-)  create mode 100644
> UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.c
>  create mode 100644
> UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.inf
>  create mode 100644
> UefiCpuPkg/Library/BaseCpuTimerLib/BaseCpuTimerLib.uni
>  create mode 100644 UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c
> 


[Trimmed]


> +
> diff --git a/UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c
> b/UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c
> new file mode 100644
> index 00..5ed01146cf
> --- /dev/null
> +++ b/UefiCpuPkg/Library/BaseCpuTimerLib/CpuTimerLib.c
> @@ -0,0 +1,290 @@
> +/** @file
> +  CPUID Leaf 0x15 for Core Crystal Clock frequency instance of Timer Library.
> +
> +  Copyright (c) 2019 Intel Corporation. All rights reserved.
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +/**
> +  Internal function to retrieves the 64-bit frequency in Hz.
> +
> +  Internal function to retrieves the 64-bit frequency in Hz.
> +
> +  @return The frequency in Hz.
> +
> +**/
> +UINT64
> +InternalGetPerformanceCounterFrequency (
> +  VOID
> +  );
> +
> +/**
> +  CPUID Leaf 0x15 for Core Crystal Clock Frequency.
> +
> +  The TSC counting frequency is determined by using CPUID leaf 0x15.
> Frequency in MHz = Core XTAL frequency * EBX/EAX.
> +  In newer flavors of the CPU, core xtal frequency is returned in ECX or 0 if
> not supported.
> +  @return The number of TSC counts per second.
> +
> +**/
> +UINT64
> +CpuidCoreClockCalculateTscFrequency (
> +  VOID
> +  )
> +{
> +  CPUID_VERSION_INFO_EAX Eax;
> +  UINT64 TscFrequency;
> +  UINT64 CoreXtalFrequency;
> +  UINT32 RegEax;
> +  UINT32 RegEbx;
> +  UINT32 RegEcx;
> +
> +  //
> +  // Display CPU FAMILY / MODEL / STEPPING ID Info  //  AsmCpuid
> + (CPUID_VERSION_INFO, , NULL, NULL, NULL);  DEBUG
> + ((DEBUG_INFO, "CPUID = %X\n", (Eax.Uint32 & 0x0FFF0FFF)));

Suggest removing this debugging code block.

> +
> +  //
> +  // Use CPUID leaf 0x15 Time Stamp Counter and Nominal Core Crystal
> + Clock Information  // EBX returns 0 if not supported. ECX, if non zero,
> provides Core Xtal Frequency in hertz.
> +  // TSC frequency = (ECX, Core Xtal Frequency) * EBX/EAX.
> +  //
> +  AsmCpuid (CPUID_TIME_STAMP_COUNTER, , , ,
> NULL);
> + DEBUG ((DEBUG_INFO, "Denominator of the TSC ratio = %d\n", RegEax));
> + DEBUG ((DEBUG_INFO, "Numerator of the TSC ratio = %d\n", RegEbx));
> + DEBUG ((DEBUG_INFO, "Nominal frequency (hertz) = %d\n", RegEcx));

Suggest removing this debug message codes as the timerlib may be used by AP.

> +
> +  //
> +  // If EBX returns 0, the XTAL ratio is not enumerated.
> +  //
> +  if (RegEbx == 0) {
> +DEBUG ((DEBUG_ERROR, "The CPU is not capble for Core Crystal Clock
> Frequency !!\n"));

Suggest removing this debug message codes as the timerlib may be used by AP.
Then the if condition can be also removed.

> +ASSERT (RegEbx != 0);
> +  }
> +  //
> +  // If ECX returns 0, the XTAL frequency is not enumerated.
> +  //
> +  if (RegEcx == 0) {
> +DEBUG ((DEBUG_ERROR, "The CPU is not capble for Core Crystal Clock
> Frequency !!\n"));

Suggest removing this debug message codes as the timerlib may be used by AP.

> +CoreXtalFrequency = PcdGet64 (PcdCpuCoreCrystalClockFrequency);
> +DEBUG ((DEBUG_INFO, "CoreXtalFrequency (hertz) from PCD = %d\n",
> CoreXtalFrequency));

Suggest removing this debug message codes as the timerlib may be used by AP.

> +//ASSERT (RegEcx != 0);

Suggest removing this line

> +  } else {
> +CoreXtalFrequency = (UINT64) RegEcx;  }
> +
> +  //
> +  // Calculate TSC frequency = (ECX, Core Xtal Frequency) * EBX/EAX  //
> + TscFrequency = DivU64x32 (MultU64x32 (CoreXtalFrequency, RegEbx) +
> + (UINT64)(RegEax >> 1), RegEax);
> +
> +  return TscFrequency;
> +}
> +

[Trimmed]

> --- a/UefiCpuPkg/UefiCpuPkg.dsc
> +++ b/UefiCpuPkg/UefiCpuPkg.dsc
> @@ -42,7 +42,7 @@
>PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
>

Re: [edk2-devel] [PATCH 1/3] NetworkPkg: Add Dpc protocol

2019-08-12 Thread Siyuan, Fu
Reviewed-by: Siyuan Fu 

> -Original Message-
> From: Zhang, Shenglei
> Sent: 2019年8月12日 16:37
> To: devel@edk2.groups.io
> Cc: Fu, Siyuan ; Wu, Jiaxin 
> Subject: [PATCH 1/3] NetworkPkg: Add Dpc protocol
> 
> To move Dpc.h from MdeModulePkg to NetworkPkg,
> we need to introduce the Guid of protocol first.
> https://bugzilla.tianocore.org/show_bug.cgi?id=1949
> 
> Cc: Siyuan Fu 
> Cc: Jiaxin Wu 
> Signed-off-by: Shenglei Zhang 
> ---
>  NetworkPkg/NetworkPkg.dec | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/NetworkPkg/NetworkPkg.dec b/NetworkPkg/NetworkPkg.dec
> index b260ea5b77c5..2bdb3f5663a2 100644
> --- a/NetworkPkg/NetworkPkg.dec
> +++ b/NetworkPkg/NetworkPkg.dec
> @@ -70,6 +70,10 @@ [Guids]
># Include/Guid/WifiConnectionManagerConfigHii.h
>gWifiConfigGuid   = { 0x9f94d327, 0x0b18, 0x4245, { 0x8f, 
> 0xf2, 0x83,
> 0x2e, 0x30, 0xd, 0x2c, 0xef }}
> 
> +[Protocols]
> +  ## Include/Protocol/Dpc.h
> +  gEfiDpcProtocolGuid   = {0x480f8ae9, 0xc46, 0x4aa9,  { 0xbc, 0x89, 
> 0xdb,
> 0x9f, 0xba, 0x61, 0x98, 0x6 }}
> +
>  [PcdsFixedAtBuild]
>## The max attempt number will be created by iSCSI driver.
># @Prompt Max attempt number.
> --
> 2.18.0.windows.1


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

View/Reply Online (#45420): https://edk2.groups.io/g/devel/message/45420
Mute This Topic: https://groups.io/mt/32838743/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH 3/3] MdeModulePkg/MdeModulePkg.dec: Remove gEfiDpcProtocolGuid

2019-08-12 Thread Zhang, Shenglei
Since the transfer has been finished in previous patches,
gEfiDpcProtocolGuid can be removed.
https://bugzilla.tianocore.org/show_bug.cgi?id=1949

Cc: Jian J Wang 
Cc: Hao A Wu 
Signed-off-by: Shenglei Zhang 
---
 MdeModulePkg/MdeModulePkg.dec | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 35935d7aa623..cf08e959f69a 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -489,9 +489,6 @@ [Protocols]
   # Include/Protocol/DebuggerConfiguration.h
   gEfiDebuggerConfigurationProtocolGuid = { 0x577d959c, 0xe967, 0x4546, { 
0x86, 0x20, 0xc7, 0x78, 0xfa, 0xe5, 0xda, 0x05 }}
 
-  ## Include/Protocol/Dpc.h
-  gEfiDpcProtocolGuid= {0x480f8ae9, 0xc46, 0x4aa9,  { 0xbc, 0x89, 
0xdb, 0x9f, 0xba, 0x61, 0x98, 0x6 }}
-
   ## Fault Tolerant Write protocol provides boot-time service to do fault 
tolerant write capability for block devices.
   #  Include/Protocol/FaultTolerantWrite.h
   gEfiFaultTolerantWriteProtocolGuid = { 0x3EBD9E82, 0x2C78, 0x4DE6, { 0x97, 
0x86, 0x8D, 0x4B, 0xFC, 0xB7, 0xC8, 0x81 }}
-- 
2.18.0.windows.1


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

View/Reply Online (#45418): https://edk2.groups.io/g/devel/message/45418
Mute This Topic: https://groups.io/mt/32838744/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH 1/3] NetworkPkg: Add Dpc protocol

2019-08-12 Thread Zhang, Shenglei
To move Dpc.h from MdeModulePkg to NetworkPkg,
we need to introduce the Guid of protocol first.
https://bugzilla.tianocore.org/show_bug.cgi?id=1949

Cc: Siyuan Fu 
Cc: Jiaxin Wu 
Signed-off-by: Shenglei Zhang 
---
 NetworkPkg/NetworkPkg.dec | 4 
 1 file changed, 4 insertions(+)

diff --git a/NetworkPkg/NetworkPkg.dec b/NetworkPkg/NetworkPkg.dec
index b260ea5b77c5..2bdb3f5663a2 100644
--- a/NetworkPkg/NetworkPkg.dec
+++ b/NetworkPkg/NetworkPkg.dec
@@ -70,6 +70,10 @@ [Guids]
   # Include/Guid/WifiConnectionManagerConfigHii.h
   gWifiConfigGuid   = { 0x9f94d327, 0x0b18, 0x4245, { 0x8f, 0xf2, 
0x83, 0x2e, 0x30, 0xd, 0x2c, 0xef }}
 
+[Protocols]
+  ## Include/Protocol/Dpc.h
+  gEfiDpcProtocolGuid   = {0x480f8ae9, 0xc46, 0x4aa9,  { 0xbc, 0x89, 
0xdb, 0x9f, 0xba, 0x61, 0x98, 0x6 }}
+
 [PcdsFixedAtBuild]
   ## The max attempt number will be created by iSCSI driver.
   # @Prompt Max attempt number.
-- 
2.18.0.windows.1


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

View/Reply Online (#45417): https://edk2.groups.io/g/devel/message/45417
Mute This Topic: https://groups.io/mt/32838743/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH 0/3] Move MdeModulePkg/Include/Protocol/Dpc.h to NetworkPkg

2019-08-12 Thread Zhang, Shenglei
The file MdeModulePkg/Include/Protocol/Dpc.h is consumed
by the modules in NetworkPkg.
Hence, this protocol header file should be moved into NetworkPkg.
https://bugzilla.tianocore.org/show_bug.cgi?id=1949

Cc: Siyuan Fu 
Cc: Jiaxin Wu 
Cc: Jian J Wang 
Cc: Hao A Wu 
Shenglei Zhang (3):
  NetworkPkg: Add Dpc protocol
  NetworkPkg: Move Dpc.h from MdeModulePkg to NetworkPkg
  MdeModulePkg/MdeModulePkg.dec: Remove gEfiDpcProtocolGuid

 MdeModulePkg/MdeModulePkg.dec   | 3 ---
 NetworkPkg/DpcDxe/DpcDxe.inf| 1 -
 {MdeModulePkg => NetworkPkg}/Include/Protocol/Dpc.h | 0
 NetworkPkg/Library/DxeDpcLib/DxeDpcLib.inf  | 1 -
 NetworkPkg/NetworkPkg.dec   | 4 
 5 files changed, 4 insertions(+), 5 deletions(-)
 rename {MdeModulePkg => NetworkPkg}/Include/Protocol/Dpc.h (100%)

-- 
2.18.0.windows.1


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

View/Reply Online (#45416): https://edk2.groups.io/g/devel/message/45416
Mute This Topic: https://groups.io/mt/32838742/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [Patch 3/4] UefiCpuPkg/PiSmmCpuDxeSmm: Supports detect before set new value logic.

2019-08-12 Thread Dong, Eric
Hi Laszlo,

> -Original Message-
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> Laszlo Ersek
> Sent: Friday, August 9, 2019 11:31 PM
> To: Dong, Eric ; devel@edk2.groups.io
> Cc: Ni, Ray 
> Subject: Re: [edk2-devel] [Patch 3/4] UefiCpuPkg/PiSmmCpuDxeSmm:
> Supports detect before set new value logic.
> 
> On 08/09/19 08:11, Eric Dong wrote:
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2040
> >
> > Supports new logic which detect current value before set new value.
> > Only set new value when current value not same as new value.
> >
> > Signed-off-by: Eric Dong 
> > Cc: Ray Ni 
> > Cc: Laszlo Ersek 
> > ---
> >  UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c | 135
> > --
> >  1 file changed, 92 insertions(+), 43 deletions(-)
> 
> I have only superficial comments, as my understanding is that
> "UefiCpuPkg/CpuS3DataDxe", which is what OVMF uses, doesn't set up any
> register programming for S3 resume.
> 
> > diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
> > b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
> > index d8c6b19ead..957f2896eb 100644
> > --- a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
> > +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
> > @@ -159,6 +159,58 @@ S3WaitForSemaphore (
> >   ) != Value);
> >  }
> >
> > +/**
> > +  Read / write CR value.
> > +
> > +  @param[in]  CrIndex The CR index which need to read/write.
> > +  @param[in]  ReadRead or write. TRUE is read.
> > +  @param[in,out]  CrValue CR value.
> > +
> > +  @retvalEFI_SUCCESS means read/write success, else return
> EFI_UNSUPPORTED.
> > +**/
> > +UINTN
> > +ReadWriteCr (
> > +  IN UINT32   CrIndex,
> > +  IN BOOLEAN  Read,
> > +  IN OUT UINTN*CrValue
> > +  )
> > +{
> > +  switch (CrIndex) {
> > +  case 0:
> > +if (Read) {
> > +  *CrValue = AsmReadCr0 ();
> > +} else {
> > +  AsmWriteCr0 (*CrValue);
> > +}
> > +break;
> > +  case 2:
> > +if (Read) {
> > +  *CrValue = AsmReadCr2 ();
> > +} else {
> > +  AsmWriteCr2 (*CrValue);
> > +}
> > +break;
> > +  case 3:
> > +if (Read) {
> > +  *CrValue = AsmReadCr3 ();
> > +} else {
> > +  AsmWriteCr3 (*CrValue);
> > +}
> > +break;
> > +  case 4:
> > +if (Read) {
> > +  *CrValue = AsmReadCr4 ();
> > +} else {
> > +  AsmWriteCr4 (*CrValue);
> > +}
> > +break;
> > +  default:
> > +return EFI_UNSUPPORTED;;
> > +  }
> > +
> > +  return EFI_SUCCESS;
> > +}
> > +
> >  /**
> >Initialize the CPU registers from a register table.
> >
> > @@ -188,6 +240,8 @@ ProgramProcessorRegister (
> >UINTN ProcessorIndex;
> >UINTN ValidThreadCount;
> >UINT32*ValidCoreCountPerPackage;
> > +  EFI_STATUSStatus;
> > +  UINT64CurrentValue;
> >
> >//
> >// Traverse Register Table of this logical processor @@ -206,55
> > +260,50 @@ ProgramProcessorRegister (
> >  // The specified register is Control Register
> >  //
> >  case ControlRegister:
> > -  switch (RegisterTableEntry->Index) {
> > -  case 0:
> > -Value = AsmReadCr0 ();
> > -Value = (UINTN) BitFieldWrite64 (
> > -  Value,
> > -  RegisterTableEntry->ValidBitStart,
> > -  RegisterTableEntry->ValidBitStart + 
> > RegisterTableEntry-
> >ValidBitLength - 1,
> > -  (UINTN) RegisterTableEntry->Value
> > -  );
> > -AsmWriteCr0 (Value);
> > -break;
> > -  case 2:
> > -Value = AsmReadCr2 ();
> > -Value = (UINTN) BitFieldWrite64 (
> > -  Value,
> > -  RegisterTableEntry->ValidBitStart,
> > -  RegisterTableEntry->ValidBitStart + 
> > RegisterTableEntry-
> >ValidBitLength - 1,
> > -  (UINTN) RegisterTableEntry->Value
> > -  );
> > -AsmWriteCr2 (Value);
> > -break;
> > -  case 3:
> > -Value = AsmReadCr3 ();
> > -Value = (UINTN) BitFieldWrite64 (
> > -  Value,
> > -  RegisterTableEntry->ValidBitStart,
> > -  RegisterTableEntry->ValidBitStart + 
> > RegisterTableEntry-
> >ValidBitLength - 1,
> > -  (UINTN) RegisterTableEntry->Value
> > -  );
> > -AsmWriteCr3 (Value);
> > -break;
> > -  case 4:
> > -Value = AsmReadCr4 ();
> > -Value = (UINTN) BitFieldWrite64 (
> > -  Value,
> > -  RegisterTableEntry->ValidBitStart,
> > -  RegisterTableEntry->ValidBitStart + 
> > RegisterTableEntry-
> >ValidBitLength - 1,
> > -  (UINTN) RegisterTableEntry->Value
> > -

[edk2-devel] [RFC] BZ 1772 MdeModulePkg: Transfer reset data

2019-08-12 Thread Gao, Zhichao
HI,

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

Before the ResetData of ResetSystem is limit by ResetType and ResetStatus. As 
the Uefi spec update to 2.8, there is no limit any longer.
Here we introduce a new API ResetSystemWithSubtype to transfer a null string 
and GUID data with all ResetType to reset system.
It is useful for capsule update to get a specific GUID to do some special 
operation with specific phase. That can be implemented in platform code thru 
Reset Notify protocol.
Here is the guids:
gEdkiiCapsuleArmedResetGuid= {0xc6b4eea7, 0xfce2, 0x4625, {0x9c, 
0x4f, 0xc4, 0xb0, 0x82, 0x37, 0xae, 0x23}}
gEdkiiCapsuleUpdateCompleteResetGuid   = {0x5d512714, 0xa4df, 0x4e46, {0xb6, 
0xc7, 0xbc, 0x9f, 0x97, 0x9d, 0x59, 0xa0}}

Thanks,
Zhichao



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

View/Reply Online (#45414): https://edk2.groups.io/g/devel/message/45414
Mute This Topic: https://groups.io/mt/32838732/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [edk2-platforms] [PATCH v2] Platform/Intel: Update Readme.md to point to edk2-non-osi master branch

2019-08-12 Thread Leif Lindholm


On Sun, Aug 11, 2019 at 04:44:48PM -0700, Nate DeSimone wrote:
> Updated Platform/Intel/Readme.md to point to master branch on
> edk2-non-osi instead of devel-MinPlatform
> 
> Updated edk2-platforms/Readme.md to point to Platform/Intel/Readme.md
> for build instructions on Intel based Minimum Platforms
> 
> Added a link to the EDK II Minimum Platform Draft Specification
> to Platform/Intel/Readme.md
> 
> Cc: Andrew Fish 
> Cc: Laszlo Ersek 
> Cc: Leif Lindholm 
> Cc: Michael D Kinney 
> Cc: Michael Kubacki 
> Cc: Ankit Sinha 
> Cc: Chasel Chiu 
> Signed-off-by: Nate DeSimone 

Reviewed-by: Leif Lindholm 

> ---
>  Platform/Intel/Readme.md | 6 --
>  Readme.md| 4 ++--
>  2 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/Platform/Intel/Readme.md b/Platform/Intel/Readme.md
> index 0a0e8a8c80..00f42985a2 100644
> --- a/Platform/Intel/Readme.md
> +++ b/Platform/Intel/Readme.md
> @@ -1,7 +1,9 @@
>  # **EDK II Minimum Platform Firmware for Intel(R) Platforms**
>  
>  The Minimum Platform is a software architecture that guides uniform delivery 
> of Intel platforms enabling firmware
> -solutions for basic boot functionality with extensibility built-in.
> +solutions for basic boot functionality with extensibility built-in. Please 
> see the
> +[EDK II Minimum Platform Draft 
> Specification](https://edk2-docs.gitbooks.io/edk-ii-minimum-platform-specification/)
> +for more details.
>  
>  Package maintainers for the Minimum Platform projects are listed in 
> Maintainers.txt.
>  
> @@ -98,7 +100,7 @@ return back to the minimum platform caller.
>* ``git clone https://github.com/tianocore/edk2-platforms.git``
>  
>  * edk2-non-osi repository
> -  * ``git clone https://github.com/tianocore/edk2-non-osi.git -b 
> devel-MinPlatform``
> +  * ``git clone https://github.com/tianocore/edk2-non-osi.git``
>  
>  * FSP repository
>* ``git clone https://github.com/IntelFsp/FSP.git``
> diff --git a/Readme.md b/Readme.md
> index 63e59f60b4..1befd0b544 100644
> --- a/Readme.md
> +++ b/Readme.md
> @@ -223,8 +223,8 @@ they will be documented with the platform.
>  * [D05](Platform/Hisilicon/D05)
>  * [HiKey](Platform/Hisilicon/HiKey)
>  
> -## [Intel](Platform/Intel/Readme.md)
> -### Minimum Platforms
> +## Intel
> +### [Minimum Platforms](Platform/Intel/Readme.md)
>  * [Clevo](Platform/Intel/ClevoOpenBoardPkg)
>  * [Kaby Lake](Platform/Intel/KabylakeOpenBoardPkg)
>  * [Purley](Platform/Intel/PurleyOpenBoardPkg)
> -- 
> 2.17.1.windows.2
> 

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

View/Reply Online (#45413): https://edk2.groups.io/g/devel/message/45413
Mute This Topic: https://groups.io/mt/32835408/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [Patch] Readme.md: Remove tag release from Readme

2019-08-12 Thread Leif Lindholm
On Mon, Aug 12, 2019 at 10:09:15AM +0800, Liming Gao wrote:
> The latest tag release can be found in Release Planning.
> They are not required to be listed here.
> 
> Cc: Andrew Fish 
> Cc: Laszlo Ersek 
> Cc: Leif Lindholm 
> Cc: Michael D Kinney 
> Signed-off-by: Liming Gao 

Reviewed-by: Leif Lindholm 

> ---
>  Readme.md | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/Readme.md b/Readme.md
> index e564c6c09b..7c873759a5 100644
> --- a/Readme.md
> +++ b/Readme.md
> @@ -28,9 +28,6 @@ are listed in [Maintainers.txt](Maintainers.txt).
>  * [TianoCore Bugzilla](https://bugzilla.tianocore.org)
>  * [How To 
> Contribute](https://github.com/tianocore/tianocore.github.io/wiki/How-To-Contribute)
>  * [Release 
> Planning](https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Release-Planning)
> -* [UDK2017](https://github.com/tianocore/edk2/releases/tag/vUDK2017)
> -* [UDK2018](https://github.com/tianocore/edk2/releases/tag/vUDK2018)
> -* 
> [edk2-stable201811](https://github.com/tianocore/edk2/releases/tag/edk2-stable201811)
>  
>  # Code Contributions
>  To make a contribution to a TianoCore project, follow these steps.
> -- 
> 2.13.0.windows.1
> 

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

View/Reply Online (#45412): https://edk2.groups.io/g/devel/message/45412
Mute This Topic: https://groups.io/mt/32836513/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [Patch 1/4] UefiCpuPkg/RegisterCpuFeaturesLib: Add "detect before set" Micros.

2019-08-12 Thread Dong, Eric
Hi Laszlo,

Will fix it in my next version change.

Thanks,
Eric

> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Friday, August 9, 2019 11:31 PM
> To: Dong, Eric ; devel@edk2.groups.io
> Cc: Ni, Ray 
> Subject: Re: [Patch 1/4] UefiCpuPkg/RegisterCpuFeaturesLib: Add "detect before
> set" Micros.
> 
> On 08/09/19 08:11, Eric Dong wrote:
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2040
> >
> > Add below new micros which test the current value before set
> 
> Both the subject line and the commit message should say "macros", not
> "micros".
> 
> Thanks
> Laszlo

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

View/Reply Online (#45411): https://edk2.groups.io/g/devel/message/45411
Mute This Topic: https://groups.io/mt/32807819/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH V2 2/2] BaseTools/Capsule: Tool to generate Windows Firmware Update Driver

2019-08-12 Thread Eric Jin
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1837

The tool is designed to generate Windows Firmware Update Drivers,
the input is one drivername.cap with related parameters, the output
Windows Driver package are composed by drivername.cap, drivername.inf
and drivername.cat to update the single payload in device.

usage:
GenerateWindowsDriver [-h] [--output-folder OUTPUTFOLDER]
  [--product-fmp-guid PRODUCTFMPGUID]
  [--capsuleversion-dotstring CAPSULEVERSION_DOTSTRING]
  [--capsuleversion-hexstring CAPSULEVERSION_HEXSTRING]
  [--product-fw-provider PRODUCTFWPROVIDER]
  [--product-fw-mfg-name PRODUCTFWMFGNAME]
  [--product-fw-desc PRODUCTFWDESC]
  [--capsule-file-name CAPSULEFILENAME]
  [--pfx-file PFXFILE] [--arch ARCH]
  [--operating-system-string OPERATINGSYSTEMSTRING]

Cc: Sean Brogan 
Cc: Bret Barkelew 
Cc: Bob Feng 
Cc: Liming Gao 
Cc: Kinney Michael D 
Signed-off-by: Eric Jin 
---
 .../Python/Capsule/GenerateWindowsDriver.py   | 120 ++
 .../Capsule/WindowsCapsuleSupportHelper.py|  16 ++-
 2 files changed, 129 insertions(+), 7 deletions(-)
 create mode 100644 BaseTools/Source/Python/Capsule/GenerateWindowsDriver.py

diff --git a/BaseTools/Source/Python/Capsule/GenerateWindowsDriver.py 
b/BaseTools/Source/Python/Capsule/GenerateWindowsDriver.py
new file mode 100644
index 00..bea7a0df38
--- /dev/null
+++ b/BaseTools/Source/Python/Capsule/GenerateWindowsDriver.py
@@ -0,0 +1,120 @@
+## @file
+# Generate a capsule windows driver.
+#
+# Copyright (c) 2019, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+
+'''
+GenerateWindowsDriver
+'''
+
+import sys
+import argparse
+import uuid
+import struct
+import subprocess
+import os
+import tempfile
+import shutil
+import platform
+import re
+import logging
+from WindowsCapsuleSupportHelper import WindowsCapsuleSupportHelper
+from Common.Uefi.Capsule.FmpCapsuleHeader  import FmpCapsuleHeaderClass
+from Common.Uefi.Capsule.UefiCapsuleHeader import UefiCapsuleHeaderClass
+
+#
+# Globals for help information
+#
+__prog__= 'GenerateWindowsDriver'
+__version__ = '0.0'
+__copyright__   = 'Copyright (c) 2019, Intel Corporation. All rights reserved.'
+__description__ = 'Generate Capsule Windows Driver.\n'
+
+def GetCapGuid (InputFile):
+with open(InputFile, 'rb') as File:
+Buffer = File.read()
+try:
+Result = UefiCapsuleHeader.Decode (Buffer)
+if len (Result) > 0:
+FmpCapsuleHeader.Decode (Result)
+for index in range (0, FmpCapsuleHeader.PayloadItemCount):
+Guid = FmpCapsuleHeader.GetFmpCapsuleImageHeader 
(index).UpdateImageTypeId
+return Guid
+except:
+print ('GenerateCapsule: error: can not decode capsule')
+sys.exit (1)
+
+def ArgCheck(args):
+Version = args.CapsuleVersion_DotString.split('.')
+
+if len(Version) != 4:
+logging.critical("Name invalid: '%s'", args.CapsuleVersion_DotString)
+raise ValueError("Name invalid.")
+for sub in Version:
+if  int(sub, 16) > 65536:
+logging.critical("Name invalid: '%s'", 
args.CapsuleVersion_DotString)
+raise ValueError("Name exceed limit 65536.")
+
+if not 
(re.compile(r'[\a-fA-F0-9]*$')).match(args.CapsuleVersion_DotString):
+logging.critical("Name invalid: '%s'", args.CapsuleVersion_DotString)
+raise ValueError("Name has invalid chars.")
+
+def CapsuleGuidCheck(InputFile, Guid):
+CapGuid = GetCapGuid(InputFile)
+if (str(Guid).lower() != str(CapGuid)):
+print('GenerateWindowsDriver error: Different Guid from Capsule')
+sys.exit(1)
+
+if __name__ == '__main__':
+def convert_arg_line_to_args(arg_line):
+for arg in arg_line.split():
+if not arg.strip():
+continue
+yield arg
+
+parser = argparse.ArgumentParser (
+prog = __prog__,
+description = __description__ + __copyright__,
+conflict_handler = 'resolve',
+fromfile_prefix_chars = '@'
+)
+parser.convert_arg_line_to_args = convert_arg_line_to_args
+parser.add_argument("--output-folder", dest = 'OutputFolder', help = 
"firmware resource update driver package output folder.")
+parser.add_argument("--product-fmp-guid", dest = 'ProductFmpGuid', help = 
"firmware GUID of resource update driver package")
+parser.add_argument("--capsuleversion-dotstring", dest = 
'CapsuleVersion_DotString', help = "firmware version with date on which update 
driver package is authored")
+parser.add_argument("--capsuleversion-hexstring", dest = 
'CapsuleVersion_HexString', help = "firmware version in Hex of update driver 
package")
+

[edk2-devel] [RFC] BZ 2067 BaseTools/Scripts: Add GetUtcDateTime.py for edk2-stable201908 stable tag.

2019-08-12 Thread Chiu, Chasel

Hello,

I would like to add below simple script to 201908 stable tag, review was sent 
on August 8th:

A script that can return UTC date and time in ascii format which is convenient 
for patching build time information in any binary.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2067
Patch: https://edk2.groups.io/g/devel/topic/32797962#45177

Thanks!
Chasel


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

View/Reply Online (#45408): https://edk2.groups.io/g/devel/message/45408
Mute This Topic: https://groups.io/mt/32838481/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH V2 1/2] BaseTools/Capsule: Add WindowsCapsuleSupportHelper

2019-08-12 Thread Eric Jin
From: Sean Brogan 

Add initial version WindowsCapsuleSupportHelper.py
original source comes from
https://github.com/microsoft/mu_basecore/blob/dev/201905/BaseTools/Plugin/WindowsCapsuleSupportHelper/WindowsCapsuleSupportHelper.py
commit ebd9aad90dee3a3094b575928670cf81b8c685b5
Convert EOL to CRLF

Cc: Sean Brogan 
Cc: Bret Barkelew 
Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Bob Feng 
Signed-off-by: Eric Jin 
---
 .../Capsule/WindowsCapsuleSupportHelper.py| 62 +++
 1 file changed, 62 insertions(+)
 create mode 100644 
BaseTools/Source/Python/Capsule/WindowsCapsuleSupportHelper.py

diff --git a/BaseTools/Source/Python/Capsule/WindowsCapsuleSupportHelper.py 
b/BaseTools/Source/Python/Capsule/WindowsCapsuleSupportHelper.py
new file mode 100644
index 00..166af58d81
--- /dev/null
+++ b/BaseTools/Source/Python/Capsule/WindowsCapsuleSupportHelper.py
@@ -0,0 +1,62 @@
+##
+# UefiBuild Plugin that supports Window Capsule files based on the
+# Windows Firmware Update Platform spec.
+# Creates INF, Cat, and then signs it
+#
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+
+import sys
+import re
+import datetime
+import os
+import logging
+from MuEnvironment import PluginManager
+from MuPythonLibrary.Uefi.Capsule.CatGenerator import *
+from MuPythonLibrary.Uefi.Capsule.InfGenerator import *
+from MuPythonLibrary.UtilityFunctions import CatalogSignWithSignTool
+from MuPythonLibrary.Windows.VsWhereUtilities import FindToolInWinSdk
+
+
+class WindowsCapsuleSupportHelper(PluginManager.IUefiHelperPlugin):
+
+  def RegisterHelpers(self, obj):
+  fp = os.path.abspath(__file__)
+  obj.Register("PackageWindowsCapsuleFiles", 
WindowsCapsuleSupportHelper.PackageWindowsCapsuleFiles, fp)
+
+
+  @staticmethod
+  def PackageWindowsCapsuleFiles(OutputFolder, ProductName, ProductFmpGuid, 
CapsuleVersion_DotString,
+CapsuleVersion_HexString, ProductFwProvider, ProductFwMfgName, 
ProductFwDesc, CapsuleFileName, PfxFile=None, PfxPass=None,
+Rollback=False, Arch='amd64', OperatingSystem_String='Win10'):
+
+  logging.debug("CapsulePackage: Create Windows Capsule Files")
+
+  #Make INF
+  InfFilePath = os.path.join(OutputFolder, ProductName + ".inf")
+  InfTool = InfGenerator(ProductName, ProductFwProvider, ProductFmpGuid, 
Arch, ProductFwDesc, CapsuleVersion_DotString, CapsuleVersion_HexString)
+  InfTool.Manufacturer = ProductFwMfgName  #optional
+  ret = InfTool.MakeInf(InfFilePath, CapsuleFileName, Rollback)
+  if(ret != 0):
+  raise Exception("CreateWindowsInf Failed with errorcode %d" % ret)
+
+  #Make CAT
+  CatFilePath = os.path.realpath(os.path.join(OutputFolder, ProductName + 
".cat"))
+  CatTool = CatGenerator(Arch, OperatingSystem_String)
+  ret = CatTool.MakeCat(CatFilePath)
+
+  if(ret != 0):
+  raise Exception("Creating Cat file Failed with errorcode %d" % ret)
+
+  if(PfxFile is not None):
+  #Find Signtool
+  SignToolPath = FindToolInWinSdk("signtool.exe")
+  if not os.path.exists(SignToolPath):
+  raise Exception("Can't find signtool on this machine.")
+  #dev sign the cat file
+  ret = CatalogSignWithSignTool(SignToolPath, CatFilePath, PfxFile, 
PfxPass)
+  if(ret != 0):
+  raise Exception("Signing Cat file Failed with errorcode %d" % 
ret)
+
+  return ret
-- 
2.20.1.windows.1


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

View/Reply Online (#45407): https://edk2.groups.io/g/devel/message/45407
Mute This Topic: https://groups.io/mt/32838475/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH V2 00/10] Multiple Controllers Support solution

2019-08-12 Thread Eric Jin
Liming,

The differences between V2 and V1 are listed below.

1) The series is composed of 10 patches in V2 (14 in V1). patch 14 is merged 
into patch 4, and patch 11/12/13 are merged into patch 5.
2) Try to fix the issue exposed by ECC. 

Btw, the patch of edk2-platform 
Platform\Intel\Vlv2TbltDevicePkg\Feature\Capsule\Library\FmpDeviceLib to 
support new APIs is provided in separated patch 
https://edk2.groups.io/g/devel/message/45328

Best Regards
Eric

-Original Message-
From: Gao, Liming 
Sent: Monday, August 12, 2019 1:19 PM
To: devel@edk2.groups.io; Jin, Eric 
Subject: RE: [edk2-devel] [PATCH V2 00/10] Multiple Controllers Support solution

Eric:
  Can you list the difference compared to version 1?

Thanks
Liming
>-Original Message-
>From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of 
>Eric Jin
>Sent: Monday, August 12, 2019 9:46 AM
>To: devel@edk2.groups.io
>Subject: [edk2-devel] [PATCH V2 00/10] Multiple Controllers Support 
>solution
>
>REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1525
>
>The patch set is to support drivers that manage multiple controllers 
>and also provide a firmware update capability to each managed controller.
>
>The following modules are related to Multiple Controllers Support 
>solution
>
>FmpDevicePkg\FmpDxe\FmpDxe.inf - Driver to manage multiple controllers 
>and provide the firmware update capability to each managed controller.
>FmpDevicePkg\CapsuleUpdatePolicyDxe\CapsuleUpdatePolicyDxe.inf - Driver 
>to produce the Capsule Update Policy Protocol using the services of the 
>CapsuleUpdatePolicyLib class. The protocol is a private interface to 
>the FmpDevicePkg 
>FmpDevicePkg\Library\CapsuleUpdatePolicyLibOnProtocol\CapsuleUpdatePo
>licyLibOnProtocol.inf -
>CapsuleUpdatePolicyLib instance that uses the services of the Capsule 
>Update Policy Protocol produced by CapsuleUpdatePolicyDxe 
>FmpDevicePkg\Library\CapsuleUpdatePolicyLibNull\CapsuleUpdatePolicyLibN
>ull.inf -
>Null CapsuleUpdatePolicyLib instance and the template for platform 
>specific implementation 
>FmpDevicePkg\Library\FmpDeviceLibNull\FmpDeviceLibNull.inf - Null 
>FmpDeviceLib instance and the template for platform specific 
>implementation
>
>Eric Jin (10):
>  FmpDevicePkg: Add UEFI_DRIVER support
>  FmpDevicePkg: Add APIs to FmpDeviceLib
>  FmpDEvicePkg/FmpDeviceLibNull: Implement new APIs
>  FmpDevicePkg/FmpDxe: Use new FmpDeviceLib APIs
>  FmpDevicePkg/FmpDxe: Different variable for each FMP Descriptor
>  FmpDevicePkg: Add Capsule Update Policy Protocol
>  FmpDevicePkg/FmpDxe: Improve all DEBUG() messages
>  FmpDevicePkg/FmpDxe: Add PcdFmpDeviceImageTypeIdGuid
>  FmpDevicePkg/FmpDxe: Add PcdFmpDeviceStorageAccessEnable
>  FmpDevicePkg/FmpDxe: Remove use of CatSprint()
>
> .../CapsuleUpdatePolicyDxe.c  | 173 
> .../CapsuleUpdatePolicyDxe.h  | 140 +++
> .../CapsuleUpdatePolicyDxe.inf|  48 +
> .../CapsuleUpdatePolicyDxe.uni|  14 +
> .../CapsuleUpdatePolicyDxeExtra.uni   |  14 +
> FmpDevicePkg/FmpDevicePkg.dec |  43 +-
> FmpDevicePkg/FmpDevicePkg.dsc |  64 +-
> FmpDevicePkg/FmpDevicePkg.uni |  16 +-
> FmpDevicePkg/FmpDxe/DetectTestKey.c   |  16 +-
> FmpDevicePkg/FmpDxe/FmpDxe.c  | 792 ++--
> FmpDevicePkg/FmpDxe/FmpDxe.h  | 355 
> FmpDevicePkg/FmpDxe/FmpDxe.inf|   7 +-
> FmpDevicePkg/FmpDxe/FmpDxeLib.inf |   7 +-
> FmpDevicePkg/FmpDxe/VariableSupport.c | 844 +-
> FmpDevicePkg/FmpDxe/VariableSupport.h | 135 ++-
> FmpDevicePkg/Include/Library/FmpDeviceLib.h   | 104 ++-
> .../CapsuleUpdatePolicyLibOnProtocol.c| 171 
> .../CapsuleUpdatePolicyLibOnProtocol.inf  |  40 +
> .../CapsuleUpdatePolicyLibOnProtocol.uni  |  15 +
> .../Library/FmpDeviceLibNull/FmpDeviceLib.c   |  93 +-
> .../FmpDeviceLibNull/FmpDeviceLibNull.inf |   4 +-
> .../FmpPayloadHeaderLibV1.inf |   4 +-
> .../Library/FmpPayloadHeaderLib.h |   0
> .../Protocol/CapsuleUpdatePolicy.h| 132 +++
> 24 files changed, 2644 insertions(+), 587 deletions(-)  create mode 
>100644 FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.c
> create mode 100644
>FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.h
> create mode 100644
>FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.inf
> create mode 100644
>FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.uni
> create mode 100644
>FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxeExtra.uni
> create mode 100644 FmpDevicePkg/FmpDxe/FmpDxe.h  create mode 100644 
>FmpDevicePkg/Library/CapsuleUpdatePolicyLibOnProtocol/CapsuleUpdatePo
>licyLibOnProtocol.c
> create mode 100644
>FmpDevicePkg/Library/CapsuleUpdatePolicyLibOnProtocol/CapsuleUpdatePo
>licyLibOnProtocol.inf
> create mode 100644

[edk2-devel] [RFC] BZ 1837 Enable Windows Firmware Update Driver Tool in Edk2/BaseTools for 201908 stable tag

2019-08-12 Thread Eric Jin
Hi All,

It is the request to Enable Windows Firmware Update Driver Tool in 
Edk2/BaseTools  and catch the Q3 tag.
The new tool will leverage the edk2-pytool-library to generate the cat/inf file 
based on the cap file. The output driver package can be trigged in Windows OS 
to complete capsule update.

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

Patch link: https://edk2.groups.io/g/devel/topic/32780378#44992

Best Regards
Eric


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

View/Reply Online (#45404): https://edk2.groups.io/g/devel/message/45404
Mute This Topic: https://groups.io/mt/32838310/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v2 1/3] MdeModulePkg: Add missing header files in INF files

2019-08-12 Thread Wu, Hao A
> -Original Message-
> From: Zhang, Shenglei
> Sent: Monday, August 12, 2019 2:23 PM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J; Wu, Hao A
> Subject: [PATCH v2 1/3] MdeModulePkg: Add missing header files in INF files
> 
> The header files are used but missing in INF,which causes
> generating warning message when building them.
> 
> Cc: Jian J Wang 
> Cc: Hao A Wu 
> Signed-off-by: Shenglei Zhang 
> ---
> v2: Add "Common/CommonHeader.h" in CapsuleX64.inf.
>  MdeModulePkg/Universal/CapsulePei/CapsulePei.inf| 3 ++-
>  MdeModulePkg/Universal/CapsulePei/CapsuleX64.inf| 1 +
>  MdeModulePkg/Universal/EbcDxe/EbcDebuggerConfig.inf | 9 -
>  3 files changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/CapsulePei/CapsulePei.inf
> b/MdeModulePkg/Universal/CapsulePei/CapsulePei.inf
> index 786c41163304..e5078c79863c 100644
> --- a/MdeModulePkg/Universal/CapsulePei/CapsulePei.inf
> +++ b/MdeModulePkg/Universal/CapsulePei/CapsulePei.inf
> @@ -6,7 +6,7 @@
>  #  This external input must be validated carefully to avoid security issue 
> like
>  #  buffer overflow, integer overflow.
>  #
> -# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
> +# Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
>  # Copyright (c) 2017, AMD Incorporated. All rights reserved.
>  #
>  # SPDX-License-Identifier: BSD-2-Clause-Patent
> @@ -33,6 +33,7 @@ [Sources]
>UefiCapsule.c
>Capsule.h
>Common/CapsuleCoalesce.c
> +  Common/CommonHeader.h
> 
>  [Packages]
>MdePkg/MdePkg.dec
> diff --git a/MdeModulePkg/Universal/CapsulePei/CapsuleX64.inf
> b/MdeModulePkg/Universal/CapsulePei/CapsuleX64.inf
> index 95e5f68c9892..35d2535a5b48 100644
> --- a/MdeModulePkg/Universal/CapsulePei/CapsuleX64.inf
> +++ b/MdeModulePkg/Universal/CapsulePei/CapsuleX64.inf
> @@ -33,6 +33,7 @@ [Sources]
>X64/X64Entry.c
>X64/PageFaultHandler.nasm
>Common/CapsuleCoalesce.c
> +  Common/CommonHeader.h
> 
>  [Packages]
>MdePkg/MdePkg.dec
> diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebuggerConfig.inf
> b/MdeModulePkg/Universal/EbcDxe/EbcDebuggerConfig.inf
> index af002bd98e99..22cf64d9507a 100644
> --- a/MdeModulePkg/Universal/EbcDxe/EbcDebuggerConfig.inf
> +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebuggerConfig.inf
> @@ -1,7 +1,7 @@
>  ## @file
>  #  EBC Debugger configuration application.
>  #
> -#  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
> +#  Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.
>  #
>  #  SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
> @@ -28,6 +28,13 @@ [Sources]
>EbcDebugger/EdbCommon.h
>EbcDebugger/EdbSupportString.c
>EbcDebugger/EdbSupport.h
> +  EbcDebugger/EdbCommand.h
> +  EbcDebugger/EdbHook.h
> +  EbcDebugger/Edb.h
> +  EbcDebugger/EdbDisasmSupport.h
> +  EbcDebugger/EdbDisasm.h
> +  EbcDebugger/EdbSymbol.h
> +  EbcDebuggerHook.h


Reviewed-by: Hao A Wu 

Best Regards,
Hao Wu


> 
>  [Packages]
>MdePkg/MdePkg.dec
> --
> 2.18.0.windows.1


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

View/Reply Online (#45403): https://edk2.groups.io/g/devel/message/45403
Mute This Topic: https://groups.io/mt/32838103/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v2 3/3] IntelFsp2Pkg/FspSecCore: Add missing header file in INF file

2019-08-12 Thread Chiu, Chasel


Reviewed-by: Chasel Chiu 

> -Original Message-
> From: Zhang, Shenglei
> Sent: Monday, August 12, 2019 2:23 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel ; Desimone, Nathaniel L
> ; Zeng, Star 
> Subject: [PATCH v2 3/3] IntelFsp2Pkg/FspSecCore: Add missing header file in
> INF file
> 
> SecFsp.h is used but missing inf file, which will cause generating warning
> message.
> 
> Cc: Chasel Chiu 
> Cc: Nate DeSimone 
> Cc: Star Zeng 
> Signed-off-by: Shenglei Zhang 
> Reviewed-by: Chasel Chiu 
> Reviewed-by: Star Zeng 
> Reviewed-by: Nate DeSimone 
> ---
>  IntelFsp2Pkg/FspSecCore/FspSecCoreS.inf | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/IntelFsp2Pkg/FspSecCore/FspSecCoreS.inf
> b/IntelFsp2Pkg/FspSecCore/FspSecCoreS.inf
> index 3de09b5b4921..17924b118c83 100644
> --- a/IntelFsp2Pkg/FspSecCore/FspSecCoreS.inf
> +++ b/IntelFsp2Pkg/FspSecCore/FspSecCoreS.inf
> @@ -1,7 +1,7 @@
>  ## @file
>  #  Sec Core for FSP
>  #
> -#  Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
> +#  Copyright (c) 2016 - 2019, Intel Corporation. All rights
> +reserved.
>  #
>  #  SPDX-License-Identifier: BSD-2-Clause-Patent  # @@ -22,6 +22,7 @@
> [Defines]
> 
>  [Sources]
>SecFspApiChk.c
> +  SecFsp.h
> 
>  [Sources.IA32]
>Ia32/Stack.nasm
> --
> 2.18.0.windows.1


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

View/Reply Online (#45402): https://edk2.groups.io/g/devel/message/45402
Mute This Topic: https://groups.io/mt/32838106/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH 1/1] MdeModulePkg/DxeIplPeim: Relocate the operation of PageMapLevel5Entry++

2019-08-12 Thread Zhang, Shenglei
PageMapLevel5Entry may be uninitialized in original code, which means
uninitialized pointer will be modified at some circumstance.
So relocate the operation of PageMapLevel5Entry++ in order to make sure
the pointer could be modified only when it is uninitialized.

Cc: Dandan Bi 
Cc: Liming Gao 
Cc: Hao A Wu 
Cc: Laszlo Ersek 
Cc: Eric Dong 
Signed-off-by: Shenglei Zhang 
---
 MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c 
b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
index b40b7e0c9813..2389f3eb485b 100644
--- a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
+++ b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
@@ -764,7 +764,7 @@ CreateIdentityMappingPageTables (
 
   for ( IndexOfPml5Entries = 0
   ; IndexOfPml5Entries < NumberOfPml5EntriesNeeded
-  ; IndexOfPml5Entries++, PageMapLevel5Entry++) {
+  ; IndexOfPml5Entries++) {
 //
 // Each PML5 entry points to a page of PML4 entires.
 // So lets allocate space for them and fill them in in the 
IndexOfPml4Entries loop.
@@ -780,6 +780,7 @@ CreateIdentityMappingPageTables (
   PageMapLevel5Entry->Uint64 = (UINT64) (UINTN) PageMapLevel4Entry | 
AddressEncMask;
   PageMapLevel5Entry->Bits.ReadWrite = 1;
   PageMapLevel5Entry->Bits.Present   = 1;
+  PageMapLevel5Entry++;
 }
 
 for ( IndexOfPml4Entries = 0
-- 
2.18.0.windows.1


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

View/Reply Online (#45401): https://edk2.groups.io/g/devel/message/45401
Mute This Topic: https://groups.io/mt/32838114/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH v2 0/3] Fix warning message issues

2019-08-12 Thread Zhang, Shenglei
There are some header files used but not included in INF
files. This causes warings are generated when building the
packages. So now add them into INF files.
https://bugzilla.tianocore.org/show_bug.cgi?id=2036

Cc: Jian J Wang 
Cc: Hao A Wu 
Cc: Jaben Carsey 
Cc: Ray Ni 
Cc: Zhichao Gao 
Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Star Zeng 
Shenglei Zhang (3):
  MdeModulePkg: Add missing header files in INF files
  ShellPkg/UefiShellAcpiViewCommandLib: Add missing header files in INF
  IntelFsp2Pkg/FspSecCore: Add missing header file in INF file

 IntelFsp2Pkg/FspSecCore/FspSecCoreS.inf  | 3 ++-
 MdeModulePkg/Universal/CapsulePei/CapsulePei.inf | 3 ++-
 MdeModulePkg/Universal/CapsulePei/CapsuleX64.inf | 1 +
 MdeModulePkg/Universal/EbcDxe/EbcDebuggerConfig.inf  | 9 -
 .../UefiShellAcpiViewCommandLib.inf  | 2 ++
 5 files changed, 15 insertions(+), 3 deletions(-)

-- 
2.18.0.windows.1


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

View/Reply Online (#45397): https://edk2.groups.io/g/devel/message/45397
Mute This Topic: https://groups.io/mt/32838102/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH v2 3/3] IntelFsp2Pkg/FspSecCore: Add missing header file in INF file

2019-08-12 Thread Zhang, Shenglei
SecFsp.h is used but missing inf file, which will cause generating
warning message.

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Star Zeng 
Signed-off-by: Shenglei Zhang 
Reviewed-by: Chasel Chiu 
Reviewed-by: Star Zeng 
Reviewed-by: Nate DeSimone 
---
 IntelFsp2Pkg/FspSecCore/FspSecCoreS.inf | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/IntelFsp2Pkg/FspSecCore/FspSecCoreS.inf 
b/IntelFsp2Pkg/FspSecCore/FspSecCoreS.inf
index 3de09b5b4921..17924b118c83 100644
--- a/IntelFsp2Pkg/FspSecCore/FspSecCoreS.inf
+++ b/IntelFsp2Pkg/FspSecCore/FspSecCoreS.inf
@@ -1,7 +1,7 @@
 ## @file
 #  Sec Core for FSP
 #
-#  Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
+#  Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -22,6 +22,7 @@ [Defines]
 
 [Sources]
   SecFspApiChk.c
+  SecFsp.h
 
 [Sources.IA32]
   Ia32/Stack.nasm
-- 
2.18.0.windows.1


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

View/Reply Online (#45400): https://edk2.groups.io/g/devel/message/45400
Mute This Topic: https://groups.io/mt/32838106/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH v2 1/3] MdeModulePkg: Add missing header files in INF files

2019-08-12 Thread Zhang, Shenglei
The header files are used but missing in INF,which causes
generating warning message when building them.

Cc: Jian J Wang 
Cc: Hao A Wu 
Signed-off-by: Shenglei Zhang 
---
v2: Add "Common/CommonHeader.h" in CapsuleX64.inf.
 MdeModulePkg/Universal/CapsulePei/CapsulePei.inf| 3 ++-
 MdeModulePkg/Universal/CapsulePei/CapsuleX64.inf| 1 +
 MdeModulePkg/Universal/EbcDxe/EbcDebuggerConfig.inf | 9 -
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Universal/CapsulePei/CapsulePei.inf 
b/MdeModulePkg/Universal/CapsulePei/CapsulePei.inf
index 786c41163304..e5078c79863c 100644
--- a/MdeModulePkg/Universal/CapsulePei/CapsulePei.inf
+++ b/MdeModulePkg/Universal/CapsulePei/CapsulePei.inf
@@ -6,7 +6,7 @@
 #  This external input must be validated carefully to avoid security issue like
 #  buffer overflow, integer overflow.
 #
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
 # Copyright (c) 2017, AMD Incorporated. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -33,6 +33,7 @@ [Sources]
   UefiCapsule.c
   Capsule.h
   Common/CapsuleCoalesce.c
+  Common/CommonHeader.h
 
 [Packages]
   MdePkg/MdePkg.dec
diff --git a/MdeModulePkg/Universal/CapsulePei/CapsuleX64.inf 
b/MdeModulePkg/Universal/CapsulePei/CapsuleX64.inf
index 95e5f68c9892..35d2535a5b48 100644
--- a/MdeModulePkg/Universal/CapsulePei/CapsuleX64.inf
+++ b/MdeModulePkg/Universal/CapsulePei/CapsuleX64.inf
@@ -33,6 +33,7 @@ [Sources]
   X64/X64Entry.c
   X64/PageFaultHandler.nasm
   Common/CapsuleCoalesce.c
+  Common/CommonHeader.h
 
 [Packages]
   MdePkg/MdePkg.dec
diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebuggerConfig.inf 
b/MdeModulePkg/Universal/EbcDxe/EbcDebuggerConfig.inf
index af002bd98e99..22cf64d9507a 100644
--- a/MdeModulePkg/Universal/EbcDxe/EbcDebuggerConfig.inf
+++ b/MdeModulePkg/Universal/EbcDxe/EbcDebuggerConfig.inf
@@ -1,7 +1,7 @@
 ## @file
 #  EBC Debugger configuration application.
 #
-#  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
+#  Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -28,6 +28,13 @@ [Sources]
   EbcDebugger/EdbCommon.h
   EbcDebugger/EdbSupportString.c
   EbcDebugger/EdbSupport.h
+  EbcDebugger/EdbCommand.h
+  EbcDebugger/EdbHook.h
+  EbcDebugger/Edb.h
+  EbcDebugger/EdbDisasmSupport.h
+  EbcDebugger/EdbDisasm.h
+  EbcDebugger/EdbSymbol.h
+  EbcDebuggerHook.h
 
 [Packages]
   MdePkg/MdePkg.dec
-- 
2.18.0.windows.1


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

View/Reply Online (#45398): https://edk2.groups.io/g/devel/message/45398
Mute This Topic: https://groups.io/mt/32838103/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-