Date   

Re: [edk2-staging/EdkRepo] [PATCH] EdkRepo: Replace imp.reload with importlib.reload

Nate DeSimone
 

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

-----Original Message-----
From: Ashley E Desimone <ashley.e.desimone@intel.com>
Sent: Wednesday, November 11, 2020 3:42 PM
To: devel@edk2.groups.io
Cc: Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Pandya, Puja
<puja.pandya@intel.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>;
Agyeman, Prince <prince.agyeman@intel.com>; Bjorge, Erik C
<erik.c.bjorge@intel.com>
Subject: [edk2-staging/EdkRepo] [PATCH] EdkRepo: Replace imp.reload with
importlib.reload

The imp module is deprecated since Python 3.4 in favor of importlib. This
patch replaces uses of imp.reload() with importlib.reload() and removes
unused imp imports.

Cc: Ashley E Desimone <ashley.e.desimone@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Signed-off-by: Ashley E Desimone <ashley.e.desimone@intel.com>
---
edkrepo/__main__.py | 4 ++--
edkrepo/edkrepo_cli.py | 1 -
edkrepo/edkrepo_entry_point.py | 4 ++--
3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/edkrepo/__main__.py b/edkrepo/__main__.py index
115a779..2d538d3 100644
--- a/edkrepo/__main__.py
+++ b/edkrepo/__main__.py
@@ -7,7 +7,7 @@
# SPDX-License-Identifier: BSD-2-Clause-Patent #

-import imp
+import importlib
import os
import sys
import site
@@ -23,7 +23,7 @@ for directory in sitepackages:
edkrepo_site_dir = edkrepo_package_path
break
else:
- imp.reload(edkrepo)
+ importlib.reload(edkrepo)
import edkrepo.edkrepo_entry_point

if __name__ == '__main__':
diff --git a/edkrepo/edkrepo_cli.py b/edkrepo/edkrepo_cli.py index
4e7ff16..1adb63f 100644
--- a/edkrepo/edkrepo_cli.py
+++ b/edkrepo/edkrepo_cli.py
@@ -18,7 +18,6 @@ import os
import subprocess
import site
import inspect
-import imp
import importlib.util
import datetime as dt

diff --git a/edkrepo/edkrepo_entry_point.py
b/edkrepo/edkrepo_entry_point.py index dd2b36e..30d65ff 100644
--- a/edkrepo/edkrepo_entry_point.py
+++ b/edkrepo/edkrepo_entry_point.py
@@ -8,7 +8,7 @@
#

import argparse
-import imp
+import importlib
import importlib.util
import inspect
import json
@@ -37,7 +37,7 @@ for directory in sitepackages:
edkrepo_site_dir = edkrepo_package_path
break
else:
- imp.reload(edkrepo)
+ importlib.reload(edkrepo)
edkrepo_package_path =
os.path.dirname(os.path.dirname(edkrepo.__file__))
for directory in sitepackages:
if edkrepo_package_path == directory:
--
2.27.0.windows.1


Re: [edk2-staging/EdkRepo][PATCH] EdkRepo: Remove unused checkout sha functionality

Nate DeSimone
 

-----Original Message-----
From: Ashley E Desimone <ashley.e.desimone@intel.com>
Sent: Wednesday, November 11, 2020 2:30 PM
To: devel@edk2.groups.io
Cc: Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Pandya, Puja
<puja.pandya@intel.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>;
Agyeman, Prince <prince.agyeman@intel.com>; Bjorge, Erik C
<erik.c.bjorge@intel.com>
Subject: [edk2-staging/EdkRepo][PATCH] EdkRepo: Remove unused
checkout sha functionality

The SHA parameter for the checkout command has been removed
previously. This commit removes the calculations which supported this
functionality and amends the checkout function to raise an
EdkRepoInvalidParameters exception if a valid combo name is not passed in.

Cc: Ashley E Desimone <ashley.e.desimone@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Signed-off-by: Ashley E Desimone <ashley.e.desimone@intel.com>
---
edkrepo/common/common_repo_functions.py | 78 ++++---------------------
1 file changed, 12 insertions(+), 66 deletions(-)

diff --git a/edkrepo/common/common_repo_functions.py
b/edkrepo/common/common_repo_functions.py
index 0d54bbf..2277c1e 100644
--- a/edkrepo/common/common_repo_functions.py
+++ b/edkrepo/common/common_repo_functions.py
@@ -427,76 +427,22 @@ def combination_is_in_manifest(combination,
manifest):
return combination in combination_names


-def get_target_sources(combination_or_sha, manifest, workspace_path,
log=None):
- if combination_is_in_manifest(combination_or_sha, manifest):
- return manifest.get_repo_sources(combination_or_sha)
-
- current_combo = manifest.general_config.current_combo
- # look for a pin file that is named combination_or_sha.xml
- pin_filename = os.path.join(
- workspace_path,
- 'repo',
- combination_or_sha+'.xml')
- if os.path.exists(pin_filename):
- return ManifestXml(pin_filename).get_repo_sources(current_combo)
-
- print ("Search repositories for '{}'".format(combination_or_sha))
- commit_map = {
- x.root : None
- for x in manifest.get_repo_sources(current_combo)
- }
- found = False
- if not log:
- log = sort_commits(manifest, workspace_path)
- for commit in log:
- root = os.path.basename(commit.repo.working_dir)
- if combination_or_sha == commit.hexsha:
- found = True
- commit_map[root] = commit.hexsha
- continue
- if not found:
- continue
- if not commit_map[root]:
- commit_map[root] = commit.hexsha
- if not found:
- raise
EdkrepoInvalidParametersException(CHECKOUT_INVALID_COMBO)
-
- # Create a new pin file
- old_sources = manifest.get_repo_sources(current_combo)
- new_sources = []
- for repo_source in old_sources:
- new_sources.append(
- repo_source._replace(commit=commit_map[repo_source.root]))
- manifest.generate_pin_xml(
- combination_or_sha,
- current_combo,
- new_sources,
- filename=pin_filename)
-
- return ManifestXml(pin_filename).get_repo_sources(current_combo)
-
-
-def checkout(combination_or_sha, verbose=False, override=False,
log=None):
+def checkout(combination, verbose=False, override=False, log=None):
workspace_path = get_workspace_path()
manifest = get_workspace_manifest()

- # Create combo_or_sha so we have original input and do not introduce
any
+ # Create combo so we have original input and do not introduce any
# unintended behavior by messing with parameters.
- combo_or_sha = combination_or_sha
+ combo = combination
submodule_combo = manifest.general_config.current_combo
try:
# Try to handle normalize combo name to match the manifest file.
- combo_or_sha = case_insensitive_single_match(combo_or_sha,
combinations_in_manifest(manifest))
- submodule_combo = combo_or_sha
+ combo = case_insensitive_single_match(combo,
combinations_in_manifest(manifest))
+ submodule_combo = combo
except:
- # No match so leave it alone. It must be a SHA1 or a bad combo name.
- pass
+ raise
EdkrepoInvalidParametersException(CHECKOUT_INVALID_COMBO)

- repo_sources = get_target_sources(
- combo_or_sha,
- manifest,
- workspace_path,
- log=log)
+ repo_sources = manifest.get_repo_sources(combo)
initial_repo_sources =
manifest.get_repo_sources(manifest.general_config.current_combo)

# Disable sparse checkout
@@ -523,7 +469,7 @@ def checkout(combination_or_sha, verbose=False,
override=False, log=None):

# Deinit all submodules due to the potential for issues when switching
# branches.
- if combo_or_sha != manifest.general_config.current_combo:
+ if combo != manifest.general_config.current_combo:
try:
deinit_full(workspace_path, manifest, verbose)
except Exception as e:
@@ -531,19 +477,19 @@ def checkout(combination_or_sha, verbose=False,
override=False, log=None):
if verbose:
print(e)

- print(CHECKING_OUT_COMBO.format(combo_or_sha))
+ print(CHECKING_OUT_COMBO.format(combo))

try:
checkout_repos(verbose, override, repo_sources, workspace_path,
manifest)
current_repos = repo_sources
# Update the current checkout combo in the manifest only if this
# combination exists in the manifest
- if combination_is_in_manifest(combo_or_sha, manifest):
- manifest.write_current_combo(combo_or_sha)
+ if combination_is_in_manifest(combo, manifest):
+ manifest.write_current_combo(combo)
except:
if verbose:
traceback.print_exc()
- print (CHECKOUT_COMBO_UNSUCCESSFULL.format(combo_or_sha))
+ print (CHECKOUT_COMBO_UNSUCCESSFULL.format(combo))
# Return to the initial combo, since there was an issue with cheking out
the selected combo
checkout_repos(verbose, override, initial_repo_sources,
workspace_path, manifest)
finally:
--
2.26.2.windows.1


Re: [edk2-staging/EdkRepo][PATCH] EdkRepo: Remove unused checkout sha functionality

Nate DeSimone
 

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

-----Original Message-----
From: Ashley E Desimone <ashley.e.desimone@intel.com>
Sent: Wednesday, November 11, 2020 2:30 PM
To: devel@edk2.groups.io
Cc: Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Pandya, Puja
<puja.pandya@intel.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>;
Agyeman, Prince <prince.agyeman@intel.com>; Bjorge, Erik C
<erik.c.bjorge@intel.com>
Subject: [edk2-staging/EdkRepo][PATCH] EdkRepo: Remove unused
checkout sha functionality

The SHA parameter for the checkout command has been removed
previously. This commit removes the calculations which supported this
functionality and amends the checkout function to raise an
EdkRepoInvalidParameters exception if a valid combo name is not passed in.

Cc: Ashley E Desimone <ashley.e.desimone@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Signed-off-by: Ashley E Desimone <ashley.e.desimone@intel.com>
---
edkrepo/common/common_repo_functions.py | 78 ++++---------------------
1 file changed, 12 insertions(+), 66 deletions(-)

diff --git a/edkrepo/common/common_repo_functions.py
b/edkrepo/common/common_repo_functions.py
index 0d54bbf..2277c1e 100644
--- a/edkrepo/common/common_repo_functions.py
+++ b/edkrepo/common/common_repo_functions.py
@@ -427,76 +427,22 @@ def combination_is_in_manifest(combination,
manifest):
return combination in combination_names


-def get_target_sources(combination_or_sha, manifest, workspace_path,
log=None):
- if combination_is_in_manifest(combination_or_sha, manifest):
- return manifest.get_repo_sources(combination_or_sha)
-
- current_combo = manifest.general_config.current_combo
- # look for a pin file that is named combination_or_sha.xml
- pin_filename = os.path.join(
- workspace_path,
- 'repo',
- combination_or_sha+'.xml')
- if os.path.exists(pin_filename):
- return ManifestXml(pin_filename).get_repo_sources(current_combo)
-
- print ("Search repositories for '{}'".format(combination_or_sha))
- commit_map = {
- x.root : None
- for x in manifest.get_repo_sources(current_combo)
- }
- found = False
- if not log:
- log = sort_commits(manifest, workspace_path)
- for commit in log:
- root = os.path.basename(commit.repo.working_dir)
- if combination_or_sha == commit.hexsha:
- found = True
- commit_map[root] = commit.hexsha
- continue
- if not found:
- continue
- if not commit_map[root]:
- commit_map[root] = commit.hexsha
- if not found:
- raise
EdkrepoInvalidParametersException(CHECKOUT_INVALID_COMBO)
-
- # Create a new pin file
- old_sources = manifest.get_repo_sources(current_combo)
- new_sources = []
- for repo_source in old_sources:
- new_sources.append(
- repo_source._replace(commit=commit_map[repo_source.root]))
- manifest.generate_pin_xml(
- combination_or_sha,
- current_combo,
- new_sources,
- filename=pin_filename)
-
- return ManifestXml(pin_filename).get_repo_sources(current_combo)
-
-
-def checkout(combination_or_sha, verbose=False, override=False,
log=None):
+def checkout(combination, verbose=False, override=False, log=None):
workspace_path = get_workspace_path()
manifest = get_workspace_manifest()

- # Create combo_or_sha so we have original input and do not introduce
any
+ # Create combo so we have original input and do not introduce any
# unintended behavior by messing with parameters.
- combo_or_sha = combination_or_sha
+ combo = combination
submodule_combo = manifest.general_config.current_combo
try:
# Try to handle normalize combo name to match the manifest file.
- combo_or_sha = case_insensitive_single_match(combo_or_sha,
combinations_in_manifest(manifest))
- submodule_combo = combo_or_sha
+ combo = case_insensitive_single_match(combo,
combinations_in_manifest(manifest))
+ submodule_combo = combo
except:
- # No match so leave it alone. It must be a SHA1 or a bad combo name.
- pass
+ raise
EdkrepoInvalidParametersException(CHECKOUT_INVALID_COMBO)

- repo_sources = get_target_sources(
- combo_or_sha,
- manifest,
- workspace_path,
- log=log)
+ repo_sources = manifest.get_repo_sources(combo)
initial_repo_sources =
manifest.get_repo_sources(manifest.general_config.current_combo)

# Disable sparse checkout
@@ -523,7 +469,7 @@ def checkout(combination_or_sha, verbose=False,
override=False, log=None):

# Deinit all submodules due to the potential for issues when switching
# branches.
- if combo_or_sha != manifest.general_config.current_combo:
+ if combo != manifest.general_config.current_combo:
try:
deinit_full(workspace_path, manifest, verbose)
except Exception as e:
@@ -531,19 +477,19 @@ def checkout(combination_or_sha, verbose=False,
override=False, log=None):
if verbose:
print(e)

- print(CHECKING_OUT_COMBO.format(combo_or_sha))
+ print(CHECKING_OUT_COMBO.format(combo))

try:
checkout_repos(verbose, override, repo_sources, workspace_path,
manifest)
current_repos = repo_sources
# Update the current checkout combo in the manifest only if this
# combination exists in the manifest
- if combination_is_in_manifest(combo_or_sha, manifest):
- manifest.write_current_combo(combo_or_sha)
+ if combination_is_in_manifest(combo, manifest):
+ manifest.write_current_combo(combo)
except:
if verbose:
traceback.print_exc()
- print (CHECKOUT_COMBO_UNSUCCESSFULL.format(combo_or_sha))
+ print (CHECKOUT_COMBO_UNSUCCESSFULL.format(combo))
# Return to the initial combo, since there was an issue with cheking out
the selected combo
checkout_repos(verbose, override, initial_repo_sources,
workspace_path, manifest)
finally:
--
2.26.2.windows.1


Re: [Patch] IntelFsp2Pkg/Tools: Fixed PatchFv.py to parse new Fv map file format

Nate DeSimone
 

Hi Bob,

Does it make sense to have two regular expressions, one for the new format and one for the old format? The user might be using a .map file generated by an older version of BaseTools.

Thanks,
Nate

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Bob
Feng
Sent: Friday, November 13, 2020 5:57 AM
To: devel@edk2.groups.io
Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
<nathaniel.l.desimone@intel.com>; Zeng, Star <star.zeng@intel.com>;
Yunhua Feng <fengyunhua@byosoft.com.cn>; Liu, Zhiguang
<zhiguang.liu@intel.com>
Subject: [edk2-devel] [Patch] IntelFsp2Pkg/Tools: Fixed PatchFv.py to parse
new Fv map file format

The commit 76e8aac158b0717fa27f12e4d008f79161ddb050 changed Fv map
format.
It added the image type to better support source level debug. But it broke
the function of PatchFv.py because PatchFv.py also consume Fv map file.

This patch is to update PatchFv.py to make it work again.

Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Yunhua Feng <fengyunhua@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
---
IntelFsp2Pkg/Tools/PatchFv.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/IntelFsp2Pkg/Tools/PatchFv.py b/IntelFsp2Pkg/Tools/PatchFv.py
index 0c8d908063..f4c390a17b 100644
--- a/IntelFsp2Pkg/Tools/PatchFv.py
+++ b/IntelFsp2Pkg/Tools/PatchFv.py
@@ -361,11 +361,11 @@ class Symbols:
foundModHdr = False while (rptLine != "" ): if rptLine[0] != ' ':
#DxeIpl (Fixed Flash Address, BaseAddress=0x00fffb4310,
EntryPoint=0x00fffb4958) #(GUID=86D70125-BAA3-4296-A62F-
602BEBBB9081 .textbaseaddress=0x00fffb4398
.databaseaddress=0x00fffb4178)- match = re.match("([_a-zA-Z0-9\-
]+)\s\(.+BaseAddress=(0x[0-9a-fA-F]+),\s+EntryPoint=(0x[0-9a-fA-F]+)\)",
rptLine)+ match = re.match("([_a-zA-Z0-9\-
]+)\s\(.+BaseAddress=(0x[0-9a-fA-F]+),\s+EntryPoint=(0x[0-9a-fA-
F]+),\s*Type=\w+\)", rptLine) if match is not None:
foundModHdr = True modName = match.group(1) if
len(modName) == 36: modName =
self.dictGuidNameXref[modName.upper()]--
2.29.1.windows.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#67527): https://edk2.groups.io/g/devel/message/67527
Mute This Topic: https://groups.io/mt/78229423/1767664
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub
[nathaniel.l.desimone@intel.com] -=-=-=-=-=-=


Re: [Patch] IntelFsp2Pkg/Tools: Fixed PatchFv.py to parse new Fv map file format

Nate DeSimone
 

Hi Bob,

Does it make sense to have two regular expressions, one for the new format and one for the old format? The user might be using a .map file generated by an older version of BaseTools.

Thanks,
Nate

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Bob
Feng
Sent: Friday, November 13, 2020 5:57 AM
To: devel@edk2.groups.io
Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
<nathaniel.l.desimone@intel.com>; Zeng, Star <star.zeng@intel.com>;
Yunhua Feng <fengyunhua@byosoft.com.cn>; Liu, Zhiguang
<zhiguang.liu@intel.com>
Subject: [edk2-devel] [Patch] IntelFsp2Pkg/Tools: Fixed PatchFv.py to parse
new Fv map file format

The commit 76e8aac158b0717fa27f12e4d008f79161ddb050 changed Fv map
format.
It added the image type to better support source level debug. But it broke
the function of PatchFv.py because PatchFv.py also consume Fv map file.

This patch is to update PatchFv.py to make it work again.

Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Yunhua Feng <fengyunhua@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
---
IntelFsp2Pkg/Tools/PatchFv.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/IntelFsp2Pkg/Tools/PatchFv.py b/IntelFsp2Pkg/Tools/PatchFv.py
index 0c8d908063..f4c390a17b 100644
--- a/IntelFsp2Pkg/Tools/PatchFv.py
+++ b/IntelFsp2Pkg/Tools/PatchFv.py
@@ -361,11 +361,11 @@ class Symbols:
foundModHdr = False while (rptLine != "" ): if rptLine[0] != ' ':
#DxeIpl (Fixed Flash Address, BaseAddress=0x00fffb4310,
EntryPoint=0x00fffb4958) #(GUID=86D70125-BAA3-4296-A62F-
602BEBBB9081 .textbaseaddress=0x00fffb4398
.databaseaddress=0x00fffb4178)- match = re.match("([_a-zA-Z0-9\-
]+)\s\(.+BaseAddress=(0x[0-9a-fA-F]+),\s+EntryPoint=(0x[0-9a-fA-F]+)\)",
rptLine)+ match = re.match("([_a-zA-Z0-9\-
]+)\s\(.+BaseAddress=(0x[0-9a-fA-F]+),\s+EntryPoint=(0x[0-9a-fA-
F]+),\s*Type=\w+\)", rptLine) if match is not None:
foundModHdr = True modName = match.group(1) if
len(modName) == 36: modName =
self.dictGuidNameXref[modName.upper()]--
2.29.1.windows.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#67527): https://edk2.groups.io/g/devel/message/67527
Mute This Topic: https://groups.io/mt/78229423/1767664
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub
[nathaniel.l.desimone@intel.com] -=-=-=-=-=-=


Re: [PATCH] IntelFsp2Pkg: Fix FSP binary rebasing issue for PE32+ image

Nate DeSimone
 

-----Original Message-----
From: Maurice Ma <maurice.ma@intel.com>
Sent: Wednesday, November 11, 2020 4:11 PM
To: devel@edk2.groups.io
Cc: Ma, Maurice <maurice.ma@intel.com>; Chiu, Chasel
<chasel.chiu@intel.com>; Desimone, Nathaniel L
<nathaniel.l.desimone@intel.com>; Zeng, Star <star.zeng@intel.com>
Subject: [PATCH] IntelFsp2Pkg: Fix FSP binary rebasing issue for PE32+ image

Current FSP rebasing script SplitFspBin.py has support for both
PE32 and PE32+ image formats. However, while updating the ImageBase field
in the image header, it always assumed the ImageBase field is 32bit long.
Since PE32+ image format defined ImageBase as 64bit, the current script will
only update the lower 32bit value and leave the upper 32bit untouched. It
does not work well for PE32+ image that requires update in the upper 32bit
ImageBase field. The expected behavior is to update the full 64bit field. This
patch implemented this fix.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
---
IntelFsp2Pkg/Tools/SplitFspBin.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/IntelFsp2Pkg/Tools/SplitFspBin.py
b/IntelFsp2Pkg/Tools/SplitFspBin.py
index 3c0d5af1b6..24272e82af 100644
--- a/IntelFsp2Pkg/Tools/SplitFspBin.py
+++ b/IntelFsp2Pkg/Tools/SplitFspBin.py
@@ -677,8 +677,12 @@ class PeTeImage:
else: offset = self.Offset + self.DosHdr.e_lfanew offset +=
EFI_IMAGE_NT_HEADERS32.OptionalHeader.offset- offset +=
EFI_IMAGE_OPTIONAL_HEADER32.ImageBase.offset- size =
EFI_IMAGE_OPTIONAL_HEADER32.ImageBase.size+ if
self.PeHdr.OptionalHeader.PePlusOptHdr.Magic == 0x20b: # PE32+ image+
offset += EFI_IMAGE_OPTIONAL_HEADER32_PLUS.ImageBase.offset+
size = EFI_IMAGE_OPTIONAL_HEADER32_PLUS.ImageBase.size+
else:+ offset +=
EFI_IMAGE_OPTIONAL_HEADER32.ImageBase.offset+ size =
EFI_IMAGE_OPTIONAL_HEADER32.ImageBase.size value =
Bytes2Val(fdbin[offset:offset+size]) + delta fdbin[offset:offset+size] =
Val2Bytes(value, size)--
2.29.2.windows.1


Re: [PATCH] IntelFsp2Pkg: Fix FSP binary rebasing issue for PE32+ image

Nate DeSimone
 

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

-----Original Message-----
From: Maurice Ma <maurice.ma@intel.com>
Sent: Wednesday, November 11, 2020 4:11 PM
To: devel@edk2.groups.io
Cc: Ma, Maurice <maurice.ma@intel.com>; Chiu, Chasel
<chasel.chiu@intel.com>; Desimone, Nathaniel L
<nathaniel.l.desimone@intel.com>; Zeng, Star <star.zeng@intel.com>
Subject: [PATCH] IntelFsp2Pkg: Fix FSP binary rebasing issue for PE32+ image

Current FSP rebasing script SplitFspBin.py has support for both
PE32 and PE32+ image formats. However, while updating the ImageBase field
in the image header, it always assumed the ImageBase field is 32bit long.
Since PE32+ image format defined ImageBase as 64bit, the current script will
only update the lower 32bit value and leave the upper 32bit untouched. It
does not work well for PE32+ image that requires update in the upper 32bit
ImageBase field. The expected behavior is to update the full 64bit field. This
patch implemented this fix.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
---
IntelFsp2Pkg/Tools/SplitFspBin.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/IntelFsp2Pkg/Tools/SplitFspBin.py
b/IntelFsp2Pkg/Tools/SplitFspBin.py
index 3c0d5af1b6..24272e82af 100644
--- a/IntelFsp2Pkg/Tools/SplitFspBin.py
+++ b/IntelFsp2Pkg/Tools/SplitFspBin.py
@@ -677,8 +677,12 @@ class PeTeImage:
else: offset = self.Offset + self.DosHdr.e_lfanew offset +=
EFI_IMAGE_NT_HEADERS32.OptionalHeader.offset- offset +=
EFI_IMAGE_OPTIONAL_HEADER32.ImageBase.offset- size =
EFI_IMAGE_OPTIONAL_HEADER32.ImageBase.size+ if
self.PeHdr.OptionalHeader.PePlusOptHdr.Magic == 0x20b: # PE32+ image+
offset += EFI_IMAGE_OPTIONAL_HEADER32_PLUS.ImageBase.offset+
size = EFI_IMAGE_OPTIONAL_HEADER32_PLUS.ImageBase.size+
else:+ offset +=
EFI_IMAGE_OPTIONAL_HEADER32.ImageBase.offset+ size =
EFI_IMAGE_OPTIONAL_HEADER32.ImageBase.size value =
Bytes2Val(fdbin[offset:offset+size]) + delta fdbin[offset:offset+size] =
Val2Bytes(value, size)--
2.29.2.windows.1


Re: [Patch V6 3/3] MinPlatformPkg: Add SerialPortTerminalLib to suport Serial Terminal feature

Nate DeSimone
 

Hi Heng,

There is a bug in this code. You need to change SerialTerminalFeaturePkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.inf to MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.inf

Other than that, look's good!

Thanks,
Nate

On 11/11/20, 7:01 PM, Luo, Heng <heng.luo@intel.com> wrote:


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

1. Add SerialPortTerminalLib to MinPlatformPkg/Library.
2. Add SerialPortTerminalLib to BdsDxe driver, to add the serial device to
ConIn and ConOut variables
3. Include SerialDxe and TerminalDxe to CoreDxeInclude.dsc and
CoreUefiBootInclude.fdf.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Heng Luo <heng.luo@intel.com>
---
Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
| 15 +++++++++++++--
Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
| 8 +++++++-

Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTer
minalLib.c | 102
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++

Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTer
minalLib.h | 34 ++++++++++++++++++++++++++++++++++

Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTer
minalLib.inf | 40 ++++++++++++++++++++++++++++++++++++++++
5 files changed, 196 insertions(+), 3 deletions(-)

diff --git a/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
b/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
index f0e578f8cc..86bf5e6f22 100644
--- a/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
+++ b/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
@@ -1,7 +1,7 @@
## @file

# Platform description.

#

-# Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.<BR>

+# Copyright (c) 2017 - 2020, Intel Corporation. All rights reserved.<BR>

#

# SPDX-License-Identifier: BSD-2-Clause-Patent

#

@@ -46,7 +46,18 @@



MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCoun
terRuntimeDxe.inf



- MdeModulePkg/Universal/BdsDxe/BdsDxe.inf

+ MdeModulePkg/Universal/BdsDxe/BdsDxe.inf {

+ <LibraryClasses>

+!if gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable == TRUE

+
NULL|SerialTerminalFeaturePkg/Library/SerialPortTerminalLib/SerialPortTer
minalLib.inf
This is the bug, please change to MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.inf


+!endif

+ }

+

+!if gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable == TRUE

+ MdeModulePkg/Universal/SerialDxe/SerialDxe.inf

+ MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf

+!endif

+


MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManager
Dxe.inf

MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf {

<LibraryClasses>

diff --git
a/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
b/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
index 7859c0b1a5..ef4576eedf 100644
--- a/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
+++ b/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
@@ -1,7 +1,7 @@
## @file

# FDF file of Platform.

#

-# Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.<BR>

+# Copyright (c) 2017 - 2020, Intel Corporation. All rights reserved.<BR>

#

# SPDX-License-Identifier: BSD-2-Clause-Patent

#

@@ -26,6 +26,12 @@ INF
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
INF
MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCoun
terRuntimeDxe.inf



INF MdeModulePkg/Universal/BdsDxe/BdsDxe.inf

+

+!if gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable == TRUE

+INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf

+INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf

+!endif

+

INF
MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManager
Dxe.inf

INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf

INF
MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf

diff --git
a/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTe
rminalLib.c
b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTe
rminalLib.c
new file mode 100644
index 0000000000..94de475173
--- /dev/null
+++
b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTe
rminalLib.c
@@ -0,0 +1,102 @@
+/** @file

+ Main file for NULL named library for Serial Port Terminal Redirection library.

+

+ Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>

+ SPDX-License-Identifier: BSD-2-Clause-Patent

+

+**/

+

+#include "SerialPortTerminalLib.h"

+

+GLOBAL_REMOVE_IF_UNREFERENCED SERIAL_DEVICE_PATH
mSerialDevicePath = {

+ {

+ {

+ HARDWARE_DEVICE_PATH,

+ HW_VENDOR_DP,

+ {

+ (UINT8) sizeof (VENDOR_DEVICE_PATH),

+ (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)

+ }

+ },

+ EDKII_SERIAL_PORT_LIB_VENDOR_GUID

+ },

+ {

+ {

+ MESSAGING_DEVICE_PATH,

+ MSG_UART_DP,

+ {

+ (UINT8) sizeof (UART_DEVICE_PATH),

+ (UINT8) ((sizeof (UART_DEVICE_PATH)) >> 8)

+ }

+ },

+ 0, // Reserved

+ 0, // BaudRate

+ 0, // DataBits

+ 0, // Parity

+ 0 // StopBits

+ },

+ {

+ {

+ MESSAGING_DEVICE_PATH,

+ MSG_VENDOR_DP,

+ {

+ (UINT8) (sizeof (VENDOR_DEVICE_PATH)),

+ (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8),

+ }

+ },

+ DEVICE_PATH_MESSAGING_PC_ANSI

+ },

+ gEndEntire

+};

+

+/**

+ Updates the ConOut, ConIn, ErrOut variables with the serial terminal
device path

+ @param none

+ @retval none

+**/

+VOID

+AddSerialTerminal (

+ VOID

+ )

+{

+ DEBUG ((DEBUG_INFO, "[AddSerialPortTerminal]\n"));

+

+ //

+ // Append Serial Terminal into "ConIn"

+ //

+ EfiBootManagerUpdateConsoleVariable (ConOut,
(EFI_DEVICE_PATH_PROTOCOL *) &mSerialDevicePath, NULL);

+ EfiBootManagerUpdateConsoleVariable (ConIn,
(EFI_DEVICE_PATH_PROTOCOL *) &mSerialDevicePath, NULL);

+ EfiBootManagerUpdateConsoleVariable (ErrOut,
(EFI_DEVICE_PATH_PROTOCOL *) &mSerialDevicePath, NULL);

+}

+

+

+/**

+ Constructor for the Serial Port Device controller library.

+

+ @param ImageHandle the image handle of the process

+ @param SystemTable the EFI System Table pointer

+

+ @retval EFI_SUCCESS the shell command handlers were installed
sucessfully

+ @retval EFI_UNSUPPORTED the shell level required was not found.

+**/

+EFI_STATUS

+EFIAPI

+SerialPortTerminalLibConstructor (

+ IN EFI_HANDLE ImageHandle,

+ IN EFI_SYSTEM_TABLE *SystemTable

+ )

+{

+ mSerialDevicePath.Uart.BaudRate =
PcdGet64(PcdSerialTerminalBaudRate);

+ mSerialDevicePath.Uart.DataBits = PcdGet8(PcdSerialTerminalDataBits);

+ mSerialDevicePath.Uart.Parity = PcdGet8(PcdSerialTerminalParity);

+ mSerialDevicePath.Uart.StopBits = PcdGet8(PcdSerialTerminalStopBits);

+ DEBUG ((DEBUG_INFO, "[SerialPortTerminalLibConstructor] [%d, %d, %d,
%d]\n",

+ mSerialDevicePath.Uart.BaudRate,

+ mSerialDevicePath.Uart.DataBits,

+ mSerialDevicePath.Uart.Parity,

+ mSerialDevicePath.Uart.StopBits));

+

+ AddSerialTerminal();

+

+ return EFI_SUCCESS;

+}

diff --git
a/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTe
rminalLib.h
b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTe
rminalLib.h
new file mode 100644
index 0000000000..bfa73cca7d
--- /dev/null
+++
b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTe
rminalLib.h
@@ -0,0 +1,34 @@
+/** @file

+ Header file for NULL named library for for Serial Port Terminal Redirection
library.

+

+ Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>

+ SPDX-License-Identifier: BSD-2-Clause-Patent

+

+**/

+

+#ifndef _SERIAL_PORT_TERMINAL_LIB_H_

+#define _SERIAL_PORT_TERMINAL_LIB_H_

+

+#include <Uefi.h>

+#include <Guid/SerialPortLibVendor.h>

+#include <Library/UefiLib.h>

+#include <Library/DevicePathLib.h>

+#include <Library/DebugLib.h>

+#include <Library/UefiBootManagerLib.h>

+

+//

+// Below is the platform console device path

+//

+typedef struct {

+ VENDOR_DEVICE_PATH Guid;

+ UART_DEVICE_PATH Uart;

+ VENDOR_DEVICE_PATH TerminalType;

+ EFI_DEVICE_PATH_PROTOCOL End;

+} SERIAL_DEVICE_PATH;

+

+#define gEndEntire \

+ { \

+ END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE, {
END_DEVICE_PATH_LENGTH, 0 } \

+ }

+

+#endif

diff --git
a/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTe
rminalLib.inf
b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTe
rminalLib.inf
new file mode 100644
index 0000000000..2667ec6d19
--- /dev/null
+++
b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTe
rminalLib.inf
@@ -0,0 +1,40 @@
+## @file

+# Component information file for Serial Port Terminal Redirection Library

+#

+# INTEL CONFIDENTIAL

+# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>

+#

+# SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+##

+[Defines]

+ INF_VERSION = 0x00010006

+ BASE_NAME = SerialPortTerminalLib

+ FILE_GUID = E12BFA46-95F2-4ADC-9774-7E38DE78741E

+ MODULE_TYPE = UEFI_DRIVER

+ VERSION_STRING = 1.2

+ LIBRARY_CLASS = NULL|UEFI_DRIVER DXE_DRIVER
DXE_RUNTIME_DRIVER

+ CONSTRUCTOR = SerialPortTerminalLibConstructor

+

+[Packages]

+ MdePkg/MdePkg.dec

+ MdeModulePkg/MdeModulePkg.dec

+ BoardModulePkg/BoardModulePkg.dec

+ MinPlatformPkg/MinPlatformPkg.dec

+

+[Sources]

+ SerialPortTerminalLib.c

+ SerialPortTerminalLib.h

+

+[LibraryClasses]

+ DevicePathLib

+ DebugLib

+ UefiDriverEntryPoint

+ UefiBootManagerLib

+ UefiLib

+

+[Pcd]

+ gEfiMdePkgTokenSpaceGuid.PcdSerialTerminalBaudRate

+ gEfiMdePkgTokenSpaceGuid.PcdSerialTerminalDataBits

+ gEfiMdePkgTokenSpaceGuid.PcdSerialTerminalParity

+ gEfiMdePkgTokenSpaceGuid.PcdSerialTerminalStopBits

--
2.24.0.windows.2


Re: [Patch V6 2/3] OpenBoardPkg: Configurae PcdSerialTerminalEnable

Nate DeSimone
 

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

On 11/11/20, 7:01 PM, Luo, Heng <heng.luo@intel.com> wrote:


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

Enable Serial Terminal Feature for UpXtreme, and disable it for other
platform by default.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Heng Luo <heng.luo@intel.com>
---

Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgPc
d.dsc | 1 +
Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
| 1 +

Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.ds
c | 1 +
Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc
| 1 +

Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.ds
c | 1 +

Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPk
gPcd.dsc | 1 +
6 files changed, 6 insertions(+)

diff --git
a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg
Pcd.dsc
b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg
Pcd.dsc
index d611e99fc1..589b002d06 100644
---
a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg
Pcd.dsc
+++
b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg
Pcd
+++ .dsc
@@ -131,6 +131,7 @@
gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE+
gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE !if
gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUEdiff --git
a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.ds
c
b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.ds
c
index 352416a489..44dacdf082 100644
---
a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.ds
c
+++
b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.ds
c
@@ -130,6 +130,7 @@
gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE+
gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE !if
gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUEdiff --git
a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.
dsc
b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.
dsc
index 9e8b148753..725596cbf7 100644
---
a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.
dsc
+++
b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.
d
+++ sc
@@ -168,6 +168,7 @@
gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE+
gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE !if
gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUEdiff --git
a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
c
b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
c
index 52cdf9ec0f..251f46f812 100644
---
a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
c
+++
b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
+++ c
@@ -50,6 +50,7 @@
gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|FALSE
gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE+
gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE !if
gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUEdiff --git
a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.
dsc
b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.
dsc
index d797ae9d94..e161bf06f4 100644
---
a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.
dsc
+++
b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.
ds
+++ c
@@ -127,6 +127,7 @@
gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE+
gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|TRUE !if
gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUEdiff --git
a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoard
PkgPcd.dsc
b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoard
PkgPcd.dsc
index 5d769e8153..83ada3c95c 100644
---
a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoard
PkgPcd.dsc
+++
b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoard
Pk
+++ gPcd.dsc
@@ -127,6 +127,7 @@
gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE+
gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE !if
gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE--
2.24.0.windows.2


Re: [Patch V6 1/3] MinPlatformPkg: Add PCDs for Serial Terminal feature

Nate DeSimone
 

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

On 11/11/20, 7:00 PM, Luo, Heng <heng.luo@intel.com> wrote:


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

Add PcdSerialTerminalEnable to enable/disable Serial Terminal feature, this
feature supports console redirect after the shell is loaded.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Heng Luo <heng.luo@intel.com>
---
Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec | 1 +
Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
index 7ef189dac8..2a831f2669 100644
--- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
+++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
@@ -318,3 +318,4 @@
gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable
|FALSE|BOOLEAN|0xF00000A5
gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable|FALSE|BOOL
EAN|0xF00000A6 gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable
|FALSE|BOOLEAN|0xF00000A7+
gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable
|FALSE|BOOLEAN|0xF00000B0diff --git
a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
index 112ddff7d9..d0b5593817 100644
--- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
+++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
@@ -1,7 +1,7 @@
## @file # Platform description. #-# Copyright (c) 2017 - 2019, Intel
Corporation. All rights reserved.<BR>+# Copyright (c) 2017 - 2020, Intel
Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-
Clause-Patent #@@ -44,6 +44,7 @@
gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable|FALSE+
gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
##########################################################
###################### #--
2.24.0.windows.2


Re: [platforms: PATCH] SolidRun/Armada80x0McBin: Introduce SD/MMC ACPI description

Ard Biesheuvel
 

Hello Marcin,

On 11/14/20 10:21 AM, Marcin Wojtas wrote:
This patch adds a new description of the board's SD/MMC
interfaces in DSDT table that can work with the newly
introduced support in Linux.
Remaining Armada7k8k / CN913x platforms will follow
after this binding is accepted.
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
---
Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/Dsdt.asl | 60 ++++++++++++++++++++
1 file changed, 60 insertions(+)
diff --git a/Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/Dsdt.asl b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/Dsdt.asl
index 7e9e361988..5f910fa814 100644
--- a/Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/Dsdt.asl
+++ b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/Dsdt.asl
@@ -86,6 +86,66 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, "MVEBU ", "ARMADA8K", 3)
})
}
+ Device (MMC0)
+ {
+ Name (_HID, "MRVL0002") // _HID: Hardware ID
+ Name (_UID, 0x00) // _UID: Unique ID
+ Name (_CCA, 0x01) // _CCA: Cache Coherency Attribute
+
+ Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
+ {
+ Memory32Fixed (ReadWrite,
+ 0xF06E0000, // Address Base (MMIO)
+ 0x00000300, // Address Length
+ )
+ Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive, ,, )
+ {
+ 48
+ }
+ })
+ Name (_DSD, Package () {
+ ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+ Package () {
+ Package () { "clock-frequency", 400000000 },
+ Package () { "bus-width", 8 },
+ Package () { "marvell,xenon-phy-slow-mode", 0x1 },
+ Package () { "no-1-8-v", 0x1 },
+ Package () { "no-sd", 0x1 },
+ Package () { "no-sdio", 0x1 },
+ Package () { "non-removable", 0x1 },
+ Package () { "compatible", "marvell,armada-ap806-sdhci" },
Please use either a dedicated ACPI _HID, or use PRP0001+compatible to match the device (and the former is strongly preferred).


+ }
+ })
+ }
+
+ Device (MMC1)
+ {
+ Name (_HID, "MRVL0002") // _HID: Hardware ID
+ Name (_UID, 0x01) // _UID: Unique ID
+ Name (_CCA, 0x01) // _CCA: Cache Coherency Attribute
+
+ Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
+ {
+ Memory32Fixed (ReadWrite,
+ 0xF2780000, // Address Base (MMIO)
+ 0x00000300, // Address Length
+ )
+ Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive, ,, )
+ {
+ CP_GIC_SPI_CP0_SDMMC
+ }
+ })
+ Name (_DSD, Package () {
+ ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+ Package () {
+ Package () { "clock-frequency", 400000000 },
+ Package () { "bus-width", 4 },
+ Package () { "broken-cd", 0x1 },
+ Package () { "no-1-8-v", 0x1 },
+ }
+ })
+ }
+
Device (XHC0)
{
Name (_HID, "PNP0D10") // _HID: Hardware ID


[platforms: PATCH] SolidRun/Armada80x0McBin: Introduce SD/MMC ACPI description

Marcin Wojtas
 

This patch adds a new description of the board's SD/MMC
interfaces in DSDT table that can work with the newly
introduced support in Linux.
Remaining Armada7k8k / CN913x platforms will follow
after this binding is accepted.

Signed-off-by: Marcin Wojtas <mw@semihalf.com>
---
Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/Dsdt.asl | 60 ++++++=
++++++++++++++
1 file changed, 60 insertions(+)

diff --git a/Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/Dsdt.asl=
b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/Dsdt.asl
index 7e9e361988..5f910fa814 100644
--- a/Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/Dsdt.asl
+++ b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/Dsdt.asl
@@ -86,6 +86,66 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, "MVEBU ", "ARMAD=
A8K", 3)
})=0D
}=0D
=0D
+ Device (MMC0)=0D
+ {=0D
+ Name (_HID, "MRVL0002") // _HID: Hardware ID=0D
+ Name (_UID, 0x00) // _UID: Unique ID=0D
+ Name (_CCA, 0x01) // _CCA: Cache Coherency Attribute=
=0D
+=0D
+ Name (_CRS, ResourceTemplate () // _CRS: Current Resource Set=
tings=0D
+ {=0D
+ Memory32Fixed (ReadWrite,=0D
+ 0xF06E0000, // Address Base (MMIO)=0D
+ 0x00000300, // Address Length=0D
+ )=0D
+ Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive,=
,, )=0D
+ {=0D
+ 48=0D
+ }=0D
+ })=0D
+ Name (_DSD, Package () {=0D
+ ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),=0D
+ Package () {=0D
+ Package () { "clock-frequency", 400000000 },=0D
+ Package () { "bus-width", 8 },=0D
+ Package () { "marvell,xenon-phy-slow-mode", 0x1 },=0D
+ Package () { "no-1-8-v", 0x1 },=0D
+ Package () { "no-sd", 0x1 },=0D
+ Package () { "no-sdio", 0x1 },=0D
+ Package () { "non-removable", 0x1 },=0D
+ Package () { "compatible", "marvell,armada-ap806-sdh=
ci" },=0D
+ }=0D
+ })=0D
+ }=0D
+=0D
+ Device (MMC1)=0D
+ {=0D
+ Name (_HID, "MRVL0002") // _HID: Hardware ID=0D
+ Name (_UID, 0x01) // _UID: Unique ID=0D
+ Name (_CCA, 0x01) // _CCA: Cache Coherency Attribute=
=0D
+=0D
+ Name (_CRS, ResourceTemplate () // _CRS: Current Resource Set=
tings=0D
+ {=0D
+ Memory32Fixed (ReadWrite,=0D
+ 0xF2780000, // Address Base (MMIO)=0D
+ 0x00000300, // Address Length=0D
+ )=0D
+ Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive,=
,, )=0D
+ {=0D
+ CP_GIC_SPI_CP0_SDMMC=0D
+ }=0D
+ })=0D
+ Name (_DSD, Package () {=0D
+ ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),=0D
+ Package () {=0D
+ Package () { "clock-frequency", 400000000 },=0D
+ Package () { "bus-width", 4 },=0D
+ Package () { "broken-cd", 0x1 },=0D
+ Package () { "no-1-8-v", 0x1 },=0D
+ }=0D
+ })=0D
+ }=0D
+=0D
Device (XHC0)=0D
{=0D
Name (_HID, "PNP0D10") // _HID: Hardware ID=0D
--=20
2.29.0


Re: [PATCH v7 2/2] UefiCpuPkg/PiSmmCpuDxeSmm: Reflect page table depth with page table address

Laszlo Ersek
 

On 11/13/20 03:50, Sheng Wei wrote:

diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c
index 810985df20..1c6075e332 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c
@@ -1111,14 +1140,13 @@ SetPageTableAttributes (
UINT64 *L3PageTable;
UINT64 *L4PageTable;
UINT64 *L5PageTable;
+ UINTN PageTableBase;
BOOLEAN IsSplitted;
BOOLEAN PageTableSplitted;
BOOLEAN CetEnabled;
- IA32_CR4 Cr4;
BOOLEAN Enable5LevelPaging;

- Cr4.UintN = AsmReadCr4 ();
- Enable5LevelPaging = (BOOLEAN) (Cr4.Bits.LA57 == 1);
+ GetPageTable (&PageTableBase, &Enable5LevelPaging);

//
// Don't mark page table memory as read-only if
(1) You didn't address point (14) from my v6 review:

https://edk2.groups.io/g/devel/message/67251
https://www.redhat.com/archives/edk2-devel-archive/2020-November/msg00410.html

To summarize it here: in v8, please move the GetPageTable() call into
the outermost loop, as follows:

diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c
index 1c6075e3326a..cdc1fcefc524 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c
@@ -1127,89 +1127,90 @@ SmiPFHandler (
This function sets memory attribute for page table.
**/
VOID
SetPageTableAttributes (
VOID
)
{
UINTN Index2;
UINTN Index3;
UINTN Index4;
UINTN Index5;
UINT64 *L1PageTable;
UINT64 *L2PageTable;
UINT64 *L3PageTable;
UINT64 *L4PageTable;
UINT64 *L5PageTable;
UINTN PageTableBase;
BOOLEAN IsSplitted;
BOOLEAN PageTableSplitted;
BOOLEAN CetEnabled;
BOOLEAN Enable5LevelPaging;

- GetPageTable (&PageTableBase, &Enable5LevelPaging);
-
//
// Don't mark page table memory as read-only if
// - no restriction on access to non-SMRAM memory; or
// - SMM heap guard feature enabled; or
// BIT2: SMM page guard enabled
// BIT3: SMM pool guard enabled
// - SMM profile feature enabled
//
if (!mCpuSmmRestrictedMemoryAccess ||
((PcdGet8 (PcdHeapGuardPropertyMask) & (BIT3 | BIT2)) != 0) ||
FeaturePcdGet (PcdCpuSmmProfileEnable)) {
//
// Restriction on access to non-SMRAM memory and heap guard could not be enabled at the same time.
//
ASSERT (!(mCpuSmmRestrictedMemoryAccess &&
(PcdGet8 (PcdHeapGuardPropertyMask) & (BIT3 | BIT2)) != 0));

//
// Restriction on access to non-SMRAM memory and SMM profile could not be enabled at the same time.
//
ASSERT (!(mCpuSmmRestrictedMemoryAccess && FeaturePcdGet (PcdCpuSmmProfileEnable)));
return ;
}

DEBUG ((DEBUG_INFO, "SetPageTableAttributes\n"));

//
// Disable write protection, because we need mark page table to be write protected.
// We need *write* page table memory, to mark itself to be *read only*.
//
CetEnabled = ((AsmReadCr4() & CR4_CET_ENABLE) != 0) ? TRUE : FALSE;
if (CetEnabled) {
//
// CET must be disabled if WP is disabled.
//
DisableCet();
}
AsmWriteCr0 (AsmReadCr0() & ~CR0_WP);

do {
DEBUG ((DEBUG_INFO, "Start...\n"));
PageTableSplitted = FALSE;
L5PageTable = NULL;
+
+ GetPageTable (&PageTableBase, &Enable5LevelPaging);
+
if (Enable5LevelPaging) {
L5PageTable = (UINT64 *)PageTableBase;
SmmSetMemoryAttributesEx ((EFI_PHYSICAL_ADDRESS)PageTableBase, SIZE_4KB, EFI_MEMORY_RO, &IsSplitted);
PageTableSplitted = (PageTableSplitted || IsSplitted);
}

for (Index5 = 0; Index5 < (Enable5LevelPaging ? SIZE_4KB/sizeof(UINT64) : 1); Index5++) {
if (Enable5LevelPaging) {
L4PageTable = (UINT64 *)(UINTN)(L5PageTable[Index5] & ~mAddressEncMask & PAGING_4K_ADDRESS_MASK_64);
if (L4PageTable == NULL) {
continue;
}
} else {
L4PageTable = (UINT64 *)PageTableBase;
}
SmmSetMemoryAttributesEx ((EFI_PHYSICAL_ADDRESS)(UINTN)L4PageTable, SIZE_4KB, EFI_MEMORY_RO, &IsSplitted);
PageTableSplitted = (PageTableSplitted || IsSplitted);

for (Index4 = 0; Index4 < SIZE_4KB/sizeof(UINT64); Index4++) {
L3PageTable = (UINT64 *)(UINTN)(L4PageTable[Index4] & ~mAddressEncMask & PAGING_4K_ADDRESS_MASK_64);
if (L3PageTable == NULL) {
continue;
This incremental patch should be squashed into your v8 2/2.

Then I'll give my R-b.

Thanks,
Laszlo


Re: [PATCH v2] NetworkPkg: Add NETWORK_HTTP_ENABLE macro

Laszlo Ersek
 

Hi Abner,

On 11/12/20 07:10, Abner Chang wrote:
BZ:2917

Add NETWORK_HTTP_ENABLE macro and separate HttpDxe
and HttpUtilitiesDxe drivers from
HTTP_NETWORK_HTTP_BOOT_ENABLE macro.

Current NETWORK_HTTP_BOOT_ENABLE macro is defined to enable HTTP
boot feature in POST, this macro is not only enabling HTTP Boot
related modules but also enabling other generic HTTP modules
such as HttpDxe, HttpUtilitiesDxe and DnsDxe.
These HTTP base drivers would not be only used by HTTP boot
when we introduce the use case of Redfish implementation over
HTTP to edk2.
We should have a dedicate macro to enable generic HTTP functions
on Network stack and additionally provide NETWORK_HTTP_BOOT_ENABLE
for HTTP boot functionality for the use case that platform doesn't
require HTTP boot.

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Nickle Wang <nickle.wang@hpe.com>
Cc: Peter O'Hanley <peter.ohanley@hpe.com>
---
NetworkPkg/Network.fdf.inc | 5 ++++-
NetworkPkg/NetworkComponents.dsc.inc | 5 ++++-
NetworkPkg/NetworkDefines.dsc.inc | 9 +++++++++
NetworkPkg/NetworkPkg.ci.yaml | 1 +
4 files changed, 18 insertions(+), 2 deletions(-)
Thanks for fixing up the bracketed subject prefix.

Also thanks for the new paragraph in the commit message.

Regarding the change to the "NetworkPkg/NetworkPkg.ci.yaml" file, which
is new in v2, I'm not sure if it makes any difference. I certainly don't
mind it.

However, other than the above, this patch is identical to v1. It seems
like you missed my points (2) through (6) in my v1 review:

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

https://www.redhat.com/archives/edk2-devel-archive/2020-November/msg00467.html

Please don't stop reading my messages until you reach the end of the
email, or my signature. I *always* make it clear in my emails when/where
the recipient is supposed to stop reading.

(I would expect everybody else to do the same, like either sign every
email explicitly where they're done responding, or if they don't want to
sign, at least cut away the irrelevant context after their last point
made, so readers don't have to scroll down uselessly to the end -- but
hey, what I can do.)

In this particular instance, I'm going to keep the trailing context
(like I tend to) because above I made a reference to the YAML file, so
preserving that makes sense. But, as almost always, I'm also going to
sign my response:

Thanks,
Laszlo



diff --git a/NetworkPkg/Network.fdf.inc b/NetworkPkg/Network.fdf.inc
index 803a0d64fd..8a662ad1de 100644
--- a/NetworkPkg/Network.fdf.inc
+++ b/NetworkPkg/Network.fdf.inc
@@ -46,10 +46,13 @@
INF NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf
!endif

- !if $(NETWORK_HTTP_BOOT_ENABLE) == TRUE
+ !if ($(NETWORK_HTTP_BOOT_ENABLE) == TRUE) OR ($(NETWORK_HTTP_ENABLE) == TRUE)
INF NetworkPkg/DnsDxe/DnsDxe.inf
INF NetworkPkg/HttpDxe/HttpDxe.inf
INF NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf
+ !endif
+
+ !if $(NETWORK_HTTP_BOOT_ENABLE) == TRUE
INF NetworkPkg/HttpBootDxe/HttpBootDxe.inf
!endif

diff --git a/NetworkPkg/NetworkComponents.dsc.inc b/NetworkPkg/NetworkComponents.dsc.inc
index 40cb8ee18e..21cb62082f 100644
--- a/NetworkPkg/NetworkComponents.dsc.inc
+++ b/NetworkPkg/NetworkComponents.dsc.inc
@@ -48,10 +48,13 @@
NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf
!endif

- !if $(NETWORK_HTTP_BOOT_ENABLE) == TRUE
+ !if ($(NETWORK_HTTP_BOOT_ENABLE) == TRUE) OR ($(NETWORK_HTTP_ENABLE) == TRUE)
NetworkPkg/DnsDxe/DnsDxe.inf
NetworkPkg/HttpDxe/HttpDxe.inf
NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf
+ !endif
+
+ !if $(NETWORK_HTTP_BOOT_ENABLE) == TRUE
NetworkPkg/HttpBootDxe/HttpBootDxe.inf
!endif

diff --git a/NetworkPkg/NetworkDefines.dsc.inc b/NetworkPkg/NetworkDefines.dsc.inc
index a442d1b157..6f274582a8 100644
--- a/NetworkPkg/NetworkDefines.dsc.inc
+++ b/NetworkPkg/NetworkDefines.dsc.inc
@@ -15,12 +15,14 @@
# DEFINE NETWORK_IP4_ENABLE = TRUE
# DEFINE NETWORK_IP6_ENABLE = TRUE
# DEFINE NETWORK_TLS_ENABLE = TRUE
+# DEFINE NETWORK_HTTP_ENABLE = TRUE
# DEFINE NETWORK_HTTP_BOOT_ENABLE = TRUE
# DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = FALSE
# DEFINE NETWORK_ISCSI_ENABLE = TRUE
# DEFINE NETWORK_VLAN_ENABLE = TRUE
#
# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+# (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -73,6 +75,13 @@
DEFINE NETWORK_TLS_ENABLE = TRUE
!endif

+!ifndef NETWORK_HTTP_ENABLE
+ #
+ # This flag is to enable or disable HTTP(S) feature.
+ #
+ DEFINE NETWORK_HTTP_ENABLE = TRUE
+!endif
+
!ifndef NETWORK_HTTP_BOOT_ENABLE
#
# This flag is to enable or disable HTTP(S) boot feature.
diff --git a/NetworkPkg/NetworkPkg.ci.yaml b/NetworkPkg/NetworkPkg.ci.yaml
index 1a3ab71792..66b74cfe9a 100644
--- a/NetworkPkg/NetworkPkg.ci.yaml
+++ b/NetworkPkg/NetworkPkg.ci.yaml
@@ -71,6 +71,7 @@
"BLD_*_NETWORK_IP4_ENABLE": "TRUE",
"BLD_*_NETWORK_IP6_ENABLE": "TRUE",
"BLD_*_NETWORK_TLS_ENABLE": "TRUE",
+ "BLD_*_NETWORK_HTTP_ENABLE": "TRUE",
"BLD_*_NETWORK_HTTP_BOOT_ENABLE": "TRUE",
"BLD_*_NETWORK_ISCSI_ENABLE": "TRUE",
}


Re: [PATCH v1 1/1] CryptoPkg: BaseCryptLib: Fix buffer double free in CryptPkcs7VerifyEku

Yao, Jiewen
 

Sorry, I missed this email.

Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>

-----Original Message-----
From: Kun Qin <kun.q@outlook.com>
Sent: Wednesday, October 21, 2020 10:32 AM
To: devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@intel.com>; Lu, XiaoyuX
<xiaoyux.lu@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>; Jiang,
Guomin <guomin.jiang@intel.com>
Subject: [PATCH v1 1/1] CryptoPkg: BaseCryptLib: Fix buffer double free in
CryptPkcs7VerifyEku

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

SignerCert is part of Pkcs7 instance when both have valid content. OpenSLL
PKCS7_free function will release the memory of SignerCert when applicable.
Freeing SignerCert with X509_free again might cause page fault if use-
after-free guard is enabled.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Xiaoyu Lu <xiaoyux.lu@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Guomin Jiang <guomin.jiang@intel.com>

Signed-off-by: Kun Qin <kun.q@outlook.com>
---
CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyEku.c | 4 ----
1 file changed, 4 deletions(-)

diff --git a/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyEku.c
b/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyEku.c
index c9fdb65b99d1..40cc39afe7dd 100644
--- a/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyEku.c
+++ b/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyEku.c
@@ -508,10 +508,6 @@ Exit:
free (SignedData);

}



- if (SignerCert != NULL) {

- X509_free (SignerCert);

- }

-

if (Pkcs7 != NULL) {

PKCS7_free (Pkcs7);

}

--
2.28.0.windows.1


Re: [PATCH V4 12/13] NetworkPkg/Defines: Make iSCSI disable as default

Laszlo Ersek
 

On 11/12/20 06:55, Gao, Zhichao wrote:
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3003

iSCSI is using the deprecated function MD5. It is
better to make the default setting secure. If the platforms
want to use the iSCSI, they should enable it in the platforms'
dsc file and be aware they are using an function with weak
cryptography.

Enable iSCSI in NetworkPkg.dsc for build.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Xiaoyu Lu <xiaoyux.lu@intel.com>
Cc: Guomin Jiang <guomin.jiang@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Kelly Steele <kelly.steele@intel.com>
Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
---
NetworkPkg/NetworkDefines.dsc.inc | 4 ++--
NetworkPkg/NetworkPkg.dsc | 4 +++-
2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/NetworkPkg/NetworkDefines.dsc.inc b/NetworkPkg/NetworkDefines.dsc.inc
index a442d1b157..18921d81f6 100644
--- a/NetworkPkg/NetworkDefines.dsc.inc
+++ b/NetworkPkg/NetworkDefines.dsc.inc
@@ -17,7 +17,7 @@
# DEFINE NETWORK_TLS_ENABLE = TRUE
# DEFINE NETWORK_HTTP_BOOT_ENABLE = TRUE
# DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = FALSE
-# DEFINE NETWORK_ISCSI_ENABLE = TRUE
+# DEFINE NETWORK_ISCSI_ENABLE = FALSE
# DEFINE NETWORK_VLAN_ENABLE = TRUE
#
# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
@@ -101,7 +101,7 @@
# Both OpensslLib.inf and OpensslLibCrypto.inf library instance can be used
# since libssl is not required for iSCSI.
#
- DEFINE NETWORK_ISCSI_ENABLE = TRUE
+ DEFINE NETWORK_ISCSI_ENABLE = FALSE
!endif

!if $(NETWORK_ENABLE) == TRUE
diff --git a/NetworkPkg/NetworkPkg.dsc b/NetworkPkg/NetworkPkg.dsc
index 716d04fdad..e508995e3a 100644
--- a/NetworkPkg/NetworkPkg.dsc
+++ b/NetworkPkg/NetworkPkg.dsc
@@ -2,7 +2,7 @@
# UEFI 2.4 Network Module Package for All Architectures
#
# (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
-# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2009 - 2020, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -18,6 +18,8 @@
BUILD_TARGETS = DEBUG|RELEASE|NOOPT
SKUID_IDENTIFIER = DEFAULT

+ DEFINE NETWORK_ISCSI_ENABLE = TRUE
+
[LibraryClasses]
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
Reviewed-by: Laszlo Ersek <lersek@redhat.com>


Re: [PATCH V4 11/13] OvmfPkg/BhyveX64.dsc: Enable MD5 while enable iSCSI

Laszlo Ersek
 

On 11/12/20 06:55, Gao, Zhichao wrote:
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3003

There is a plan to make MD5 disable as default.
The new MACRO ENABLE_MD5_DEPRECATED_INTERFACES
would be introduced to enable MD5. Make the
definition ahead of the change to avoid build
error after the MACRO changed.

Enable iSCSI.

Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: Leif Lindholm <leif@nuviainc.com>
---
OvmfPkg/Bhyve/BhyveX64.dsc | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc
index 16d2233d77..77e31af5d5 100644
--- a/OvmfPkg/Bhyve/BhyveX64.dsc
+++ b/OvmfPkg/Bhyve/BhyveX64.dsc
@@ -1,6 +1,6 @@
#
# Copyright (c) 2020, Rebecca Cran <rebecca@bsdio.com>
-# Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.<BR>
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
# Copyright (c) 2014, Pluribus Networks, Inc.
#
@@ -41,6 +41,7 @@
DEFINE NETWORK_IP6_ENABLE = FALSE
DEFINE NETWORK_HTTP_BOOT_ENABLE = FALSE
DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = TRUE
+ DEFINE NETWORK_ISCSI_ENABLE = TRUE

!include NetworkPkg/NetworkDefines.dsc.inc

@@ -83,6 +84,8 @@
INTEL:*_*_*_CC_FLAGS = /D DISABLE_NEW_DEPRECATED_INTERFACES
GCC:*_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES

+!include NetworkPkg/NetworkBuildOptions.dsc.inc
+
[BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
XCODE:*_*_*_DLINK_FLAGS = -seg1addr 0x1000 -segalign 0x1000
Reviewed-by: Laszlo Ersek <lersek@redhat.com>

Also, on top of Rebecca's recently-merged series
(662b42db76a5..5e9a8a6dfb15), it makes sense to *attempt* building this
patch. So:

Build-tested-by: Laszlo Ersek <lersek@redhat.com>

Thanks
Laszlo


Re: [PATCH V4 10/13] OvmfPkg/OvmfXen.dsc: Enable MD5 while enable iSCSI

Laszlo Ersek
 

On 11/12/20 06:55, Gao, Zhichao wrote:
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3003

There is a plan to make MD5 disable as default.
The new MACRO ENABLE_MD5_DEPRECATED_INTERFACES
would be introduced to enable MD5. Make the
definition ahead of the change to avoid build
error after the MACRO changed.

Enable iSCSI.

Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: Leif Lindholm <leif@nuviainc.com>
---
OvmfPkg/OvmfXen.dsc | 3 +++
1 file changed, 3 insertions(+)

diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc
index 34c9de19df..83e1e9bbfd 100644
--- a/OvmfPkg/OvmfXen.dsc
+++ b/OvmfPkg/OvmfXen.dsc
@@ -38,6 +38,7 @@
DEFINE NETWORK_IP6_ENABLE = FALSE
DEFINE NETWORK_HTTP_BOOT_ENABLE = FALSE
DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = TRUE
+ DEFINE NETWORK_ISCSI_ENABLE = TRUE

!include NetworkPkg/NetworkDefines.dsc.inc

@@ -80,6 +81,8 @@
INTEL:*_*_*_CC_FLAGS = /D DISABLE_NEW_DEPRECATED_INTERFACES
GCC:*_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES

+!include NetworkPkg/NetworkBuildOptions.dsc.inc
+
[BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
XCODE:*_*_*_DLINK_FLAGS = -seg1addr 0x1000 -segalign 0x1000
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Build-tested-by: Laszlo Ersek <lersek@redhat.com>


Re: [PATCH V4 09/13] OvmfPkg/OvmfPkgX64.dsc: Enable MD5 while enable iSCSI

Laszlo Ersek
 

On 11/12/20 06:55, Gao, Zhichao wrote:
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3003

There is a plan to make MD5 disable as default.
The new MACRO ENABLE_MD5_DEPRECATED_INTERFACES
would be introduced to enable MD5. Make the
definition ahead of the change to avoid build
error after the MACRO changed.

Enable iSCSI.

Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: Leif Lindholm <leif@nuviainc.com>
---
OvmfPkg/OvmfPkgX64.dsc | 3 +++
1 file changed, 3 insertions(+)

diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index 7a8bdb8a86..10968da4e8 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -41,6 +41,7 @@
DEFINE NETWORK_IP6_ENABLE = FALSE
DEFINE NETWORK_HTTP_BOOT_ENABLE = FALSE
DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = TRUE
+ DEFINE NETWORK_ISCSI_ENABLE = TRUE

!include NetworkPkg/NetworkDefines.dsc.inc

@@ -90,6 +91,8 @@
INTEL:*_*_*_CC_FLAGS = /D DISABLE_NEW_DEPRECATED_INTERFACES
GCC:*_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES

+!include NetworkPkg/NetworkBuildOptions.dsc.inc
+
[BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
XCODE:*_*_*_DLINK_FLAGS = -seg1addr 0x1000 -segalign 0x1000
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Build-tested-by: Laszlo Ersek <lersek@redhat.com>


Re: [PATCH V4 08/13] OvmfPkg/OvmfPkgIa32X64.dsc: Enable MD5 while enable iSCSI

Laszlo Ersek
 

On 11/12/20 06:55, Gao, Zhichao wrote:
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3003

There is a plan to make MD5 disable as default.
The new MACRO ENABLE_MD5_DEPRECATED_INTERFACES
would be introduced to enable MD5. Make the
definition ahead of the change to avoid build
error after the MACRO changed.

Enable iSCSI.

Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: Leif Lindholm <leif@nuviainc.com>
---
OvmfPkg/OvmfPkgIa32X64.dsc | 3 +++
1 file changed, 3 insertions(+)

diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
index 3551f9710a..a17abc3ae5 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -41,6 +41,7 @@
DEFINE NETWORK_IP6_ENABLE = FALSE
DEFINE NETWORK_HTTP_BOOT_ENABLE = FALSE
DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = TRUE
+ DEFINE NETWORK_ISCSI_ENABLE = TRUE

!include NetworkPkg/NetworkDefines.dsc.inc

@@ -90,6 +91,8 @@
INTEL:*_*_*_CC_FLAGS = /D DISABLE_NEW_DEPRECATED_INTERFACES
GCC:*_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES

+!include NetworkPkg/NetworkBuildOptions.dsc.inc
+
[BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
XCODE:*_*_*_DLINK_FLAGS = -seg1addr 0x1000 -segalign 0x1000
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Build-tested-by: Laszlo Ersek <lersek@redhat.com>

4921 - 4940 of 72431