Date   

回复: [edk2-devel] [PATCH] MdeModulePkg/RegularExpressionDxe: Fix memory assert in FreePool()

gaoliming
 

Please also add this file into the ignored file list.

Thanks
Liming

-----邮件原件-----
发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Nickle Wang
发送时间: 2021年7月5日 8:55
收件人: devel@edk2.groups.io; gaoliming@...;
lersek@...
抄送: jian.j.wang@...; hao.a.wu@...; Wang, Nickle (HPS SW)
<nickle.wang@...>
主题: Re: [edk2-devel] [PATCH] MdeModulePkg/RegularExpressionDxe: Fix
memory assert in FreePool()

Thanks Liming! I create personal PR below and I also see CI error on
OnigurumaUefiPort.h. It looks like "Ubuntu GCC PR" does not like the coding
style on OnigurumaUefiPort.h. However, I just follow the coding style of other
functions in this file.

https://github.com/tianocore/edk2/pull/1788

So, should I add this file into exception list too? Or I just follow the coding style
on what I modified?

Thanks,
Nickle

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of gaoliming
Sent: Thursday, July 1, 2021 1:19 PM
To: devel@edk2.groups.io; Wang, Nickle (HPS SW) <nickle.wang@...>;
lersek@...
Cc: jian.j.wang@...; hao.a.wu@...
Subject: 回复: [edk2-devel] [PATCH] MdeModulePkg/RegularExpressionDxe:
Fix memory assert in FreePool()

Nickle:
You can create personal PR to verify this change first. If it passes CI, please
send the updated patch set.

Thanks
Liming
-----邮件原件-----
发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Nickle
Wang
发送时间: 2021年6月30日 21:11
收件人: devel@edk2.groups.io; Wang, Nickle (HPS SW)
<nickle.wang@...>; gaoliming <gaoliming@...>;
lersek@...
抄送: jian.j.wang@...; hao.a.wu@...; Wang, Nickle (HPS SW)
<nickle.wang@...>
主题: Re: [edk2-devel] [PATCH] MdeModulePkg/RegularExpressionDxe: Fix
memory assert in FreePool()

Hi Liming,

I got my patch ready. Should I test it by creating PR on Github like
https://github.com/tianocore/edk2/pull/1735? Or I just send out new
patch for review?

Thanks,
Nickle

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Nickle
Wang
Sent: Wednesday, June 30, 2021 9:49 AM
To: gaoliming <gaoliming@...>; devel@edk2.groups.io;
lersek@...
Cc: jian.j.wang@...; hao.a.wu@...; Wang, Nickle (HPS SW)
<nickle.wang@...>
Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/RegularExpressionDxe:
Fix memory assert in FreePool()

I see. Thanks for your quick response. I will work on it.

Nickle

-----Original Message-----
From: gaoliming <gaoliming@...>
Sent: Wednesday, June 30, 2021 9:43 AM
To: Wang, Nickle (HPS SW) <nickle.wang@...>;
devel@edk2.groups.io;
lersek@...
Cc: jian.j.wang@...; hao.a.wu@...
Subject: 回复: [edk2-devel] [PATCH]
MdeModulePkg/RegularExpressionDxe:
Fix memory assert in FreePool()

This is a separate commit. You can send it together with previous patch.

Thanks
Liming
-----邮件原件-----
发件人: Wang, Nickle (HPS SW) <nickle.wang@...>
发送时间: 2021年6月30日 9:29
收件人: gaoliming <gaoliming@...>; devel@edk2.groups.io;
lersek@...
抄送: jian.j.wang@...; hao.a.wu@...; Wang, Nickle (HPS
SW)
<nickle.wang@...>
主题: RE: [edk2-devel] [PATCH] MdeModulePkg/RegularExpressionDxe:
Fix
memory assert in FreePool()

Hi Liming,

No problem. It looks like I have to add OnigurumaUefiPort.c into
"IgnoreFiles"
object in MdeModulePkg.ci.yaml. And should I send this patch alone?
Or I have to send it as a part of patch in early fix?

Thanks,
Nickle

-----Original Message-----
From: gaoliming <gaoliming@...>
Sent: Wednesday, June 30, 2021 9:06 AM
To: devel@edk2.groups.io; lersek@...; Wang, Nickle (HPS SW)
<nickle.wang@...>
Cc: jian.j.wang@...; hao.a.wu@...
Subject: 回复: [edk2-devel] [PATCH]
MdeModulePkg/RegularExpressionDxe:
Fix memory assert in FreePool()

Laszlo:
Yes. I agree to add OnigurumaUefiPort.c into ECC exception in
MdeModulePkg.ci.yaml.

Nickle:
Can you provide the patch to update MdeModulePkg.ci.yaml?

Thanks
Liming
-----邮件原件-----
发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Laszlo
Ersek
发送时间: 2021年6月29日 22:52
收件人: devel@edk2.groups.io; nickle.wang@...
抄送: gaoliming@...; jian.j.wang@...;
hao.a.wu@...
主题: Re: [edk2-devel] [PATCH] MdeModulePkg/RegularExpressionDxe:
Fix
memory assert in FreePool()

On 06/10/21 06:56, Nickle Wang wrote:
Memory buffer that is allocated by malloc() and realloc() will
be shifted by 8 bytes because Oniguruma keeps its memory signature.
This 8 bytes shift is not handled while calling free() to
release memory. Add
free() function to check Oniguruma signature before release
memory because memory buffer is not touched when using calloc().

Signed-off-by: Nickle Wang <nickle.wang@...>
---
.../RegularExpressionDxe/OnigurumaUefiPort.c | 19
++++++++++++++++++-
.../RegularExpressionDxe/OnigurumaUefiPort.h | 14
++------------
2 files changed, 20 insertions(+), 13 deletions(-)

diff --git
a/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.c
b/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.c
index 9aa7b0a68e..5c34324db8 100644
---
a/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.c
+++
b/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.c
@@ -2,7 +2,7 @@

Module to rewrite stdlib references within Oniguruma

- (C) Copyright 2014-2015 Hewlett Packard Enterprise
Development
LP<BR>
+ (C) Copyright 2014-2021 Hewlett Packard Enterprise
+ Development
LP<BR>
Copyright (c) 2020, Intel Corporation. All rights
reserved.<BR>

SPDX-License-Identifier: BSD-2-Clause-Patent @@ -96,3 +96,20
@@
void* memset (void *dest, char ch, unsigned int
count)
return SetMem (dest, count, ch); }

+void free(void *ptr)
+{
+ VOID *EvalOnce;
+ ONIGMEM_HEAD *PoolHdr;
+
+ EvalOnce = ptr;
+ if (EvalOnce == NULL) {
+ return;
+ }
+
+ PoolHdr = (ONIGMEM_HEAD *)EvalOnce - 1;
+ if (PoolHdr->Signature == ONIGMEM_HEAD_SIGNATURE) {
+ FreePool (PoolHdr);
+ } else {
+ FreePool (EvalOnce);
+ }
+}
diff --git
a/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.h
b/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.h
index 20b75c3361..0bdb7be529 100644
---
a/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.h
+++
b/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.h
@@ -2,7 +2,7 @@

Module to rewrite stdlib references within Oniguruma

- (C) Copyright 2014-2015 Hewlett Packard Enterprise
Development
LP<BR>
+ (C) Copyright 2014-2021 Hewlett Packard Enterprise
+ Development
LP<BR>
Copyright (c) 2020, Intel Corporation. All rights
reserved.<BR>

SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -46,17 +46,6 @@ typedef INTN intptr_t;
#endif

#define calloc(n,s) AllocateZeroPool((n)*(s))
-
-#define free(p) \
- do { \
- VOID *EvalOnce; \
- \
- EvalOnce = (p); \
- if (EvalOnce != NULL) { \
- FreePool (EvalOnce); \
- } \
- } while (FALSE)
-
#define xmemmove(Dest,Src,Length) CopyMem(Dest,Src,Length)
#define
xmemcpy(Dest,Src,Length) CopyMem(Dest,Src,Length) #define
xmemset(Buffer,Value,Length) SetMem(Buffer,Length,Value) @@
-98,6
+87,7 @@ void* malloc(size_t size);
void* realloc(void *ptr, size_t size);
void* memcpy (void *dest, const void *src, unsigned int count);
void* memset (void *dest, char ch, unsigned int count);
+void free(void *ptr);

#define exit(n) ASSERT(FALSE);

This patch cannot be merged, due to a number of EccCheck complaints:

2021-06-21T01:44:13.4327861Z PROGRESS - --Running MdeModulePkg:
EccCheck Test NO-TARGET --
2021-06-21T01:44:20.4922300Z ERROR -
2021-06-21T01:44:20.4924178Z
ERROR - EFI coding style error 2021-06-21T01:44:20.4925524Z ERROR
- *Error code: 4002 2021-06-21T01:44:20.4927323Z ERROR - *Function
header doesn't exist 2021-06-21T01:44:20.4936437Z ERROR - *file:
//home/vsts/work/1/s/MdeModulePkg/Universal/RegularExpressionDxe/Oni
gurumaUefiPort.c
2021-06-21T01:44:20.4937669Z ERROR - *Line number: 99
2021-06-21T01:44:20.4938737Z ERROR - *Function [free] has NO
comment
immediately preceding it.
2021-06-21T01:44:20.4945489Z ERROR -
2021-06-21T01:44:20.4951382Z
ERROR - EFI coding style error 2021-06-21T01:44:20.4960149Z ERROR
- *Error code: 4002 2021-06-21T01:44:20.4961161Z ERROR - *Function
header doesn't exist 2021-06-21T01:44:20.4966674Z ERROR - *file:
//home/vsts/work/1/s/MdeModulePkg/Universal/RegularExpressionDxe/Oni
gurumaUefiPort.h
2021-06-21T01:44:20.4973232Z ERROR - *Line number: 90
2021-06-21T01:44:20.4978337Z ERROR - *Function [free] has NO
comment
immediately preceding it.
2021-06-21T01:44:20.4981257Z ERROR -
2021-06-21T01:44:20.4983805Z
ERROR - EFI coding style error 2021-06-21T01:44:20.4986537Z ERROR
- *Error code: 5001 2021-06-21T01:44:20.4989508Z ERROR - *Return
type of a function should exist and in the first line
2021-06-21T01:44:20.4997043Z ERROR -
*file:
//home/vsts/work/1/s/MdeModulePkg/Universal/RegularExpressionDxe/Oni
gurumaUefiPort.h
2021-06-21T01:44:20.4997804Z ERROR - *Line number: 90
2021-06-21T01:44:20.4998331Z ERROR - *[free] Return Type should
appear on its own line 2021-06-21T01:44:20.4998762Z ERROR -
2021-06-21T01:44:20.4999175Z ERROR - EFI coding style error
2021-06-21T01:44:20.5017351Z ERROR - *Error code: 5003
2021-06-21T01:44:20.5023282Z ERROR - *Function name should be left
justified, followed by the beginning of the parameter list, with
the closing parenthesis on its own line, indented two spaces
2021-06-21T01:44:20.5024931Z ERROR - *file:
//home/vsts/work/1/s/MdeModulePkg/Universal/RegularExpressionDxe/Oni
gurumaUefiPort.c
2021-06-21T01:44:20.5025818Z ERROR - *Line number: 99
2021-06-21T01:44:20.5026960Z ERROR - *Function name [free] should
appear at the start of a line 2021-06-21T01:44:20.5027533Z ERROR -
2021-06-21T01:44:20.5027982Z ERROR - EFI coding style error
2021-06-21T01:44:20.5028454Z ERROR - *Error code: 5003
2021-06-21T01:44:20.5029279Z ERROR - *Function name should be left
justified, followed by the beginning of the parameter list, with
the closing parenthesis on its own line, indented two spaces
2021-06-21T01:44:20.5030177Z ERROR - *file:
//home/vsts/work/1/s/MdeModulePkg/Universal/RegularExpressionDxe/Oni
gurumaUefiPort.h
2021-06-21T01:44:20.5030770Z ERROR - *Line number: 90
2021-06-21T01:44:20.5031330Z ERROR - *Function name [free] should
appear at the start of a line 2021-06-21T01:44:20.5031788Z ERROR -
2021-06-21T01:44:20.5032240Z ERROR - EFI coding style error
2021-06-21T01:44:20.5032706Z ERROR - *Error code: 5003
2021-06-21T01:44:20.5033554Z ERROR - *Function name should be left
justified, followed by the beginning of the parameter list, with
the closing parenthesis on its own line, indented two spaces
2021-06-21T01:44:20.5036470Z ERROR - *file:
//home/vsts/work/1/s/MdeModulePkg/Universal/RegularExpressionDxe/Oni
gurumaUefiPort.h
2021-06-21T01:44:20.5040063Z ERROR - *Line number: 90
2021-06-21T01:44:20.5043513Z ERROR - *Parameter ptr should be in
its own line.
2021-06-21T01:44:20.5046782Z ERROR -
2021-06-21T01:44:20.5049909Z
ERROR - EFI coding style error 2021-06-21T01:44:20.5053571Z ERROR
- *Error code: 5003 2021-06-21T01:44:20.5057415Z ERROR - *Function
name should be left justified, followed by the beginning of the
parameter list, with the closing parenthesis on its own line,
indented two spaces 2021-06-21T01:44:20.5066200Z ERROR - *file:
//home/vsts/work/1/s/MdeModulePkg/Universal/RegularExpressionDxe/Oni
gurumaUefiPort.h
2021-06-21T01:44:20.5066831Z ERROR - *Line number: 90
2021-06-21T01:44:20.5067378Z ERROR - *')' should be on a new line
and indented two spaces 2021-06-21T01:44:20.5067799Z ERROR -
2021-06-21T01:44:20.5068211Z ERROR - EFI coding style error
2021-06-21T01:44:20.5070600Z ERROR - *Error code: 7001
2021-06-21T01:44:20.5074448Z ERROR - *There should be no use of
int, unsigned, char, void, long in any .c, .h or .asl files
2021-06-21T01:44:20.5077965Z ERROR - *file:
//home/vsts/work/1/s/MdeModulePkg/Universal/RegularExpressionDxe/Oni
gurumaUefiPort.c
2021-06-21T01:44:20.5081222Z ERROR - *Line number: 110
2021-06-21T01:44:20.5084248Z ERROR - *Parameter ptr
2021-06-21T01:44:20.5090115Z ERROR -
2021-06-21T01:44:20.5090517Z
ERROR - EFI coding style error 2021-06-21T01:44:20.5090923Z ERROR
- *Error code: 7001 2021-06-21T01:44:20.5093481Z ERROR - *There
should
be no use of int, unsigned, char, void, long in any .c, .h or .asl
files 2021-06-21T01:44:20.5096387Z ERROR - *file:
//home/vsts/work/1/s/MdeModulePkg/Universal/RegularExpressionDxe/Oni
gurumaUefiPort.h
2021-06-21T01:44:20.5099658Z ERROR - *Line number: 90
2021-06-21T01:44:20.5103008Z ERROR - *free Return type void
2021-06-21T01:44:20.5105878Z ERROR -
2021-06-21T01:44:20.5108537Z
ERROR - EFI coding style error 2021-06-21T01:44:20.5111630Z ERROR
- *Error code: 7001 2021-06-21T01:44:20.5115083Z ERROR - *There
should
be no use of int, unsigned, char, void, long in any .c, .h or .asl
files 2021-06-21T01:44:20.5118600Z ERROR - *file:
//home/vsts/work/1/s/MdeModulePkg/Universal/RegularExpressionDxe/Oni
gurumaUefiPort.h
2021-06-21T01:44:20.5126189Z ERROR - *Line number: 90
2021-06-21T01:44:20.5142100Z ERROR - *Parameter ptr
2021-06-21T01:44:20.5142574Z ERROR -
2021-06-21T01:44:20.5142979Z
ERROR - EFI coding style error 2021-06-21T01:44:20.5143429Z ERROR
- *Error code: 8005 2021-06-21T01:44:20.5144332Z ERROR - *Variable
name does not follow the
rules: 1. First character should be upper case 2. Must contain
lower case characters 3. No white space characters 4. Global
variable name must start with a 'g'
2021-06-21T01:44:20.5145416Z ERROR - *file:
//home/vsts/work/1/s/MdeModulePkg/Universal/RegularExpressionDxe/Oni
gurumaUefiPort.h
2021-06-21T01:44:20.5146050Z ERROR - *Line number: 90
2021-06-21T01:44:20.5146555Z ERROR - *Parameter [ptr] NOT follow
naming convention.
2021-06-21T01:44:20.5146963Z ERROR -
2021-06-21T01:44:20.5147366Z
ERROR - EFI coding style error 2021-06-21T01:44:20.5147794Z ERROR
- *Error code: 8006 2021-06-21T01:44:20.5148562Z ERROR - *Function
name does not follow the
rules: 1. First character should be upper case 2. Must contain
lower case characters 3. No white space characters
2021-06-21T01:44:20.5149399Z ERROR - *file:
//home/vsts/work/1/s/MdeModulePkg/Universal/RegularExpressionDxe/Oni
gurumaUefiPort.c
2021-06-21T01:44:20.5149932Z ERROR - *Line number: 99
2021-06-21T01:44:20.5150445Z ERROR - *The function name [free]
does not follow the rules 2021-06-21T01:44:20.5155470Z ERROR -
--->Test
Failed: EccCheck Test NO-TARGET returned 1

These are all (or mostly) related to preexistent code, so I think
the EccCheck plugin config should be updated in MdeModulePkg, to
permit an exception for these files.

For now, I've closed <https://github.com/tianocore/edk2/pull/1735>
without merging it.

Thanks
Laszlo

























Re: [PATCH] IntelFsp2Pkg: PatchFv parseInfFile function modification

Chiu, Chasel
 

Thanks Ashraf.
Adding my comments below inline.

-----Original Message-----
From: S, Ashraf Ali <ashraf.ali.s@...>
Sent: Sunday, July 4, 2021 7:23 PM
To: devel@edk2.groups.io
Cc: S, Ashraf Ali <ashraf.ali.s@...>; Ni, Ray <ray.ni@...>; Chiu,
Chasel <chasel.chiu@...>; Desimone, Nathaniel L
<nathaniel.l.desimone@...>; Zeng, Star <star.zeng@...>
Subject: [PATCH] IntelFsp2Pkg: PatchFv parseInfFile function modification

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

parseInfFile currently reading the EFI_BASE_ADDRESS from INF, once the
address found still it's continues to read the complete inf file which is not
required. once the EFI_BASE_ADDRESS read from the INF no need to read
the INF further.
MSFT compiler can generate the map file address 8 or 16 based on which
architecture the INF is compiler. currently it's support for IA32, it can be
update the X64 in future.
modification of few typo errors in parseModMapFile, getCurr function
required

Signed-off-by: Ashraf Ali S <ashraf.ali.s@...>
Cc: Ray Ni <ray.ni@...>
Cc: Chasel Chiu <chasel.chiu@...>
Cc: Nate DeSimone <nathaniel.l.desimone@...>
Cc: Star Zeng <star.zeng@...>
---
IntelFsp2Pkg/Tools/PatchFv.py | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/IntelFsp2Pkg/Tools/PatchFv.py b/IntelFsp2Pkg/Tools/PatchFv.py
index 112de4077a..236019b62d 100644
--- a/IntelFsp2Pkg/Tools/PatchFv.py
+++ b/IntelFsp2Pkg/Tools/PatchFv.py
@@ -1,6 +1,6 @@
## @ PatchFv.py
#
-# Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2014 - 2021, Intel Corporation. All rights
+reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -297,17 +297,17
@@ class Symbols:
#
fvOffset = self.getFvOffsetInFd(infFile[0:-4] + ".Fv")
fdIn = open(infFile, "r")
- rptLine = fdIn.readline()
+ rptLines = fdIn.readlines()



The target line "EFI_BASE_ADDRESS = 0x********" is usually the second line in the generated INF file, do you think we really need to change to "readlines()" to read whole file?
It looks to me original readline() implementation is better in efficiency, but just need to break when the match found.




self.fdBase = 0xFFFFFFFF
- while (rptLine != "" ):
+ for line in rptLines:
#EFI_BASE_ADDRESS = 0xFFFDF400
- match = re.match("^EFI_BASE_ADDRESS\s*=\s*(0x[a-fA-F0-9]+)",
rptLine)
+ match =
+ re.match("^EFI_BASE_ADDRESS\s*=\s*(0x[a-fA-F0-9]+)", line)
if match is not None:
self.fdBase = int(match.group(1), 16) - fvOffset
- rptLine = fdIn.readline()
+ break
fdIn.close()
if self.fdBase == 0xFFFFFFFF:
- raise Exception("Could not find EFI_BASE_ADDRESS in INF file!" %
fvFile)
+ raise Exception("Could not find EFI_BASE_ADDRESS in INF
+ file!" % infFile)
return 0

#
@@ -402,6 +402,7 @@ class Symbols:
#
# retval 0 Parsed MOD MAP file successfully
# retval 1 There is no moduleEntryPoint in modSymbols
+ # retval 2 There is no offset for moduleEntryPoint in modSymbols
#
def parseModMapFile(self, moduleName, mapFile):
#
@@ -426,7 +427,7 @@ class Symbols:
else:
#MSFT
#0003:00000190 _gComBase 00007a50 SerialPo
- patchMapFileMatchString = "^\s[0-9a-fA-F]{4}:[0-9a-fA-
F]{8}\s+(\w+)\s+([0-9a-fA-F]{8}\s+)"
+ patchMapFileMatchString = "^\s[0-9a-fA-F]{4}:[0-9a-fA-
F]{8}\s+(\w+)\s+([0-9a-fA-F]{8,16}\s+)"
matchKeyGroupIndex = 1
matchSymbolGroupIndex = 2
prefix = ''
@@ -498,7 +499,7 @@ class Symbols:
#
# Get current character
#
- # retval elf.string[self.index]
+ # retval self.string[self.index]
# retval '' Exception
#
def getCurr(self):
--
2.30.2.windows.1


[PATCH] MdeModulePkg PiSmmCore: Change MemoryAttributes message to DEBUG_VERBOSE level

Yang Gang
 

1. Reduce the debug message during boot.
2. Update SmmCore debug level of MemoryAttributesTable align to DxeCore.

Signed-off-by: Yang Gang <yanggang@...>
Cc: Eric Dong <eric.dong@...>
Cc: Ray Ni <ray.ni@...>
Cc: Liming Gao <gaoliming@...>
---
.../Core/PiSmmCore/MemoryAttributesTable.c | 26 +++++++++----------
1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c b/MdeMod=
ulePkg/Core/PiSmmCore/MemoryAttributesTable.c
index de8262ecb9..3e8a80dd7d 100644
--- a/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
+++ b/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c
@@ -1208,10 +1208,10 @@ PublishMemoryAttributesTable (
ASSERT (Status =3D=3D EFI_BUFFER_TOO_SMALL);
=20
do {
- DEBUG ((DEBUG_INFO, "MemoryMapSize - 0x%x\n", MemoryMapSize));
+ DEBUG ((DEBUG_VERBOSE, "MemoryMapSize - 0x%x\n", MemoryMapSize));
MemoryMap =3D AllocatePool (MemoryMapSize);
ASSERT (MemoryMap !=3D NULL);
- DEBUG ((DEBUG_INFO, "MemoryMap - 0x%x\n", MemoryMap));
+ DEBUG ((DEBUG_VERBOSE, "MemoryMap - 0x%x\n", MemoryMap));
=20
Status =3D SmmCoreGetMemoryMapMemoryAttributesTable (
&MemoryMapSize,
@@ -1236,19 +1236,19 @@ PublishMemoryAttributesTable (
MemoryAttributesTable->NumberOfEntries =3D (UINT32)RuntimeEntryCount;
MemoryAttributesTable->DescriptorSize =3D (UINT32)DescriptorSize;
MemoryAttributesTable->Reserved =3D 0;
- DEBUG ((DEBUG_INFO, "MemoryAttributesTable:\n"));
- DEBUG ((DEBUG_INFO, " Version - 0x%08x\n", MemoryAttribu=
tesTable->Version));
- DEBUG ((DEBUG_INFO, " NumberOfEntries - 0x%08x\n", MemoryAttribu=
tesTable->NumberOfEntries));
- DEBUG ((DEBUG_INFO, " DescriptorSize - 0x%08x\n", MemoryAttribu=
tesTable->DescriptorSize));
+ DEBUG ((DEBUG_VERBOSE, "MemoryAttributesTable:\n"));
+ DEBUG ((DEBUG_VERBOSE, " Version - 0x%08x\n", MemoryAttr=
ibutesTable->Version));
+ DEBUG ((DEBUG_VERBOSE, " NumberOfEntries - 0x%08x\n", MemoryAttr=
ibutesTable->NumberOfEntries));
+ DEBUG ((DEBUG_VERBOSE, " DescriptorSize - 0x%08x\n", MemoryAttr=
ibutesTable->DescriptorSize));
MemoryAttributesEntry =3D (EFI_MEMORY_DESCRIPTOR *)(MemoryAttributesTa=
ble + 1);
for (Index =3D 0; Index < MemoryMapSize/DescriptorSize; Index++) {
CopyMem (MemoryAttributesEntry, MemoryMap, DescriptorSize);
- DEBUG ((DEBUG_INFO, "Entry (0x%x)\n", MemoryAttributesEntry));
- DEBUG ((DEBUG_INFO, " Type - 0x%x\n", MemoryAttributes=
Entry->Type));
- DEBUG ((DEBUG_INFO, " PhysicalStart - 0x%016lx\n", MemoryAttrib=
utesEntry->PhysicalStart));
- DEBUG ((DEBUG_INFO, " VirtualStart - 0x%016lx\n", MemoryAttrib=
utesEntry->VirtualStart));
- DEBUG ((DEBUG_INFO, " NumberOfPages - 0x%016lx\n", MemoryAttrib=
utesEntry->NumberOfPages));
- DEBUG ((DEBUG_INFO, " Attribute - 0x%016lx\n", MemoryAttrib=
utesEntry->Attribute));
+ DEBUG ((DEBUG_VERBOSE, "Entry (0x%x)\n", MemoryAttributesEntry));
+ DEBUG ((DEBUG_VERBOSE, " Type - 0x%x\n", MemoryAttribu=
tesEntry->Type));
+ DEBUG ((DEBUG_VERBOSE, " PhysicalStart - 0x%016lx\n", MemoryAtt=
ributesEntry->PhysicalStart));
+ DEBUG ((DEBUG_VERBOSE, " VirtualStart - 0x%016lx\n", MemoryAtt=
ributesEntry->VirtualStart));
+ DEBUG ((DEBUG_VERBOSE, " NumberOfPages - 0x%016lx\n", MemoryAtt=
ributesEntry->NumberOfPages));
+ DEBUG ((DEBUG_VERBOSE, " Attribute - 0x%016lx\n", MemoryAtt=
ributesEntry->Attribute));
MemoryAttributesEntry =3D NEXT_MEMORY_DESCRIPTOR(MemoryAttributesEnt=
ry, DescriptorSize);
=20
MemoryMap =3D NEXT_MEMORY_DESCRIPTOR(MemoryMap, DescriptorSize);
@@ -1331,7 +1331,7 @@ SmmInstallMemoryAttributesTable (
{
SmmInstallImageRecord ();
=20
- DEBUG ((DEBUG_INFO, "SMM MemoryProtectionAttribute - 0x%016lx\n", mMem=
oryProtectionAttribute));
+ DEBUG ((DEBUG_VERBOSE, "SMM MemoryProtectionAttribute - 0x%016lx\n", m=
MemoryProtectionAttribute));
if ((mMemoryProtectionAttribute & EFI_MEMORY_ATTRIBUTES_RUNTIME_MEMORY=
_PROTECTION_NON_EXECUTABLE_PE_DATA) =3D=3D 0) {
return EFI_SUCCESS;
}
--=20
2.23.0.windows.1


Re: [PATCH] MdeModulePkg/RegularExpressionDxe: Fix memory assert in FreePool()

Nickle Wang
 

Thanks Liming! I create personal PR below and I also see CI error on OnigurumaUefiPort.h. It looks like "Ubuntu GCC PR" does not like the coding style on OnigurumaUefiPort.h. However, I just follow the coding style of other functions in this file.

https://github.com/tianocore/edk2/pull/1788

So, should I add this file into exception list too? Or I just follow the coding style on what I modified?

Thanks,
Nickle

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of gaoliming
Sent: Thursday, July 1, 2021 1:19 PM
To: devel@edk2.groups.io; Wang, Nickle (HPS SW) <nickle.wang@...>; lersek@...
Cc: jian.j.wang@...; hao.a.wu@...
Subject: 回复: [edk2-devel] [PATCH] MdeModulePkg/RegularExpressionDxe: Fix memory assert in FreePool()

Nickle:
You can create personal PR to verify this change first. If it passes CI, please send the updated patch set.

Thanks
Liming
-----邮件原件-----
发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Nickle Wang
发送时间: 2021年6月30日 21:11
收件人: devel@edk2.groups.io; Wang, Nickle (HPS SW)
<nickle.wang@...>; gaoliming <gaoliming@...>;
lersek@...
抄送: jian.j.wang@...; hao.a.wu@...; Wang, Nickle (HPS SW)
<nickle.wang@...>
主题: Re: [edk2-devel] [PATCH] MdeModulePkg/RegularExpressionDxe: Fix
memory assert in FreePool()

Hi Liming,

I got my patch ready. Should I test it by creating PR on Github like
https://github.com/tianocore/edk2/pull/1735? Or I just send out new
patch for review?

Thanks,
Nickle

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Nickle
Wang
Sent: Wednesday, June 30, 2021 9:49 AM
To: gaoliming <gaoliming@...>; devel@edk2.groups.io;
lersek@...
Cc: jian.j.wang@...; hao.a.wu@...; Wang, Nickle (HPS SW)
<nickle.wang@...>
Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/RegularExpressionDxe:
Fix memory assert in FreePool()

I see. Thanks for your quick response. I will work on it.

Nickle

-----Original Message-----
From: gaoliming <gaoliming@...>
Sent: Wednesday, June 30, 2021 9:43 AM
To: Wang, Nickle (HPS SW) <nickle.wang@...>; devel@edk2.groups.io;
lersek@...
Cc: jian.j.wang@...; hao.a.wu@...
Subject: 回复: [edk2-devel] [PATCH] MdeModulePkg/RegularExpressionDxe:
Fix memory assert in FreePool()

This is a separate commit. You can send it together with previous patch.

Thanks
Liming
-----邮件原件-----
发件人: Wang, Nickle (HPS SW) <nickle.wang@...>
发送时间: 2021年6月30日 9:29
收件人: gaoliming <gaoliming@...>; devel@edk2.groups.io;
lersek@...
抄送: jian.j.wang@...; hao.a.wu@...; Wang, Nickle (HPS SW)
<nickle.wang@...>
主题: RE: [edk2-devel] [PATCH] MdeModulePkg/RegularExpressionDxe: Fix
memory assert in FreePool()

Hi Liming,

No problem. It looks like I have to add OnigurumaUefiPort.c into
"IgnoreFiles"
object in MdeModulePkg.ci.yaml. And should I send this patch alone?
Or I have to send it as a part of patch in early fix?

Thanks,
Nickle

-----Original Message-----
From: gaoliming <gaoliming@...>
Sent: Wednesday, June 30, 2021 9:06 AM
To: devel@edk2.groups.io; lersek@...; Wang, Nickle (HPS SW)
<nickle.wang@...>
Cc: jian.j.wang@...; hao.a.wu@...
Subject: 回复: [edk2-devel] [PATCH]
MdeModulePkg/RegularExpressionDxe:
Fix memory assert in FreePool()

Laszlo:
Yes. I agree to add OnigurumaUefiPort.c into ECC exception in
MdeModulePkg.ci.yaml.

Nickle:
Can you provide the patch to update MdeModulePkg.ci.yaml?

Thanks
Liming
-----邮件原件-----
发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Laszlo
Ersek
发送时间: 2021年6月29日 22:52
收件人: devel@edk2.groups.io; nickle.wang@...
抄送: gaoliming@...; jian.j.wang@...;
hao.a.wu@...
主题: Re: [edk2-devel] [PATCH] MdeModulePkg/RegularExpressionDxe:
Fix
memory assert in FreePool()

On 06/10/21 06:56, Nickle Wang wrote:
Memory buffer that is allocated by malloc() and realloc() will
be shifted by 8 bytes because Oniguruma keeps its memory signature.
This 8 bytes shift is not handled while calling free() to
release memory. Add
free() function to check Oniguruma signature before release
memory because memory buffer is not touched when using calloc().

Signed-off-by: Nickle Wang <nickle.wang@...>
---
.../RegularExpressionDxe/OnigurumaUefiPort.c | 19
++++++++++++++++++-
.../RegularExpressionDxe/OnigurumaUefiPort.h | 14
++------------
2 files changed, 20 insertions(+), 13 deletions(-)

diff --git
a/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.c
b/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.c
index 9aa7b0a68e..5c34324db8 100644
---
a/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.c
+++
b/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.c
@@ -2,7 +2,7 @@

Module to rewrite stdlib references within Oniguruma

- (C) Copyright 2014-2015 Hewlett Packard Enterprise
Development
LP<BR>
+ (C) Copyright 2014-2021 Hewlett Packard Enterprise
+ Development
LP<BR>
Copyright (c) 2020, Intel Corporation. All rights
reserved.<BR>

SPDX-License-Identifier: BSD-2-Clause-Patent @@ -96,3 +96,20
@@
void* memset (void *dest, char ch, unsigned int
count)
return SetMem (dest, count, ch); }

+void free(void *ptr)
+{
+ VOID *EvalOnce;
+ ONIGMEM_HEAD *PoolHdr;
+
+ EvalOnce = ptr;
+ if (EvalOnce == NULL) {
+ return;
+ }
+
+ PoolHdr = (ONIGMEM_HEAD *)EvalOnce - 1;
+ if (PoolHdr->Signature == ONIGMEM_HEAD_SIGNATURE) {
+ FreePool (PoolHdr);
+ } else {
+ FreePool (EvalOnce);
+ }
+}
diff --git
a/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.h
b/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.h
index 20b75c3361..0bdb7be529 100644
---
a/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.h
+++
b/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.h
@@ -2,7 +2,7 @@

Module to rewrite stdlib references within Oniguruma

- (C) Copyright 2014-2015 Hewlett Packard Enterprise
Development
LP<BR>
+ (C) Copyright 2014-2021 Hewlett Packard Enterprise
+ Development
LP<BR>
Copyright (c) 2020, Intel Corporation. All rights
reserved.<BR>

SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -46,17 +46,6 @@ typedef INTN intptr_t;
#endif

#define calloc(n,s) AllocateZeroPool((n)*(s))
-
-#define free(p) \
- do { \
- VOID *EvalOnce; \
- \
- EvalOnce = (p); \
- if (EvalOnce != NULL) { \
- FreePool (EvalOnce); \
- } \
- } while (FALSE)
-
#define xmemmove(Dest,Src,Length) CopyMem(Dest,Src,Length)
#define
xmemcpy(Dest,Src,Length) CopyMem(Dest,Src,Length) #define
xmemset(Buffer,Value,Length) SetMem(Buffer,Length,Value) @@
-98,6
+87,7 @@ void* malloc(size_t size);
void* realloc(void *ptr, size_t size);
void* memcpy (void *dest, const void *src, unsigned int count);
void* memset (void *dest, char ch, unsigned int count);
+void free(void *ptr);

#define exit(n) ASSERT(FALSE);

This patch cannot be merged, due to a number of EccCheck complaints:

2021-06-21T01:44:13.4327861Z PROGRESS - --Running MdeModulePkg:
EccCheck Test NO-TARGET --
2021-06-21T01:44:20.4922300Z ERROR - 2021-06-21T01:44:20.4924178Z
ERROR - EFI coding style error 2021-06-21T01:44:20.4925524Z ERROR
- *Error code: 4002 2021-06-21T01:44:20.4927323Z ERROR - *Function
header doesn't exist 2021-06-21T01:44:20.4936437Z ERROR - *file:
//home/vsts/work/1/s/MdeModulePkg/Universal/RegularExpressionDxe/Oni
gurumaUefiPort.c
2021-06-21T01:44:20.4937669Z ERROR - *Line number: 99
2021-06-21T01:44:20.4938737Z ERROR - *Function [free] has NO
comment
immediately preceding it.
2021-06-21T01:44:20.4945489Z ERROR - 2021-06-21T01:44:20.4951382Z
ERROR - EFI coding style error 2021-06-21T01:44:20.4960149Z ERROR
- *Error code: 4002 2021-06-21T01:44:20.4961161Z ERROR - *Function
header doesn't exist 2021-06-21T01:44:20.4966674Z ERROR - *file:
//home/vsts/work/1/s/MdeModulePkg/Universal/RegularExpressionDxe/Oni
gurumaUefiPort.h
2021-06-21T01:44:20.4973232Z ERROR - *Line number: 90
2021-06-21T01:44:20.4978337Z ERROR - *Function [free] has NO
comment
immediately preceding it.
2021-06-21T01:44:20.4981257Z ERROR - 2021-06-21T01:44:20.4983805Z
ERROR - EFI coding style error 2021-06-21T01:44:20.4986537Z ERROR
- *Error code: 5001 2021-06-21T01:44:20.4989508Z ERROR - *Return
type of a function should exist and in the first line
2021-06-21T01:44:20.4997043Z ERROR -
*file:
//home/vsts/work/1/s/MdeModulePkg/Universal/RegularExpressionDxe/Oni
gurumaUefiPort.h
2021-06-21T01:44:20.4997804Z ERROR - *Line number: 90
2021-06-21T01:44:20.4998331Z ERROR - *[free] Return Type should
appear on its own line 2021-06-21T01:44:20.4998762Z ERROR -
2021-06-21T01:44:20.4999175Z ERROR - EFI coding style error
2021-06-21T01:44:20.5017351Z ERROR - *Error code: 5003
2021-06-21T01:44:20.5023282Z ERROR - *Function name should be left
justified, followed by the beginning of the parameter list, with
the closing parenthesis on its own line, indented two spaces
2021-06-21T01:44:20.5024931Z ERROR - *file:
//home/vsts/work/1/s/MdeModulePkg/Universal/RegularExpressionDxe/Oni
gurumaUefiPort.c
2021-06-21T01:44:20.5025818Z ERROR - *Line number: 99
2021-06-21T01:44:20.5026960Z ERROR - *Function name [free] should
appear at the start of a line 2021-06-21T01:44:20.5027533Z ERROR -
2021-06-21T01:44:20.5027982Z ERROR - EFI coding style error
2021-06-21T01:44:20.5028454Z ERROR - *Error code: 5003
2021-06-21T01:44:20.5029279Z ERROR - *Function name should be left
justified, followed by the beginning of the parameter list, with
the closing parenthesis on its own line, indented two spaces
2021-06-21T01:44:20.5030177Z ERROR - *file:
//home/vsts/work/1/s/MdeModulePkg/Universal/RegularExpressionDxe/Oni
gurumaUefiPort.h
2021-06-21T01:44:20.5030770Z ERROR - *Line number: 90
2021-06-21T01:44:20.5031330Z ERROR - *Function name [free] should
appear at the start of a line 2021-06-21T01:44:20.5031788Z ERROR -
2021-06-21T01:44:20.5032240Z ERROR - EFI coding style error
2021-06-21T01:44:20.5032706Z ERROR - *Error code: 5003
2021-06-21T01:44:20.5033554Z ERROR - *Function name should be left
justified, followed by the beginning of the parameter list, with
the closing parenthesis on its own line, indented two spaces
2021-06-21T01:44:20.5036470Z ERROR - *file:
//home/vsts/work/1/s/MdeModulePkg/Universal/RegularExpressionDxe/Oni
gurumaUefiPort.h
2021-06-21T01:44:20.5040063Z ERROR - *Line number: 90
2021-06-21T01:44:20.5043513Z ERROR - *Parameter ptr should be in
its own line.
2021-06-21T01:44:20.5046782Z ERROR - 2021-06-21T01:44:20.5049909Z
ERROR - EFI coding style error 2021-06-21T01:44:20.5053571Z ERROR
- *Error code: 5003 2021-06-21T01:44:20.5057415Z ERROR - *Function
name should be left justified, followed by the beginning of the
parameter list, with the closing parenthesis on its own line,
indented two spaces 2021-06-21T01:44:20.5066200Z ERROR - *file:
//home/vsts/work/1/s/MdeModulePkg/Universal/RegularExpressionDxe/Oni
gurumaUefiPort.h
2021-06-21T01:44:20.5066831Z ERROR - *Line number: 90
2021-06-21T01:44:20.5067378Z ERROR - *')' should be on a new line
and indented two spaces 2021-06-21T01:44:20.5067799Z ERROR -
2021-06-21T01:44:20.5068211Z ERROR - EFI coding style error
2021-06-21T01:44:20.5070600Z ERROR - *Error code: 7001
2021-06-21T01:44:20.5074448Z ERROR - *There should be no use of
int, unsigned, char, void, long in any .c, .h or .asl files
2021-06-21T01:44:20.5077965Z ERROR - *file:
//home/vsts/work/1/s/MdeModulePkg/Universal/RegularExpressionDxe/Oni
gurumaUefiPort.c
2021-06-21T01:44:20.5081222Z ERROR - *Line number: 110
2021-06-21T01:44:20.5084248Z ERROR - *Parameter ptr
2021-06-21T01:44:20.5090115Z ERROR - 2021-06-21T01:44:20.5090517Z
ERROR - EFI coding style error 2021-06-21T01:44:20.5090923Z ERROR
- *Error code: 7001 2021-06-21T01:44:20.5093481Z ERROR - *There
should
be no use of int, unsigned, char, void, long in any .c, .h or .asl
files 2021-06-21T01:44:20.5096387Z ERROR - *file:
//home/vsts/work/1/s/MdeModulePkg/Universal/RegularExpressionDxe/Oni
gurumaUefiPort.h
2021-06-21T01:44:20.5099658Z ERROR - *Line number: 90
2021-06-21T01:44:20.5103008Z ERROR - *free Return type void
2021-06-21T01:44:20.5105878Z ERROR - 2021-06-21T01:44:20.5108537Z
ERROR - EFI coding style error 2021-06-21T01:44:20.5111630Z ERROR
- *Error code: 7001 2021-06-21T01:44:20.5115083Z ERROR - *There
should
be no use of int, unsigned, char, void, long in any .c, .h or .asl
files 2021-06-21T01:44:20.5118600Z ERROR - *file:
//home/vsts/work/1/s/MdeModulePkg/Universal/RegularExpressionDxe/Oni
gurumaUefiPort.h
2021-06-21T01:44:20.5126189Z ERROR - *Line number: 90
2021-06-21T01:44:20.5142100Z ERROR - *Parameter ptr
2021-06-21T01:44:20.5142574Z ERROR - 2021-06-21T01:44:20.5142979Z
ERROR - EFI coding style error 2021-06-21T01:44:20.5143429Z ERROR
- *Error code: 8005 2021-06-21T01:44:20.5144332Z ERROR - *Variable
name does not follow the
rules: 1. First character should be upper case 2. Must contain
lower case characters 3. No white space characters 4. Global
variable name must start with a 'g'
2021-06-21T01:44:20.5145416Z ERROR - *file:
//home/vsts/work/1/s/MdeModulePkg/Universal/RegularExpressionDxe/Oni
gurumaUefiPort.h
2021-06-21T01:44:20.5146050Z ERROR - *Line number: 90
2021-06-21T01:44:20.5146555Z ERROR - *Parameter [ptr] NOT follow
naming convention.
2021-06-21T01:44:20.5146963Z ERROR - 2021-06-21T01:44:20.5147366Z
ERROR - EFI coding style error 2021-06-21T01:44:20.5147794Z ERROR
- *Error code: 8006 2021-06-21T01:44:20.5148562Z ERROR - *Function
name does not follow the
rules: 1. First character should be upper case 2. Must contain
lower case characters 3. No white space characters
2021-06-21T01:44:20.5149399Z ERROR - *file:
//home/vsts/work/1/s/MdeModulePkg/Universal/RegularExpressionDxe/Oni
gurumaUefiPort.c
2021-06-21T01:44:20.5149932Z ERROR - *Line number: 99
2021-06-21T01:44:20.5150445Z ERROR - *The function name [free]
does not follow the rules 2021-06-21T01:44:20.5155470Z ERROR -
--->Test
Failed: EccCheck Test NO-TARGET returned 1

These are all (or mostly) related to preexistent code, so I think
the EccCheck plugin config should be updated in MdeModulePkg, to
permit an exception for these files.

For now, I've closed <https://github.com/tianocore/edk2/pull/1735>
without merging it.

Thanks
Laszlo















Update stable tag release date for future stable tag

gaoliming
 

Hi, all

 Based on the proposal in https://edk2.groups.io/g/rfc/message/684, Soft Feature Freeze phase (SFF) will be shorten to 5 days for the reviewed patch merge, Hard Feature Freeze phase (HFF) will be extended to 2 weeks for downstream verification. Meanwhile, tag edk2-stableYYYYMM-rc0 will be created for SFF, and edk2-stableYYYYMM-rc1 will be created for HFF. The detail proposal can refer to https://edk2.groups.io/g/rfc/message/684. For next stable tag 202108, the proposed new date will be the below one. If you have any comments, please reply this mail before July 12th.

 

Date (00:00:00 UTC-8) Description for stable tag 202108

2021-05-28  Beginning of development

2021-08-09  Soft Feature Freeze

2021-08-13  Hard Feature Freeze

2021-08-27  Release

 

Thanks

Liming


Re: [PATCH 1/2] MdeModulePkg: Change the PldHeader to Header in ExtraData.h

Wu, Hao A
 

Acked-by: Hao A Wu <hao.a.wu@...>

 

Best Regards,

Hao Wu

 

From: Liu, Zhiguang <zhiguang.liu@...>
Sent: Monday, July 5, 2021 9:07 AM
To: Tan, Dun <dun.tan@...>; devel@edk2.groups.io; Wu, Hao A <hao.a.wu@...>; Wang, Jian J <jian.j.wang@...>
Cc: Ni, Ray <ray.ni@...>
Subject: Re: [PATCH 1/2] MdeModulePkg: Change the PldHeader to Header in ExtraData.h

 

Reviewed-by: Zhiguang Liu <zhiguang.liu@...>

 

Add MdeModulePkg's maintainers.

 


From: Tan, Dun <dun.tan@...>
Sent: Friday, July 2, 2021 15:35
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Liu, Zhiguang <zhiguang.liu@...>; Ni, Ray <ray.ni@...>; Tan, Dun <dun.tan@...>
Subject: [PATCH 1/2] MdeModulePkg: Change the PldHeader to Header in ExtraData.h

 

Change the PldHeader to Header in UNIVERSAL_PAYLOAD_EXTRA_DATA
The meaning of Pld is too general

Cc: Zhiguang Liu <zhiguang.liu@...>
Cc: Ray Ni <ray.ni@...>

Signed-off-by: DunTan <dun.tan@...>
---
 MdeModulePkg/Include/UniversalPayload/ExtraData.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Include/UniversalPayload/ExtraData.h b/MdeModulePkg/Include/UniversalPayload/ExtraData.h
index 146ec845f6..1128f5f47b 100644
--- a/MdeModulePkg/Include/UniversalPayload/ExtraData.h
+++ b/MdeModulePkg/Include/UniversalPayload/ExtraData.h
@@ -18,11 +18,13 @@ typedef struct {
 } UNIVERSAL_PAYLOAD_EXTRA_DATA_ENTRY;
 
 typedef struct {
-  UNIVERSAL_PAYLOAD_GENERIC_HEADER   PldHeader;
+  UNIVERSAL_PAYLOAD_GENERIC_HEADER   Header;
   UINT32                             Count;
   UNIVERSAL_PAYLOAD_EXTRA_DATA_ENTRY Entry[0];
 } UNIVERSAL_PAYLOAD_EXTRA_DATA;
 
 #pragma pack()
 
+#define UNIVERSAL_PAYLOAD_EXTRA_DATA_REVISION 1
+
 #endif
--
2.31.1.windows.1


Re: [PATCH 1/2] MdeModulePkg: Change the PldHeader to Header in ExtraData.h

Zhiguang Liu
 

Reviewed-by: Zhiguang Liu <zhiguang.liu@...>

Add MdeModulePkg's maintainers.


From: Tan, Dun <dun.tan@...>
Sent: Friday, July 2, 2021 15:35
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Liu, Zhiguang <zhiguang.liu@...>; Ni, Ray <ray.ni@...>; Tan, Dun <dun.tan@...>
Subject: [PATCH 1/2] MdeModulePkg: Change the PldHeader to Header in ExtraData.h
 
Change the PldHeader to Header in UNIVERSAL_PAYLOAD_EXTRA_DATA
The meaning of Pld is too general

Cc: Zhiguang Liu <zhiguang.liu@...>
Cc: Ray Ni <ray.ni@...>

Signed-off-by: DunTan <dun.tan@...>
---
 MdeModulePkg/Include/UniversalPayload/ExtraData.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Include/UniversalPayload/ExtraData.h b/MdeModulePkg/Include/UniversalPayload/ExtraData.h
index 146ec845f6..1128f5f47b 100644
--- a/MdeModulePkg/Include/UniversalPayload/ExtraData.h
+++ b/MdeModulePkg/Include/UniversalPayload/ExtraData.h
@@ -18,11 +18,13 @@ typedef struct {
 } UNIVERSAL_PAYLOAD_EXTRA_DATA_ENTRY;
 
 typedef struct {
-  UNIVERSAL_PAYLOAD_GENERIC_HEADER   PldHeader;
+  UNIVERSAL_PAYLOAD_GENERIC_HEADER   Header;
   UINT32                             Count;
   UNIVERSAL_PAYLOAD_EXTRA_DATA_ENTRY Entry[0];
 } UNIVERSAL_PAYLOAD_EXTRA_DATA;
 
 #pragma pack()
 
+#define UNIVERSAL_PAYLOAD_EXTRA_DATA_REVISION 1
+
 #endif
--
2.31.1.windows.1


回复: [edk2-devel] 回复: [edk2][PATCH V3] MdePkg : Add IPMI Macro and Structure Defintions to resolve build errors

gaoliming
 

This patch in MdePkg has been merged at 55dee4947b20103fc48858b18307bd2b114dc145 on edk2 master.

 

Thanks

Liming

发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 gaoliming
发送时间: 2021630 9:22
收件人: devel@edk2.groups.io; gaoliming@...; lateefcs@...
抄送: 'manickavasakam karpagavinayagam' <manickavasakamk@...>; isaac.w.oram@...; nathaniel.l.desimone@...; Felixp@...; Harikrishnad@...; manishj@...; zacharyb@...
主题: 回复: [edk2-devel] 回复: [edk2][PATCH V3] MdePkg : Add IPMI Macro and Structure Defintions to resolve build errors

 

If no other comment, I will create PR to merge this patch.

 

Thanks

Liming

发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 gaoliming
发送时间: 2021624 8:54
收件人: devel@edk2.groups.io; lateefcs@...
抄送: 'manickavasakam karpagavinayagam' <manickavasakamk@...>; isaac.w.oram@...; nathaniel.l.desimone@...; Felixp@...; Harikrishnad@...; manishj@...; zacharyb@...
主题: 回复: [edk2-devel] 回复: [edk2][PATCH V3] MdePkg : Add IPMI Macro and Structure Defintions to resolve build errors

 

AbduL:

 This is same to the definition of UINT8 CompletionCode without bitfield.

 

Thanks

Liming

发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 AbduL Lateef
发送时间: 2021623 19:43
收件人: devel@edk2.groups.io; gaoliming@...
抄送: manickavasakam karpagavinayagam <manickavasakamk@...>; isaac.w.oram@...; nathaniel.l.desimone@...; Felixp@...; Harikrishnad@...; manishj@...; zacharyb@...
主题: Re: [edk2-devel] 回复: [edk2][PATCH V3] MdePkg : Add IPMI Macro and Structure Defintions to resolve build errors

 

whats the use of bitfield:8 for UINT8 variable type?

+typedef struct {
+ UINT8 CompletionCode:8;
+} IPMI_SET_BOOT_OPTIONS_RESPONSE;

 

Thanks

AbduL

 

On Mon, Jun 21, 2021 at 7:19 AM gaoliming <gaoliming@...> wrote:

Thanks for you update.

Reviewed-by: Liming Gao <gaoliming@...>

Thanks
Liming
> -----
邮件原件-----
>
发件人: manickavasakam karpagavinayagam <manickavasakamk@...>
>
发送时间: 2021618 23:38
>
收件人: devel@edk2.groups.io
>
抄送: isaac.w.oram@...; nathaniel.l.desimone@...;
> Felixp@...; Harikrishnad@...; manishj@...;
> zacharyb@...; manickavasakamk@...;
> gaoliming@...
>
主题: [edk2][PATCH V3] MdePkg : Add IPMI Macro and Structure Defintions
> to resolve build errors
>
> Build error reported for missing structures
> IPMI_SET_BOOT_OPTIONS_RESPONSE,
> EFI_IPMI_MSG_GET_BMC_EXEC_RSP and
> macros EFI_FIRMWARE_GET_BMC_EXECUTION_CONTEXT
> EFI_FIRMWARE_BMC_IN_FULL_RUNTIME/EFI_FIRMWARE_BMC_IN_FORCE
> D_UPDATE_MODE
> when using
> edk2-platforms\Features\Intel\OutOfBandManagement\IpmiFeaturePkg
>
> MdePkg : Rename IPMI Macro and Structure Defintions
>
> Rename the EFI_IPMI_MSG_GET_BMC_EXEC_RSPB,
> EFI_FIRMWARE_GET_BMC_EXECUTION_CONTEXT
> EFI_FIRMWARE_BMC_IN_FORCED_UPDATE_MODE to
> IPMI_MSG_GET_BMC_EXEC_RSPB,IPMI_GET_BMC_EXECUTION_CONTEXT
> IPMI_BMC_IN_FORCED_UPDATE_MODE
>
> Notes:
> V1 :
> Rename the EFI_IPMI_MSG_GET_BMC_EXEC_RSPB,
> EFI_FIRMWARE_GET_BMC_EXECUTION_CONTEXT
> EFI_FIRMWARE_BMC_IN_FORCED_UPDATE_MODE to
> IPMI_MSG_GET_BMC_EXEC_RSPB,IPMI_GET_BMC_EXECUTION_CONTEXT
> IPMI_BMC_IN_FORCED_UPDATE_MODE
>
> V2:
>
> Remove 0001-MdePkg-Add-IPMI-Macro-and-Structure-Defintions-to-re.patch
>
> V3:
>
> Add Signed-off-by information
>
> Signed-off-by: Manickavasakam Karpagavinayagam
> <manickavasakamk@...>
> ---
>  .../IndustryStandard/IpmiNetFnChassis.h        |  4 ++++
>  .../IndustryStandard/IpmiNetFnFirmware.h       | 18
> ++++++++++++++++++
>  2 files changed, 22 insertions(+)
>
> diff --git a/MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h
> b/MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h
> index 79db55523d..d7cdd3a865 100644
> --- a/MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h
> +++ b/MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h
> @@ -186,6 +186,10 @@ typedef struct {
>    UINT8                                  ParameterData[0];
>
>  } IPMI_SET_BOOT_OPTIONS_REQUEST;
>
>
>
> +typedef struct {
>
> +  UINT8   CompletionCode:8;
>
> +} IPMI_SET_BOOT_OPTIONS_RESPONSE;
>
> +
>
>  //
>
>  //  Definitions for Get System Boot options command
>
>  //
>
> diff --git a/MdePkg/Include/IndustryStandard/IpmiNetFnFirmware.h
> b/MdePkg/Include/IndustryStandard/IpmiNetFnFirmware.h
> index 2d892dbd5a..c4cbe2349b 100644
> --- a/MdePkg/Include/IndustryStandard/IpmiNetFnFirmware.h
> +++ b/MdePkg/Include/IndustryStandard/IpmiNetFnFirmware.h
> @@ -17,4 +17,22 @@
>  // All Firmware commands and their structure definitions to follow here
>
>  //
>
>
>
> +//
----------------------------------------------------------------------------
------------
>
> +//    Definitions for Get BMC Execution Context
>
> +//
----------------------------------------------------------------------------
------------
>
> +#define IPMI_GET_BMC_EXECUTION_CONTEXT  0x23
>
> +
>
> +//
>
> +//  Constants and Structure definitions for "Get Device ID" command to
> follow here
>
> +//
>
> +typedef struct {
>
> +  UINT8   CurrentExecutionContext;
>
> +  UINT8   PartitionPointer;
>
> +} IPMI_MSG_GET_BMC_EXEC_RSP;
>
> +
>
> +//
>
> +// Current Execution Context responses
>
> +//
>
> +#define IPMI_BMC_IN_FORCED_UPDATE_MODE  0x11
>
> +
>
>  #endif
>
> --
> 2.25.0.windows.1
>
>
> Please consider the environment before printing this email.
>
> The information contained in this message may be confidential and
> proprietary to American Megatrends (AMI).  This communication is intended
> to be read only by the individual or entity to whom it is addressed or by
their
> designee. If the reader of this message is not the intended recipient, you
are
> on notice that any distribution of this message, in any form, is strictly
> prohibited.  Please promptly notify the sender by reply e-mail or by
> telephone at 770-246-8600, and then delete or destroy all copies of the
> transmission.





 

--

Thanks and Regards
Abdul Lateef Attar
Bangalore


[PATCH] IntelFsp2Pkg: PatchFv parseInfFile function modification

Ashraf Ali S
 

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

parseInfFile currently reading the EFI_BASE_ADDRESS from INF, once the
address found still it's continues to read the complete inf file which
is not required. once the EFI_BASE_ADDRESS read from the INF no need to
read the INF further.
MSFT compiler can generate the map file address 8 or 16 based on which
architecture the INF is compiler. currently it's support for IA32,
it can be update the X64 in future.
modification of few typo errors in parseModMapFile, getCurr function
required

Signed-off-by: Ashraf Ali S <ashraf.ali.s@...>
Cc: Ray Ni <ray.ni@...>
Cc: Chasel Chiu <chasel.chiu@...>
Cc: Nate DeSimone <nathaniel.l.desimone@...>
Cc: Star Zeng <star.zeng@...>
---
IntelFsp2Pkg/Tools/PatchFv.py | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/IntelFsp2Pkg/Tools/PatchFv.py b/IntelFsp2Pkg/Tools/PatchFv.py
index 112de4077a..236019b62d 100644
--- a/IntelFsp2Pkg/Tools/PatchFv.py
+++ b/IntelFsp2Pkg/Tools/PatchFv.py
@@ -1,6 +1,6 @@
## @ PatchFv.py
#
-# Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
@@ -297,17 +297,17 @@ class Symbols:
#
fvOffset = self.getFvOffsetInFd(infFile[0:-4] + ".Fv")
fdIn = open(infFile, "r")
- rptLine = fdIn.readline()
+ rptLines = fdIn.readlines()
self.fdBase = 0xFFFFFFFF
- while (rptLine != "" ):
+ for line in rptLines:
#EFI_BASE_ADDRESS = 0xFFFDF400
- match = re.match("^EFI_BASE_ADDRESS\s*=\s*(0x[a-fA-F0-9]+)", rptLine)
+ match = re.match("^EFI_BASE_ADDRESS\s*=\s*(0x[a-fA-F0-9]+)", line)
if match is not None:
self.fdBase = int(match.group(1), 16) - fvOffset
- rptLine = fdIn.readline()
+ break
fdIn.close()
if self.fdBase == 0xFFFFFFFF:
- raise Exception("Could not find EFI_BASE_ADDRESS in INF file!" % fvFile)
+ raise Exception("Could not find EFI_BASE_ADDRESS in INF file!" % infFile)
return 0

#
@@ -402,6 +402,7 @@ class Symbols:
#
# retval 0 Parsed MOD MAP file successfully
# retval 1 There is no moduleEntryPoint in modSymbols
+ # retval 2 There is no offset for moduleEntryPoint in modSymbols
#
def parseModMapFile(self, moduleName, mapFile):
#
@@ -426,7 +427,7 @@ class Symbols:
else:
#MSFT
#0003:00000190 _gComBase 00007a50 SerialPo
- patchMapFileMatchString = "^\s[0-9a-fA-F]{4}:[0-9a-fA-F]{8}\s+(\w+)\s+([0-9a-fA-F]{8}\s+)"
+ patchMapFileMatchString = "^\s[0-9a-fA-F]{4}:[0-9a-fA-F]{8}\s+(\w+)\s+([0-9a-fA-F]{8,16}\s+)"
matchKeyGroupIndex = 1
matchSymbolGroupIndex = 2
prefix = ''
@@ -498,7 +499,7 @@ class Symbols:
#
# Get current character
#
- # retval elf.string[self.index]
+ # retval self.string[self.index]
# retval '' Exception
#
def getCurr(self):
--
2.30.2.windows.1


[PATCH] IntelFsp2Pkg: PatchFv parseInfFile function modification

Ashraf Ali S
 

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

parseInfFile currently reading the EFI_BASE_ADDRESS from INF, once the
address found still it's continues to read the complete inf file which
is not required. once the EFI_BASE_ADDRESS read from the INF no need to
read the INF further.
MSFT compiler can generate the map file address 8 or 16 based on which
architecture the INF is compiler. currently it's support for IA32,
it can be update the X64 in future.
modification of few typo errors in parseModMapFile, getCurr function
required

Signed-off-by: Ashraf Ali S <ashraf.ali.s@...>
Cc: Ray Ni <ray.ni@...>
Cc: Chasel Chiu <chasel.chiu@...>
Cc: Nate DeSimone <nathaniel.l.desimone@...>
Cc: Star Zeng <star.zeng@...>
---
IntelFsp2Pkg/Tools/PatchFv.py | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/IntelFsp2Pkg/Tools/PatchFv.py b/IntelFsp2Pkg/Tools/PatchFv.py
index 112de4077a..765dfed8ef 100644
--- a/IntelFsp2Pkg/Tools/PatchFv.py
+++ b/IntelFsp2Pkg/Tools/PatchFv.py
@@ -1,6 +1,6 @@
## @ PatchFv.py
#
-# Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
@@ -297,17 +297,16 @@ class Symbols:
#
fvOffset = self.getFvOffsetInFd(infFile[0:-4] + ".Fv")
fdIn = open(infFile, "r")
- rptLine = fdIn.readline()
+ rptLines = fdIn.readlines()
self.fdBase = 0xFFFFFFFF
- while (rptLine != "" ):
- #EFI_BASE_ADDRESS = 0xFFFDF400
- match = re.match("^EFI_BASE_ADDRESS\s*=\s*(0x[a-fA-F0-9]+)", rptLine)
+ for line in rptLines:
+ match = re.match("^EFI_BASE_ADDRESS\s*=\s*(0x[a-fA-F0-9]+)", line)
if match is not None:
self.fdBase = int(match.group(1), 16) - fvOffset
- rptLine = fdIn.readline()
+ break
fdIn.close()
if self.fdBase == 0xFFFFFFFF:
- raise Exception("Could not find EFI_BASE_ADDRESS in INF file!" % fvFile)
+ raise Exception("Could not find EFI_BASE_ADDRESS in INF file!" % infFile)
return 0

#
@@ -402,6 +401,7 @@ class Symbols:
#
# retval 0 Parsed MOD MAP file successfully
# retval 1 There is no moduleEntryPoint in modSymbols
+ # retval 2 There is no offset for moduleEntryPoint in modSymbols
#
def parseModMapFile(self, moduleName, mapFile):
#
@@ -426,7 +426,7 @@ class Symbols:
else:
#MSFT
#0003:00000190 _gComBase 00007a50 SerialPo
- patchMapFileMatchString = "^\s[0-9a-fA-F]{4}:[0-9a-fA-F]{8}\s+(\w+)\s+([0-9a-fA-F]{8}\s+)"
+ patchMapFileMatchString = "^\s[0-9a-fA-F]{4}:[0-9a-fA-F]{8}\s+(\w+)\s+([0-9a-fA-F]{8,16}\s+)"
matchKeyGroupIndex = 1
matchSymbolGroupIndex = 2
prefix = ''
@@ -498,7 +498,7 @@ class Symbols:
#
# Get current character
#
- # retval elf.string[self.index]
+ # retval self.string[self.index]
# retval '' Exception
#
def getCurr(self):
--
2.26.2.windows.1


Event: TianoCore Design Meeting - APAC/NAMO - 07/09/2021 #cal-reminder

devel@edk2.groups.io Calendar <noreply@...>
 

Reminder: TianoCore Design Meeting - APAC/NAMO

When:
07/09/2021
9:30am to 10:30am
(UTC+08:00) Asia/Shanghai

Where:
Microsoft Teams

Organizer: Ray Ni ray.ni@...

View Event

Description:

TOPIC

  1. NA

For more info, see here: https://www.tianocore.org/design-meeting/


Microsoft Teams meeting

Join on your computer or mobile app

Click here to join the meeting

Join with a video conferencing device

teams@...

Video Conference ID: 119 715 416 0

Alternate VTC dialing instructions

Learn More | Meeting options


Re: EFI_AUDIO_OUTPUT_PROTOCOL: assistance with VirtIO initialization

Ethin Probst
 

Update: I just realized I'd made a typo -- the unknown request is
actually a get_min request.

On 7/2/21, Ethin Probst <harlydavidsen@...> wrote:
Thank you for all that information, both of you. I didn't realize that
VirtIO sound would be so complicated. The specification seemed simple
enough -- but, alas, all things seem simple until you actually go and
try to implement them.

I did manage to retrieve a packet dump, from both myself and from
somebody else that Leif contacted. The one from myself was from a USB
mixer that I have -- its how my audio headphones work, and that
generated far too many packets -- well over 5,000 at least. Utilizing
display filters wasn't much of a help either -- it doesn't seem like
my mixer makes available an audio device class descriptor anywhere,
which is odd because it should. But I also might not have been
filtering it properly. The other packet dump was sort-of helpful, but
did contain some confusing elements:

* There were four unknown URB transfer types (0x7F) that Wireshark
claimed were "malformed". I asked around on the OSDev.org forum and I
don't think anyone recognizes that either.
* The primary init sequence was understandable, along with the get
string requests, but after that there were a bunch of URB control
transfers from device-to-host and some requests from host-to-device
containing data that I didn't understand. I wasn't sure what those
were for. They looked something like this:

Frame 29: 36 bytes on wire (288 bits), 36 bytes captured (288 bits) on
interface wireshark_extcap1868, id 0
Interface id: 0 (wireshark_extcap1868)
Interface name: wireshark_extcap1868
Encapsulation type: USB packets with USBPcap header (152)
Arrival Time: Jul 1, 2021 02:21:45.291271000 CDT
[Time shift for this packet: 0.000000000 seconds]
Epoch Time: 1625124105.291271000 seconds
[Time delta from previous captured frame: 0.000008000 seconds]
[Time delta from previous displayed frame: 0.000008000 seconds]
[Time since reference or first frame: 0.035324000 seconds]
Frame Number: 29
Frame Length: 36 bytes (288 bits)
Capture Length: 36 bytes (288 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: usb]
USB URB
[Source: host]
[Destination: 2.7.0]
USBPcap pseudoheader length: 28
IRP ID: 0xffffa90f548b8a20
IRP USBD_STATUS: USBD_STATUS_SUCCESS (0x00000000)
URB Function: URB_FUNCTION_CLASS_INTERFACE (0x001b)
IRP information: 0x00, Direction: FDO -> PDO
0000 000. = Reserved: 0x00
.... ...0 = Direction: FDO -> PDO (0x0)
URB bus id: 2
Device address: 7
Endpoint: 0x80, Direction: IN
1... .... = Direction: IN (1)
.... 0000 = Endpoint number: 0
URB transfer type: URB_CONTROL (0x02)
Packet Data Length: 8
[Response in: 30]
Control transfer stage: Setup (0)
[bInterfaceClass: Audio (0x01)]
Setup Data
bmRequestType: 0xa1
1... .... = Direction: Device-to-host
.01. .... = Type: Class (0x1)
...0 0001 = Recipient: Interface (0x01)
bRequest: 130
wValue: 0x0201
wIndex: 1536 (0x0600)
wLength: 2

Frame 30: 30 bytes on wire (240 bits), 30 bytes captured (240 bits) on
interface wireshark_extcap1868, id 0
Interface id: 0 (wireshark_extcap1868)
Interface name: wireshark_extcap1868
Encapsulation type: USB packets with USBPcap header (152)
Arrival Time: Jul 1, 2021 02:21:45.291389000 CDT
[Time shift for this packet: 0.000000000 seconds]
Epoch Time: 1625124105.291389000 seconds
[Time delta from previous captured frame: 0.000118000 seconds]
[Time delta from previous displayed frame: 0.000118000 seconds]
[Time since reference or first frame: 0.035442000 seconds]
Frame Number: 30
Frame Length: 30 bytes (240 bits)
Capture Length: 30 bytes (240 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: usb]
USB URB
[Source: 2.7.0]
[Destination: host]
USBPcap pseudoheader length: 28
IRP ID: 0xffffa90f548b8a20
IRP USBD_STATUS: USBD_STATUS_SUCCESS (0x00000000)
URB Function: URB_FUNCTION_CONTROL_TRANSFER (0x0008)
IRP information: 0x01, Direction: PDO -> FDO
0000 000. = Reserved: 0x00
.... ...1 = Direction: PDO -> FDO (0x1)
URB bus id: 2
Device address: 7
Endpoint: 0x80, Direction: IN
1... .... = Direction: IN (1)
.... 0000 = Endpoint number: 0
URB transfer type: URB_CONTROL (0x02)
Packet Data Length: 2
[Request in: 29]
[Time from request: 0.000118000 seconds]
Control transfer stage: Complete (3)
[bInterfaceClass: Audio (0x01)]
CONTROL response data: 00d3

According to the audio 1.0 specification, this is a "get_cur" request
(appendix 9: Audio Class-Specific Request Codes). However, I wasn't
really sure what it was trying to get. The spec (SEC. B.3.3.3)
indicates that this is an input terminal descriptor. I'll continue
following this chain of requests and responses and see if I can figure
out exactly what its doing -- I need to map the request IDs onto their
actual values since Wireshark isn't doing that for me automatically.

On 7/2/21, Michael Brown <mcb30@...> wrote:
On 02/07/2021 10:41, Michael Brown wrote:
UsbIo->UsbControlTransfer(UsbIo, &Req, EfiUsbDataIn,
                          PcdGet32 (PcdUsbTransferTimeoutValue),
                          &Header, sizeof(Header), &Status);

(Error handling etc omitted for brevity)

That would get you the first 8 bytes of the class-specific AC interface
header descriptor.  You would then need to extract the TotalLength
field, allocate that length of memory, and repeat the
UsbControlTransfer() call to fetch the full-length descriptor into the
newly allocated block.

Hope that helps,
BTW, in case you aren't already aware of this: wireshark is pretty good
at dissecting USB traffic. You can capture it by doing a "modprobe
usbmon", after which you'll see a number of usbmonN devices show up in
the wireshark interface list. Try them each in turn until you find
which one corresponds to the host controller to which your device is
attached.

My normal method for developing or debugging iPXE USB drivers will
typically involve using wireshark to capture the USB traffic that
happens when the device is being used by a known-working driver (e.g.
the Linux driver for that device) and comparing it to the traffic that
happens when I'm using my own driver (via USB pass-through in a VM).
This is often a lot faster than trying to pull together all of the
information from the multiple USB spec documents.

Good luck!

Michael

--
Signed,
Ethin D. Probst
--
Signed,
Ethin D. Probst


Re: EFI_AUDIO_OUTPUT_PROTOCOL: assistance with VirtIO initialization

Ethin Probst
 

Thank you for all that information, both of you. I didn't realize that
VirtIO sound would be so complicated. The specification seemed simple
enough -- but, alas, all things seem simple until you actually go and
try to implement them.

I did manage to retrieve a packet dump, from both myself and from
somebody else that Leif contacted. The one from myself was from a USB
mixer that I have -- its how my audio headphones work, and that
generated far too many packets -- well over 5,000 at least. Utilizing
display filters wasn't much of a help either -- it doesn't seem like
my mixer makes available an audio device class descriptor anywhere,
which is odd because it should. But I also might not have been
filtering it properly. The other packet dump was sort-of helpful, but
did contain some confusing elements:

* There were four unknown URB transfer types (0x7F) that Wireshark
claimed were "malformed". I asked around on the OSDev.org forum and I
don't think anyone recognizes that either.
* The primary init sequence was understandable, along with the get
string requests, but after that there were a bunch of URB control
transfers from device-to-host and some requests from host-to-device
containing data that I didn't understand. I wasn't sure what those
were for. They looked something like this:

Frame 29: 36 bytes on wire (288 bits), 36 bytes captured (288 bits) on
interface wireshark_extcap1868, id 0
Interface id: 0 (wireshark_extcap1868)
Interface name: wireshark_extcap1868
Encapsulation type: USB packets with USBPcap header (152)
Arrival Time: Jul 1, 2021 02:21:45.291271000 CDT
[Time shift for this packet: 0.000000000 seconds]
Epoch Time: 1625124105.291271000 seconds
[Time delta from previous captured frame: 0.000008000 seconds]
[Time delta from previous displayed frame: 0.000008000 seconds]
[Time since reference or first frame: 0.035324000 seconds]
Frame Number: 29
Frame Length: 36 bytes (288 bits)
Capture Length: 36 bytes (288 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: usb]
USB URB
[Source: host]
[Destination: 2.7.0]
USBPcap pseudoheader length: 28
IRP ID: 0xffffa90f548b8a20
IRP USBD_STATUS: USBD_STATUS_SUCCESS (0x00000000)
URB Function: URB_FUNCTION_CLASS_INTERFACE (0x001b)
IRP information: 0x00, Direction: FDO -> PDO
0000 000. = Reserved: 0x00
.... ...0 = Direction: FDO -> PDO (0x0)
URB bus id: 2
Device address: 7
Endpoint: 0x80, Direction: IN
1... .... = Direction: IN (1)
.... 0000 = Endpoint number: 0
URB transfer type: URB_CONTROL (0x02)
Packet Data Length: 8
[Response in: 30]
Control transfer stage: Setup (0)
[bInterfaceClass: Audio (0x01)]
Setup Data
bmRequestType: 0xa1
1... .... = Direction: Device-to-host
.01. .... = Type: Class (0x1)
...0 0001 = Recipient: Interface (0x01)
bRequest: 130
wValue: 0x0201
wIndex: 1536 (0x0600)
wLength: 2

Frame 30: 30 bytes on wire (240 bits), 30 bytes captured (240 bits) on
interface wireshark_extcap1868, id 0
Interface id: 0 (wireshark_extcap1868)
Interface name: wireshark_extcap1868
Encapsulation type: USB packets with USBPcap header (152)
Arrival Time: Jul 1, 2021 02:21:45.291389000 CDT
[Time shift for this packet: 0.000000000 seconds]
Epoch Time: 1625124105.291389000 seconds
[Time delta from previous captured frame: 0.000118000 seconds]
[Time delta from previous displayed frame: 0.000118000 seconds]
[Time since reference or first frame: 0.035442000 seconds]
Frame Number: 30
Frame Length: 30 bytes (240 bits)
Capture Length: 30 bytes (240 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: usb]
USB URB
[Source: 2.7.0]
[Destination: host]
USBPcap pseudoheader length: 28
IRP ID: 0xffffa90f548b8a20
IRP USBD_STATUS: USBD_STATUS_SUCCESS (0x00000000)
URB Function: URB_FUNCTION_CONTROL_TRANSFER (0x0008)
IRP information: 0x01, Direction: PDO -> FDO
0000 000. = Reserved: 0x00
.... ...1 = Direction: PDO -> FDO (0x1)
URB bus id: 2
Device address: 7
Endpoint: 0x80, Direction: IN
1... .... = Direction: IN (1)
.... 0000 = Endpoint number: 0
URB transfer type: URB_CONTROL (0x02)
Packet Data Length: 2
[Request in: 29]
[Time from request: 0.000118000 seconds]
Control transfer stage: Complete (3)
[bInterfaceClass: Audio (0x01)]
CONTROL response data: 00d3

According to the audio 1.0 specification, this is a "get_cur" request
(appendix 9: Audio Class-Specific Request Codes). However, I wasn't
really sure what it was trying to get. The spec (SEC. B.3.3.3)
indicates that this is an input terminal descriptor. I'll continue
following this chain of requests and responses and see if I can figure
out exactly what its doing -- I need to map the request IDs onto their
actual values since Wireshark isn't doing that for me automatically.

On 7/2/21, Michael Brown <mcb30@...> wrote:
On 02/07/2021 10:41, Michael Brown wrote:
UsbIo->UsbControlTransfer(UsbIo, &Req, EfiUsbDataIn,
                          PcdGet32 (PcdUsbTransferTimeoutValue),
                          &Header, sizeof(Header), &Status);

(Error handling etc omitted for brevity)

That would get you the first 8 bytes of the class-specific AC interface
header descriptor.  You would then need to extract the TotalLength
field, allocate that length of memory, and repeat the
UsbControlTransfer() call to fetch the full-length descriptor into the
newly allocated block.

Hope that helps,
BTW, in case you aren't already aware of this: wireshark is pretty good
at dissecting USB traffic. You can capture it by doing a "modprobe
usbmon", after which you'll see a number of usbmonN devices show up in
the wireshark interface list. Try them each in turn until you find
which one corresponds to the host controller to which your device is
attached.

My normal method for developing or debugging iPXE USB drivers will
typically involve using wireshark to capture the USB traffic that
happens when the device is being used by a known-working driver (e.g.
the Linux driver for that device) and comparing it to the traffic that
happens when I'm using my own driver (via USB pass-through in a VM).
This is often a lot faster than trying to pull together all of the
information from the multiple USB spec documents.

Good luck!

Michael
--
Signed,
Ethin D. Probst


Re: [PATCH v3 2/2] OvmfPkg/Bhyve: use static PCI32Base address

Rebecca Cran
 

Acked-by: Rebecca Cran <rebecca@...>

On 7/1/21 6:01 AM, Corvin Köhne wrote:
It's neccessary to allocate a Graphics Stolen Memory area to enable
GPU-Passthrough for integrated Intel GPUs. Therefore, use a new
memory layout with a static Pci32Baseaddress.

Old layout:
[... , lowmemlimit] RAM
[lowmemlimit, 0xE000 0000] PCI Space
New layout:
[... , lowmemlimit] RAM
[lowmemlimit, gsmbase ] Memory hole (may be absent)
[gsmbase , 0xC000 0000] GSM (may be absent)
[0xC000 0000, 0xE000 0000] PCI Space
---
OvmfPkg/Bhyve/BhyveX64.dsc | 4 ++--
OvmfPkg/Bhyve/PlatformPei/Platform.c | 4 +++-
2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc
index a0a2071b86..c435dadc0a 100644
--- a/OvmfPkg/Bhyve/BhyveX64.dsc
+++ b/OvmfPkg/Bhyve/BhyveX64.dsc
@@ -537,8 +537,8 @@
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId|0
gUefiOvmfPkgTokenSpaceGuid.PcdPciIoBase|0x0
gUefiOvmfPkgTokenSpaceGuid.PcdPciIoSize|0x0
- gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Base|0x0
- gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Size|0x0
+ gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Base|0xC0000000
+ gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Size|0x20000000
gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Base|0x0
gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size|0x800000000
diff --git a/OvmfPkg/Bhyve/PlatformPei/Platform.c b/OvmfPkg/Bhyve/PlatformPei/Platform.c
index 3a414ffcb7..f38e74ccfc 100644
--- a/OvmfPkg/Bhyve/PlatformPei/Platform.c
+++ b/OvmfPkg/Bhyve/PlatformPei/Platform.c
@@ -191,7 +191,9 @@ MemMapInitialization (
ASSERT (PciExBarBase <= MAX_UINT32 - SIZE_256MB);
PciBase = (UINT32)(PciExBarBase + SIZE_256MB);
} else {
- PciBase = (TopOfLowRam < BASE_2GB) ? BASE_2GB : TopOfLowRam;
+ PciBase = PcdGet64(PcdPciMmio32Base);
+ if (PciBase == 0)
+ PciBase = (TopOfLowRam < BASE_2GB) ? BASE_2GB : TopOfLowRam;
}
//


Re: [PATCH 1/1] MdeModulePkg: Add BootDiscoveryPolicyUiLib.

Sunny Wang
 

Hi Greg,

In our offline discussion, we found some reasons below to change PcdBootDiscoveryPolicy default value from 0 (minimal discovery/fast boot) to 2 (full discovery). Could you update your patch for this?
1. The minimal discovery/fast boot causes issues with system deployment and testing. For example, we saw several issues reported in https://github.com/pftf/RPi4/issues.
2. On ARM systems, the fast boot doesn't save a lot of boot time. On RPi4, I saw it only reduces boot time by less than 1 second.
3. For the platforms that need Fast boot to work by default, we can still modify the platform's dsc file.


Best Regards,
Sunny Wang

-----Original Message-----
From: Sunny Wang <Sunny.Wang@...>
Sent: Wednesday, June 30, 2021 2:55 PM
To: Grzegorz Bernacki <gjb@...>; devel@edk2.groups.io; ray.ni@...; zhichao.gao@...
Cc: leif@...; ardb+tianocore@...; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@...>; mw@...; upstream@...; pete@...; jian.j.wang@...; hao.a.wu@...; dandan.bi@...; eric.dong@...; Sunny Wang <Sunny.Wang@...>
Subject: RE: [PATCH 1/1] MdeModulePkg: Add BootDiscoveryPolicyUiLib.

Internally reviewed this patch before sending the edk2 mailing list and Greg already addressed all my comments, so It looks good to me.
Reviewed-by: Sunny Wang <sunny.wang@...>

Add Ray and Zhichao. They're BDS modules reviewers.

Hi Ray and Zhichao,
Could you help review this patch?


-----Original Message-----
From: Grzegorz Bernacki <gjb@...>
Sent: Tuesday, June 22, 2021 4:52 PM
To: devel@edk2.groups.io
Cc: leif@...; ardb+tianocore@...; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@...>; Sunny Wang <Sunny.Wang@...>; mw@...; upstream@...; pete@...; jian.j.wang@...; hao.a.wu@...; dandan.bi@...; eric.dong@...; Grzegorz Bernacki <gjb@...>
Subject: [PATCH 1/1] MdeModulePkg: Add BootDiscoveryPolicyUiLib.

This library extends Boot Maintenance Menu and allows to select
Boot Discovery Policy. When choice is made BootDiscoveryPolicy
variable is set. Platform code can use this variable to decide
which class of device shall be connected.

Signed-off-by: Grzegorz Bernacki <gjb@...>
---
MdeModulePkg/MdeModulePkg.dec | 6 +
MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib.inf | 52 +++++++
MdeModulePkg/Include/Guid/BootDiscoveryPolicy.h | 22 +++
MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib.c | 160 ++++++++++++++++++++
MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib.uni | 18 +++
MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLibStrings.uni | 29 ++++
MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLibVfr.Vfr | 44 ++++++
7 files changed, 331 insertions(+)
create mode 100644 MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib.inf
create mode 100644 MdeModulePkg/Include/Guid/BootDiscoveryPolicy.h
create mode 100644 MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib.c
create mode 100644 MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib.uni
create mode 100644 MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLibStrings.uni
create mode 100644 MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLibVfr.Vfr

diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 10602a8f79..1e65ad2dd7 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -422,6 +422,9 @@
## Include/UniversalPayload/ExtraData.h
gUniversalPayloadExtraDataGuid = {0x15a5baf6, 0x1c91, 0x467d, {0x9d, 0xfb, 0x31, 0x9d, 0x17, 0x8d, 0x4b, 0xb4}}

+ ## GUID used for Boot Discovery Policy FormSet guid and related variables.
+ gBootDiscoveryPolicyMgrFormsetGuid = { 0x5b6f7107, 0xbb3c, 0x4660, { 0x92, 0xcd, 0x54, 0x26, 0x90, 0x28, 0x0b, 0xbd } }
+
[Ppis]
## Include/Ppi/AtaController.h
gPeiAtaControllerPpiGuid = { 0xa45e60d1, 0xc719, 0x44aa, { 0xb0, 0x7a, 0xaa, 0x77, 0x7f, 0x85, 0x90, 0x6d }}
@@ -1597,6 +1600,9 @@
# @Prompt Console Output Row of Text Setup
gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutRow|25|UINT32|0x4000000e

+ ## Specify the Boot Discovery Policy settings
+ gEfiMdeModulePkgTokenSpaceGuid.PcdBootDiscoveryPolicy|0|UINT32|0x4000000f
+
[PcdsFixedAtBuild.AARCH64, PcdsPatchableInModule.AARCH64]
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiExposedTableVersions|0x20|UINT32|0x0001004c

diff --git a/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib.inf b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib.inf
new file mode 100644
index 0000000000..1fb4d43caa
--- /dev/null
+++ b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib.inf
@@ -0,0 +1,52 @@
+## @file
+# Library for BDS phase to use Boot Discovery Policy
+#
+# Copyright (c) 2021, ARM Ltd. All rights reserved.<BR>
+# Copyright (c) 2021, Semihalf All rights reserved.<BR>
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = BootDiscoveryPolicyUiLib
+ MODULE_UNI_FILE = BootDiscoveryPolicyUiLib.uni
+ FILE_GUID = BE73105A-B13D-4B57-A41A-463DBD15FE10
+ MODULE_TYPE = DXE_DRIVER
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = NULL|DXE_DRIVER UEFI_APPLICATION
+ CONSTRUCTOR = BootDiscoveryPolicyUiLibConstructor
+ DESTRUCTOR = BootDiscoveryPolicyUiLibDestructor
+#
+# The following information is for reference only and not required by the build tools.
+#
+# VALID_ARCHITECTURES = IA32 X64 AARCH64
+#
+
+[Sources]
+ BootDiscoveryPolicyUiLib.c
+ BootDiscoveryPolicyUiLibStrings.uni
+ BootDiscoveryPolicyUiLibVfr.Vfr
+
+[Packages]
+ MdePkg/MdePkg.dec
+ MdeModulePkg/MdeModulePkg.dec
+
+[LibraryClasses]
+ DevicePathLib
+ BaseLib
+ UefiRuntimeServicesTableLib
+ UefiBootServicesTableLib
+ DebugLib
+ HiiLib
+ UefiLib
+ BaseMemoryLib
+
+[Guids]
+ gBootDiscoveryPolicyMgrFormsetGuid
+
+[Pcd]
+ gEfiMdeModulePkgTokenSpaceGuid.PcdBootDiscoveryPolicy ## PRODUCES
+
+[Depex]
+ gEfiHiiDatabaseProtocolGuid AND gPcdProtocolGuid
diff --git a/MdeModulePkg/Include/Guid/BootDiscoveryPolicy.h b/MdeModulePkg/Include/Guid/BootDiscoveryPolicy.h
new file mode 100644
index 0000000000..8eb0968a16
--- /dev/null
+++ b/MdeModulePkg/Include/Guid/BootDiscoveryPolicy.h
@@ -0,0 +1,22 @@
+/** @file
+ Definition for structure & defines exported by Boot Discovery Policy UI
+
+ Copyright (c) 2021, ARM Ltd. All rights reserved.<BR>
+ Copyright (c) 2021, Semihalf All rights reserved.<BR>
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef _BOOT_DISCOVERY_POLICY_UI_LIB_H_
+#define _BOOT_DISCOVERY_POLICY_UI_LIB_H_
+
+#define BDP_CONNECT_MINIMAL 0 /* Do not connect any additional devices */
+#define BDP_CONNECT_NET 1
+#define BDP_CONNECT_ALL 2
+
+#define BOOT_DISCOVERY_POLICY_MGR_FORMSET_GUID { 0x5b6f7107, 0xbb3c, 0x4660, { 0x92, 0xcd, 0x54, 0x26, 0x90, 0x28, 0x0b, 0xbd } }
+
+#define BOOT_DISCOVERY_POLICY_VAR L"BootDiscoveryPolicy"
+
+#endif
diff --git a/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib.c b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib.c
new file mode 100644
index 0000000000..6814d0bb8f
--- /dev/null
+++ b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib.c
@@ -0,0 +1,160 @@
+/** @file
+ Boot Discovery Policy UI for Boot Maintenance menu.
+
+ Copyright (c) 2021, ARM Ltd. All rights reserved.<BR>
+ Copyright (c) 2021, Semihalf All rights reserved.<BR>
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <Guid/BootDiscoveryPolicy.h>
+#include <Library/UefiDriverEntryPoint.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/UefiRuntimeServicesTableLib.h>
+#include <Library/BaseLib.h>
+#include <Library/DevicePathLib.h>
+#include <Library/DebugLib.h>
+#include <Library/HiiLib.h>
+#include <Library/UefiLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Include/Library/PcdLib.h>
+
+///
+/// HII specific Vendor Device Path definition.
+///
+typedef struct {
+ VENDOR_DEVICE_PATH VendorDevicePath;
+ EFI_DEVICE_PATH_PROTOCOL End;
+} HII_VENDOR_DEVICE_PATH;
+
+extern unsigned char BootDiscoveryPolicyUiLibVfrBin[];
+
+EFI_HII_HANDLE mBPHiiHandle = NULL;
+EFI_HANDLE mBPDriverHandle = NULL;
+
+STATIC HII_VENDOR_DEVICE_PATH mVendorDevicePath = {
+ {
+ {
+ HARDWARE_DEVICE_PATH,
+ HW_VENDOR_DP,
+ {
+ (UINT8)(sizeof (VENDOR_DEVICE_PATH)),
+ (UINT8)((sizeof (VENDOR_DEVICE_PATH)) >> 8)
+ }
+ },
+ BOOT_DISCOVERY_POLICY_MGR_FORMSET_GUID
+ },
+ {
+ END_DEVICE_PATH_TYPE,
+ END_ENTIRE_DEVICE_PATH_SUBTYPE,
+ {
+ (UINT8)(END_DEVICE_PATH_LENGTH),
+ (UINT8)((END_DEVICE_PATH_LENGTH) >> 8)
+ }
+ }
+};
+
+/**
+
+ Initialize Boot Maintenance Menu library.
+
+ @param ImageHandle The image handle.
+ @param SystemTable The system table.
+
+ @retval EFI_SUCCESS Install Boot manager menu success.
+ @retval Other Return error status.gBPDisplayLibGuid
+
+**/
+EFI_STATUS
+EFIAPI
+BootDiscoveryPolicyUiLibConstructor (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ )
+{
+ EFI_STATUS Status;
+ UINTN Size;
+ UINT32 BootDiscoveryPolicy;
+
+ Size = sizeof (UINT32);
+ Status = gRT->GetVariable (
+ BOOT_DISCOVERY_POLICY_VAR,
+ &gBootDiscoveryPolicyMgrFormsetGuid,
+ NULL,
+ &Size,
+ &BootDiscoveryPolicy
+ );
+ if (EFI_ERROR (Status)) {
+ Status = PcdSet32S (PcdBootDiscoveryPolicy, PcdGet32 (PcdBootDiscoveryPolicy));
+ ASSERT_EFI_ERROR (Status);
+ }
+
+ Status = gBS->InstallMultipleProtocolInterfaces (
+ &mBPDriverHandle,
+ &gEfiDevicePathProtocolGuid,
+ &mVendorDevicePath,
+ NULL
+ );
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+
+ //
+ // Publish our HII data
+ //
+ mBPHiiHandle = HiiAddPackages (
+ &gBootDiscoveryPolicyMgrFormsetGuid,
+ mBPDriverHandle,
+ BootDiscoveryPolicyUiLibVfrBin,
+ BootDiscoveryPolicyUiLibStrings,
+ NULL
+ );
+ if (mBPHiiHandle == NULL) {
+ gBS->UninstallMultipleProtocolInterfaces (
+ mBPDriverHandle,
+ &gEfiDevicePathProtocolGuid,
+ &mVendorDevicePath,
+ NULL
+ );
+
+ return EFI_OUT_OF_RESOURCES;
+ }
+
+ return EFI_SUCCESS;
+}
+
+/**
+ Destructor of Boot Maintenance menu library.
+
+ @param ImageHandle The firmware allocated handle for the EFI image.
+ @param SystemTable A pointer to the EFI System Table.
+
+ @retval EFI_SUCCESS The destructor completed successfully.
+ @retval Other value The destructor did not complete successfully.
+
+**/
+EFI_STATUS
+EFIAPI
+BootDiscoveryPolicyUiLibDestructor (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ )
+{
+
+ if (mBPDriverHandle != NULL) {
+ gBS->UninstallProtocolInterface (
+ mBPDriverHandle,
+ &gEfiDevicePathProtocolGuid,
+ &mVendorDevicePath
+ );
+ mBPDriverHandle = NULL;
+ }
+
+ if (mBPHiiHandle != NULL) {
+ HiiRemovePackages (mBPHiiHandle);
+ mBPHiiHandle = NULL;
+ }
+
+ return EFI_SUCCESS;
+}
diff --git a/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib.uni b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib.uni
new file mode 100644
index 0000000000..eea3ca6c8d
--- /dev/null
+++ b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLib.uni
@@ -0,0 +1,18 @@
+// /** @file
+// Boot Discovery Policy UI module.
+//
+// Copyright (c) 2021, ARM Ltd. All rights reserved.<BR>
+// Copyright (c) 2021, Semihalf All rights reserved.<BR>
+//
+// SPDX-License-Identifier: BSD-2-Clause-Patent
+//
+// **/
+
+
+#string STR_MODULE_ABSTRACT
+#language en-US "Boot Discovery Policy UI module."
+
+#string STR_MODULE_DESCRIPTION
+#language en-US "Boot Discovery Policy UI module."
+
+
diff --git a/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLibStrings.uni b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLibStrings.uni
new file mode 100644
index 0000000000..736011c9bb
--- /dev/null
+++ b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLibStrings.uni
@@ -0,0 +1,29 @@
+// *++
+//
+// Copyright (c) 2021, ARM Ltd. All rights reserved.<BR>
+// Copyright (c) 2021, Semihalf All rights reserved.<BR>
+// SPDX-License-Identifier: BSD-2-Clause-Patent
+//
+// Module Name:
+//
+// BootDiscoveryPolicyUiLibStrings.uni
+//
+// Abstract:
+//
+// String definitions for Boot Discovery Policy UI.
+//
+// --*/
+
+/=#
+
+
+#langdef en-US "English"
+
+#string STR_FORM_BDP_MAIN_TITLE #language en-US "Boot Discovery Policy"
+
+#string STR_FORM_BDP_CONN_MIN #language en-US "Minimal"
+
+#string STR_FORM_BDP_CONN_NET #language en-US "Connect Network Devices"
+
+#string STR_FORM_BDP_CONN_ALL #language en-US "Connect All Devices"
+
diff --git a/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLibVfr.Vfr b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLibVfr.Vfr
new file mode 100644
index 0000000000..0de87ec34f
--- /dev/null
+++ b/MdeModulePkg/Library/BootDiscoveryPolicyUiLib/BootDiscoveryPolicyUiLibVfr.Vfr
@@ -0,0 +1,44 @@
+///** @file
+//
+// Formset for Boot Discovery Policy UI
+//
+// Copyright (c) 2021, ARM Ltd. All rights reserved.<BR>
+// Copyright (c) 2021, Semihalf All rights reserved.<BR>
+//
+// SPDX-License-Identifier: BSD-2-Clause-Patent
+//
+//**/
+
+#include <Uefi/UefiMultiPhase.h>
+#include "Guid/BootDiscoveryPolicy.h"
+#include <Guid/HiiBootMaintenanceFormset.h>
+
+typedef struct {
+ UINT32 BootDiscoveryPolicy;
+} BOOT_DISCOVERY_POLICY_VARSTORE_DATA;
+
+formset
+ guid = BOOT_DISCOVERY_POLICY_MGR_FORMSET_GUID,
+ title = STRING_TOKEN(STR_FORM_BDP_MAIN_TITLE),
+ help = STRING_TOKEN(STR_FORM_BDP_MAIN_TITLE),
+ classguid = EFI_IFR_BOOT_MAINTENANCE_GUID,
+
+ efivarstore BOOT_DISCOVERY_POLICY_VARSTORE_DATA,
+ attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
+ name = BootDiscoveryPolicy,
+ guid = BOOT_DISCOVERY_POLICY_MGR_FORMSET_GUID;
+
+ form formid = 0x0001,
+ title = STRING_TOKEN(STR_FORM_BDP_MAIN_TITLE);
+
+ oneof varid = BootDiscoveryPolicy.BootDiscoveryPolicy,
+ prompt = STRING_TOKEN(STR_FORM_BDP_MAIN_TITLE),
+ help = STRING_TOKEN(STR_FORM_BDP_MAIN_TITLE),
+ flags = NUMERIC_SIZE_4 | INTERACTIVE | RESET_REQUIRED,
+ option text = STRING_TOKEN(STR_FORM_BDP_CONN_MIN), value = BDP_CONNECT_MINIMAL, flags = DEFAULT;
+ option text = STRING_TOKEN(STR_FORM_BDP_CONN_NET), value = BDP_CONNECT_NET, flags = 0;
+ option text = STRING_TOKEN(STR_FORM_BDP_CONN_ALL), value = BDP_CONNECT_ALL, flags = 0;
+ endoneof;
+
+ endform;
+endformset;
--
2.25.1

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


Re: [PATCH v3 2/2] OvmfPkg/Bhyve: use static PCI32Base address

Laszlo Ersek
 

On 07/01/21 14:01, Corvin Köhne wrote:
It's neccessary to allocate a Graphics Stolen Memory area to enable
GPU-Passthrough for integrated Intel GPUs. Therefore, use a new
memory layout with a static Pci32Baseaddress.

Old layout:
[... , lowmemlimit] RAM
[lowmemlimit, 0xE000 0000] PCI Space
New layout:
[... , lowmemlimit] RAM
[lowmemlimit, gsmbase ] Memory hole (may be absent)
[gsmbase , 0xC000 0000] GSM (may be absent)
[0xC000 0000, 0xE000 0000] PCI Space
---
OvmfPkg/Bhyve/BhyveX64.dsc | 4 ++--
OvmfPkg/Bhyve/PlatformPei/Platform.c | 4 +++-
2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc
index a0a2071b86..c435dadc0a 100644
--- a/OvmfPkg/Bhyve/BhyveX64.dsc
+++ b/OvmfPkg/Bhyve/BhyveX64.dsc
@@ -537,8 +537,8 @@
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId|0
gUefiOvmfPkgTokenSpaceGuid.PcdPciIoBase|0x0
gUefiOvmfPkgTokenSpaceGuid.PcdPciIoSize|0x0
- gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Base|0x0
- gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Size|0x0
+ gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Base|0xC0000000
+ gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Size|0x20000000
gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Base|0x0
gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size|0x800000000

diff --git a/OvmfPkg/Bhyve/PlatformPei/Platform.c b/OvmfPkg/Bhyve/PlatformPei/Platform.c
index 3a414ffcb7..f38e74ccfc 100644
--- a/OvmfPkg/Bhyve/PlatformPei/Platform.c
+++ b/OvmfPkg/Bhyve/PlatformPei/Platform.c
@@ -191,7 +191,9 @@ MemMapInitialization (
ASSERT (PciExBarBase <= MAX_UINT32 - SIZE_256MB);
PciBase = (UINT32)(PciExBarBase + SIZE_256MB);
} else {
- PciBase = (TopOfLowRam < BASE_2GB) ? BASE_2GB : TopOfLowRam;
+ PciBase = PcdGet64(PcdPciMmio32Base);
+ if (PciBase == 0)
+ PciBase = (TopOfLowRam < BASE_2GB) ? BASE_2GB : TopOfLowRam;
}

//
Please post a new version (with Peter's R-b picked up), with the
following updates:

- The commit messages (on both patches) seem to have some UTF-8 garbage
at the start. Please remove that.

- In the above "PcdGet64(PcdPciMmio32Base)" call, a space character is
missing right before the opening paren. (I could fix it up, but I'd like
contributors to get used to that space character.)

Rebecca, any comments? An ACK would be appreciated (for v4).

Thanks,
Laszlo


[PATCH] UefiCpuPkg VTF0 X64: Build page tables using 1-GByte Page Granularity

Ashraf Ali S
 

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

X64 Reset Vector Code can access the memory range till 4GB using the
Linear-Address Translation to a 2-MByte Page, when user wants to use
more than 4G using 2M Page it will leads to use more number of Page
table entries. using the 1-GByte Page table user can use more than
4G Memory by reducing the page table entries using 1-GByte Page,
this patch attached can access memory range till 512GByte.
Build Scrips for Reset Vector currently based on Python 2
which is already EOL, needs to modify the build script based on
Python 3, update the Binary accordingly.

Cc: Ray Ni <ray.ni@...>
Cc: Rahul Kumar <rahul1.kumar@...>
Cc: Debkumar De <debkumar.de@...>
Cc: Harry Han <harry.han@...>
Cc: Catharine West <catharine.west@...>
Cc: Sangeetha V <sangeetha.v@...>
Signed-off-by: Ashraf Ali S <ashraf.ali.s@...>
---
.../Vtf0/Bin/ResetVector.ia32.port80.raw | Bin 516 -> 484 bytes
.../ResetVector/Vtf0/Bin/ResetVector.ia32.raw | Bin 484 -> 468 bytes
.../Vtf0/Bin/ResetVector.ia32.serial.raw | Bin 884 -> 868 bytes
.../Vtf0/Bin/ResetVector.x64.port80.raw | Bin 28676 -> 12292 bytes
.../ResetVector/Vtf0/Bin/ResetVector.x64.raw | Bin 28676 -> 12292 bytes
.../Vtf0/Bin/ResetVector.x64.serial.raw | Bin 28676 -> 12292 bytes
UefiCpuPkg/ResetVector/Vtf0/Build.py | 11 +--
.../ResetVector/Vtf0/Ia32/PageTables64.asm | 2 +-
UefiCpuPkg/ResetVector/Vtf0/ReadMe.txt | 2 +-
.../Vtf0/Tools/FixupForRawSection.py | 4 +-
UefiCpuPkg/ResetVector/Vtf0/Vtf0.nasmb | 4 +-
.../ResetVector/Vtf0/X64/1GPageTables.asm | 64 ++++++++++++++++++
.../X64/{PageTables.asm => 2MPageTables.asm} | 0
13 files changed, 77 insertions(+), 10 deletions(-)
create mode 100644 UefiCpuPkg/ResetVector/Vtf0/X64/1GPageTables.asm
rename UefiCpuPkg/ResetVector/Vtf0/X64/{PageTables.asm => 2MPageTables.asm} (100%)

diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.port80.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.port80.raw
index 2c6ff655ded2a5855ca8f4428d559a7727eb6983..79b23c047bdc6e552d77d5c9e9aeae21ff04d91d 100644
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F!g`tAAbQ#M!vED

diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.raw
index e34780a3a2c9b22bd10a1d5a405e344faaff94f3..ce7faa502b858e99908bcdb397b776258205e1d5 100644
GIT binary patch
delta 421
zcmaFDe1%zP0uUG;&}9%{V6bIiVEA8TJW)uczPUn$q4ZSeVde;h(!;MgckBm(&ZDpY
zbsl}`&d9)Ec)Rmn=Zm!NSOdlzMb@vG9g56a50n@+A7C%iRr%2sA^z>KLdmOc50S=)
z|NsAI;5=D!m+@c;Q_=N?3L)lFw%6jV2TIvGPrN>5c%buG>$g&-l7BD10Br{v65o74
z!m|EEaYRD}vp|V7kQ6F0>XvAH3^E94n?v&f<|1pAKd)~$A7DvqwD658)#cwFVZ(U1
z(K^7DfuU5M*;(VYJW#Upa9X2vSX3z=volBY0S*4`(QKMGUbF51+Qaa&258)`-3%Z4
zZtt%9ub0NpD4w=MnSsH9U+F;FtJKNSjMDY5-6qI0OaQ6_1rZE@G=l)pF$@fo&qL_h
zFuI>%zf-_#uKkVyuUXSNkGy7j{quG6%Zz{j|G(S<Bsw4be+DxMO257gVSvmG3vpwZ
NFyZwchzJ{m0sv1?z^?!R

literal 484
zcmX9*OG_g`5Uz2YXi!K{AwfI@4Wb8^4I;k92Z}6+5k#W02QLkK9j9Rq9_&L7ZDbtq
zqIePigaaNjIzCSdixLS)RFt&2cybqA?5!~cU5~H6s_N>tZQD+`9S{Z>1OTb`GBa#G
zt*_G(GaClinx^RkGo#yGe2LyNvnlO${H9mTj3XK78TZswjJl#0BPWZ(PsE3m63x5<
zkjV2pUL={H-<6y`Ayi}y>qBYR=+mmu*E{2X*HV!;FJ=@olMU=1D<ODc<ds9CLcd-$
z>r@&PjmS*9G|11z5fTzEKTW^U3gc6Jd}Rz>i=xwezWi&|RKrFLb)7MgiLyt(A5Nap
z{K@){_&;%jkXDHiVLej|v^%t)8c;mepB%?^+SRc((Td402KNZ-pIe~y>R7ebhG=Mi
zG0>h98oCZ15CogOAHb`XKiHDrNJxngrv+CGHM`_x1(RWLh67mGTp&(0SUJnJ3Rcm&
z65UvCM_?B@w(a-w1uqM*d0DnQmyjJzmTIyi$x?vuV|+aEM~V$8raq+<d#HFpKI8Y<
TrM$1pedcB-0FmP|Qr7<gpRvyd

diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.serial.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.serial.raw
index 6dfa68eabb48a44bc50a0b7fe678f80b5cdadfd5..6503a988abdac06f9aa88f0a65f2525e12233b0a 100644
GIT binary patch
delta 426
zcmeyu_JnPMtN<&s;Q?I+0R{$J1_p-zMaC0#Rrs4LR2WK6bslDpP$)h8+H+!>JIm{T
zoku68$xYtMs2t$H#K2&9yYpV>i?r@o1I8OgcCVQoiY!|Xl$bUjU@tOI`Oy_2{_U_r
z$*XP;k;aGr|Nm#;JXvy=@n8v4(e;K3A?8xfm(zi^wH_#C>pb!L_+($k?)of7kU&X%
z^8pFV6U7k?70d!9(m+zE#Hd@M@iE8{piK_V2bhbjRsOub-F$#0t<l0as#KSMdxQ<+
z;YRBKR|bYsd1hyg*YZHg&ckVq)?rble9X=q%?C92w@0&S-gwQr186V9%Rm4A|KIhO
z`OON2k{`Q%FmEt?H#v*RP`Ks4UK&56c-jtS1_lRyr2}cNv?s4)imrd{GC`hU0?-K)
zzyM?f2mqbLz%cndgq{tf`x*8-1-$0n?-=l!Bdznu%Ljj6Grj)ylK211_kaHXf4Teb
e|Nos2{y&2l1two#MwlBG;>Ivx!s|Uq(h~riBD@{|

delta 425
zcmaFD_JwVNtbi=D;Q?I+0R{$J1_p-zMV1qFRYV&rRDc|Y(&L?nnIjZR54`jN@+Ky@
zv%mcP|NsBaqZ1S4CZ1G|2xMYlFudJ)uk%G(cdP;9jUu;~%s_<>MRu(RN~~Dff$Sn<
zl^<OZ;@=J{l)UKn5NUh})X%_qvg9`7!4jsTs|^)G%%z+!X8~2V9w_DPJn`}nP{Cvy
z#_sxJMvz!Z5vv4H((*)cW<v$DK#2m76e_XlmS}toG6`sBAS=kuA}^IcFRuZGSXqF)
zv_=cxs8VzO?GZMNha0T}T!DVkWOmkgsRon;tLQwO)@U6TRVvKv%)zPw6y@I@&8B(d
zB`c7*1Be-zUOt;_%H$+G>%U$aKcjfs4rQRn_>~T%y|SO&#T1?W(j2HroM8dT6;J?X
zO+L>6re~jL*zXkZns2{jz-!L5&Lb~R`~e2e%P;?5ivNFk_0RwRFIW8q2IYhQ&nCRS
WJpl|r#)O5qF-(~7`Upe>LIMEmI;Oe+

diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.port80.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.port80.raw
index 6c0bcc47ebff84830b59047790c70d96e9488296..835f8ea423437fdd8b33470ca07b5d09e27ef5bf 100644
GIT binary patch
literal 12292
zcmeI&+i#oo0mkts4Go129J)fo=$7=rD1$;94uge`K!JtR2m?x1&W9N`jtlni4!~nY
zMKVPp5;sh{V}AhViU1dVP$**DtP&R#RiF&CsHt!04FZH}-n3u#KY(6K@yE_L{>6E&
z?8q}SGc)VwyIqx+a)EMza)EMza)EMza)EMza)EMza)EMza)EMz@AU%z;;$<lUAkFl
z463KNvDDER)G|66gX*QDF{oqcXbfsO9gRWt(a{*xv2-*BwStbuppK)XF{tC|XbkEH
zbTkI_LpmCRI)RSHpiZQtF{lb1jY0L((HPW8bTkIFl8(lpendxOP^;)@4C-V$8iP88
zj>e!?)6p2z03D4%ok~YzP(P-lF{sn%Xbfr%9gRW#gpS6beo9AUP=j<d1~o)SV^C}9
zXbfr{9gRV)r=u~b4RkaHbvhl5LH&%5#-PriqcNzBbTkHaCLN7I{hW@*pw6PBF{rcY
zXbfr-9gRVqLq}s!=hD#_)Mh#wgW5tzV^G6%GzN7Z9gRVqPe)@=7tqld)P;032K5U%
z8iTrsj>e!arlT>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5(z4gXBPU72M<jL><xHvrWL;v%%{x6Nr
BvabLD

diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.raw
index a78d5b407c8a106c221af127216d073cf8fdb99d..80c2de6ed5ef5e8dc5d45297fb83e7085bce0c01 100644
GIT binary patch
literal 12292
zcmeI&OK)6-0mbp-n3#mun2<IGLgPGWLcx%PHx9*+hMMw7$|IOiN}=uWei;u8kTz#z
zQfUY>BOw;3%YJ|^F=dg1Od`mpk-8udwK7GZICs-*P>WEe*U2A=&w%bop5LAMkMDTS
zYQ~yQr_)(I+wH2lR0~uKR0~uKR0~uKR0~uKR0~uKR0~uKR0~uKe6JVy3$LzpWd5+!
z7*tPrFyGM_)B-vhgX*QDF{o4MXbfs09gRWt(a{*xsdO|3wTO<!pcd277}RNWGzN7#
z9gRVqK}TayXVTFa)LC>i234b@F{pkz8iP8Uj>e#t(9sywIdn7zwUmy=pngC{V^BY&
zqcNyubTkGvKu2Rx=hD#_)OmC?26a9ijX^D^qcNxp=x7Y;M|3m>wStbupa$t^3~D7E
zjX|xVqcNz}bTkIFhK|OdE~KL|s2|hO7}Q!i8iQI#M`KVI(a{*xPv~e2>S8(?gSv!{
z#-N7iXbkF7IvRtzjE=^j*3;1#)CM{lgW5<(V^EjV(HPVfbTkHaB^`}HT}4M@P*>B@
z7}Pa%GzN7o9gRU<M@M5&!*nzTwTX_#psuH*F{q!?(HPVXbTkGvLPujzH`37<)J=3W
z2DO=v#-M&iM`KW1=x7Y;W;z;!`Z*nqL5<SU7}PCvGzRqxIvRtzm5#=sZlj|ysN3mi
z4C)R#8iU$OM`KXi=x7Y;mvl4+btfH-LES}1V^DX~(HPV{bTkIFosPz!?xmwKs4+Sk
zgSwB7#-Mi4(HPYIbTkI_D>@p3dVr3`pngq9V^9y$(HPWk=x7Y;Avzj^dYF#Jpngk7
zV^F`NqcN!8)6p1IosPz!9-*T#s7L8&4C*mD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!P8=iMq7hZ7k
z?-ws#Jn-yGA|Cvb3x9m!<}=TD+Ji2+>FURxTzWVvuYQMX`<k~ub?3wVs~>XTe|h>-
z?)l0auej#sXIyoU^DjM=ao1nG<|UW>+%<Q&`giKw-7Y<Q*OS*j9C>Y@z3YV+o&5aa
zfCu-57he0yvv;`WRVR-=oZ|3eSD(84aLB`7^eG=*=PteMnkx>scf011&$#^jpWga<
zhciF%)U9W}`f>ODkCWd$Jay`hhev15KkPl9diJ5GpYxPQUUK94M?B#%hkwokE`9X<
zPwsd4!`qIyaO0Wtk9hJ^&))sgN8jbt{SVKce$EHn=>a#LoI2dS;qVbBXAUoRL(IjC
zr?0%}^c8dZr*1xV`pWsqis;jCeRy=2(+@g*MIY|m`}CFl@&_J{zC2EzbtwPsx$$?`
zz2vzcckwOHoWA6qXKr}o!@e92IrH)-9*(&zZpb?w&UWRTx#2Ex-A&i^b#vX#*S+}U
zafkBWQHMkR_nYeQ^lj_5pTa-u*W)(7{=fafc-}id;g(l_-a9?vmOGuf@chFk;pCq$
zo_yBDlT)v{c=6<^x86ML@RC>EaJaec+jCdl=Y?0@=LJ{Y=lNG%n2UdLIMppT-hRGY
SPx9m^JvI){eBb~48~hhX6Rzk0

diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.serial.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.serial.raw
index 61c71349a8a599916f3eeae8c5dee92efb56db71..9a24e8a752440462541a9589e514770692a838e4 100644
GIT binary patch
literal 12292
zcmeI&No<sL9LDjd3`;?ADxy?DDT|5=+Jc~nO9jQc<AxRYZQQpyqvQUYG{lT(ZQ{Wg
zk6gUT%~}sUrlROY5)WdCrfM_{V;Um~qGHE);A=uhqn`DB5A&J-d^7L7|KId5(@cMV
zfB(GUT21MZP9U8?I)QWo=>*aVq!UOdkWL_-KsteR0_g<O3H+xguz}qrcGmAE1{&3r
z+^KgAG-@0j1C7eiG0>>-bPP0V0v!X5nn=e$qbAWY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s%y;o_T5zT>dNt$p!L
zcfRY~3m<uaXRbM*|NH5legFUY75*Pi@jcgFJ+iZRTz}Ky5TE<zFZzNyf9l4wHy^$}
z@$B<oeba>>y?Q=}Gyjb1ub%lGFM0ZVPk!+5)b)=(Y@NCAaW8%4xsN^l+E+aPy8A9X
z?`5BK_&A?=>P62u`G~_`KD5Wh`_5c=-pgNk?n6$!=yBIS<M8b1*M8Pxo_YVt^@oS|
z9R9?~+uwiX$~`exuAIK*{?j+l>3biz{`4*LZ57d{pMBVR-05eXzPS$%o_hM0e#iO4
z-Zx!yl|1K~Y5VAFw*NPu>jxZ8+LiY1s~6g>m;cwT=R9KT36I!%{N<l{UHrsdZ+qPr
zUiqjqr>}eRnR`C$a6KFj?aVu#beNVK<DPuX;Vf^NM}9E3U2{y&zGnLu9^;vN9v64r
ze^=i%cRg^|TTWhbn5#=qjXJ!?&o3@lC-CZc=zrnA?0X*e>weB}jn}{MWe<MP>p$^j
z58iO*;u}u#y@!kU<R`D3Jo?JXOW%9t%E>M7JAA3bjNX3F;bkBC7rNV@_NLpP_Qu<v
j_J-Rp&Xu=6c;CbCb@e@7{+Tb1OP3z}mY;w3OP78Y>oK+#

diff --git a/UefiCpuPkg/ResetVector/Vtf0/Build.py b/UefiCpuPkg/ResetVector/Vtf0/Build.py
index 343c53b5ff..29f29ff0c2 100644
--- a/UefiCpuPkg/ResetVector/Vtf0/Build.py
+++ b/UefiCpuPkg/ResetVector/Vtf0/Build.py
@@ -1,7 +1,7 @@
## @file
# Automate the process of building the various reset vector types
#
-# Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2009 - 2021, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -32,16 +32,19 @@ for arch in ('ia32', 'x64'):
'-o', output,
'Vtf0.nasmb',
)
+ print(f"Command : {' '.join(commandLine)}")
ret = RunCommand(commandLine)
- print '\tASM\t' + output
- if ret != 0: sys.exit(ret)
+ if ret != 0:
+ print(f"something went wrong while executing the {commandLine[-1]}")
+ sys.exit()
+ print('\tASM\t' + output)

commandLine = (
'python',
'Tools/FixupForRawSection.py',
output,
)
- print '\tFIXUP\t' + output
+ print('\tFIXUP\t' + output)
ret = RunCommand(commandLine)
if ret != 0: sys.exit(ret)

diff --git a/UefiCpuPkg/ResetVector/Vtf0/Ia32/PageTables64.asm b/UefiCpuPkg/ResetVector/Vtf0/Ia32/PageTables64.asm
index 87a4125d4b..9cc6f56c17 100644
--- a/UefiCpuPkg/ResetVector/Vtf0/Ia32/PageTables64.asm
+++ b/UefiCpuPkg/ResetVector/Vtf0/Ia32/PageTables64.asm
@@ -15,7 +15,7 @@ BITS 32
SetCr3ForPageTables64:

;
- ; These pages are built into the ROM image in X64/PageTables.asm
+ ; These pages are built into the ROM image in X64/1GPageTables.asm
;
mov eax, ADDR_OF(TopLevelPageDirectory)
mov cr3, eax
diff --git a/UefiCpuPkg/ResetVector/Vtf0/ReadMe.txt b/UefiCpuPkg/ResetVector/Vtf0/ReadMe.txt
index e6e5b54243..eb9dd24ee2 100644
--- a/UefiCpuPkg/ResetVector/Vtf0/ReadMe.txt
+++ b/UefiCpuPkg/ResetVector/Vtf0/ReadMe.txt
@@ -29,7 +29,7 @@ EBP/RBP - Pointer to the start of the Boot Firmware Volume
=== HOW TO BUILD VTF0 ===

Dependencies:
-* Python 2.5~2.7
+* Python 3.0 or newer
* Nasm 2.03 or newer

To rebuild the VTF0 binaries:
diff --git a/UefiCpuPkg/ResetVector/Vtf0/Tools/FixupForRawSection.py b/UefiCpuPkg/ResetVector/Vtf0/Tools/FixupForRawSection.py
index c77438a0ce..de771eba22 100644
--- a/UefiCpuPkg/ResetVector/Vtf0/Tools/FixupForRawSection.py
+++ b/UefiCpuPkg/ResetVector/Vtf0/Tools/FixupForRawSection.py
@@ -1,7 +1,7 @@
## @file
# Apply fixup to VTF binary image for FFS Raw section
#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2008 - 2021, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -15,6 +15,6 @@ c = ((len(d) + 4 + 7) & ~7) - 4
if c > len(d):
c -= len(d)
f = open(sys.argv[1], 'wb')
- f.write('\x90' * c)
+ f.write(b'\x90' * c)
f.write(d)
f.close()
diff --git a/UefiCpuPkg/ResetVector/Vtf0/Vtf0.nasmb b/UefiCpuPkg/ResetVector/Vtf0/Vtf0.nasmb
index 493738c79c..0625efc456 100644
--- a/UefiCpuPkg/ResetVector/Vtf0/Vtf0.nasmb
+++ b/UefiCpuPkg/ResetVector/Vtf0/Vtf0.nasmb
@@ -2,7 +2,7 @@
; @file
; This file includes all other code files to assemble the reset vector code
;
-; Copyright (c) 2008 - 2013, Intel Corporation. All rights reserved.<BR>
+; Copyright (c) 2008 - 2021, Intel Corporation. All rights reserved.<BR>
; SPDX-License-Identifier: BSD-2-Clause-Patent
;
;------------------------------------------------------------------------------
@@ -36,7 +36,7 @@
%include "PostCodes.inc"

%ifdef ARCH_X64
-%include "X64/PageTables.asm"
+%include "X64/1GPageTables.asm"
%endif

%ifdef DEBUG_PORT80
diff --git a/UefiCpuPkg/ResetVector/Vtf0/X64/1GPageTables.asm b/UefiCpuPkg/ResetVector/Vtf0/X64/1GPageTables.asm
new file mode 100644
index 0000000000..8ae6c4c98c
--- /dev/null
+++ b/UefiCpuPkg/ResetVector/Vtf0/X64/1GPageTables.asm
@@ -0,0 +1,64 @@
+;------------------------------------------------------------------------------
+; @file
+; Emits Page Tables for 1:1 mapping of the addresses 0 - 0x8000000000 (512GB)
+;
+; Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+; SPDX-License-Identifier: BSD-2-Clause-Patent
+; Linear-Address Translation to a 1-GByte Page
+;
+;------------------------------------------------------------------------------
+
+BITS 64
+
+%define ALIGN_TOP_TO_4K_FOR_PAGING
+
+%define PAGE_PRESENT 0x01
+%define PAGE_READ_WRITE 0x02
+%define PAGE_USER_SUPERVISOR 0x04
+%define PAGE_WRITE_THROUGH 0x08
+%define PAGE_CACHE_DISABLE 0x010
+%define PAGE_ACCESSED 0x020
+%define PAGE_DIRTY 0x040
+%define PAGE_PAT 0x080
+%define PAGE_GLOBAL 0x0100
+%define PAGE_1G 0x80
+
+%define PAGE_PDP_ATTR (PAGE_ACCESSED + \
+ PAGE_READ_WRITE + \
+ PAGE_PRESENT)
+
+%define PAGE_PDP_1G_ATTR (PAGE_ACCESSED + \
+ PAGE_READ_WRITE + \
+ PAGE_PRESENT + \
+ PAGE_1G)
+
+%define PGTBLS_OFFSET(x) ((x) - TopLevelPageDirectory)
+%define PGTBLS_ADDR(x) (ADDR_OF(TopLevelPageDirectory) + (x))
+
+%define PDP(offset) (ADDR_OF(TopLevelPageDirectory) + (offset) + \
+ PAGE_PDP_ATTR)
+
+%define PDP_1G(x) ((x << 30) + PAGE_PDP_1G_ATTR)
+
+ALIGN 16
+
+TopLevelPageDirectory:
+
+ ;
+ ; Top level Page Directory Pointers (1 * 512GB entry)
+ ;
+ DQ PDP(0x1000)
+
+
+ TIMES 0x1000-PGTBLS_OFFSET($) DB 0
+ ;
+ ; Next level Page Directory Pointers (512 * 1GB entries => 512GB)
+ ;
+%assign i 0
+%rep 512
+ DQ PDP_1G(i)
+ %assign i i+1
+%endrep
+
+
+EndOfPageTables:
diff --git a/UefiCpuPkg/ResetVector/Vtf0/X64/PageTables.asm b/UefiCpuPkg/ResetVector/Vtf0/X64/2MPageTables.asm
similarity index 100%
rename from UefiCpuPkg/ResetVector/Vtf0/X64/PageTables.asm
rename to UefiCpuPkg/ResetVector/Vtf0/X64/2MPageTables.asm
--
2.32.0.windows.1


[PATCH 1/1] UefiCpuPkg: Empty change for test

Ashraf Ali S
 

Signed-off-by: Ashraf Ali S <ashraf.ali.s@...>
---
UefiCpuPkg/ResetVector/Vtf0/Vtf0.inf | 1 +
1 file changed, 1 insertion(+)

diff --git a/UefiCpuPkg/ResetVector/Vtf0/Vtf0.inf b/UefiCpuPkg/ResetVector/Vtf0/Vtf0.inf
index 9922cb27558c..8507275a92ae 100644
--- a/UefiCpuPkg/ResetVector/Vtf0/Vtf0.inf
+++ b/UefiCpuPkg/ResetVector/Vtf0/Vtf0.inf
@@ -15,6 +15,7 @@ [Defines]
VERSION_STRING = 1.1
MODULE_UNI_FILE = ResetVector.uni

+
#
# The following information is for reference only and not required by the build tools.
#
--
2.26.2.windows.1


Re: [PATCH v2 1/2] OvmfPkg/Bhyve: add USB support

Peter Grehan
 

Is that a detail of the current implementation, or a fundamental limitation in the bhyve architecture?
  Only two choices ? :) Maybe half way between those points.
When there is no fundamental limitation,
It's not so much a fundamental technical limitation as in a large amount of work in FreeBSD for almost zero return - maybe a fundamental resource limitation.

i.e. when a future version of the hypervisor may be able to support the feature with no changes to the firmware, then it would be good practice to leave the drivers enabled. Doing so avoids creating an unnecessarily tight coupling between the hypervisor and firmware versions.
Well versed in those issues :)

More importantly: does it even matter that the hypervisor doesn't support passthrough of PCI legacy interrupts?  UEFI operates on a polling basis, with the only active interrupt being some kind of periodic timer.  Where do you see any requirement for legacy interrupts in the UHCI/EHCI drivers?
It creates a case where the o/s booted by EFI isn't able to use those controllers as expected.

Anyways, this is more a discussion for the freebsd-virtualization mailing list if you'd like to chat about it more.

later,

Peter.


Re: [PATCH v2 1/2] OvmfPkg/Bhyve: add USB support

Michael Brown
 

On 02/07/2021 00:31, Peter Grehan wrote:
  bhyve doesn't (and will likely never) support Uhci/Ehci controllers so those lines can be removed.
Is it possible to pass such a controller by PCI-Passthrough to a VM?
If it's possible, I would keep these lines.
  Uhci/Ehci only support legacy interrupts and that isn't supported by bhyve PCI passthru.
Is that a detail of the current implementation, or a fundamental limitation in the bhyve architecture?
 Only two choices ? :) Maybe half way between those points.
When there is no fundamental limitation, i.e. when a future version of the hypervisor may be able to support the feature with no changes to the firmware, then it would be good practice to leave the drivers enabled. Doing so avoids creating an unnecessarily tight coupling between the hypervisor and firmware versions.

More importantly: does it even matter that the hypervisor doesn't support passthrough of PCI legacy interrupts? UEFI operates on a polling basis, with the only active interrupt being some kind of periodic timer. Where do you see any requirement for legacy interrupts in the UHCI/EHCI drivers?

Thanks,

Michael

14921 - 14940 of 92312