Date   

Re: [PATCH 1/3] UsbNetworkPkg/UsbRndis: Add USB RNDIS devices support

Michael Brown
 

On 03/10/2022 10:26, RichardHo [何明忠] via groups.io wrote:
diff --git a/UsbNetworkPkg/NetworkCommon/DriverBinding.h b/UsbNetworkPkg/NetworkCommon/DriverBinding.h
new file mode 100644
index 0000000000..29f1f967f5
--- /dev/null
+++ b/UsbNetworkPkg/NetworkCommon/DriverBinding.h
+VOID
+UndiApiEntry (
+ IN UINT64 Cdb
+ );
Needs an EFIAPI modifier, i.e.

VOID
EFIAPI
UndiApiEntry (
IN UINT64 Cdb
);

to avoid runtime failures when using a non-Microsoft compiler.

diff --git a/UsbNetworkPkg/NetworkCommon/PxeFunction.c b/UsbNetworkPkg/NetworkCommon/PxeFunction.c
new file mode 100644
index 0000000000..f6505f7018
--- /dev/null
+++ b/UsbNetworkPkg/NetworkCommon/PxeFunction.c
+/**
+ UNDI API table entry.
+
+ @param[in] Cdb A pointer to the command descriptor block.
+
+**/
+VOID
+UndiApiEntry (
+ IN UINT64 Cdb
+ )
As above:

VOID
EFIAPI
UndiApiEntry (
IN UINT64 Cdb
)

Thanks,

Michael


回复: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib: Remove HOST_APPLICATION limitation

gaoliming
 

Zhiguang:
Can you explain more about the emulator usage model for this library?

Thanks
Liming
-----邮件原件-----
发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Zhiguang Liu
发送时间: 2022年12月2日 14:25
收件人: devel@edk2.groups.io
抄送: Zhiguang Liu <zhiguang.liu@...>; Michael D Kinney
<michael.d.kinney@...>; Liming Gao <gaoliming@...>;
Ray Ni <ray.ni@...>
主题: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib: Remove
HOST_APPLICATION limitation

Remove HOST_APPLICATION limitation for UnitTestHostBaseLib, so that
this library can be used as BaseLib by Emulator.
Also, add some missing files

Cc: Michael D Kinney <michael.d.kinney@...>
Cc: Liming Gao <gaoliming@...>
Signed-off-by: Ray Ni <ray.ni@...>
---
MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
b/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
index 09a610c31c..fefa2e79f6 100644
--- a/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
+++ b/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
@@ -1,7 +1,7 @@
## @file
# Base Library implementation for use with host based unit tests.
#
-# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.<BR>
# Portions copyright (c) 2008 - 2009, Apple Inc. All rights
reserved.<BR>
# Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All
rights reserved.<BR>
@@ -18,7 +18,7 @@
FILE_GUID =
9555A0D3-09BA-46C4-A51A-45198E3C765E
MODULE_TYPE = BASE
VERSION_STRING = 1.1
- LIBRARY_CLASS = BaseLib|HOST_APPLICATION
+ LIBRARY_CLASS = BaseLib
LIBRARY_CLASS =
UnitTestHostBaseLib|HOST_APPLICATION

#
@@ -128,6 +128,7 @@
X86RdRand.c
X86SpeculationBarrier.c
X86UnitTestHost.c
+ IntelTdxNull.c

[Sources.X64]
X64/LongJump.nasm
@@ -168,6 +169,7 @@
X64/RdRand.nasm
ChkStkGcc.c | GCC
X86UnitTestHost.c
+ IntelTdxNull.c

[Sources.EBC]
Ebc/CpuBreakpoint.c
--
2.31.1.windows.1





Re: [PATCH 1/4] MdeModulePkg/XhciDxe/XhciReg: Handle incorrect PSIV indices

Wu, Hao A
 

Hello,

I saw there are several CI check failures for this 4 patches:
https://github.com/tianocore/edk2/pull/3702

Could you help to resolve them? Thanks.

Best Regards,
Hao Wu

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Sean
Rhodes
Sent: Friday, December 2, 2022 4:25 AM
To: devel@edk2.groups.io
Cc: Matt DeVillier <matt.devillier@...>; Wu, Hao A
<hao.a.wu@...>; Ni, Ray <ray.ni@...>; Rhodes, Sean
<sean@...>
Subject: [edk2-devel] [PATCH 1/4] MdeModulePkg/XhciDxe/XhciReg: Handle
incorrect PSIV indices

From: Matt DeVillier <matt.devillier@...>

On some platforms, including Sky Lake and Kaby Lake, the PSIV (Protocol Speed
ID Value) indicesare shared between Protocol Speed ID DWORD' in the
extended capabilities registers for both USB2 (Full Speed) and USB3 (Super
Speed).

An example can be found below:

XhcCheckUsbPortSpeedUsedPsic: checking for USB2 ext caps
XhciPsivGetPsid: found 3 PSID entries
XhciPsivGetPsid: looking for port speed 1
XhciPsivGetPsid: PSIV 1 PSIE 2 PLT 0 PSIM 12
XhciPsivGetPsid: PSIV 2 PSIE 1 PLT 0 PSIM 1500
XhciPsivGetPsid: PSIV 3 PSIE 2 PLT 0 PSIM 480
XhcCheckUsbPortSpeedUsedPsic: checking for USB3 ext caps
XhciPsivGetPsid: found 3 PSID entries
XhciPsivGetPsid: looking for port speed 1
XhciPsivGetPsid: PSIV 1 PSIE 3 PLT 0 PSIM 5
XhciPsivGetPsid: PSIV 2 PSIE 3 PLT 0 PSIM 10
XhciPsivGetPsid: PSIV 34 PSIE 2 PLT 0 PSIM 1248

The result is edk2 detecting USB2 devices as USB3 devices, which consequently
causes enumeration to fail.

To avoid incorrect detection, check the extended capability registers for USB2
before USB3. If edk2 finds a match for a USB 2 device, don't check for USB 3.

Cc: Hao A Wu <hao.a.wu@...>
Cc: Ray Ni <ray.ni@...>
Reviewed-by: Sean Rhodes <sean@...>
Signed-off-by: Matt DeVillier <matt.devillier@...>
Change-Id: I5bcf32105ce85fda95b4ba98a5e420e8f522374c
---
MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c | 36 +++++++++++++++-----------
MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h | 1 +
2 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c
b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c
index 2b4a4b2444..c992323443 100644
--- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c
+++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c
@@ -698,25 +698,11 @@ XhcCheckUsbPortSpeedUsedPsic (
SpField.Dword = 0; UsbSpeedIdMap = 0; - //- // Check xHCI Supported
Protocol Capability, find the PSIV field to match- // PortSpeed definition when
the Major Revision is 03h.- //- if (Xhc->Usb3SupOffset != 0xFFFFFFFF) {-
SpField.Dword = XhciPsivGetPsid (Xhc, Xhc->Usb3SupOffset, PortSpeed);- if
(SpField.Dword != 0) {- //- // Found the corresponding PORTSC value in
PSIV field of USB3 offset.- //- UsbSpeedIdMap =
USB_PORT_STAT_SUPER_SPEED;- }- }- // // Check xHCI Supported Protocol
Capability, find the PSIV field to match // PortSpeed definition when the Major
Revision is 02h. //- if ((UsbSpeedIdMap == 0) && (Xhc->Usb2SupOffset !=
0xFFFFFFFF)) {+ if (Xhc->Usb2SupOffset != 0xFFFFFFFF) { SpField.Dword =
XhciPsivGetPsid (Xhc, Xhc->Usb2SupOffset, PortSpeed); if (SpField.Dword != 0)
{ //@@ -733,6 +719,12 @@ XhcCheckUsbPortSpeedUsedPsic (
// PSIM shows as default High-speed protocol, apply to High-speed
mapping // UsbSpeedIdMap =
USB_PORT_STAT_HIGH_SPEED;+ } else if (SpField.Data.Psim ==
XHC_SUPPORTED_PROTOCOL_USB2_FULL_SPEED_PSIM) {+ //+ //
PSIM shows as default Full-speed protocol, return 0+ // to ensure no port
status set+ //+ return 0; } } else if (SpField.Data.Psie == 1)
{ //@@ -750,6 +742,20 @@ XhcCheckUsbPortSpeedUsedPsic (
} } + //+ // Check xHCI Supported Protocol Capability, find the PSIV field to
match+ // PortSpeed definition when the Major Revision is 03h.+ //+ if
((UsbSpeedIdMap == 0) && (Xhc->Usb3SupOffset != 0xFFFFFFFF)) {+
SpField.Dword = XhciPsivGetPsid (Xhc, Xhc->Usb3SupOffset, PortSpeed);+ if
(SpField.Dword != 0) {+ //+ // Found the corresponding PORTSC value in
PSIV field of USB3 offset.+ //+ UsbSpeedIdMap =
USB_PORT_STAT_SUPER_SPEED;+ }+ }+ return UsbSpeedIdMap; } diff --git
a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h
b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h
index 5fe2ba4f0e..74ac6297ba 100644
--- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h
+++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h
@@ -85,6 +85,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#define XHC_SUPPORTED_PROTOCOL_DW2_OFFSET 0x08 #define
XHC_SUPPORTED_PROTOCOL_PSI_OFFSET 0x10 #define
XHC_SUPPORTED_PROTOCOL_USB2_HIGH_SPEED_PSIM 480+#define
XHC_SUPPORTED_PROTOCOL_USB2_FULL_SPEED_PSIM 12 #define
XHC_SUPPORTED_PROTOCOL_USB2_LOW_SPEED_PSIM 1500 #pragma
pack (1)--
2.37.2



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#96843): https://edk2.groups.io/g/devel/message/96843
Mute This Topic: https://groups.io/mt/95391831/1768737
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [hao.a.wu@...] -=-=-
=-=-=-=


[PATCH] MdePkg/UnitTestHostBaseLib: Remove HOST_APPLICATION limitation

Zhiguang Liu
 

Remove HOST_APPLICATION limitation for UnitTestHostBaseLib, so that
this library can be used as BaseLib by Emulator.
Also, add some missing files

Cc: Michael D Kinney <michael.d.kinney@...>
Cc: Liming Gao <gaoliming@...>
Signed-off-by: Ray Ni <ray.ni@...>
---
MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf b/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
index 09a610c31c..fefa2e79f6 100644
--- a/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
+++ b/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
@@ -1,7 +1,7 @@
## @file
# Base Library implementation for use with host based unit tests.
#
-# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.<BR>
# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
# Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
@@ -18,7 +18,7 @@
FILE_GUID = 9555A0D3-09BA-46C4-A51A-45198E3C765E
MODULE_TYPE = BASE
VERSION_STRING = 1.1
- LIBRARY_CLASS = BaseLib|HOST_APPLICATION
+ LIBRARY_CLASS = BaseLib
LIBRARY_CLASS = UnitTestHostBaseLib|HOST_APPLICATION

#
@@ -128,6 +128,7 @@
X86RdRand.c
X86SpeculationBarrier.c
X86UnitTestHost.c
+ IntelTdxNull.c

[Sources.X64]
X64/LongJump.nasm
@@ -168,6 +169,7 @@
X64/RdRand.nasm
ChkStkGcc.c | GCC
X86UnitTestHost.c
+ IntelTdxNull.c

[Sources.EBC]
Ebc/CpuBreakpoint.c
--
2.31.1.windows.1


[PATCH] MdePkg/BaseCpuLib: Remove assembly for CpuFlushTlb

Zhiguang Liu
 

For different compilers, both IA32 and X64 can use
Ia32/CpuFlushTlbGcc.c, which is C code (no inline assembly code).
To simplify, remove other assemly file for CpuFlushTlb,
and rename Ia32/CpuFlushTlbGcc.c to Ia32/CpuFlushTlb.c.

Cc: Michael D Kinney <michael.d.kinney@...>
Cc: Liming Gao <gaoliming@...>
Signed-off-by: Ray Ni <ray.ni@...>
Signed-off-by: Zhiguang Liu <zhiguang.liu@...>
---
MdePkg/Library/BaseCpuLib/BaseCpuLib.inf | 10 ++----
MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlb.c | 12 +++----
.../Library/BaseCpuLib/Ia32/CpuFlushTlb.nasm | 31 ------------------
.../Library/BaseCpuLib/Ia32/CpuFlushTlbGcc.c | 25 ---------------
.../Library/BaseCpuLib/X64/CpuFlushTlb.nasm | 32 -------------------
5 files changed, 9 insertions(+), 101 deletions(-)
delete mode 100644 MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlb.nasm
delete mode 100644 MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlbGcc.c
delete mode 100644 MdePkg/Library/BaseCpuLib/X64/CpuFlushTlb.nasm

diff --git a/MdePkg/Library/BaseCpuLib/BaseCpuLib.inf b/MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
index 6b230f6e6d..0feb592638 100644
--- a/MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
+++ b/MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
@@ -4,7 +4,7 @@
# CPU Library implemented using ASM functions for IA32, X64, ARM, AARCH64,
# PAL CALLs for IPF, and empty functions for EBC.
#
-# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.<BR>
# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
# Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
@@ -31,16 +31,12 @@

[Sources.IA32]
Ia32/CpuSleep.c | MSFT
- Ia32/CpuFlushTlb.c | MSFT
-
Ia32/CpuSleep.nasm| INTEL
- Ia32/CpuFlushTlb.nasm| INTEL
-
Ia32/CpuSleepGcc.c | GCC
- Ia32/CpuFlushTlbGcc.c | GCC
+ Ia32/CpuFlushTlb.c

[Sources.X64]
- X64/CpuFlushTlb.nasm
+ Ia32/CpuFlushTlb.c
X64/CpuSleep.nasm


diff --git a/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlb.c b/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlb.c
index 549f4eb8a0..17a351d054 100644
--- a/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlb.c
+++ b/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlb.c
@@ -1,11 +1,14 @@
/** @file
- CpuFlushTlb function.
+ CpuFlushTlb function for Ia32/X64.

- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
+ Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent

**/

+#include <Library/BaseLib.h>
+
/**
Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.

@@ -18,8 +21,5 @@ CpuFlushTlb (
VOID
)
{
- _asm {
- mov eax, cr3
- mov cr3, eax
- }
+ AsmWriteCr3 (AsmReadCr3 ());
}
diff --git a/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlb.nasm b/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlb.nasm
deleted file mode 100644
index bc3b68e3f2..0000000000
--- a/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlb.nasm
+++ /dev/null
@@ -1,31 +0,0 @@
-;------------------------------------------------------------------------------ ;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
-; SPDX-License-Identifier: BSD-2-Clause-Patent
-;
-; Module Name:
-;
-; CpuFlushTlb.Asm
-;
-; Abstract:
-;
-; CpuFlushTlb function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; CpuFlushTlb (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(CpuFlushTlb)
-ASM_PFX(CpuFlushTlb):
- mov eax, cr3
- mov cr3, eax ; moving to CR3 flushes TLB
- ret
-
diff --git a/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlbGcc.c b/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlbGcc.c
deleted file mode 100644
index ee44f2ea6e..0000000000
--- a/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlbGcc.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/** @file
- CpuFlushTlb function for Ia32/X64 GCC.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
- Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include <Library/BaseLib.h>
-
-/**
- Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
-
- Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
-
-**/
-VOID
-EFIAPI
-CpuFlushTlb (
- VOID
- )
-{
- AsmWriteCr3 (AsmReadCr3 ());
-}
diff --git a/MdePkg/Library/BaseCpuLib/X64/CpuFlushTlb.nasm b/MdePkg/Library/BaseCpuLib/X64/CpuFlushTlb.nasm
deleted file mode 100644
index 8ddf7a2864..0000000000
--- a/MdePkg/Library/BaseCpuLib/X64/CpuFlushTlb.nasm
+++ /dev/null
@@ -1,32 +0,0 @@
-;------------------------------------------------------------------------------ ;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
-; SPDX-License-Identifier: BSD-2-Clause-Patent
-;
-; Module Name:
-;
-; CpuFlushTlb.Asm
-;
-; Abstract:
-;
-; CpuFlushTlb function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; CpuFlushTlb (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(CpuFlushTlb)
-ASM_PFX(CpuFlushTlb):
- mov rax, cr3
- mov cr3, rax
- ret
-
--
2.31.1.windows.1


[PATCH EDK2 v2 1/1] CryptoPkg/BaseCryptLib:time overflow

wenyi,xie
 

From: Zihong Yi <yizihong@...>

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

In CrtLibSupport.h, time_t is defined as INT32, and its maximum value
is 2147483647. That is, the corresponding maximum timestamp is
2038-01-19 11:14:07. Therefore, overflow occurs when the test time
exceeds 2038-01-19 11:14:07. So change the type of time_t to INT64 and
also change the type of variables in function gmtime which calculated
with time_t.

Cc: Jiewen Yao <jiewen.yao@...>
Cc: Jian J Wang <jian.j.wang@...>
Cc: Xiaoyu Lu <xiaoyu1.lu@...>
Cc: Guomin Jiang <guomin.jiang@...>
Signed-off-by: Zihong Yi <yizihong@...>
---
CryptoPkg/Library/Include/CrtLibSupport.h | 2 +-
CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c | 51 ++++++++++++++------
2 files changed, 38 insertions(+), 15 deletions(-)

diff --git a/CryptoPkg/Library/Include/CrtLibSupport.h b/CryptoPkg/Library/Include/CrtLibSupport.h
index 5072c343da57..94b0e6b6014f 100644
--- a/CryptoPkg/Library/Include/CrtLibSupport.h
+++ b/CryptoPkg/Library/Include/CrtLibSupport.h
@@ -109,7 +109,7 @@ typedef UINTN off_t;
typedef UINTN u_int;
typedef INTN ptrdiff_t;
typedef INTN ssize_t;
-typedef INT32 time_t;
+typedef INT64 time_t;
typedef UINT8 __uint8_t;
typedef UINT8 sa_family_t;
typedef UINT8 u_char;
diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c b/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c
index bf8a5325817f..2dfc6fe6c593 100644
--- a/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c
+++ b/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c
@@ -15,7 +15,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
// -- Time Management Routines --
//

-#define IsLeap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))
#define SECSPERMIN (60)
#define SECSPERHOUR (60 * 60)
#define SECSPERDAY (24 * SECSPERHOUR)
@@ -60,6 +59,26 @@ UINTN CumulativeDays[2][14] = {
}
};

+/* Check the year is leap or not. */
+// BOOLEAN IsLeap(
+// INTN timer
+// )
+BOOLEAN
+IsLeap (
+ time_t timer
+ )
+{
+ INT64 Remainder1;
+ INT64 Remainder2;
+ INT64 Remainder3;
+
+ DivS64x64Remainder (timer, 4, &Remainder1);
+ DivS64x64Remainder (timer, 100, &Remainder2);
+ DivS64x64Remainder (timer, 400, &Remainder3);
+
+ return (Remainder1 == 0 && (Remainder2 != 0 || Remainder3 == 0));
+}
+
/* Get the system time as seconds elapsed since midnight, January 1, 1970. */
// INTN time(
// INTN *timer
@@ -117,12 +136,13 @@ gmtime (
)
{
struct tm *GmTime;
- UINT16 DayNo;
- UINT32 DayRemainder;
+ UINT64 DayNo;
+ UINT64 DayRemainder;
time_t Year;
time_t YearNo;
- UINT16 TotalDays;
- UINT16 MonthNo;
+ UINT32 TotalDays;
+ UINT32 MonthNo;
+ INT64 Remainder;

if (timer == NULL) {
return NULL;
@@ -135,18 +155,21 @@ gmtime (

ZeroMem ((VOID *)GmTime, (UINTN)sizeof (struct tm));

- DayNo = (UINT16)(*timer / SECSPERDAY);
- DayRemainder = (UINT32)(*timer % SECSPERDAY);
+ DayNo = (UINT64)DivS64x64Remainder (*timer, SECSPERDAY, &Remainder);
+ DayRemainder = (UINT64)Remainder;

- GmTime->tm_sec = (int)(DayRemainder % SECSPERMIN);
- GmTime->tm_min = (int)((DayRemainder % SECSPERHOUR) / SECSPERMIN);
- GmTime->tm_hour = (int)(DayRemainder / SECSPERHOUR);
- GmTime->tm_wday = (int)((DayNo + 4) % 7);
+ DivS64x64Remainder (DayRemainder, SECSPERMIN, &Remainder);
+ GmTime->tm_sec = (int)Remainder;
+ DivS64x64Remainder (DayRemainder, SECSPERHOUR, &Remainder);
+ GmTime->tm_min = (int)DivS64x64Remainder (Remainder, SECSPERMIN, NULL);
+ GmTime->tm_hour = (int)DivS64x64Remainder (DayRemainder, SECSPERHOUR, NULL);
+ DivS64x64Remainder ((DayNo + 4), 7, &Remainder);
+ GmTime->tm_wday = (int)Remainder;

for (Year = 1970, YearNo = 0; DayNo > 0; Year++) {
- TotalDays = (UINT16)(IsLeap (Year) ? 366 : 365);
+ TotalDays = (UINT32)(IsLeap (Year) ? 366 : 365);
if (DayNo >= TotalDays) {
- DayNo = (UINT16)(DayNo - TotalDays);
+ DayNo = (UINT64)(DayNo - TotalDays);
YearNo++;
} else {
break;
@@ -158,7 +181,7 @@ gmtime (

for (MonthNo = 12; MonthNo > 1; MonthNo--) {
if (DayNo >= CumulativeDays[IsLeap (Year)][MonthNo]) {
- DayNo = (UINT16)(DayNo - (UINT16)(CumulativeDays[IsLeap (Year)][MonthNo]));
+ DayNo = (UINT64)(DayNo - (UINT32)(CumulativeDays[IsLeap (Year)][MonthNo]));
break;
}
}
--
2.20.1.windows.1


[PATCH EDK2 v2 0/1] CryptoPkg/BaseCryptLib:time overflow

wenyi,xie
 

Main Changes since v1 :
1.fix code format

Zihong Yi (1):
CryptoPkg/BaseCryptLib:time overflow

CryptoPkg/Library/Include/CrtLibSupport.h | 2 +-
CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c | 51 ++++++++++++++------
2 files changed, 38 insertions(+), 15 deletions(-)

--
2.20.1.windows.1


Re: [PATCH 1/1] RedfishPkg: Fix typos of the .inc filenames

Nickle Wang
 

Reviewed-by: Nickle Wang <nicklew@...>

Regards,
Nickle

-----Original Message-----
From: Chang, Abner <Abner.Chang@...>
Sent: Friday, December 2, 2022 7:36 AM
To: Rebecca Cran <rebecca@...>; devel@edk2.groups.io; Nickle Wang <nicklew@...>
Cc: Igor Kulchytskyy <igork@...>
Subject: RE: [PATCH 1/1] RedfishPkg: Fix typos of the .inc filenames

External email: Use caution opening links or attachments


[AMD Official Use Only - General]

Reviewed-by: Abner Chang <abner.chang@...>

-----Original Message-----
From: Rebecca Cran <rebecca@...>
Sent: Friday, December 2, 2022 12:04 AM
To: devel@edk2.groups.io; Chang, Abner <Abner.Chang@...>; Nickle
Wang <nicklew@...>
Cc: Rebecca Cran <rebecca@...>
Subject: [PATCH 1/1] RedfishPkg: Fix typos of the .inc filenames

Caution: This message originated from an External Source. Use proper
caution when opening attachments, clicking links, or responding.


Fix a typo of "RedfishLibs.dsc.inc" in RedfishLibs.dsc.inc, and
correct the name of the .fdf.inc filename in Redfish.fdf.inc.

Signed-off-by: Rebecca Cran <rebecca@...>
---
RedfishPkg/RedfishLibs.dsc.inc | 2 +-
RedfishPkg/Redfish.fdf.inc | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/RedfishPkg/RedfishLibs.dsc.inc
b/RedfishPkg/RedfishLibs.dsc.inc index 50e5dda77357..56950b711f12
100644
--- a/RedfishPkg/RedfishLibs.dsc.inc
+++ b/RedfishPkg/RedfishLibs.dsc.inc
@@ -2,7 +2,7 @@
# Redfish DSC include file for [LibraryClasses*] section of all Architectures.
#
# This file can be included to the [LibraryClasses*] section(s) of a
platform DSC file -# by using "!include RedfishPkg/RedfisLibs.dsc.inc"
to specify the library instances
+# by using "!include RedfishPkg/RedfishLibs.dsc.inc" to specify the
+library instances
# of EDKII network library classes.
#
# (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
diff --git a/RedfishPkg/Redfish.fdf.inc b/RedfishPkg/Redfish.fdf.inc
index
60f31cfcee0c..67e046991424 100644
--- a/RedfishPkg/Redfish.fdf.inc
+++ b/RedfishPkg/Redfish.fdf.inc
@@ -2,7 +2,7 @@
# Redfish FDF include file for [FV*] section of all Architectures.
#
# This file can be included to the [FV*] section(s) of a platform FDF
file -# by using "!include RedfishPkg/RedfisLibs.fdf.inc" to specify
the module instances
+# by using "!include RedfishPkg/Redfish.fdf.inc" to specify the
+module instances
# to be built in the firmware volume.
#
# (C) Copyright 2020-2021 Hewlett Packard Enterprise Development
LP<BR>
--
2.30.2


[PATCH] SecurityPkg: check return value of GetEfiGlobalVariable2() in DxeImageVerificationHandler()

Jon Maloy
 

Fixes: CVE-2019-14560

GetEfiGlobalVariable2() is used in some instances when looking up the
SecureBoot UEFI variable. The API can fail in certain circumstances,
for example, if AllocatePool() fails or if gRT->GetVariable() fails.
In the case of secure boot checks, it is critical that this return value
is checked. if an attacker can cause the API to fail, it would currently
constitute a secure boot bypass.

This return value check is missing in the function DxeImageVerificationHandler(),
so we add it here.

This commit is almost identical to one suggested by Jian J Wang <jian.j.wang@...>
on 2019-09-09, but that one was for some reason never posted to the edk2-devel
list. We now make a new attempt to get it reviewed and applied.

Cc: Jiewen Yao <jiewen.yao@...>
Cc: Jian J Wang <jian.j.wang@...>
Cc: Min Xu <min.m.xu@...>
Cc: devel@edk2.groups.io

Signed-off-by: Jon Maloy <jmaloy@...>
---
.../DxeImageVerificationLib.c | 39 +++++++++++--------
1 file changed, 23 insertions(+), 16 deletions(-)

diff --git a/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c b/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c
index 66e2f5eaa3c0..4ae0bd8b20db 100644
--- a/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c
+++ b/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c
@@ -1686,6 +1686,7 @@ DxeImageVerificationHandler (
RETURN_STATUS PeCoffStatus;
EFI_STATUS HashStatus;
EFI_STATUS DbStatus;
+ EFI_STATUS SecBootStatus;
BOOLEAN IsFound;

SignatureList = NULL;
@@ -1742,23 +1743,29 @@ DxeImageVerificationHandler (
CpuDeadLoop ();
}

- GetEfiGlobalVariable2 (EFI_SECURE_BOOT_MODE_NAME, (VOID **)&SecureBoot, NULL);
- //
- // Skip verification if SecureBoot variable doesn't exist.
- //
- if (SecureBoot == NULL) {
- return EFI_SUCCESS;
- }
+ SecBootStatus = GetEfiGlobalVariable2 (EFI_SECURE_BOOT_MODE_NAME, (VOID **)&SecureBoot, NULL);
+ if (!EFI_ERROR (SecBootStatus)) {
+ if (SecureBoot == NULL) {
+ //
+ // Skip verification if SecureBoot variable doesn't exist.
+ //
+ return EFI_SUCCESS;
+ } else {
+ //
+ // Skip verification if SecureBoot is disabled but not AuditMode
+ //
+ if (*SecureBoot == SECURE_BOOT_MODE_DISABLE) {
+ FreePool (SecureBoot);
+ return EFI_SUCCESS;
+ }
+ FreePool (SecureBoot);
+ }
+ } else {
+ //
+ // Assume SecureBoot enabled in the case of error.
+ //
+ }

- //
- // Skip verification if SecureBoot is disabled but not AuditMode
- //
- if (*SecureBoot == SECURE_BOOT_MODE_DISABLE) {
- FreePool (SecureBoot);
- return EFI_SUCCESS;
- }
-
- FreePool (SecureBoot);

//
// Read the Dos header.
--
2.35.3


Re: [PATCH V1 1/1] OvmfPkg/PlatformInitLib: Add check to NvVarStoreFV HeaderLength

Yao, Jiewen
 

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Yao,
Jiewen
Sent: Thursday, December 1, 2022 2:27 PM
To: Xu, Min M <min.m.xu@...>; devel@edk2.groups.io
Cc: Aktas, Erdem <erdemaktas@...>; James Bottomley
<jejb@...>; Gerd Hoffmann <kraxel@...>; Tom
Lendacky <thomas.lendacky@...>
Subject: Re: [edk2-devel] [PATCH V1 1/1] OvmfPkg/PlatformInitLib: Add
check to NvVarStoreFV HeaderLength

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

-----Original Message-----
From: Xu, Min M <min.m.xu@...>
Sent: Sunday, November 27, 2022 3:00 PM
To: devel@edk2.groups.io
Cc: Xu, Min M <min.m.xu@...>; Aktas, Erdem
<erdemaktas@...>; James Bottomley <jejb@...>;
Yao,
Jiewen <jiewen.yao@...>; Gerd Hoffmann <kraxel@...>;
Tom Lendacky <thomas.lendacky@...>
Subject: [PATCH V1 1/1] OvmfPkg/PlatformInitLib: Add check to
NvVarStoreFV HeaderLength

From: Min M Xu <min.m.xu@...>

There should be a check that the FV HeaderLength cannot be an odd
number. Otherwise in the following CalculateSum16 there would be an
ASSERT.

In
ValidateFvHeader@QemuFlashFvbServicesRuntimeDxe/FwBlockServices.c
there a is similar check to the FwVolHeader->HeaderLength.

Cc: Erdem Aktas <erdemaktas@...>
Cc: James Bottomley <jejb@...>
Cc: Jiewen Yao <jiewen.yao@...>
Cc: Gerd Hoffmann <kraxel@...>
Cc: Tom Lendacky <thomas.lendacky@...>
Signed-off-by: Min Xu <min.m.xu@...>
---
OvmfPkg/Library/PlatformInitLib/Platform.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/OvmfPkg/Library/PlatformInitLib/Platform.c
b/OvmfPkg/Library/PlatformInitLib/Platform.c
index 2582689ffe35..77f22de046f2 100644
--- a/OvmfPkg/Library/PlatformInitLib/Platform.c
+++ b/OvmfPkg/Library/PlatformInitLib/Platform.c
@@ -653,6 +653,7 @@ PlatformValidateNvVarStore (
(!CompareGuid (&FvHdrGUID, &NvVarStoreFvHeader-
FileSystemGuid))
||
(NvVarStoreFvHeader->Signature != EFI_FVH_SIGNATURE) ||
(NvVarStoreFvHeader->Attributes != 0x4feff) ||
+ ((NvVarStoreFvHeader->HeaderLength & 0x01) != 0) ||
(NvVarStoreFvHeader->Revision != EFI_FVH_REVISION) ||
(NvVarStoreFvHeader->FvLength != NvVarStoreSize)
)
--
2.29.2.windows.2




Re: [PATCH 1/1] MdeModulePkg: Put USB DEBUGs that occur for bulk timeouts under VERBOSE

Wu, Hao A
 

Sorry for a question.

For the changes in EhcBulkTransfer() and XhcBulkTransfer(), is it feasible
to distinguish timeout cases with other error cases and only adjust
timeout related messages to VERBOSE level?

Best Regards,
Hao Wu

-----Original Message-----
From: Rebecca Cran <rebecca@...>
Sent: Friday, December 2, 2022 5:00 AM
To: devel@edk2.groups.io; Wang, Jian J <jian.j.wang@...>; Gao, Liming
<gaoliming@...>; Wu, Hao A <hao.a.wu@...>; Ni, Ray
<ray.ni@...>
Cc: Rebecca Cran <rebecca@...>
Subject: [PATCH 1/1] MdeModulePkg: Put USB DEBUGs that occur for bulk
timeouts under VERBOSE

With the pending commit of UsbNetworkPkg, it will become common for
UsbBulkTransfer calls to timeout, given that the drivers are called from
MnpSystemPoll every MNP_SYS_POLL_INTERVAL milliseconds: the drivers
check for network packets by calling UsbBulkTransfer with a timeout of
1ms.

Avoid console spam by moving DEBUG messages that occur each time a bulk
transfer request times out from DEBUG_ERROR to DEBUG_VERBOSE, for both
EHCI and XHCI drivers.

Signed-off-by: Rebecca Cran <rebecca@...>
---
MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c | 2 +-
MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c | 2 +-
MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c | 2 +-
MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 6 +++---
4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
index 0b7270f4e930..4f1d990c8bf1 100644
--- a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
+++ b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
@@ -932,7 +932,7 @@ EhcBulkTransfer (
gBS->RestoreTPL (OldTpl);

if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "EhcBulkTransfer: error - %r, transfer - %x\n",
Status, *TransferResult));
+ DEBUG ((DEBUG_VERBOSE, "EhcBulkTransfer: error - %r, transfer - %x\n",
Status, *TransferResult));
}

return Status;
diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
b/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
index 5da26afbe120..6967aabceb78 100644
--- a/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
+++ b/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
@@ -702,7 +702,7 @@ EhcExecTransfer (
}

if (!Finished) {
- DEBUG ((DEBUG_ERROR, "EhcExecTransfer: transfer not finished
in %dms\n", (UINT32)TimeOut));
+ DEBUG ((DEBUG_VERBOSE, "EhcExecTransfer: transfer not finished
in %dms\n", (UINT32)TimeOut));
EhcDumpQh (Urb->Qh, NULL, FALSE);

Status = EFI_TIMEOUT;
diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
index c05431ff30ec..e0347970c9ad 100644
--- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
+++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
@@ -1304,7 +1304,7 @@ XhcBulkTransfer (

ON_EXIT:
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "XhcBulkTransfer: error - %r, transfer - %x\n",
Status, *TransferResult));
+ DEBUG ((DEBUG_VERBOSE, "XhcBulkTransfer: error - %r, transfer - %x\n",
Status, *TransferResult));
}

gBS->RestoreTPL (OldTpl);
diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
index 13b0400e83d7..13247f7b0dfc 100644
--- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
+++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
@@ -734,7 +734,7 @@ XhcDequeueTrbFromEndpoint (
Dci = XhcEndpointToDci (Urb->Ep.EpAddr, (UINT8)(Urb->Ep.Direction));
ASSERT (Dci < 32);

- DEBUG ((DEBUG_INFO, "Stop Slot = %x,Dci = %x\n", SlotId, Dci));
+ DEBUG ((DEBUG_VERBOSE, "Stop Slot = %x,Dci = %x\n", SlotId, Dci));

//
// 1) Send Stop endpoint command to stop xHC from executing of the TDs on
the endpoint
@@ -3376,7 +3376,7 @@ XhcStopEndpoint (
EVT_TRB_COMMAND_COMPLETION *EvtTrb;
CMD_TRB_STOP_ENDPOINT CmdTrbStopED;

- DEBUG ((DEBUG_INFO, "XhcStopEndpoint: Slot = 0x%x, Dci = 0x%x\n", SlotId,
Dci));
+ DEBUG ((DEBUG_VERBOSE, "XhcStopEndpoint: Slot = 0x%x, Dci = 0x%x\n",
SlotId, Dci));

//
// When XhcCheckUrbResult waits for the Stop_Endpoint completion, it also
checks
@@ -3497,7 +3497,7 @@ XhcSetTrDequeuePointer (
CMD_SET_TR_DEQ_POINTER CmdSetTRDeq;
EFI_PHYSICAL_ADDRESS PhyAddr;

- DEBUG ((DEBUG_INFO, "XhcSetTrDequeuePointer: Slot = 0x%x, Dci = 0x%x,
Urb = 0x%x\n", SlotId, Dci, Urb));
+ DEBUG ((DEBUG_VERBOSE, "XhcSetTrDequeuePointer: Slot = 0x%x, Dci =
0x%x, Urb = 0x%x\n", SlotId, Dci, Urb));

//
// Send stop endpoint command to transit Endpoint from running to stop state
--
2.30.2


[PATCH 2/2] ArmPkg: Improve formatting of docs in ArmExceptionLib/ArmExceptionLib.c

Rebecca Cran <quic_rcran@...>
 

Improve the formatting of the documentation for functions in
ArmExceptionLib/ArmExceptionLib.c.

Signed-off-by: Rebecca Cran <rebecca@...>
---
ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c | 115 +++++++++++---------
1 file changed, 64 insertions(+), 51 deletions(-)

diff --git a/ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c b/ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c
index b20472008b3f..057ab3a9f201 100644
--- a/ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c
+++ b/ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c
@@ -69,19 +69,24 @@ STATIC CONST BOOLEAN gArmRelocateVectorTable = FALSE;
#endif

/**
-Initializes all CPU exceptions entries and provides the default exception handlers.
+ Initializes all CPU exceptions entries and provides the default exception
+ handlers.

-Caller should try to get an array of interrupt and/or exception vectors that are in use and need to
-persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification.
-If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL.
-If VectorInfo is not NULL, the exception vectors will be initialized per vector attribute accordingly.
+ Caller should try to get an array of interrupt and/or exception vectors that
+ are in use and need to persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3
+ specification.
+ If caller cannot get reserved vector list or it does not exists, set
+ VectorInfo to NULL.
+ If VectorInfo is not NULL, the exception vectors will be initialized per
+ vector attribute accordingly.

-@param[in] VectorInfo Pointer to reserved vector list.
+ @param[in] VectorInfo Pointer to reserved vector list.

-@retval EFI_SUCCESS CPU Exception Entries have been successfully initialized
-with default exception handlers.
-@retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL.
-@retval EFI_UNSUPPORTED This function is not supported.
+ @retval EFI_SUCCESS CPU Exception Entries have been successfully
+ initialized with default exception handlers.
+ @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if
+ VectorInfo is not NULL.
+ @retval EFI_UNSUPPORTED This function is not supported.

**/
EFI_STATUS
@@ -130,19 +135,23 @@ InitializeCpuExceptionHandlers (
}

/**
-Copies exception handlers to the specified address.
+ Copies exception handlers to the specified address.

-Caller should try to get an array of interrupt and/or exception vectors that are in use and need to
-persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification.
-If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL.
-If VectorInfo is not NULL, the exception vectors will be initialized per vector attribute accordingly.
+ Caller should try to get an array of interrupt and/or exception vectors that
+ are in use and need to persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3
+ specification.
+ If caller cannot get reserved vector list or it does not exists, set
+ VectorInfo to NULL.
+ If VectorInfo is not NULL, the exception vectors will be initialized per
+ vector attribute accordingly.

-@param[in] BaseAddress Address to copy exception handlers to.
+ @param[in] BaseAddress Address to copy exception handlers to.

-@retval EFI_SUCCESS CPU Exception Entries have been successfully initialized
-with default exception handlers.
-@retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL.
-@retval EFI_UNSUPPORTED This function is not supported.
+ @retval EFI_SUCCESS CPU Exception Entries have been successfully
+ initialized with default exception handlers.
+ @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if
+ VectorInfo is not NULL.
+ @retval EFI_UNSUPPORTED This function is not supported.

**/
STATIC
@@ -196,29 +205,33 @@ CopyExceptionHandlers (
}

/**
-Registers a function to be called from the processor exception handler. (On ARM/AArch64 this only
-provides exception handlers, not interrupt handling which is provided through the Hardware Interrupt
-Protocol.)
+ Registers a function to be called from the processor exception handler.
+ (On ARM/AArch64 this only provides exception handlers, not interrupt handling
+ which is provided through the Hardware Interrupt Protocol.)

-This function registers and enables the handler specified by ExceptionHandler for a processor
-interrupt or exception type specified by ExceptionType. If ExceptionHandler is NULL, then the
-handler for the processor interrupt or exception type specified by ExceptionType is uninstalled.
-The installed handler is called once for each processor interrupt or exception.
-NOTE: This function should be invoked after InitializeCpuExceptionHandlers() is invoked,
-otherwise EFI_UNSUPPORTED returned.
+ This function registers and enables the handler specified by ExceptionHandler
+ for a processor interrupt or exception type specified by ExceptionType. If
+ ExceptionHandler is NULL, then the handler for the processor interrupt or
+ exception type specified by ExceptionType is uninstalled.
+ The installed handler is called once for each processor interrupt or
+ exception.
+ NOTE: This function should be invoked after InitializeCpuExceptionHandlers()
+ is invoked, otherwise EFI_UNSUPPORTED returned.

-@param[in] ExceptionType Defines which interrupt or exception to hook.
-@param[in] ExceptionHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called
-when a processor interrupt occurs. If this parameter is NULL, then the handler
-will be uninstalled.
+ @param[in] ExceptionType Defines which interrupt or exception to hook.
+ @param[in] ExceptionHandler A pointer to a function of type
+ EFI_CPU_INTERRUPT_HANDLER that is called when a
+ processor interrupt occurs. If this parameter is
+ NULL, then the handler will be uninstalled.

-@retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.
-@retval EFI_ALREADY_STARTED ExceptionHandler is not NULL, and a handler for ExceptionType was
-previously installed.
-@retval EFI_INVALID_PARAMETER ExceptionHandler is NULL, and a handler for ExceptionType was not
-previously installed.
-@retval EFI_UNSUPPORTED The interrupt specified by ExceptionType is not supported,
-or this function is not supported.
+ @retval EFI_SUCCESS The handler for the processor interrupt was
+ successfully installed or uninstalled.
+ @retval EFI_ALREADY_STARTED ExceptionHandler is not NULL, and a handler
+ for ExceptionType was previously installed.
+ @retval EFI_INVALID_PARAMETER ExceptionHandler is NULL, and a handler for
+ ExceptionType was not previously installed.
+ @retval EFI_UNSUPPORTED The interrupt specified by ExceptionType is not
+ supported, or this function is not supported.
**/
RETURN_STATUS
RegisterCpuInterruptHandler (
@@ -240,19 +253,19 @@ RegisterCpuInterruptHandler (
}

/**
-Register exception handler.
+ Register exception handler.

-@param ExceptionType Defines which interrupt or exception to hook. Type EFI_EXCEPTION_TYPE and
-the valid values for this parameter are defined in EFI_DEBUG_SUPPORT_PROTOCOL
-of the UEFI 2.0 specification.
-@param InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER
-that is called when a processor interrupt occurs.
-If this parameter is NULL, then the handler will be uninstalled.
+ @param ExceptionType Defines which interrupt or exception to hook. Type EFI_EXCEPTION_TYPE and
+ the valid values for this parameter are defined in EFI_DEBUG_SUPPORT_PROTOCOL
+ of the UEFI 2.0 specification.
+ @param InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER
+ that is called when a processor interrupt occurs.
+ If this parameter is NULL, then the handler will be uninstalled.

-@retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.
-@retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was previously installed.
-@retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not previously installed.
-@retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported.
+ @retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.
+ @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was previously installed.
+ @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not previously installed.
+ @retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported.

**/
EFI_STATUS
--
2.30.2


[PATCH 1/2] ArmPkg: Fix incorrect parameter list in doxygen comments

Rebecca Cran <quic_rcran@...>
 

Fix the doxygen comments for CopyExceptionHandlers by removing the
nonexistant "VectorInfo" parameter and replacing it with "BaseAddress".

Fix the doxygen comments for RegisterCpuInterruptHandler by removing
the nonexistant parameter "This".

Signed-off-by: Rebecca Cran <rebecca@...>
---
ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c b/ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c
index a521c33f3281..b20472008b3f 100644
--- a/ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c
+++ b/ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c
@@ -137,7 +137,7 @@ persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification.
If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL.
If VectorInfo is not NULL, the exception vectors will be initialized per vector attribute accordingly.

-@param[in] VectorInfo Pointer to reserved vector list.
+@param[in] BaseAddress Address to copy exception handlers to.

@retval EFI_SUCCESS CPU Exception Entries have been successfully initialized
with default exception handlers.
@@ -242,7 +242,6 @@ RegisterCpuInterruptHandler (
/**
Register exception handler.

-@param This A pointer to the SMM_CPU_SERVICE_PROTOCOL instance.
@param ExceptionType Defines which interrupt or exception to hook. Type EFI_EXCEPTION_TYPE and
the valid values for this parameter are defined in EFI_DEBUG_SUPPORT_PROTOCOL
of the UEFI 2.0 specification.
--
2.30.2


[PATCH 0/2] ArmPkg: Improve doxygen comments in ArmExceptionLib

Rebecca Cran <quic_rcran@...>
 

Fix incorrect parameters and improve formatting of doxygen comments in
ArmExceptionLib.

Rebecca Cran (2):
ArmPkg: Fix incorrect parameter list in doxygen comments
ArmPkg: Improve formatting of docs in
ArmExceptionLib/ArmExceptionLib.c

ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c | 116 +++++++++++---------
1 file changed, 64 insertions(+), 52 deletions(-)

--
2.30.2


Re: [PATCH 1/1] RedfishPkg: Fix typos of the .inc filenames

Chang, Abner
 

[AMD Official Use Only - General]

Reviewed-by: Abner Chang <abner.chang@...>

-----Original Message-----
From: Rebecca Cran <rebecca@...>
Sent: Friday, December 2, 2022 12:04 AM
To: devel@edk2.groups.io; Chang, Abner <Abner.Chang@...>; Nickle
Wang <nicklew@...>
Cc: Rebecca Cran <rebecca@...>
Subject: [PATCH 1/1] RedfishPkg: Fix typos of the .inc filenames

Caution: This message originated from an External Source. Use proper caution
when opening attachments, clicking links, or responding.


Fix a typo of "RedfishLibs.dsc.inc" in RedfishLibs.dsc.inc, and correct the name
of the .fdf.inc filename in Redfish.fdf.inc.

Signed-off-by: Rebecca Cran <rebecca@...>
---
RedfishPkg/RedfishLibs.dsc.inc | 2 +-
RedfishPkg/Redfish.fdf.inc | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/RedfishPkg/RedfishLibs.dsc.inc b/RedfishPkg/RedfishLibs.dsc.inc
index 50e5dda77357..56950b711f12 100644
--- a/RedfishPkg/RedfishLibs.dsc.inc
+++ b/RedfishPkg/RedfishLibs.dsc.inc
@@ -2,7 +2,7 @@
# Redfish DSC include file for [LibraryClasses*] section of all Architectures.
#
# This file can be included to the [LibraryClasses*] section(s) of a platform DSC
file -# by using "!include RedfishPkg/RedfisLibs.dsc.inc" to specify the library
instances
+# by using "!include RedfishPkg/RedfishLibs.dsc.inc" to specify the
+library instances
# of EDKII network library classes.
#
# (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR> diff --git
a/RedfishPkg/Redfish.fdf.inc b/RedfishPkg/Redfish.fdf.inc index
60f31cfcee0c..67e046991424 100644
--- a/RedfishPkg/Redfish.fdf.inc
+++ b/RedfishPkg/Redfish.fdf.inc
@@ -2,7 +2,7 @@
# Redfish FDF include file for [FV*] section of all Architectures.
#
# This file can be included to the [FV*] section(s) of a platform FDF file -# by
using "!include RedfishPkg/RedfisLibs.fdf.inc" to specify the module instances
+# by using "!include RedfishPkg/Redfish.fdf.inc" to specify the module
+instances
# to be built in the firmware volume.
#
# (C) Copyright 2020-2021 Hewlett Packard Enterprise Development LP<BR>
--
2.30.2


[PATCH 1/1] NetworkPkg: Improve grammar in comment about MediaPresent in PxeReceive

Rebecca Cran <quic_rcran@...>
 

Improve the grammar of the comment in PxeReceive about ensuring that
MediaPresent is set to the correct value.

Signed-off-by: Rebecca Cran <rebecca@...>
---
NetworkPkg/SnpDxe/Receive.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/NetworkPkg/SnpDxe/Receive.c b/NetworkPkg/SnpDxe/Receive.c
index 41601980f25f..6a1914b84ba5 100644
--- a/NetworkPkg/SnpDxe/Receive.c
+++ b/NetworkPkg/SnpDxe/Receive.c
@@ -126,10 +126,10 @@ PxeReceive (
}

//
- // We have received a packet from network interface, which implies that the
- // network cable should be present. While, some UNDI driver may not report
- // correct media status during Snp->Initialize(). So, we need ensure
- // MediaPresent in SNP mode data is set to correct value.
+ // We have received a packet from the network interface, which implies
+ // that the network cable should be present. Some UNDI drivers may not
+ // report correct media status during Snp->Initialize(), so we need to
+ // ensure MediaPresent in SNP mode data is set to the correct value.
//
if (Snp->Mode.MediaPresentSupported && !Snp->Mode.MediaPresent) {
Snp->Mode.MediaPresent = TRUE;
--
2.30.2


[PATCH 1/1] ShellPkg: Improve "ping" output by adding equals sign after time

Rebecca Cran <quic_rcran@...>
 

The output of the "ping" command shows the time without a space between
the label and the value. e.g.:

20 bytes from 192.168.0.1 : icmp_seq=1 ttl=1 time1~2ms

Improve the readability and consistency by adding an equals sign for the
time value:

20 bytes from 192.168.0.1 : icmp_seq=1 ttl=1 time=1~2ms

Signed-off-by: Rebecca Cran <rebecca@...>
---
ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.uni | 2 +-
ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.uni | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.uni b/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.uni
index 73cf96d9e614..37fd4a11929c 100644
--- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.uni
+++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.uni
@@ -52,7 +52,7 @@
#string STR_PING_NOROUTE_FOUND #language en-US "There is no route to the destination '%B%s%N' from the source '%B%s%N' was found.\r\n"
#string STR_PING_START #language en-US "Ping %s %d data bytes.\r\n"
#string STR_PING_TIMEOUT #language en-US "Echo request sequence %d timeout.\r\n"
-#string STR_PING_REPLY_INFO #language en-US "%d bytes from %s : icmp_seq=%d ttl=%d time%d~%dms\r\n"
+#string STR_PING_REPLY_INFO #language en-US "%d bytes from %s : icmp_seq=%d ttl=%d time=%d~%dms\r\n"
#string STR_PING_STAT #language en-US "\n%d packets transmitted, %d received, %d%% packet loss, time %dms\r\n"
#string STR_PING_RTT #language en-US "\nRtt(round trip time) min=%d~%dms max=%d~%dms avg=%d~%dms\r\n"

diff --git a/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.uni b/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.uni
index 30913ae5b583..cb9d39a33fbe 100644
--- a/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.uni
+++ b/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.uni
@@ -33,7 +33,7 @@
#string STR_PING6_NOSOURCE_INDOMAIN #language en-US "No sources in %s's multicast domain.\r\n"
#string STR_PING6_START #language en-US "Ping %s %d data bytes\r\n"
#string STR_PING6_TIMEOUT #language en-US "Echo request sequence %d timeout.\r\n"
-#string STR_PING6_REPLY_INFO #language en-US "%d bytes from %s : icmp_seq=%d ttl=%d time%d~%dms\r\n"
+#string STR_PING6_REPLY_INFO #language en-US "%d bytes from %s : icmp_seq=%d ttl=%d time=%d~%dms\r\n"
#string STR_PING6_STAT #language en-US "\n%d packets transmitted, %d received, %d%% packet loss, time %dms\r\n"
#string STR_PING6_RTT #language en-US "\nRtt(round trip time) min=%d~%dms max=%d~%dms avg=%d~%dms\r\n"

--
2.30.2


[PATCH 1/1] MdeModulePkg: Put USB DEBUGs that occur for bulk timeouts under VERBOSE

Rebecca Cran <quic_rcran@...>
 

With the pending commit of UsbNetworkPkg, it will become common for
UsbBulkTransfer calls to timeout, given that the drivers are called from
MnpSystemPoll every MNP_SYS_POLL_INTERVAL milliseconds: the drivers
check for network packets by calling UsbBulkTransfer with a timeout of
1ms.

Avoid console spam by moving DEBUG messages that occur each time a bulk
transfer request times out from DEBUG_ERROR to DEBUG_VERBOSE, for both
EHCI and XHCI drivers.

Signed-off-by: Rebecca Cran <rebecca@...>
---
MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c | 2 +-
MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c | 2 +-
MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c | 2 +-
MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 6 +++---
4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
index 0b7270f4e930..4f1d990c8bf1 100644
--- a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
+++ b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
@@ -932,7 +932,7 @@ EhcBulkTransfer (
gBS->RestoreTPL (OldTpl);

if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "EhcBulkTransfer: error - %r, transfer - %x\n", Status, *TransferResult));
+ DEBUG ((DEBUG_VERBOSE, "EhcBulkTransfer: error - %r, transfer - %x\n", Status, *TransferResult));
}

return Status;
diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c b/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
index 5da26afbe120..6967aabceb78 100644
--- a/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
+++ b/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
@@ -702,7 +702,7 @@ EhcExecTransfer (
}

if (!Finished) {
- DEBUG ((DEBUG_ERROR, "EhcExecTransfer: transfer not finished in %dms\n", (UINT32)TimeOut));
+ DEBUG ((DEBUG_VERBOSE, "EhcExecTransfer: transfer not finished in %dms\n", (UINT32)TimeOut));
EhcDumpQh (Urb->Qh, NULL, FALSE);

Status = EFI_TIMEOUT;
diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
index c05431ff30ec..e0347970c9ad 100644
--- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
+++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
@@ -1304,7 +1304,7 @@ XhcBulkTransfer (

ON_EXIT:
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "XhcBulkTransfer: error - %r, transfer - %x\n", Status, *TransferResult));
+ DEBUG ((DEBUG_VERBOSE, "XhcBulkTransfer: error - %r, transfer - %x\n", Status, *TransferResult));
}

gBS->RestoreTPL (OldTpl);
diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
index 13b0400e83d7..13247f7b0dfc 100644
--- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
+++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
@@ -734,7 +734,7 @@ XhcDequeueTrbFromEndpoint (
Dci = XhcEndpointToDci (Urb->Ep.EpAddr, (UINT8)(Urb->Ep.Direction));
ASSERT (Dci < 32);

- DEBUG ((DEBUG_INFO, "Stop Slot = %x,Dci = %x\n", SlotId, Dci));
+ DEBUG ((DEBUG_VERBOSE, "Stop Slot = %x,Dci = %x\n", SlotId, Dci));

//
// 1) Send Stop endpoint command to stop xHC from executing of the TDs on the endpoint
@@ -3376,7 +3376,7 @@ XhcStopEndpoint (
EVT_TRB_COMMAND_COMPLETION *EvtTrb;
CMD_TRB_STOP_ENDPOINT CmdTrbStopED;

- DEBUG ((DEBUG_INFO, "XhcStopEndpoint: Slot = 0x%x, Dci = 0x%x\n", SlotId, Dci));
+ DEBUG ((DEBUG_VERBOSE, "XhcStopEndpoint: Slot = 0x%x, Dci = 0x%x\n", SlotId, Dci));

//
// When XhcCheckUrbResult waits for the Stop_Endpoint completion, it also checks
@@ -3497,7 +3497,7 @@ XhcSetTrDequeuePointer (
CMD_SET_TR_DEQ_POINTER CmdSetTRDeq;
EFI_PHYSICAL_ADDRESS PhyAddr;

- DEBUG ((DEBUG_INFO, "XhcSetTrDequeuePointer: Slot = 0x%x, Dci = 0x%x, Urb = 0x%x\n", SlotId, Dci, Urb));
+ DEBUG ((DEBUG_VERBOSE, "XhcSetTrDequeuePointer: Slot = 0x%x, Dci = 0x%x, Urb = 0x%x\n", SlotId, Dci, Urb));

//
// Send stop endpoint command to transit Endpoint from running to stop state
--
2.30.2


Re: [PATCH v10 16/17] CI: use ubuntu-22.04 image (Linux only)

Michael Kubacki
 

Reviewed-by: Michael Kubacki <michael.kubacki@...>

On 12/1/2022 3:28 PM, Oliver Steffen wrote:
Use the same vm_image as the other Linux CIs in
ArmVirtPkg, EmulatorPkg, and OvmfPkg.
Switch over to ubuntu-22.04 form ubuntu-latest.
Signed-off-by: Oliver Steffen <osteffen@...>
---
.azurepipelines/Ubuntu-GCC5.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.azurepipelines/Ubuntu-GCC5.yml b/.azurepipelines/Ubuntu-GCC5.yml
index ca23b684e222..48844b7dad3a 100644
--- a/.azurepipelines/Ubuntu-GCC5.yml
+++ b/.azurepipelines/Ubuntu-GCC5.yml
@@ -17,7 +17,7 @@ jobs:
- template: templates/pr-gate-build-job.yml
parameters:
tool_chain_tag: 'GCC5'
- vm_image: 'ubuntu-latest'
+ vm_image: 'ubuntu-22.04'
container: 'ghcr.io/tianocore/containers/fedora-35-build:2113a0e'
arch_list: "IA32,X64,ARM,AARCH64,RISCV64,LOONGARCH64"
usePythonVersion: '' # use Python from the container image


Re: [PATCH v10 12/17] BaseTools: remove ext_dep files for gcc

Michael Kubacki
 

Reviewed-by: Michael Kubacki <michael.kubacki@...>

On 12/1/2022 3:28 PM, Oliver Steffen wrote:
Remove BaseTools/Bin/gcc_*_ext_dep.yaml to stop
downloading gcc from external locations; use the
gcc provided by the container image instead.
The container image sets the variable GCC5_*_PREFIX accordingly.
Signed-off-by: Oliver Steffen <osteffen@...>
---
BaseTools/Bin/gcc_aarch64_linux_ext_dep.yaml | 21 ------------------
BaseTools/Bin/gcc_arm_linux_ext_dep.yaml | 21 ------------------
...gcc_loongarch64_unknown_linux_ext_dep.yaml | 22 -------------------
.../Bin/gcc_riscv64_unknown_ext_dep.yaml | 22 -------------------
4 files changed, 86 deletions(-)
delete mode 100644 BaseTools/Bin/gcc_aarch64_linux_ext_dep.yaml
delete mode 100644 BaseTools/Bin/gcc_arm_linux_ext_dep.yaml
delete mode 100644 BaseTools/Bin/gcc_loongarch64_unknown_linux_ext_dep.yaml
delete mode 100644 BaseTools/Bin/gcc_riscv64_unknown_ext_dep.yaml
diff --git a/BaseTools/Bin/gcc_aarch64_linux_ext_dep.yaml
b/BaseTools/Bin/gcc_aarch64_linux_ext_dep.yaml
deleted file mode 100644
index ff8a9e868100..000000000000
--- a/BaseTools/Bin/gcc_aarch64_linux_ext_dep.yaml
+++ /dev/null
@@ -1,21 +0,0 @@
-## @file
-# Download GCC AARCH64 compiler from Arm's release site
-# Set shell variable GCC5_AARCH64_INSTALL to this folder
-#
-# This is only downloaded when a build activates scope gcc_aarch64_linux
-#
-# Copyright (c) Microsoft Corporation.
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-##
-{
- "scope": "gcc_aarch64_linux",
- "type": "web",
- "name": "gcc_aarch64_linux",
- "source": "https://developer.arm.com/-/media/Files/downloads/gnu/11.2-2022.02/binrel/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu.tar.xz",
- "version": "11.2-2022.02",
- "sha256": "52dbac3eb71dbe0916f60a8c5ab9b7dc9b66b3ce513047baa09fae56234e53f3",
- "compression_type": "tar",
- "internal_path": "/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/",
- "flags": ["set_shell_var", ],
- "var_name": "GCC5_AARCH64_INSTALL"
-}
diff --git a/BaseTools/Bin/gcc_arm_linux_ext_dep.yaml
b/BaseTools/Bin/gcc_arm_linux_ext_dep.yaml
deleted file mode 100644
index 151cbfa4b532..000000000000
--- a/BaseTools/Bin/gcc_arm_linux_ext_dep.yaml
+++ /dev/null
@@ -1,21 +0,0 @@
-## @file
-# Download GCC ARM compiler from Arm's release site
-# Set shell variable GCC5_ARM_INSTALL to this folder
-#
-# This is only downloaded when a build activates scope gcc_arm_linux
-#
-# Copyright (c) Microsoft Corporation.
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-##
-{
- "scope": "gcc_arm_linux",
- "type": "web",
- "name": "gcc_arm_linux",
- "source": "https://developer.arm.com/-/media/Files/downloads/gnu/11.2-2022.02/binrel/gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf.tar.xz",
- "version": "11.2-2022.02",
- "sha256": "c254f7199261fe76c32ef42187502839bda7efad0a66646cf739d074eff45fad",
- "compression_type": "tar",
- "internal_path": "/gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf/",
- "flags": ["set_shell_var", ],
- "var_name": "GCC5_ARM_INSTALL"
-}
diff --git a/BaseTools/Bin/gcc_loongarch64_unknown_linux_ext_dep.yaml
b/BaseTools/Bin/gcc_loongarch64_unknown_linux_ext_dep.yaml
deleted file mode 100644
index fe9a2448531a..000000000000
--- a/BaseTools/Bin/gcc_loongarch64_unknown_linux_ext_dep.yaml
+++ /dev/null
@@ -1,22 +0,0 @@
-## @file
-# Download GCC LoongArch64 compiler from LoongArch GitHub release site
-# Set shell variable GCC5_LOONGARCH64_INSTALL to this folder
-#
-# This is only downloaded when a build activates scope
gcc_loongarch64_unknown_linux
-#
-# Copyright (c) Microsoft Corporation.
-# Copyright (c) 2022, Loongson Technology Corporation Limited. All
rights reserved.<BR>
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-##
-{
- "scope": "gcc_loongarch64_unknown_linux",
- "type": "web",
- "name": "gcc_loongarch64_unknown_linux",
- "source":"https://github.com/loongson/build-tools/releases/download/2022.09.06/loongarch64-clfs-6.3-cross-tools-gcc-full.tar.xz",
- "version": "13.0.0",
- "sha256":"27a43c5bb127794f091d0e75da0003c4d0eec28a958d8f2cc7cd290a6e6133ab",
- "compression_type": "tar",
- "internal_path": "/cross-tools/",
- "flags": ["set_shell_var", ],
- "var_name": "GCC5_LOONGARCH64_INSTALL"
-}
diff --git a/BaseTools/Bin/gcc_riscv64_unknown_ext_dep.yaml
b/BaseTools/Bin/gcc_riscv64_unknown_ext_dep.yaml
deleted file mode 100644
index 8abbcd7ba040..000000000000
--- a/BaseTools/Bin/gcc_riscv64_unknown_ext_dep.yaml
+++ /dev/null
@@ -1,22 +0,0 @@
-## @file
-# Download GCC RISCV64 compiler from RISC-V Organization release site
-# Set shell variable GCC5_RISCV64_INSTALL to this folder
-#
-# This is only downloaded when a build activates scope gcc_riscv64_unknown
-#
-# Copyright (c) Microsoft Corporation.
-# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All
rights reserved.<BR>
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-##
-{
- "scope": "gcc_riscv64_unknown",
- "type": "web",
- "name": "gcc_riscv64_unknown",
- "source": "https://raw.githubusercontent.com/riscv/riscv-uefi-edk2-docs/master/gcc-riscv-edk2-ci-toolchain/gcc-riscv-9.2.0-2020.04-x86_64_riscv64-unknown-gnu.tar.xz",
- "version": "9.2.0",
- "compression_type": "tar",
- "sha256": "28373643b69f0ce008273c3dc63f172aa1121952f1b9ae94d7485ac94af7f344",
- "internal_path": "/gcc-riscv-9.2.0-2020.04-x86_64_riscv64-unknown-gnu",
- "flags": ["set_shell_var", ],
- "var_name": "GCC5_RISCV64_INSTALL"
-}