Date   

Re: [PATCH 0/3] ArmPlatformPkg: Fix Scripts/Ds5 debugging and Makefile

Rebecca Cran
 

Also, I noticed Scripts/Makefile defaults to RVCT. Are people still using that, or has everyone moved to gcc or the newer Arm compilers?

    
-- 
Rebecca Cran


On 4/10/22 19:16, Rebecca Cran wrote:

I ran into some problems debugging EDK2 code using Development Studio with
the files under ArmPlatformPkg/Scripts and these patches fix them.

I'm using Arm Development Studio 2021.2 and not DS-5, so I'm not sure if
these changes would break things for people using the older environment.

Rebecca Cran (3):
  ArmPlatformPkg: Fix error message in Scripts/Ds5/edk2_debugger.py
  ArmPlatformPkg: Fix target initialisation in cmd_load_symbols.py
  ArmPlatformPkg: Fix EDK2_DSC check in Scripts/Makefile

 ArmPlatformPkg/Scripts/Ds5/cmd_load_symbols.py | 5 ++---
 ArmPlatformPkg/Scripts/Ds5/edk2_debugger.py    | 2 +-
 ArmPlatformPkg/Scripts/Makefile                | 2 +-
 3 files changed, 4 insertions(+), 5 deletions(-)


[PATCH 3/3] ArmPlatformPkg: Fix EDK2_DSC check in Scripts/Makefile

Rebecca Cran
 

With GNU Make 4.2.1, ifeq ($(EDK2_DSC),"") doesn't catch the case where
EDK2_DSC isn't defined. So, switch to using ifndef.

Signed-off-by: Rebecca Cran <rebecca@...>
---
ArmPlatformPkg/Scripts/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ArmPlatformPkg/Scripts/Makefile b/ArmPlatformPkg/Scripts/Makefile
index da949dc1ed56..270fc80b6ae8 100644
--- a/ArmPlatformPkg/Scripts/Makefile
+++ b/ArmPlatformPkg/Scripts/Makefile
@@ -12,7 +12,7 @@ EDK2_TOOLCHAIN ?= RVCTLINUX
EDK2_ARCH ?= ARM
EDK2_BUILD ?= DEBUG

-ifeq ($(EDK2_DSC),"")
+ifndef EDK2_DSC
$(error The Makfile macro 'EDK2_DSC' must be defined with an EDK2 DSC file.)
endif
ifeq ("$(EDK2_DSC)","ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-FVP-AArch64.dsc")
--
2.25.1


[PATCH 2/3] ArmPlatformPkg: Fix target initialisation in cmd_load_symbols.py

Rebecca Cran
 

The debugger in Arm Development Studio 2021.2 doesn't work with
"ec = debugger.getExecutionContext(0)" because it's subsequently unable
to access memory. Fix it by switching to
"ec = debugger.getCurrentExecutionContext()".

The documentation for waitForStop() says:

"It is not needed after a call to stop() because stop() is blocking."

So, remove the call to waitForStop.

Signed-off-by: Rebecca Cran <rebecca@...>
---
ArmPlatformPkg/Scripts/Ds5/cmd_load_symbols.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/ArmPlatformPkg/Scripts/Ds5/cmd_load_symbols.py b/ArmPlatformPkg/Scripts/Ds5/cmd_load_symbols.py
index 89d2f28ba27d..cb4db148dedf 100644
--- a/ArmPlatformPkg/Scripts/Ds5/cmd_load_symbols.py
+++ b/ArmPlatformPkg/Scripts/Ds5/cmd_load_symbols.py
@@ -85,11 +85,10 @@ else:
debugger = Debugger()

# Initialisation commands
-ec = debugger.getExecutionContext(0)
+ec = debugger.getCurrentExecutionContext()
ec.getExecutionService().stop()
-ec.getExecutionService().waitForStop()
# in case the execution context reference is out of date
-ec = debugger.getExecutionContext(0)
+ec = debugger.getCurrentExecutionContext()

try:
armplatform_debugger = edk2_debugger.ArmPlatformDebugger(ec, report_file, regions, verbose)
--
2.25.1


[PATCH 1/3] ArmPlatformPkg: Fix error message in Scripts/Ds5/edk2_debugger.py

Rebecca Cran
 

An error message in Scripts/Ds5/edk2_debugger.py was missing the word
'not'.

Signed-off-by: Rebecca Cran <rebecca@...>
---
ArmPlatformPkg/Scripts/Ds5/edk2_debugger.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ArmPlatformPkg/Scripts/Ds5/edk2_debugger.py b/ArmPlatformPkg/Scripts/Ds5/edk2_debugger.py
index 9713f8bfaca2..4cd378dffd16 100644
--- a/ArmPlatformPkg/Scripts/Ds5/edk2_debugger.py
+++ b/ArmPlatformPkg/Scripts/Ds5/edk2_debugger.py
@@ -222,4 +222,4 @@ class ArmPlatformDebugger:
self.debug_info_table.load_all_symbols(self.verbose)
except:
# Debugger exception could be excepted if DRAM has not been initialized or if we have not started to run from DRAM yet
- print "Note: no symbols have been found in System Memory (possible cause: the UEFI permanent memory has been installed yet)"
+ print "Note: no symbols have been found in System Memory (possible cause: the UEFI permanent memory has not been installed yet)"
--
2.25.1


[PATCH 0/3] ArmPlatformPkg: Fix Scripts/Ds5 debugging and Makefile

Rebecca Cran
 

I ran into some problems debugging EDK2 code using Development Studio with
the files under ArmPlatformPkg/Scripts and these patches fix them.

I'm using Arm Development Studio 2021.2 and not DS-5, so I'm not sure if
these changes would break things for people using the older environment.

Rebecca Cran (3):
ArmPlatformPkg: Fix error message in Scripts/Ds5/edk2_debugger.py
ArmPlatformPkg: Fix target initialisation in cmd_load_symbols.py
ArmPlatformPkg: Fix EDK2_DSC check in Scripts/Makefile

ArmPlatformPkg/Scripts/Ds5/cmd_load_symbols.py | 5 ++---
ArmPlatformPkg/Scripts/Ds5/edk2_debugger.py | 2 +-
ArmPlatformPkg/Scripts/Makefile | 2 +-
3 files changed, 4 insertions(+), 5 deletions(-)

--
2.25.1


Re: [staging/LoongArch RESEND PATCH v1 28/33] MdeModulePkg/Logo: Add LoongArch64 architecture.

Gao, Zhichao
 

Acked-by: Zhichao Gao <zhichao.gao@...>

Thanks,
Zhichao

-----Original Message-----
From: Chang, Abner (HPS SW/FW Technologist) <abner.chang@...>
Sent: Thursday, April 7, 2022 10:25 PM
To: devel@edk2.groups.io; lichao@...
Cc: Gao, Zhichao <zhichao.gao@...>; Ni, Ray <ray.ni@...>
Subject: RE: [edk2-devel] [staging/LoongArch RESEND PATCH v1 28/33]
MdeModulePkg/Logo: Add LoongArch64 architecture.

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

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Chao
Li
Sent: Wednesday, February 9, 2022 4:02 PM
To: devel@edk2.groups.io
Cc: Zhichao Gao <zhichao.gao@...>; Ray Ni <ray.ni@...>
Subject: [edk2-devel] [staging/LoongArch RESEND PATCH v1 28/33]
MdeModulePkg/Logo: Add LoongArch64 architecture.

Add LoongArch64 architecture to the Logo.

Cc: Zhichao Gao <zhichao.gao@...>
Cc: Ray Ni <ray.ni@...>

Signed-off-by: Chao Li <lichao@...>
---
MdeModulePkg/Logo/Logo.inf | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Logo/Logo.inf
b/MdeModulePkg/Logo/Logo.inf
index 70a66cae98..294482ccdc 100644
--- a/MdeModulePkg/Logo/Logo.inf
+++ b/MdeModulePkg/Logo/Logo.inf
@@ -3,6 +3,7 @@
#
# Copyright (c) 2006 - 2018, Intel Corporation. All rights
reserved.<BR> # Copyright (c) 2020, Hewlett Packard Enterprise
Development LP. All rights reserved.<BR>
+# Copyright (c) 2022, Loongson Technology Corporation Limited. All
+rights
reserved.<BR>

#
# SPDX-License-Identifier: BSD-2-Clause-Patent @@ -21,7 +22,7 @@ #
# The following information is for reference only and not required by
the build tools.
#
-# VALID_ARCHITECTURES = IA32 X64 EBC ARM AARCH64 RISCV64
+# VALID_ARCHITECTURES = IA32 X64 EBC ARM AARCH64 RISCV64
LOONGARCH64
#

[Binaries]
--
2.27.0





Re: [PATCH] UefiPayloadPkg: Keep reserved MMIO at runtime

Guo Dong
 

This patch changed both MdeModulePkg and UefiPayloadPkg, had better split them into 2 patches?

Thanks,
Guo

-----Original Message-----
From: Akihiko Odaki <akihiko.odaki@...>
Sent: Friday, April 8, 2022 7:25 PM
Cc: devel@edk2.groups.io; Wang, Jian J <jian.j.wang@...>; Gao, Liming <gaoliming@...>; Bi, Dandan <dandan.bi@...>; Kinney, Michael D <michael.d.kinney@...>; Liu, Zhiguang <zhiguang.liu@...>; Dong, Guo <guo.dong@...>; Ni, Ray <ray.ni@...>; Ma, Maurice <maurice.ma@...>; You, Benjamin <benjamin.you@...>; Akihiko Odaki <akihiko.odaki@...>
Subject: [PATCH] UefiPayloadPkg: Keep reserved MMIO at runtime

Signed-off-by: Akihiko Odaki <akihiko.odaki@...>
---
MdeModulePkg/Core/Dxe/Gcd/Gcd.c | 9 +++++++++
MdePkg/Include/Pi/PiHob.h | 2 ++
UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c | 3 ++-
3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c index 3763467bdb..623b316c61 100644
--- a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c
+++ b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c
@@ -2628,6 +2628,15 @@ CoreInitializeGcdServices (
ResourceHob->ResourceLength, Capabilities );++ if (!EFI_ERROR (Status) &&+ (ResourceHob->ResourceAttribute & EFI_RESOURCE_ATTRIBUTE_RUNTIME) == EFI_RESOURCE_ATTRIBUTE_RUNTIME) {+ Status = CoreSetMemorySpaceAttributes(+ ResourceHob->PhysicalStart,+ ResourceHob->ResourceLength,+ EFI_MEMORY_RUNTIME+ );+ } } if (GcdIoType != EfiGcdIoTypeNonExistent) {diff --git a/MdePkg/Include/Pi/PiHob.h b/MdePkg/Include/Pi/PiHob.h
index e9f0ab4309..92bacbe62c 100644
--- a/MdePkg/Include/Pi/PiHob.h
+++ b/MdePkg/Include/Pi/PiHob.h
@@ -296,6 +296,8 @@ typedef UINT32 EFI_RESOURCE_ATTRIBUTE_TYPE; // #define EFI_RESOURCE_ATTRIBUTE_MORE_RELIABLE 0x02000000 +#define EFI_RESOURCE_ATTRIBUTE_RUNTIME 0x04000000+ /// /// Describes the resource properties of all fixed, /// nonrelocatable resource ranges found on the processordiff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
index 0fed1e3691..a50f1c0271 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
@@ -74,7 +74,8 @@ MemInfoCallbackMmio (
EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE | EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE | EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |- EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE;+ EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE |+ EFI_RESOURCE_ATTRIBUTE_RUNTIME; BuildResourceDescriptorHob (Type, Attribue, (EFI_PHYSICAL_ADDRESS)Base, Size); DEBUG ((DEBUG_INFO, "buildhob: base = 0x%lx, size = 0x%lx, type = 0x%x\n", Base, Size, Type));--
2.35.1


Re: [PATCH v2 1/8] MdeModulePkg: Add Variable Flash Info HOB

Guo Dong
 

Does the range (NvStorageBaseAddress, NvStorageLength) includes FTW spare range and FTW working range?
If not, maybe rename them as (NvVariableBaseAddress, NvVariableLength) to make it clear.

For these 3 ranges, are there any other requirements (e.g. base address must be 4KB aligned, or FtwSpaceLength >= NvVariablelength)?
If yes, had better add to this interface file to make the HOB producer easy to build the HOB.

Thanks,
Guo

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Michael Kubacki
Sent: Friday, April 8, 2022 2:17 PM
To: devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@...>; Wu, Hao A <hao.a.wu@...>; Gao, Liming <gaoliming@...>
Subject: [edk2-devel] [PATCH v2 1/8] MdeModulePkg: Add Variable Flash Info HOB

From: Michael Kubacki <michael.kubacki@...>

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

Adds a new GUID that is used to identify a HOB that passes variable flash information to UEFI variable drivers in HOB consumption phases such as DXE, Traditional MM, and Standalone MM.

This information was previously passed directly with PCDs such as EfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase
and gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize.

However, the Standalone MM variable driver instance does not have direct access to the PCD database. Therefore, this HOB will first be considered as the source for variable flash information and if platforms do not produce the HOB, reading the information from the PCDs directly will be a backup to provide backward compatibility.

Cc: Jian J Wang <jian.j.wang@...>
Cc: Hao A Wu <hao.a.wu@...>
Cc: Liming Gao <gaoliming@...>
Signed-off-by: Michael Kubacki <michael.kubacki@...>
---
MdeModulePkg/Include/Guid/VariableFlashInfo.h | 39 ++++++++++++++++++++
MdeModulePkg/MdeModulePkg.dec | 4 ++
2 files changed, 43 insertions(+)

diff --git a/MdeModulePkg/Include/Guid/VariableFlashInfo.h b/MdeModulePkg/Include/Guid/VariableFlashInfo.h
new file mode 100644
index 000000000000..e526e362aab9
--- /dev/null
+++ b/MdeModulePkg/Include/Guid/VariableFlashInfo.h
@@ -0,0 +1,39 @@
+/** @file
+ This file defines the GUID and data structure used to pass
+information about
+ a variable store mapped on flash (i.e. a MMIO firmware volume) to the DXE and MM environment.
+
+ Copyright (c) Microsoft Corporation.<BR>
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef VARIABLE_FLASH_INFO_H_
+#define VARIABLE_FLASH_INFO_H_
+
+#define VARIABLE_FLASH_INFO_HOB_GUID \
+ { 0x5d11c653, 0x8154, 0x4ac3, { 0xa8, 0xc2, 0xfb, 0xa2, 0x89, 0x20,
+0xfc, 0x90 }}
+
+#define VARIABLE_FLASH_INFO_HOB_VERSION 1
+
+extern EFI_GUID gVariableFlashInfoHobGuid;
+
+#pragma pack (push, 1)
+
+///
+/// This structure can be used to describe UEFI variable /// flash
+information.
+///
+typedef struct {
+ UINT32 Version;
+ EFI_PHYSICAL_ADDRESS NvStorageBaseAddress;
+ UINT64 NvStorageLength;
+ EFI_PHYSICAL_ADDRESS FtwSpareBaseAddress;
+ UINT64 FtwSpareLength;
+ EFI_PHYSICAL_ADDRESS FtwWorkingBaseAddress;
+ UINT64 FtwWorkingLength;
+} VARIABLE_FLASH_INFO;
+
+#pragma pack (pop)
+
+#endif
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index cf79292ec877..4e82f5836096 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -226,6 +226,10 @@ [Guids]
# Include/Guid/SmmVariableCommon.h
gSmmVariableWriteGuid = { 0x93ba1826, 0xdffb, 0x45dd, { 0x82, 0xa7, 0xe7, 0xdc, 0xaa, 0x3b, 0xbd, 0xf3 }}

+ ## Guid of the variable flash information HOB.
+ # Include/Guid/VariableFlashInfo.h
+ gVariableFlashInfoHobGuid = { 0x5d11c653, 0x8154, 0x4ac3, { 0xa8,
+ 0xc2, 0xfb, 0xa2, 0x89, 0x20, 0xfc, 0x90 }}
+
## Performance protocol guid that also acts as the performance HOB guid and performance variable GUID
# Include/Guid/Performance.h
gPerformanceProtocolGuid = { 0x76B6BDFA, 0x2ACD, 0x4462, { 0x9E, 0x3F, 0xCB, 0x58, 0xC9, 0x69, 0xD9, 0x37 } }
--
2.28.0.windows.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#88650): https://edk2.groups.io/g/devel/message/88650
Mute This Topic: https://groups.io/mt/90345653/1781375
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [guo.dong@...]
-=-=-=-=-=-=


Re: [PATCH] UefiPayloadPkg: Fix bug that Elf loader doesn't relocate in some case

Guo Dong
 

Reviewed-by: Guo Dong <guo.dong@...>

-----Original Message-----
From: Liu, Zhiguang <zhiguang.liu@...>
Sent: Wednesday, April 6, 2022 6:52 AM
To: devel@edk2.groups.io
Cc: Dong, Guo <guo.dong@...>; Ni, Ray <ray.ni@...>; Ma, Maurice <maurice.ma@...>; You, Benjamin <benjamin.you@...>; Rhodes, Sean <sean@...>
Subject: [PATCH] UefiPayloadPkg: Fix bug that Elf loader doesn't relocate in some case

Current implementation of the Elf loader reuses the same memory range if the desired memory range is covered by [file base, file base + file size].
However, there is a potentil bug, for example:
If the first segment is located at 0x1000, and the desired address is 0x2000. While the second segment is located at 0x2000, and the desired address is 0x2000. When we parse and try to load the elf file, current implementation may load the first segment at 0x2000, and override second segment.

Cc: Guo Dong <guo.dong@...>
Cc: Ray Ni <ray.ni@...>
Cc: Maurice Ma <maurice.ma@...>
Cc: Benjamin You <benjamin.you@...>
Cc: Sean Rhodes <sean@...>

Signed-off-by: Zhiguang Liu <zhiguang.liu@...>
---
UefiPayloadPkg/PayloadLoaderPeim/ElfLib/ElfLib.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/ElfLib.c b/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/ElfLib.c
index 2a6305c67b..c7dfae14af 100644
--- a/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/ElfLib.c
+++ b/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/ElfLib.c
@@ -312,6 +312,13 @@ ParseElfImage (
ElfCt->ReloadRequired = TRUE; } + if (SegInfo.MemAddr != ((UINTN)ElfCt->FileBase + SegInfo.Offset)) {+ //+ // Need to relocate if the desired address is not the current address+ //+ ElfCt->ReloadRequired = TRUE;+ }+ if (Base > (SegInfo.MemAddr & ~(EFI_PAGE_SIZE - 1))) { Base = SegInfo.MemAddr & ~(EFI_PAGE_SIZE - 1); }--
2.32.0.windows.2


Re: [PATCH v1 6/6] UefiPayloadPkg: Add CpuLib to module INFs that depend on UefiCpuLib.

Guo Dong
 

Reviewed-by: Guo Dong <guo.dong@...>

-----Original Message-----
From: Pu, Yu <yu.pu@...>
Sent: Thursday, March 31, 2022 10:22 PM
To: devel@edk2.groups.io
Cc: Pu, Yu <yu.pu@...>; Dong, Guo <guo.dong@...>; Ni, Ray <ray.ni@...>; Ma, Maurice <maurice.ma@...>; You, Benjamin <benjamin.you@...>; Rhodes, Sean <sean@...>
Subject: [PATCH v1 6/6] UefiPayloadPkg: Add CpuLib to module INFs that depend on UefiCpuLib.

Step 1 to merge UefiCpuLib to CpuLib.

Cc: Guo Dong <guo.dong@...>
Cc: Ray Ni <ray.ni@...>
Cc: Maurice Ma <maurice.ma@...>
Cc: Benjamin You <benjamin.you@...>
Cc: Sean Rhodes <sean@...>
Signed-off-by: Yu Pu <yu.pu@...>
---
UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h | 1 +
UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf | 1 +
UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf | 1 +
3 files changed, 3 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h
index 56e0a4c639a0..d1c7425b28f2 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h
+++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h
@@ -23,6 +23,7 @@
#include <Library/PeCoffLib.h>

#include <Library/BlParseLib.h>

#include <Library/PlatformSupportLib.h>

+#include <Library/CpuLib.h>

#include <Library/UefiCpuLib.h>

#include <IndustryStandard/Acpi.h>

#include <IndustryStandard/MemoryMappedConfigurationSpaceAccessTable.h>

diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf
index c4e4339ede4b..95446dd99729 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf
+++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf
@@ -54,6 +54,7 @@
HobLib

PeCoffLib

PlatformSupportLib

+ CpuLib

UefiCpuLib



[Guids]

diff --git a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf
index 80af5afe0a3f..3b4836042a06 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf
+++ b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf
@@ -52,6 +52,7 @@
IoLib

HobLib

PeCoffLib

+ CpuLib

UefiCpuLib



[Guids]

--
2.30.0.windows.2


Re: [PATCH v1 1/1] UefiPayloadPkg: Add dependency of VariableSmm driver.

Guo Dong
 

Reviewed-by: Guo Dong <guo.dong@...>

-----Original Message-----
From: Li, Zhihao <zhihao.li@...>
Sent: Tuesday, March 29, 2022 12:12 AM
To: devel@edk2.groups.io
Cc: Dong, Guo <guo.dong@...>; Ni, Ray <ray.ni@...>; You, Benjamin <benjamin.you@...>; Rhodes, Sean <sean@...>; Fu, Siyuan <siyuan.fu@...>
Subject: [PATCH v1 1/1] UefiPayloadPkg: Add dependency of VariableSmm driver.

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

UefiCpuPkg define a new Protocol with the new services SmmWaitForAllProcessor(), which can be used by SMI handler to optionally wait for other APs to complete SMM rendezvous in relaxed AP mode.

VariableSmm driver need use SmmCpuRendezvousLib, So add SmmCpuRendezvousLib dependency in UefiPayloadPkg which use VariableSmm driver.

Cc: Guo Dong <guo.dong@...>
Cc: Ray Ni <ray.ni@...>
Cc: Benjamin You <benjamin.you@...>
Cc: Sean Rhodes <sean@...>
Cc: Siyuan Fu <siyuan.fu@...>

Signed-off-by: Zhihao Li <zhihao.li@...>
---
UefiPayloadPkg/UefiPayloadPkg.dsc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 14a8d157a292..a9feba47bbd9 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -3,7 +3,7 @@
# # Provides drivers and definitions to create uefi payload for bootloaders. #-# Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.<BR>+# Copyright (c) 2014 - 2022, Intel Corporation. All rights reserved.<BR> # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent #@@ -352,6 +352,7 @@
SmmCpuFeaturesLib|UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf+ SmmCpuRendezvousLib|UefiCpuPkg/Library/SmmCpuRendezvousLib/SmmCpuRendezvousLib.inf !if $(PERFORMANCE_MEASUREMENT_ENABLE) PerformanceLib|MdeModulePkg/Library/SmmPerformanceLib/SmmPerformanceLib.inf !endif--
2.26.2.windows.1


Event: TianoCore Design Meeting - APAC/NAMO - 04/15/2022 #cal-reminder

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

Reminder: TianoCore Design Meeting - APAC/NAMO

When:
04/15/2022
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: [staging/LoongArch RESEND PATCH v1 00/33] Add a new architecture called LoongArch in EDK II

Abner Chang
 

Hi Li,
I had went through the whole patch set and gave feedbacks to the patch respectively. Apart from those comments, I have no problems with this contribution. I think we can adopt LoongArch port in the mainstream edk2 repo after the comments are addressed and the corresponding spec defined in UEFI spec unless any objections from others.

Thanks
Abner

From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Chao Li <lichao@...>
Sent: Wednesday, February 9, 2022 2:51 PM
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Ray Ni <ray.ni@...>; Liming Gao <gaoliming@...>; Michael D Kinney <michael.d.kinney@...>; Guomin Jiang <guomin.jiang@...>; Wei6 Xu <wei6.xu@...>; Maciej Rabeda <maciej.rabeda@...>; Jiaxin Wu <jiaxin.wu@...>; Siyuan Fu <siyuan.fu@...>; Jiewen Yao <jiewen.yao@...>; Jian J Wang <jian.j.wang@...>; Xiaoyu Lu <xiaoyu1.lu@...>; Zhiguang Liu <zhiguang.liu@...>; Zhichao Gao <zhichao.gao@...>; Bob Feng <bob.c.feng@...>; Yuwei Chen <yuwei.chen@...>
Subject: [edk2-devel] [staging/LoongArch RESEND PATCH v1 00/33] Add a new architecture called LoongArch in EDK II
 
This new Arch should go through the EDK II Code First Process and then
the USWG can review our ECR. This commit contains 34 patchs, patch 0 is
the cover, patch 33 is Readme modification, and the others are the new
Arch support.

Modified modules: FatPkg, FmpDevicePkg, NetworkPkg,
NetworkPkg/HttpBootDxe, CryptoPkg, MdePkg/Include, SecurityPkg,
ShellPkg, UnitTestFrameworkPkg, MdePkg/DxeServicesLib, MdeModulePkg,
.python/SpellCheck, BaseTools, .azurepipelines, .pytool, MdePkg,
MdeModulePkg.

Cc: Ray Ni <ray.ni@...>
Cc: Liming Gao <gaoliming@...>
Cc: Michael D Kinney <michael.d.kinney@...>
Cc: Guomin Jiang <guomin.jiang@...>
Cc: Wei6 Xu <wei6.xu@...>
Cc: Maciej Rabeda <maciej.rabeda@...>
Cc: Jiaxin Wu <jiaxin.wu@...>
Cc: Siyuan Fu <siyuan.fu@...>
Cc: Jiewen Yao <jiewen.yao@...>
Cc: Jian J Wang <jian.j.wang@...>
Cc: Xiaoyu Lu <xiaoyu1.lu@...>
Cc: Zhiguang Liu <zhiguang.liu@...>
Cc: Zhichao Gao <zhichao.gao@...>
Cc: Bob Feng <bob.c.feng@...>
Cc: Yuwei Chen <yuwei.chen@...>

Chao Li (33):
  FatPkg: Add LOONGARCH64 architecture for EDK2 CI.
  FmpDevicePkg: Add LOONGARCH64 architecture for EDK2 CI.
  NetworkPkg: Add LOONGARCH64 architecture for EDK2 CI.
  NetworkPkg/HttpBootDxe: Add LOONGARCH64 architecture for EDK2 CI.
  CryptoPkg: Add LOONGARCH64 architecture for EDK2 CI.
  MdePkg/Include: Add LOONGARCH related definitions EDK2 CI.
  SecurityPkg: Add LOONGARCH64 architecture for EDK2 CI.
  ShellPkg: Add LOONGARCH64 architecture for EDK2 CI.
  UnitTestFrameworkPkg: Add LOONGARCH64 architecture for EDK2 CI.
  MdePkg/DxeServicesLib: Add LOONGARCH64 architecture
  MdeModulePkg: Use LockBoxNullLib for LOONGARCH64
  .python/SpellCheck: Add "Loongson" and "LOONGARCH" to "words" section
  BaseTools: BaseTools changes for LoongArch platform.
  BaseTools: BaseTools changes for LoongArch platform.
  BaseTools: BaseTools changes for LoongArch platform.
  BaseTools: Enable LoongArch64 architecture for LoongArch64 EDK2 CI.
  .azurepipelines: Add LoongArch64 architecture on LoongArch64 EDK2 CI.
  .pytool: Add LoongArch64 architecture on LoongArch64 EDK2 CI.
  MdePkg: Add LoongArch LOONGARCH64 binding
  MdePkg/Include: LoongArch definitions.
  MdePkg/BaseLib: BaseLib for LOONGARCH64 architecture.
  MdePkg/BaseCacheMaintenanceLib: LoongArch cache maintenance
    implementation.
  MdePkg/BaseIoLibIntrinsic: IoLibNoIo for LoongArch architecture.
  MdePkg/BasePeCoff: Add LoongArch PE/Coff related code.
  MdePkg/BaseCpuLib: LoongArch Base CPU library implementation.
  MdePkg/BaseSynchronizationLib: LoongArch cache related code.
  MdePkg/BaseSafeIntLib: Add LoongArch64 architecture for
    BaseSafeIntLib.
  MdeModulePkg/Logo: Add LoongArch64 architecture.
  MdeModulePkg/CapsuleRuntimeDxe: Add LoongArch64 architecture.
  MdeModulePkg/DxeIplPeim : LoongArch DxeIPL implementation.
  NetworkPkg: Add LoongArch64 architecture.
  BaseTools: Add LoongArch64 binding.
  Readme: Update the readme

 .azurepipelines/Ubuntu-GCC5.yml               |   3 +-
 .pytool/CISettings.py                         |   5 +-
 .pytool/Plugin/SpellCheck/cspell.base.yaml    |   4 +-
 ...gcc_loongarch64_unknown_linux_ext_dep.yaml |  22 ++
 BaseTools/Conf/tools_def.template             |  43 ++-
 .../LinuxGcc5ToolChain/LinuxGcc5ToolChain.py  |  31 +++
 BaseTools/Source/C/Common/BasePeCoff.c        |  15 +-
 BaseTools/Source/C/Common/PeCoffLoaderEx.c    |  76 ++++++
 BaseTools/Source/C/GNUmakefile                |   3 +
 BaseTools/Source/C/GenFv/GenFvInternalLib.c   | 128 ++++++++-
 BaseTools/Source/C/GenFw/Elf64Convert.c       | 153 ++++++++++-
 BaseTools/Source/C/GenFw/elf_common.h         |  58 ++++
 .../C/Include/IndustryStandard/PeImage.h      |  57 ++--
 .../C/Include/LoongArch64/ProcessorBind.h     |  80 ++++++
 BaseTools/Source/Python/Common/DataType.py    |  21 +-
 .../Source/Python/UPT/Library/DataType.py     |  24 +-
 BaseTools/Source/Python/build/buildoptions.py |   3 +-
 CryptoPkg/CryptoPkg.dsc                       |   3 +-
 .../Library/BaseCryptLib/BaseCryptLib.inf     |   6 +-
 .../Library/BaseCryptLib/RuntimeCryptLib.inf  |   4 +
 .../BaseCryptLibNull/BaseCryptLibNull.inf     |   3 +-
 .../BaseCryptLibOnProtocolPpi/DxeCryptLib.inf |   3 +-
 .../BaseCryptLibOnProtocolPpi/PeiCryptLib.inf |   3 +-
 CryptoPkg/Library/Include/CrtLibSupport.h     |   3 +-
 CryptoPkg/Library/OpensslLib/OpensslLib.inf   |   2 +
 .../Library/OpensslLib/OpensslLibCrypto.inf   |   2 +
 CryptoPkg/Library/TlsLib/TlsLib.inf           |   3 +-
 CryptoPkg/Library/TlsLibNull/TlsLibNull.inf   |   3 +-
 FatPkg/FatPkg.dsc                             |   3 +-
 FmpDevicePkg/FmpDevicePkg.dsc                 |   3 +-
 MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf       |   6 +-
 .../Core/DxeIplPeim/LoongArch64/DxeLoadFunc.c |  61 +++++
 MdeModulePkg/Logo/Logo.inf                    |   3 +-
 MdeModulePkg/MdeModulePkg.dsc                 |   4 +-
 .../CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf   |   9 +-
 MdePkg/Include/IndustryStandard/Dhcp.h        |  41 +--
 MdePkg/Include/IndustryStandard/PeImage.h     |   9 +
 MdePkg/Include/Library/BaseLib.h              |  24 ++
 MdePkg/Include/LoongArch64/ProcessorBind.h    | 121 +++++++++
 MdePkg/Include/Protocol/DebugSupport.h        |  65 ++++-
 MdePkg/Include/Protocol/PxeBaseCode.h         |   3 +
 MdePkg/Include/Uefi/UefiBaseType.h            |  14 +
 MdePkg/Include/Uefi/UefiSpec.h                |  16 +-
 .../BaseCacheMaintenanceLib.inf               |   4 +
 .../BaseCacheMaintenanceLib/LoongArchCache.c  | 253 ++++++++++++++++++
 MdePkg/Library/BaseCpuLib/BaseCpuLib.inf      |   7 +-
 MdePkg/Library/BaseCpuLib/BaseCpuLib.uni      |   5 +-
 .../BaseCpuLib/LoongArch/CpuFlushTlb.S        |  15 ++
 .../Library/BaseCpuLib/LoongArch/CpuSleep.S   |  15 ++
 .../BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf |  10 +-
 MdePkg/Library/BaseIoLibIntrinsic/IoLibNoIo.c |   3 +-
 MdePkg/Library/BaseLib/BaseLib.inf            |  13 +
 .../BaseLib/LoongArch64/CpuBreakpoint.S       |  24 ++
 MdePkg/Library/BaseLib/LoongArch64/CpuPause.S |  31 +++
 .../BaseLib/LoongArch64/DisableInterrupts.S   |  21 ++
 .../BaseLib/LoongArch64/EnableInterrupts.S    |  21 ++
 .../BaseLib/LoongArch64/GetInterruptState.S   |  35 +++
 .../BaseLib/LoongArch64/InternalSwitchStack.c |  58 ++++
 .../Library/BaseLib/LoongArch64/MemoryFence.S |  19 ++
 .../BaseLib/LoongArch64/SetJumpLongJump.S     |  49 ++++
 .../Library/BaseLib/LoongArch64/SwitchStack.S |  39 +++
 .../Library/BaseLib/LoongArch64/Unaligned.c   | 244 +++++++++++++++++
 MdePkg/Library/BasePeCoffLib/BasePeCoff.c     |   3 +-
 .../Library/BasePeCoffLib/BasePeCoffLib.inf   |   5 +
 .../Library/BasePeCoffLib/BasePeCoffLib.uni   |   2 +
 .../BasePeCoffLib/LoongArch/PeCoffLoaderEx.c  | 132 +++++++++
 .../Library/BaseSafeIntLib/BaseSafeIntLib.inf |   9 +-
 .../BaseSynchronizationLib.inf                |   5 +
 .../LoongArch64/Synchronization.c             | 239 +++++++++++++++++
 .../Library/DxeServicesLib/DxeServicesLib.inf |   4 +-
 MdePkg/MdePkg.dec                             |   4 +
 MdePkg/MdePkg.dsc                             |   3 +-
 NetworkPkg/HttpBootDxe/HttpBootDhcp4.h        |   3 +
 NetworkPkg/Network.dsc.inc                    |   3 +-
 NetworkPkg/NetworkPkg.dsc                     |   3 +-
 ReadMe.md                                     |  17 ++
 SecurityPkg/SecurityPkg.dsc                   |   3 +-
 ShellPkg/ShellPkg.dsc                         |   3 +-
 UnitTestFrameworkPkg/UnitTestFrameworkPkg.dsc |   3 +-
 79 files changed, 2340 insertions(+), 110 deletions(-)
 create mode 100644 BaseTools/Bin/gcc_loongarch64_unknown_linux_ext_dep.yaml
 create mode 100644 BaseTools/Source/C/Include/LoongArch64/ProcessorBind.h
 create mode 100644 MdeModulePkg/Core/DxeIplPeim/LoongArch64/DxeLoadFunc.c
 create mode 100644 MdePkg/Include/LoongArch64/ProcessorBind.h
 create mode 100644 MdePkg/Library/BaseCacheMaintenanceLib/LoongArchCache.c
 create mode 100644 MdePkg/Library/BaseCpuLib/LoongArch/CpuFlushTlb.S
 create mode 100644 MdePkg/Library/BaseCpuLib/LoongArch/CpuSleep.S
 create mode 100644 MdePkg/Library/BaseLib/LoongArch64/CpuBreakpoint.S
 create mode 100644 MdePkg/Library/BaseLib/LoongArch64/CpuPause.S
 create mode 100644 MdePkg/Library/BaseLib/LoongArch64/DisableInterrupts.S
 create mode 100644 MdePkg/Library/BaseLib/LoongArch64/EnableInterrupts.S
 create mode 100644 MdePkg/Library/BaseLib/LoongArch64/GetInterruptState.S
 create mode 100644 MdePkg/Library/BaseLib/LoongArch64/InternalSwitchStack.c
 create mode 100644 MdePkg/Library/BaseLib/LoongArch64/MemoryFence.S
 create mode 100644 MdePkg/Library/BaseLib/LoongArch64/SetJumpLongJump.S
 create mode 100644 MdePkg/Library/BaseLib/LoongArch64/SwitchStack.S
 create mode 100644 MdePkg/Library/BaseLib/LoongArch64/Unaligned.c
 create mode 100644 MdePkg/Library/BasePeCoffLib/LoongArch/PeCoffLoaderEx.c
 create mode 100644 MdePkg/Library/BaseSynchronizationLib/LoongArch64/Synchronization.c
 create mode 100644 ReadMe.md

--
2.27.0







Re: [PATCH v2 0/3] BaseTools: Add support for gdb and lldb

Bob Feng
 

-----Original Message-----
From: Rebecca Cran <quic_rcran@...>
Sent: Thursday, April 7, 2022 6:34 AM
To: devel@edk2.groups.io; Leif Lindholm <quic_llindhol@...>; Kinney, Michael D <michael.d.kinney@...>; Wu, Hao A <hao.a.wu@...>; Feng, Bob C <bob.c.feng@...>; Gao, Liming <gaoliming@...>; Chen, Christine <yuwei.chen@...>
Cc: Andrew Fish <afish@...>
Subject: Re: [PATCH v2 0/3] BaseTools: Add support for gdb and lldb

Could I have some more reviews on this please? I'd like to get this into the tree soon.

--
Rebecca Cran

On 3/21/22 14:20, Rebecca Cran wrote:
This patch set adds debugging support for gdb and lldb.
It also adds generic debugging classes that use a file like object to
make it easy to import into any debugger that supports Python.

Changes from v1 to v2:
- Moved scripts from the root of the repo into BaseTools/Scripts.
- Fixed typo of "RISCV" as "RISKV".

Testing:
- Tested gdb on Ubuntu and lldb on macOS for IA32 and X64.
- Tested gdb on openSUSE for AARCH64.

Rebecca Cran (3):
BaseTools: efi_debugging.py: Add debugger agnostic dbg Python Classes
BaseTools: Scripts/efi_gdb.py: Add gdb EFI commands and pretty Print
BaseTools: Scripts/efi_lldb.py: Add lldb EFI commands and pretty
Print

BaseTools/Scripts/efi_debugging.py | 2185 ++++++++++++++++++++
BaseTools/Scripts/efi_gdb.py | 918 ++++++++
BaseTools/Scripts/efi_lldb.py | 1044 ++++++++++
3 files changed, 4147 insertions(+)
create mode 100755 BaseTools/Scripts/efi_debugging.py
create mode 100755 BaseTools/Scripts/efi_gdb.py
create mode 100755 BaseTools/Scripts/efi_lldb.py


Re: [PATCH v2 3/3] BaseTools: Scripts/efi_lldb.py: Add lldb EFI commands and pretty Print

Bob Feng
 

Reviewed-by: Bob Feng <bob.c.feng@...>


On Tue, Mar 22, 2022 at 04:21 AM, Rebecca Cran wrote:
https://bugzilla.tianocore.org/show_bug.cgi?id=3500

Use efi_debugging.py Python Classes to implement EFI gdb commands:
efi_symbols, guid, table, hob, and devicepath

You can attach to any standard gdb or kdp remote server and get EFI
symbols. No modifications of EFI are required.

Example usage:
OvmfPkg/build.sh qemu -gdb tcp::9000
lldb -o "gdb-remote localhost:9000" -o "command script import efi_lldb.py"
Note you may also have to teach lldb about QEMU:
-o "settings set plugin.process.gdb-remote.target-definition-file
x86_64_target_definition.py"

Cc: Leif Lindholm <quic_llindhol@...>
Cc: Michael D Kinney <michael.d.kinney@...>
Cc: Hao A Wu <hao.a.wu@...>
Cc: Bob Feng <bob.c.feng@...>
Cc: Liming Gao <gaoliming@...>
Cc: Yuwei Chen <yuwei.chen@...>
Signed-off-by: Rebecca Cran <quic_rcran@...>
---
BaseTools/Scripts/efi_lldb.py | 1044 ++++++++++++++++++++
1 file changed, 1044 insertions(+)

diff --git a/BaseTools/Scripts/efi_lldb.py b/BaseTools/Scripts/efi_lldb.py
new file mode 100755
index 000000000000..089b6ba58ab8
--- /dev/null
+++ b/BaseTools/Scripts/efi_lldb.py
@@ -0,0 +1,1044 @@
+#!/usr/bin/python3
+'''
+Copyright (c) Apple Inc. 2021
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+Example usage:
+OvmfPkg/build.sh qemu -gdb tcp::9000
+lldb -o "gdb-remote localhost:9000" -o "command script import efi_lldb.py"
+'''
+
+import optparse
+import shlex
+import subprocess
+import uuid
+import sys
+import os
+from pathlib import Path
+from efi_debugging import EfiDevicePath, EfiConfigurationTable, EfiTpl
+from efi_debugging import EfiHob, GuidNames, EfiStatusClass, EfiBootMode
+from efi_debugging import PeTeImage, patch_ctypes
+
+try:
+ # Just try for LLDB in case PYTHONPATH is already correctly setup
+ import lldb
+except ImportError:
+ try:
+ env = os.environ.copy()
+ env['LLDB_DEFAULT_PYTHON_VERSION'] = str(sys.version_info.major)
+ lldb_python_path = subprocess.check_output(
+ ["xcrun", "lldb", "-P"], env=env).decode("utf-8").strip()
+ sys.path.append(lldb_python_path)
+ import lldb
+ except ValueError:
+ print("Couldn't find LLDB.framework from lldb -P")
+ print("PYTHONPATH should match the currently selected lldb")
+ sys.exit(-1)
+
+
+class LldbFileObject(object):
+ '''
+ Class that fakes out file object to abstract lldb from the generic code.
+ For lldb this is memory so we don't have a concept of the end of the file.
+ '''
+
+ def __init__(self, process):
+ # _exe_ctx is lldb.SBExecutionContext
+ self._process = process
+ self._offset = 0
+ self._SBError = lldb.SBError()
+
+ def tell(self):
+ return self._offset
+
+ def read(self, size=-1):
+ if size == -1:
+ # arbitrary default size
+ size = 0x1000000
+
+ data = self._process.ReadMemory(self._offset, size, self._SBError)
+ if self._SBError.fail:
+ raise MemoryError(
+ f'lldb could not read memory 0x{size:x} '
+ f' bytes from 0x{self._offset:08x}')
+ else:
+ return data
+
+ def readable(self):
+ return True
+
+ def seek(self, offset, whence=0):
+ if whence == 0:
+ self._offset = offset
+ elif whence == 1:
+ self._offset += offset
+ else:
+ # whence == 2 is seek from end
+ raise NotImplementedError
+
+ def seekable(self):
+ return True
+
+ def write(self, data):
+ result = self._process.WriteMemory(self._offset, data, self._SBError)
+ if self._SBError.fail:
+ raise MemoryError(
+ f'lldb could not write memory to 0x{self._offset:08x}')
+ return result
+
+ def writable(self):
+ return True
+
+ def truncate(self, size=None):
+ raise NotImplementedError
+
+ def flush(self):
+ raise NotImplementedError
+
+ def fileno(self):
+ raise NotImplementedError
+
+
+class EfiSymbols:
+ """
+ Class to manage EFI Symbols
+ You need to pass file, and exe_ctx to load symbols.
+ You can print(EfiSymbols()) to see the currently loaded symbols
+ """
+
+ loaded = {}
+ stride = None
+ range = None
+ verbose = False
+
+ def __init__(self, target=None):
+ if target:
+ EfiSymbols.target = target
+ EfiSymbols._file = LldbFileObject(target.process)
+
+ @ classmethod
+ def __str__(cls):
+ return ''.join(f'{pecoff}\n' for (pecoff, _) in cls.loaded.values())
+
+ @ classmethod
+ def configure_search(cls, stride, range, verbose=False):
+ cls.stride = stride
+ cls.range = range
+ cls.verbose = verbose
+
+ @ classmethod
+ def clear(cls):
+ cls.loaded = {}
+
+ @ classmethod
+ def add_symbols_for_pecoff(cls, pecoff):
+ '''Tell lldb the location of the .text and .data sections.'''
+
+ if pecoff.LoadAddress in cls.loaded:
+ return 'Already Loaded: '
+
+ module = cls.target.AddModule(None, None, str(pecoff.CodeViewUuid))
+ if not module:
+ module = cls.target.AddModule(pecoff.CodeViewPdb,
+ None,
+ str(pecoff.CodeViewUuid))
+ if module.IsValid():
+ SBError = cls.target.SetModuleLoadAddress(
+ module, pecoff.LoadAddress + pecoff.TeAdjust)
+ if SBError.success:
+ cls.loaded[pecoff.LoadAddress] = (pecoff, module)
+ return ''
+
+ return 'Symbols NOT FOUND: '
+
+ @ classmethod
+ def address_to_symbols(cls, address, reprobe=False):
+ '''
+ Given an address search backwards for a PE/COFF (or TE) header
+ and load symbols. Return a status string.
+ '''
+ if not isinstance(address, int):
+ address = int(address)
+
+ pecoff, _ = cls.address_in_loaded_pecoff(address)
+ if not reprobe and pecoff is not None:
+ # skip the probe of the remote
+ return f'{pecoff} is already loaded'
+
+ pecoff = PeTeImage(cls._file, None)
+ if pecoff.pcToPeCoff(address, cls.stride, cls.range):
+ res = cls.add_symbols_for_pecoff(pecoff)
+ return f'{res}{pecoff}'
+ else:
+ return f'0x{address:08x} not in a PE/COFF (or TE) image'
+
+ @ classmethod
+ def address_in_loaded_pecoff(cls, address):
+ if not isinstance(address, int):
+ address = int(address)
+
+ for (pecoff, module) in cls.loaded.values():
+ if (address >= pecoff.LoadAddress and
+ address <= pecoff.EndLoadAddress):
+
+ return pecoff, module
+
+ return None, None
+
+ @ classmethod
+ def unload_symbols(cls, address):
+ pecoff, module = cls.address_in_loaded_pecoff(address)
+ if module:
+ name = str(module)
+ cls.target.ClearModuleLoadAddress(module)
+ cls.target.RemoveModule(module)
+ del cls.loaded[pecoff.LoadAddress]
+ return f'{name:s} was unloaded'
+ return f'0x{address:x} was not in a loaded image'
+
+
+def arg_to_address(frame, arg):
+ ''' convert an lldb command arg into a memory address (addr_t)'''
+
+ if arg is None:
+ return None
+
+ arg_str = arg if isinstance(arg, str) else str(arg)
+ SBValue = frame.EvaluateExpression(arg_str)
+ if SBValue.error.fail:
+ return arg
+
+ if (SBValue.TypeIsPointerType() or
+ SBValue.value_type == lldb.eValueTypeRegister or
+ SBValue.value_type == lldb.eValueTypeRegisterSet or
+ SBValue.value_type == lldb.eValueTypeConstResult):
+ try:
+ addr = SBValue.GetValueAsAddress()
+ except ValueError:
+ addr = SBValue.unsigned
+ else:
+ try:
+ addr = SBValue.address_of.GetValueAsAddress()
+ except ValueError:
+ addr = SBValue.address_of.unsigned
+
+ return addr
+
+
+def arg_to_data(frame, arg):
+ ''' convert an lldb command arg into a data vale (uint32_t/uint64_t)'''
+ if not isinstance(arg, str):
+ arg_str = str(str)
+
+ SBValue = frame.EvaluateExpression(arg_str)
+ return SBValue.unsigned
+
+
+class EfiDevicePathCommand:
+
+ def create_options(self):
+ ''' standard lldb command help/options parser'''
+ usage = "usage: %prog [options]"
+ description = '''Command that can EFI Config Tables
+'''
+
+ # Pass add_help_option = False, since this keeps the command in line
+ # with lldb commands, and we wire up "help command" to work by
+ # providing the long & short help methods below.
+ self.parser = optparse.OptionParser(
+ description=description,
+ prog='devicepath',
+ usage=usage,
+ add_help_option=False)
+
+ self.parser.add_option(
+ '-v',
+ '--verbose',
+ action='store_true',
+ dest='verbose',
+ help='hex dump extra data',
+ default=False)
+
+ self.parser.add_option(
+ '-n',
+ '--node',
+ action='store_true',
+ dest='node',
+ help='dump a single device path node',
+ default=False)
+
+ self.parser.add_option(
+ '-h',
+ '--help',
+ action='store_true',
+ dest='help',
+ help='Show help for the command',
+ default=False)
+
+ def get_short_help(self):
+ '''standard lldb function method'''
+ return "Display EFI Tables"
+
+ def get_long_help(self):
+ '''standard lldb function method'''
+ return self.help_string
+
+ def __init__(self, debugger, internal_dict):
+ '''standard lldb function method'''
+ self.create_options()
+ self.help_string = self.parser.format_help()
+
+ def __call__(self, debugger, command, exe_ctx, result):
+ '''standard lldb function method'''
+ # Use the Shell Lexer to properly parse up command options just like a
+ # shell would
+ command_args = shlex.split(command)
+
+ try:
+ (options, args) = self.parser.parse_args(command_args)
+ dev_list = []
+ for arg in args:
+ dev_list.append(arg_to_address(exe_ctx.frame, arg))
+ except ValueError:
+ # if you don't handle exceptions, passing an incorrect argument
+ # to the OptionParser will cause LLDB to exit (courtesy of
+ # OptParse dealing with argument errors by throwing SystemExit)
+ result.SetError("option parsing failed")
+ return
+
+ if options.help:
+ self.parser.print_help()
+ return
+
+ file = LldbFileObject(exe_ctx.process)
+
+ for dev_addr in dev_list:
+ if options.node:
+ print(EfiDevicePath(file).device_path_node_str(
+ dev_addr, options.verbose))
+ else:
+ device_path = EfiDevicePath(file, dev_addr, options.verbose)
+ if device_path.valid():
+ print(device_path)
+
+
+class EfiHobCommand:
+ def create_options(self):
+ ''' standard lldb command help/options parser'''
+ usage = "usage: %prog [options]"
+ description = '''Command that can EFI dump EFI HOBs'''
+
+ # Pass add_help_option = False, since this keeps the command in line
+ # with lldb commands, and we wire up "help command" to work by
+ # providing the long & short help methods below.
+ self.parser = optparse.OptionParser(
+ description=description,
+ prog='table',
+ usage=usage,
+ add_help_option=False)
+
+ self.parser.add_option(
+ '-a',
+ '--address',
+ type="int",
+ dest='address',
+ help='Parse HOBs from address',
+ default=None)
+
+ self.parser.add_option(
+ '-t',
+ '--type',
+ type="int",
+ dest='type',
+ help='Only dump HOBS of his type',
+ default=None)
+
+ self.parser.add_option(
+ '-v',
+ '--verbose',
+ action='store_true',
+ dest='verbose',
+ help='hex dump extra data',
+ default=False)
+
+ self.parser.add_option(
+ '-h',
+ '--help',
+ action='store_true',
+ dest='help',
+ help='Show help for the command',
+ default=False)
+
+ def get_short_help(self):
+ '''standard lldb function method'''
+ return "Display EFI Hobs"
+
+ def get_long_help(self):
+ '''standard lldb function method'''
+ return self.help_string
+
+ def __init__(self, debugger, internal_dict):
+ '''standard lldb function method'''
+ self.create_options()
+ self.help_string = self.parser.format_help()
+
+ def __call__(self, debugger, command, exe_ctx, result):
+ '''standard lldb function method'''
+ # Use the Shell Lexer to properly parse up command options just like a
+ # shell would
+ command_args = shlex.split(command)
+
+ try:
+ (options, _) = self.parser.parse_args(command_args)
+ except ValueError:
+ # if you don't handle exceptions, passing an incorrect argument
+ # to the OptionParser will cause LLDB to exit (courtesy of
+ # OptParse dealing with argument errors by throwing SystemExit)
+ result.SetError("option parsing failed")
+ return
+
+ if options.help:
+ self.parser.print_help()
+ return
+
+ address = arg_to_address(exe_ctx.frame, options.address)
+
+ file = LldbFileObject(exe_ctx.process)
+ hob = EfiHob(file, address, options.verbose).get_hob_by_type(
+ options.type)
+ print(hob)
+
+
+class EfiTableCommand:
+
+ def create_options(self):
+ ''' standard lldb command help/options parser'''
+ usage = "usage: %prog [options]"
+ description = '''Command that can display EFI Config Tables
+'''
+
+ # Pass add_help_option = False, since this keeps the command in line
+ # with lldb commands, and we wire up "help command" to work by
+ # providing the long & short help methods below.
+ self.parser = optparse.OptionParser(
+ description=description,
+ prog='table',
+ usage=usage,
+ add_help_option=False)
+
+ self.parser.add_option(
+ '-h',
+ '--help',
+ action='store_true',
+ dest='help',
+ help='Show help for the command',
+ default=False)
+
+ def get_short_help(self):
+ '''standard lldb function method'''
+ return "Display EFI Tables"
+
+ def get_long_help(self):
+ '''standard lldb function method'''
+ return self.help_string
+
+ def __init__(self, debugger, internal_dict):
+ '''standard lldb function method'''
+ self.create_options()
+ self.help_string = self.parser.format_help()
+
+ def __call__(self, debugger, command, exe_ctx, result):
+ '''standard lldb function method'''
+ # Use the Shell Lexer to properly parse up command options just like a
+ # shell would
+ command_args = shlex.split(command)
+
+ try:
+ (options, _) = self.parser.parse_args(command_args)
+ except ValueError:
+ # if you don't handle exceptions, passing an incorrect argument
+ # to the OptionParser will cause LLDB to exit (courtesy of
+ # OptParse dealing with argument errors by throwing SystemExit)
+ result.SetError("option parsing failed")
+ return
+
+ if options.help:
+ self.parser.print_help()
+ return
+
+ gST = exe_ctx.target.FindFirstGlobalVariable('gST')
+ if gST.error.fail:
+ print('Error: This command requires symbols for gST to be loaded')
+ return
+
+ file = LldbFileObject(exe_ctx.process)
+ table = EfiConfigurationTable(file, gST.unsigned)
+ if table:
+ print(table, '\n')
+
+
+class EfiGuidCommand:
+
+ def create_options(self):
+ ''' standard lldb command help/options parser'''
+ usage = "usage: %prog [options]"
+ description = '''
+ Command that can display all EFI GUID's or give info on a
+ specific GUID's
+ '''
+ self.parser = optparse.OptionParser(
+ description=description,
+ prog='guid',
+ usage=usage,
+ add_help_option=False)
+
+ self.parser.add_option(
+ '-n',
+ '--new',
+ action='store_true',
+ dest='new',
+ help='Generate a new GUID',
+ default=False)
+
+ self.parser.add_option(
+ '-v',
+ '--verbose',
+ action='store_true',
+ dest='verbose',
+ help='Also display GUID C structure values',
+ default=False)
+
+ self.parser.add_option(
+ '-h',
+ '--help',
+ action='store_true',
+ dest='help',
+ help='Show help for the command',
+ default=False)
+
+ def get_short_help(self):
+ '''standard lldb function method'''
+ return "Display EFI GUID's"
+
+ def get_long_help(self):
+ '''standard lldb function method'''
+ return self.help_string
+
+ def __init__(self, debugger, internal_dict):
+ '''standard lldb function method'''
+ self.create_options()
+ self.help_string = self.parser.format_help()
+
+ def __call__(self, debugger, command, exe_ctx, result):
+ '''standard lldb function method'''
+ # Use the Shell Lexer to properly parse up command options just like a
+ # shell would
+ command_args = shlex.split(command)
+
+ try:
+ (options, args) = self.parser.parse_args(command_args)
+ if len(args) >= 1:
+ # guid { 0x414e6bdd, 0xe47b, 0x47cc,
+ # { 0xb2, 0x44, 0xbb, 0x61, 0x02, 0x0c,0xf5, 0x16 }}
+ # this generates multiple args
+ arg = ' '.join(args)
+ except ValueError:
+ # if you don't handle exceptions, passing an incorrect argument
+ # to the OptionParser will cause LLDB to exit (courtesy of
+ # OptParse dealing with argument errors by throwing SystemExit)
+ result.SetError("option parsing failed")
+ return
+
+ if options.help:
+ self.parser.print_help()
+ return
+
+ if options.new:
+ guid = uuid.uuid4()
+ print(str(guid).upper())
+ print(GuidNames.to_c_guid(guid))
+ return
+
+ if len(args) > 0:
+ if GuidNames.is_guid_str(arg):
+ # guid 05AD34BA-6F02-4214-952E-4DA0398E2BB9
+ key = arg.lower()
+ name = GuidNames.to_name(key)
+ elif GuidNames.is_c_guid(arg):
+ # guid { 0x414e6bdd, 0xe47b, 0x47cc,
+ # { 0xb2, 0x44, 0xbb, 0x61, 0x02, 0x0c,0xf5, 0x16 }}
+ key = GuidNames.from_c_guid(arg)
+ name = GuidNames.to_name(key)
+ else:
+ # guid gEfiDxeServicesTableGuid
+ name = arg
+ try:
+ key = GuidNames.to_guid(name)
+ name = GuidNames.to_name(key)
+ except ValueError:
+ return
+
+ extra = f'{GuidNames.to_c_guid(key)}: ' if options.verbose else ''
+ print(f'{key}: {extra}{name}')
+
+ else:
+ for key, value in GuidNames._dict_.items():
+ if options.verbose:
+ extra = f'{GuidNames.to_c_guid(key)}: '
+ else:
+ extra = ''
+ print(f'{key}: {extra}{value}')
+
+
+class EfiSymbolicateCommand(object):
+ '''Class to abstract an lldb command'''
+
+ def create_options(self):
+ ''' standard lldb command help/options parser'''
+ usage = "usage: %prog [options]"
+ description = '''Command that can load EFI PE/COFF and TE image
+ symbols. If you are having trouble in PEI try adding --pei.
+ '''
+
+ # Pass add_help_option = False, since this keeps the command in line
+ # with lldb commands, and we wire up "help command" to work by
+ # providing the long & short help methods below.
+ self.parser = optparse.OptionParser(
+ description=description,
+ prog='efi_symbols',
+ usage=usage,
+ add_help_option=False)
+
+ self.parser.add_option(
+ '-a',
+ '--address',
+ type="int",
+ dest='address',
+ help='Load symbols for image at address',
+ default=None)
+
+ self.parser.add_option(
+ '-f',
+ '--frame',
+ action='store_true',
+ dest='frame',
+ help='Load symbols for current stack frame',
+ default=False)
+
+ self.parser.add_option(
+ '-p',
+ '--pc',
+ action='store_true',
+ dest='pc',
+ help='Load symbols for pc',
+ default=False)
+
+ self.parser.add_option(
+ '--pei',
+ action='store_true',
+ dest='pei',
+ help='Load symbols for PEI (searches every 4 bytes)',
+ default=False)
+
+ self.parser.add_option(
+ '-e',
+ '--extended',
+ action='store_true',
+ dest='extended',
+ help='Try to load all symbols based on config tables.',
+ default=False)
+
+ self.parser.add_option(
+ '-r',
+ '--range',
+ type="long",
+ dest='range',
+ help='How far to search backward for start of PE/COFF Image',
+ default=None)
+
+ self.parser.add_option(
+ '-s',
+ '--stride',
+ type="long",
+ dest='stride',
+ help='Boundary to search for PE/COFF header',
+ default=None)
+
+ self.parser.add_option(
+ '-t',
+ '--thread',
+ action='store_true',
+ dest='thread',
+ help='Load symbols for the frames of all threads',
+ default=False)
+
+ self.parser.add_option(
+ '-h',
+ '--help',
+ action='store_true',
+ dest='help',
+ help='Show help for the command',
+ default=False)
+
+ def get_short_help(self):
+ '''standard lldb function method'''
+ return (
+ "Load symbols based on an address that is part of"
+ " a PE/COFF EFI image.")
+
+ def get_long_help(self):
+ '''standard lldb function method'''
+ return self.help_string
+
+ def __init__(self, debugger, unused):
+ '''standard lldb function method'''
+ self.create_options()
+ self.help_string = self.parser.format_help()
+
+ def lldb_print(self, lldb_str):
+ # capture command out like an lldb command
+ self.result.PutCString(lldb_str)
+ # flush the output right away
+ self.result.SetImmediateOutputFile(
+ self.exe_ctx.target.debugger.GetOutputFile())
+
+ def __call__(self, debugger, command, exe_ctx, result):
+ '''standard lldb function method'''
+ # Use the Shell Lexer to properly parse up command options just like a
+ # shell would
+ command_args = shlex.split(command)
+
+ try:
+ (options, _) = self.parser.parse_args(command_args)
+ except ValueError:
+ # if you don't handle exceptions, passing an incorrect argument
+ # to the OptionParser will cause LLDB to exit (courtesy of
+ # OptParse dealing with argument errors by throwing SystemExit)
+ result.SetError("option parsing failed")
+ return
+
+ if options.help:
+ self.parser.print_help()
+ return
+
+ file = LldbFileObject(exe_ctx.process)
+ efi_symbols = EfiSymbols(exe_ctx.target)
+ self.result = result
+ self.exe_ctx = exe_ctx
+
+ if options.pei:
+ # XIP code ends up on a 4 byte boundary.
+ options.stride = 4
+ options.range = 0x100000
+ efi_symbols.configure_search(options.stride, options.range)
+
+ if not options.pc and options.address is None:
+ # default to
+ options.frame = True
+
+ if options.frame:
+ if not exe_ctx.frame.IsValid():
+ result.SetError("invalid frame")
+ return
+
+ threads = exe_ctx.process.threads if options.thread else [
+ exe_ctx.thread]
+
+ for thread in threads:
+ for frame in thread:
+ res = efi_symbols.address_to_symbols(frame.pc)
+ self.lldb_print(res)
+
+ else:
+ if options.address is not None:
+ address = options.address
+ elif options.pc:
+ try:
+ address = exe_ctx.thread.GetSelectedFrame().pc
+ except ValueError:
+ result.SetError("invalid pc")
+ return
+ else:
+ address = 0
+
+ res = efi_symbols.address_to_symbols(address.pc)
+ print(res)
+
+ if options.extended:
+
+ gST = exe_ctx.target.FindFirstGlobalVariable('gST')
+ if gST.error.fail:
+ print('Error: This command requires symbols to be loaded')
+ else:
+ table = EfiConfigurationTable(file, gST.unsigned)
+ for address, _ in table.DebugImageInfo():
+ res = efi_symbols.address_to_symbols(address)
+ self.lldb_print(res)
+
+ # keep trying module file names until we find a GUID xref file
+ for m in exe_ctx.target.modules:
+ if GuidNames.add_build_guid_file(str(m.file)):
+ break
+
+
+def CHAR16_TypeSummary(valobj, internal_dict):
+ '''
+ Display CHAR16 as a String in the debugger.
+ Note: utf-8 is returned as that is the value for the debugger.
+ '''
+ SBError = lldb.SBError()
+ Str = ''
+ if valobj.TypeIsPointerType():
+ if valobj.GetValueAsUnsigned() == 0:
+ return "NULL"
+
+ # CHAR16 * max string size 1024
+ for i in range(1024):
+ Char = valobj.GetPointeeData(i, 1).GetUnsignedInt16(SBError, 0)
+ if SBError.fail or Char == 0:
+ break
+ Str += chr(Char)
+ return 'L"' + Str + '"'
+
+ if valobj.num_children == 0:
+ # CHAR16
+ return "L'" + chr(valobj.unsigned) + "'"
+
+ else:
+ # CHAR16 []
+ for i in range(valobj.num_children):
+ Char = valobj.GetChildAtIndex(i).data.GetUnsignedInt16(SBError, 0)
+ if Char == 0:
+ break
+ Str += chr(Char)
+ return 'L"' + Str + '"'
+
+ return Str
+
+
+def CHAR8_TypeSummary(valobj, internal_dict):
+ '''
+ Display CHAR8 as a String in the debugger.
+ Note: utf-8 is returned as that is the value for the debugger.
+ '''
+ SBError = lldb.SBError()
+ Str = ''
+ if valobj.TypeIsPointerType():
+ if valobj.GetValueAsUnsigned() == 0:
+ return "NULL"
+
+ # CHAR8 * max string size 1024
+ for i in range(1024):
+ Char = valobj.GetPointeeData(i, 1).GetUnsignedInt8(SBError, 0)
+ if SBError.fail or Char == 0:
+ break
+ Str += chr(Char)
+ Str = '"' + Str + '"'
+ return Str
+
+ if valobj.num_children == 0:
+ # CHAR8
+ return "'" + chr(valobj.unsigned) + "'"
+ else:
+ # CHAR8 []
+ for i in range(valobj.num_children):
+ Char = valobj.GetChildAtIndex(i).data.GetUnsignedInt8(SBError, 0)
+ if SBError.fail or Char == 0:
+ break
+ Str += chr(Char)
+ return '"' + Str + '"'
+
+ return Str
+
+
+def EFI_STATUS_TypeSummary(valobj, internal_dict):
+ if valobj.TypeIsPointerType():
+ return ''
+ return str(EfiStatusClass(valobj.unsigned))
+
+
+def EFI_TPL_TypeSummary(valobj, internal_dict):
+ if valobj.TypeIsPointerType():
+ return ''
+ return str(EfiTpl(valobj.unsigned))
+
+
+def EFI_GUID_TypeSummary(valobj, internal_dict):
+ if valobj.TypeIsPointerType():
+ return ''
+ return str(GuidNames(bytes(valobj.data.uint8)))
+
+
+def EFI_BOOT_MODE_TypeSummary(valobj, internal_dict):
+ if valobj.TypeIsPointerType():
+ return ''
+ '''Return #define name for EFI_BOOT_MODE'''
+ return str(EfiBootMode(valobj.unsigned))
+
+
+def lldb_type_formaters(debugger, mod_name):
+ '''Teach lldb about EFI types'''
+
+ category = debugger.GetDefaultCategory()
+ FormatBool = lldb.SBTypeFormat(lldb.eFormatBoolean)
+ category.AddTypeFormat(lldb.SBTypeNameSpecifier("BOOLEAN"), FormatBool)
+
+ FormatHex = lldb.SBTypeFormat(lldb.eFormatHex)
+ category.AddTypeFormat(lldb.SBTypeNameSpecifier("UINT64"), FormatHex)
+ category.AddTypeFormat(lldb.SBTypeNameSpecifier("INT64"), FormatHex)
+ category.AddTypeFormat(lldb.SBTypeNameSpecifier("UINT32"), FormatHex)
+ category.AddTypeFormat(lldb.SBTypeNameSpecifier("INT32"), FormatHex)
+ category.AddTypeFormat(lldb.SBTypeNameSpecifier("UINT16"), FormatHex)
+ category.AddTypeFormat(lldb.SBTypeNameSpecifier("INT16"), FormatHex)
+ category.AddTypeFormat(lldb.SBTypeNameSpecifier("UINT8"), FormatHex)
+ category.AddTypeFormat(lldb.SBTypeNameSpecifier("INT8"), FormatHex)
+ category.AddTypeFormat(lldb.SBTypeNameSpecifier("UINTN"), FormatHex)
+ category.AddTypeFormat(lldb.SBTypeNameSpecifier("INTN"), FormatHex)
+ category.AddTypeFormat(lldb.SBTypeNameSpecifier("CHAR8"), FormatHex)
+ category.AddTypeFormat(lldb.SBTypeNameSpecifier("CHAR16"), FormatHex)
+ category.AddTypeFormat(lldb.SBTypeNameSpecifier(
+ "EFI_PHYSICAL_ADDRESS"), FormatHex)
+ category.AddTypeFormat(lldb.SBTypeNameSpecifier(
+ "PHYSICAL_ADDRESS"), FormatHex)
+ category.AddTypeFormat(lldb.SBTypeNameSpecifier("EFI_LBA"), FormatHex)
+ category.AddTypeFormat(
+ lldb.SBTypeNameSpecifier("EFI_BOOT_MODE"), FormatHex)
+ category.AddTypeFormat(lldb.SBTypeNameSpecifier(
+ "EFI_FV_FILETYPE"), FormatHex)
+
+ #
+ # Smart type printing for EFI
+ #
+
+ debugger.HandleCommand(
+ f'type summary add GUID - -python-function '
+ f'{mod_name}.EFI_GUID_TypeSummary')
+ debugger.HandleCommand(
+ f'type summary add EFI_GUID --python-function '
+ f'{mod_name}.EFI_GUID_TypeSummary')
+ debugger.HandleCommand(
+ f'type summary add EFI_STATUS --python-function '
+ f'{mod_name}.EFI_STATUS_TypeSummary')
+ debugger.HandleCommand(
+ f'type summary add EFI_TPL - -python-function '
+ f'{mod_name}.EFI_TPL_TypeSummary')
+ debugger.HandleCommand(
+ f'type summary add EFI_BOOT_MODE --python-function '
+ f'{mod_name}.EFI_BOOT_MODE_TypeSummary')
+
+ debugger.HandleCommand(
+ f'type summary add CHAR16 --python-function '
+ f'{mod_name}.CHAR16_TypeSummary')
+
+ # W605 this is the correct escape sequence for the lldb command
+ debugger.HandleCommand(
+ f'type summary add --regex "CHAR16 \[[0-9]+\]" ' # noqa: W605
+ f'--python-function {mod_name}.CHAR16_TypeSummary')
+
+ debugger.HandleCommand(
+ f'type summary add CHAR8 --python-function '
+ f'{mod_name}.CHAR8_TypeSummary')
+
+ # W605 this is the correct escape sequence for the lldb command
+ debugger.HandleCommand(
+ f'type summary add --regex "CHAR8 \[[0-9]+\]" ' # noqa: W605
+ f'--python-function {mod_name}.CHAR8_TypeSummary')
+
+
+class LldbWorkaround:
+ needed = True
+
+ @classmethod
+ def activate(cls):
+ if cls.needed:
+ lldb.debugger.HandleCommand("process handle SIGALRM -n false")
+ cls.needed = False
+
+
+def LoadEmulatorEfiSymbols(frame, bp_loc, internal_dict):
+ #
+ # This is an lldb breakpoint script, and assumes the breakpoint is on a
+ # function with the same prototype as SecGdbScriptBreak(). The
+ # argument names are important as lldb looks them up.
+ #
+ # VOID
+ # SecGdbScriptBreak (
+ # char *FileName,
+ # int FileNameLength,
+ # long unsigned int LoadAddress,
+ # int AddSymbolFlag
+ # )
+ # {
+ # return;
+ # }
+ #
+ # When the emulator loads a PE/COFF image, it calls the stub function with
+ # the filename of the symbol file, the length of the FileName, the
+ # load address and a flag to indicate if this is a load or unload operation
+ #
+ LldbWorkaround().activate()
+
+ symbols = EfiSymbols(frame.thread.process.target)
+ LoadAddress = frame.FindVariable("LoadAddress").unsigned
+ if frame.FindVariable("AddSymbolFlag").unsigned == 1:
+ res = symbols.address_to_symbols(LoadAddress)
+ else:
+ res = symbols.unload_symbols(LoadAddress)
+ print(res)
+
+ # make breakpoint command continue
+ return False
+
+
+def __lldb_init_module(debugger, internal_dict):
+ '''
+ This initializer is being run from LLDB in the embedded command interpreter
+ '''
+
+ mod_name = Path(__file__).stem
+ lldb_type_formaters(debugger, mod_name)
+
+ # Add any commands contained in this module to LLDB
+ debugger.HandleCommand(
+ f'command script add -c {mod_name}.EfiSymbolicateCommand efi_symbols')
+ debugger.HandleCommand(
+ f'command script add -c {mod_name}.EfiGuidCommand guid')
+ debugger.HandleCommand(
+ f'command script add -c {mod_name}.EfiTableCommand table')
+ debugger.HandleCommand(
+ f'command script add -c {mod_name}.EfiHobCommand hob')
+ debugger.HandleCommand(
+ f'command script add -c {mod_name}.EfiDevicePathCommand devicepath')
+
+ print('EFI specific commands have been installed.')
+
+ # patch the ctypes c_void_p values if the debuggers OS and EFI have
+ # different ideas on the size of the debug.
+ try:
+ patch_ctypes(debugger.GetSelectedTarget().addr_size)
+ except ValueError:
+ # incase the script is imported and the debugger has not target
+ # defaults to sizeof(UINTN) == sizeof(UINT64)
+ patch_ctypes()
+
+ try:
+ target = debugger.GetSelectedTarget()
+ if target.FindFunctions('SecGdbScriptBreak').symbols:
+ breakpoint = target.BreakpointCreateByName('SecGdbScriptBreak')
+ # Set the emulator breakpoints, if we are in the emulator
+ cmd = 'breakpoint command add -s python -F '
+ cmd += f'efi_lldb.LoadEmulatorEfiSymbols {breakpoint.GetID()}'
+ debugger.HandleCommand(cmd)
+ print('Type r to run emulator.')
+ else:
+ raise ValueError("No Emulator Symbols")
+
+ except ValueError:
+ # default action when the script is imported
+ debugger.HandleCommand("efi_symbols --frame --extended")
+ debugger.HandleCommand("register read")
+ debugger.HandleCommand("bt all")
+
+
+if __name__ == '__main__':
+ pass
--
2.34.1


Re: [PATCH v3 0/3] BaseTools: fix gcc workaround

Bob Feng
 

Hi Gerd,

Your patches are great but I think we can't take them because of the incompatible license.
I think the new Toolchain definition, like GCC12, can not resolve this issue because Toolchain is not used for building BaseTools.
So I'd prefer the second option of using 'gcc -dumpversion'.

And also we have the task to convert the tools implemented by C to python implementation. After we have done that, there will be no BaseTools build issue.
https://github.com/tianocore/edk2-staging/tree/PyBaseTools

@Gao, Liming @Chen, Christine
Could you review the corresponding patch?

Thanks,
Bob

-----Original Message-----
From: Gerd Hoffmann <kraxel@...>
Sent: Thursday, April 7, 2022 6:12 PM
To: Pedro Falcato <pedro.falcato@...>
Cc: edk2-devel-groups-io <devel@edk2.groups.io>; Chen, Christine <yuwei.chen@...>; Gao, Liming <gaoliming@...>; Pawel Polawski <ppolawsk@...>; Feng, Bob C <bob.c.feng@...>; Oliver Steffen <osteffen@...>; Rebecca Cran <rebecca@...>
Subject: Re: [edk2-devel] [PATCH v3 0/3] BaseTools: fix gcc workaround

On Mon, Apr 04, 2022 at 04:18:56PM +0100, Pedro Falcato wrote:
Hi Gerd,

These patches are a great idea but I don't know if we can take GPLv2
code like that. Are they even mergeable into the main edk2 repo (as
it's not compatible with BSD-2-clause)?
It's build system, doesn't end up being linked into firmware code, so not sure license compatibility is actually a problem here.

In any case I strongly prefer to fix that in some automatic way which does *not* require a new GCC12 tool chain definition.

So, any comments how to move forward with this?
Can we take the series as-is?
If not, other suggestions?
Second-best idea I've seen on the list is using 'gcc -dumpversion'.

Is it an option to just raise the minimum required gcc version to something newer? gcc5 was released almost 7 years ago ...

take care,
Gerd


Re: [PATCH v1 0/3] Add Variable Flash Info HOB

Michael Kubacki
 

Hi Hao,

I addressed all of your feedback including abstraction of the information with a library API in v2. It did help clean up the consumption code quite a bit.

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

Thanks,
Michael

On 4/7/2022 7:56 PM, Michael Kubacki wrote:
Yes, I considered that as well but I was not sure if it was worth adding a new library just for that. I agree though that the code should not be duplicated. I will look into it and include your other suggestions in a v2 series.
Thanks,
Michael
On 4/6/2022 11:31 PM, Wu, Hao A wrote:
Sorry for a question:
GetVariableFlashInfo() seems being defined multiple times across modules, do you see value in abstracting it as a library API?

Best Regards,
Hao Wu

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Michael
Kubacki
Sent: Thursday, April 7, 2022 12:27 AM
To: devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@...>; Wu, Hao A <hao.a.wu@...>;
Gao, Liming <gaoliming@...>
Subject: [edk2-devel] [PATCH v1 0/3] Add Variable Flash Info HOB

From: Michael Kubacki <michael.kubacki@...>

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

The UEFI variable drivers such as VariableRuntimeDxe, VariableSmm,
VariableStandaloneMm, etc. (and their dependent protocol/library
stack), typically acquire UEFI variable store flash information
with PCDs declared in MdeModulePkg.

For example:
[Pcd]
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize

These PCDs work as-is in the StandaloneMm driver if they are not
dynamic such as Dynamic or DynamicEx because PCD services are not
readily available in the Standalone MM environment. Platforms that
use Standalone MM today, must define these PCDs as FixedAtBuild in
their platform build. However, the PCDs do allow platforms to treat
the PCDs as Dynamic/DynamicEx and being able to support that is
currently a gap for Standalone MM.

This patch series introduces a HOB that can be produced by the
platform to provide the same information. The HOB list is
available to Standalone MM.

The PCD declarations are left as-is in MdeModulePkg for backward
compatibility. This means unless a platform wants to use the HOB,
their code will continue to work with no change (they do not need
to produce the HOB). Only if the HOB is found, is its value used
instead of the PCDs.

Cc: Jian J Wang <jian.j.wang@...>
Cc: Hao A Wu <hao.a.wu@...>
Cc: Liming Gao <gaoliming@...>
Signed-off-by: Michael Kubacki <michael.kubacki@...

Michael Kubacki (3):
   MdeModulePkg: Add Variable Flash Info HOB
   MdeModulePkg/Variable: Consume Variable Info HOB
   MdeModulePkg/FaultTolerantWrite: Consume Variable Info HOB

MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c |
111 +++++++++++++++++---
  MdeModulePkg/Universal/FaultTolerantWriteDxe/UpdateWorkingBlock.c
|   7 +-
  MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.c
|  92 ++++++++++++++--
MdeModulePkg/Universal/Variable/Pei/Variable.c |  66
+++++++++++-
MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c |  42
++++++++
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c |
25 ++++-
  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableNonVolatile.c
|  20 +++-
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c |
20 +++-
MdeModulePkg/Include/Guid/VariableFlashInfo.h |  36
+++++++
MdeModulePkg/MdeModulePkg.dec |   4 +
  MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.h
|   9 +-
  MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
|  11 +-
  MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf
|  11 +-

MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandalon
eMm.inf |  11 +-
  MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.inf
|  10 +-
MdeModulePkg/Universal/Variable/Pei/Variable.h |   2 +
MdeModulePkg/Universal/Variable/Pei/VariablePei.inf |   6 +-
MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h |  17
+++
  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
|   6 +-
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf |
6 +-
  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf
|   6 +-
  21 files changed, 455 insertions(+), 63 deletions(-)
  create mode 100644 MdeModulePkg/Include/Guid/VariableFlashInfo.h

--
2.28.0.windows.1



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



[PATCH v2 8/8] UefiPayloadPkg: Add VariableFlashInfoLib

Michael Kubacki
 

From: Michael Kubacki <michael.kubacki@...>

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

Adds an instance of VariableFlashInfoLib to the platform build as
it is a new library class introduced in MdeModulePkg.

Cc: Guo Dong <guo.dong@...>
Cc: Ray Ni <ray.ni@...>
Cc: Maurice Ma <maurice.ma@...>
Cc: Benjamin You <benjamin.you@...>
Cc: Sean Rhodes <sean@...>
Signed-off-by: Michael Kubacki <michael.kubacki@...>
---
UefiPayloadPkg/UefiPayloadPkg.dsc | 1 +
1 file changed, 1 insertion(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPaylo=
adPkg.dsc
index e2ea48348257..170c5a1db4b2 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -272,6 +272,7 @@ [LibraryClasses]
VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolic=
yLib.inf
VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/V=
ariablePolicyHelperLib.inf
+ VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/Bas=
eVariableFlashInfoLib.inf
VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf
ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeRep=
ortStatusCodeLib.inf
=20
--=20
2.28.0.windows.1


[PATCH v2 7/8] OvmfPkg: Add VariableFlashInfoLib

Michael Kubacki
 

From: Michael Kubacki <michael.kubacki@...>

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

Adds an instance of VariableFlashInfoLib to the platform build as
it is a new library class introduced in MdeModulePkg.

Cc: Anthony Perard <anthony.perard@...>
Cc: Ard Biesheuvel <ardb+tianocore@...>
Cc: Brijesh Singh <brijesh.singh@...>
Cc: Erdem Aktas <erdemaktas@...>
Cc: Gerd Hoffmann <kraxel@...>
Cc: James Bottomley <jejb@...>
Cc: Jiewen Yao <jiewen.yao@...>
Cc: Jordan Justen <jordan.l.justen@...>
Cc: Julien Grall <julien@...>
Cc: Min Xu <min.m.xu@...>
Cc: Peter Grehan <grehan@...>
Cc: Rebecca Cran <rebecca@...>
Cc: Sebastien Boeuf <sebastien.boeuf@...>
Cc: Tom Lendacky <thomas.lendacky@...>
Signed-off-by: Michael Kubacki <michael.kubacki@...>
---
OvmfPkg/AmdSev/AmdSevX64.dsc | 1 +
OvmfPkg/Bhyve/BhyveX64.dsc | 1 +
OvmfPkg/CloudHv/CloudHvX64.dsc | 1 +
OvmfPkg/IntelTdx/IntelTdxX64.dsc | 1 +
OvmfPkg/Microvm/MicrovmX64.dsc | 1 +
OvmfPkg/OvmfPkgIa32.dsc | 1 +
OvmfPkg/OvmfPkgIa32X64.dsc | 1 +
OvmfPkg/OvmfPkgX64.dsc | 1 +
OvmfPkg/OvmfXen.dsc | 1 +
9 files changed, 9 insertions(+)

diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc
index fcdc3efab204..3868c577fe39 100644
--- a/OvmfPkg/AmdSev/AmdSevX64.dsc
+++ b/OvmfPkg/AmdSev/AmdSevX64.dsc
@@ -195,6 +195,7 @@ [LibraryClasses]
VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolic=
yLib.inf
VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/V=
ariablePolicyHelperLib.inf
+ VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/Bas=
eVariableFlashInfoLib.inf
=20
!if $(BUILD_SHELL) =3D=3D TRUE
ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc
index e1b6b8e15f36..3df49e54de8a 100644
--- a/OvmfPkg/Bhyve/BhyveX64.dsc
+++ b/OvmfPkg/Bhyve/BhyveX64.dsc
@@ -206,6 +206,7 @@ [LibraryClasses]
VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolic=
yLib.inf
VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/V=
ariablePolicyHelperLib.inf
+ VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/Bas=
eVariableFlashInfoLib.inf
=20
#
# Network libraries
diff --git a/OvmfPkg/CloudHv/CloudHvX64.dsc b/OvmfPkg/CloudHv/CloudHvX64.=
dsc
index 20f3bc340807..19b84275eba3 100644
--- a/OvmfPkg/CloudHv/CloudHvX64.dsc
+++ b/OvmfPkg/CloudHv/CloudHvX64.dsc
@@ -216,6 +216,7 @@ [LibraryClasses]
VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolic=
yLib.inf
VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/V=
ariablePolicyHelperLib.inf
+ VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/Bas=
eVariableFlashInfoLib.inf
=20
=20
#
diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.dsc b/OvmfPkg/IntelTdx/IntelTdx=
X64.dsc
index 245155d41b30..f21a33ed6ba3 100644
--- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc
+++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
@@ -184,6 +184,7 @@ [LibraryClasses]
VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolic=
yLib.inf
VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/V=
ariablePolicyHelperLib.inf
+ VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/Bas=
eVariableFlashInfoLib.inf
=20
ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.=
inf
diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc b/OvmfPkg/Microvm/MicrovmX64.=
dsc
index 59580ccd4691..d8603f016a0c 100644
--- a/OvmfPkg/Microvm/MicrovmX64.dsc
+++ b/OvmfPkg/Microvm/MicrovmX64.dsc
@@ -206,6 +206,7 @@ [LibraryClasses]
VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolic=
yLib.inf
VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/V=
ariablePolicyHelperLib.inf
+ VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/Bas=
eVariableFlashInfoLib.inf
=20
=20
#
diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
index e4218b01f0fc..c689d4707046 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -213,6 +213,7 @@ [LibraryClasses]
VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolic=
yLib.inf
VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/V=
ariablePolicyHelperLib.inf
+ VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/Bas=
eVariableFlashInfoLib.inf
=20
=20
#
diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
index a80cdaacb8bc..44c75639aa5d 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -217,6 +217,7 @@ [LibraryClasses]
VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolic=
yLib.inf
VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/V=
ariablePolicyHelperLib.inf
+ VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/Bas=
eVariableFlashInfoLib.inf
=20
=20
#
diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index fb2899f8a1be..60e7e3724a6b 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -225,6 +225,7 @@ [LibraryClasses]
VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolic=
yLib.inf
VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/V=
ariablePolicyHelperLib.inf
+ VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/Bas=
eVariableFlashInfoLib.inf
=20
=20
#
diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc
index 7bd594c6e263..01d832323585 100644
--- a/OvmfPkg/OvmfXen.dsc
+++ b/OvmfPkg/OvmfXen.dsc
@@ -195,6 +195,7 @@ [LibraryClasses]
VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolic=
yLib.inf
VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/V=
ariablePolicyHelperLib.inf
+ VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/Bas=
eVariableFlashInfoLib.inf
=20
=20
#
--=20
2.28.0.windows.1


[PATCH v2 6/8] EmulatorPkg: Add VariableFlashInfoLib

Michael Kubacki
 

From: Michael Kubacki <michael.kubacki@...>

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

Adds an instance of VariableFlashInfoLib to the platform build as
it is a new library class introduced in MdeModulePkg.

Cc: Andrew Fish <afish@...>
Cc: Ray Ni <ray.ni@...>
Cc: Abner Chang <abner.chang@...>
Cc: Nickle Wang <nickle.wang@...>
Signed-off-by: Michael Kubacki <michael.kubacki@...>
---
EmulatorPkg/EmulatorPkg.dsc | 1 +
1 file changed, 1 insertion(+)

diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc
index 554c13ddb500..4cf886b9eac7 100644
--- a/EmulatorPkg/EmulatorPkg.dsc
+++ b/EmulatorPkg/EmulatorPkg.dsc
@@ -122,6 +122,7 @@ [LibraryClasses]
VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolic=
yLibRuntimeDxe.inf
VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/V=
ariablePolicyHelperLib.inf
+ VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/Bas=
eVariableFlashInfoLib.inf
SortLib|MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf
ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
--=20
2.28.0.windows.1

8061 - 8080 of 96644