Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MockDeviceBootManagerLib to 202311 #574

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[target.x86_64-unknown-uefi]
rustflags = [
"-C", "link-arg=/base:0x0",
"-C", "link-arg=/subsystem:efi_boot_service_driver",
]

[target.i686-unknown-uefi]
rustflags = [
"-C", "link-arg=/base:0x0",
"-C", "link-arg=/subsystem:efi_boot_service_driver",
]

[target.aarch64-unknown-uefi]
rustflags = [
"-C", "link-arg=/base:0x0",
"-C", "link-arg=/subsystem:efi_boot_service_driver",
]
29 changes: 3 additions & 26 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,18 @@
# Preface

Please ensure you have read the [contribution docs](https://github.com/microsoft/mu/blob/master/CONTRIBUTING.md) prior
to submitting the pull request. In particular,
[pull request guidelines](https://github.com/microsoft/mu/blob/master/CONTRIBUTING.md#pull-request-best-practices).

## Description

<_Please include a description of the change and why this change was made._>
<_Include a description of the change and why this change was made._>

For each item, place an "x" in between `[` and `]` if true. Example: `[x]`.
_(you can also check items in the GitHub UI)_
For details on how to complete to complete these options and their meaning refer to [CONTRIBUTING.md](https://github.com/microsoft/mu/blob/HEAD/CONTRIBUTING.md).

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware functions?
- Examples: Add a new library, publish a new PPI, update an algorithm, ...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an application,
flow, or firmware?
- Examples: Crypto algorithm change, buffer overflow fix, parameter
validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a break
in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo, call
a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
- **Tests** - Does the change include any explicit test code?
- Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation additions
outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to documentation
on an a separate Web page, ...

## How This Was Tested

<_Please describe the test(s) that were run to verify the changes._>
<_Describe the test(s) that were run to verify the changes._>

## Integration Instructions

Expand Down
3 changes: 2 additions & 1 deletion AdvLoggerPkg/AdvLoggerPkg.ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@
LOGTELEMETRY,
DEBUGAGENT,
POSTMEM,
MMARM
MMARM,
BLKIO
]
},

Expand Down
5 changes: 0 additions & 5 deletions AdvLoggerPkg/AdvLoggerPkg.dec
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,6 @@
#
gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerFixedInRAM|FALSE|BOOLEAN|0x00010189

## PcdAdvancedLoggerPeiInRAM - Tells the PEI Advanced Logger that this PEI can allocate memory
# and there is no need for a temporary memory buffer
#
gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerPeiInRAM|FALSE|BOOLEAN|0x00010185

## PcdAdvancedLoggerLocator - Tells the Advanced Logger to publish a variable with the logger info block address
#
gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerLocator|FALSE|BOOLEAN|0x00010186
Expand Down
63 changes: 32 additions & 31 deletions AdvLoggerPkg/Application/DecodeUefiLog/DecodeUefiLog.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
import copy

from win32com.shell import shell

from UefiVariablesSupportLib import UefiVariable
from edk2toollib.os.uefivariablesupport import UefiVariable


class AdvLogParser ():
Expand Down Expand Up @@ -260,9 +259,9 @@ class AdvLogParser ():
ADVANCED_LOGGER_PHASE_SMM = 9
ADVANCED_LOGGER_PHASE_TFA = 10
ADVANCED_LOGGER_PHASE_CNT = 11
PHASE_STRING_LIST = ["[UNSPECIFIED] ", "[SEC] ", "[PEI] ", "[PEI64] ",
"[DXE] ", "[RUNTIME] ", "[MM_CORE] ", "[MM] ",
"[SMM_CORE] ", "[SMM] ", "[TFA] "]
PHASE_STRING_LIST = ["[UNSPECIFIED]", "[SEC]", "[PEI]", "[PEI64]",
"[DXE]", "[RUNTIME]", "[MM_CORE]", "[MM]",
"[SMM_CORE]", "[SMM]", "[TFA]"]

# Debug levels from MU_BASECORE\MdePkg\Include\Library\DebugLib.h
# //
Expand Down Expand Up @@ -293,27 +292,27 @@ class AdvLogParser ():
# #define DEBUG_ERROR 0x80000000 // Error

debug_levels_dict = {
0x00000001: "[DEBUG_INIT]",
0x00000002: "[DEBUG_WARN]",
0x00000004: "[DEBUG_LOAD]",
0x00000008: "[DEBUG_FS]",
0x00000010: "[DEBUG_POOL]",
0x00000020: "[DEBUG_PAGE]",
0x00000040: "[DEBUG_INFO]",
0x00000080: "[DEBUG_DISPATCH]",
0x00000100: "[DEBUG_VARIABLE]",
0x00000200: "[DEBUG_SMI]",
0x00000400: "[DEBUG_BM]",
0x00001000: "[DEBUG_BLKIO]",
0x00004000: "[DEBUG_NET]",
0x00010000: "[DEBUG_UNDI]",
0x00020000: "[DEBUG_LOADFILE]",
0x00080000: "[DEBUG_EVENT]",
0x00100000: "[DEBUG_GCD]",
0x00200000: "[DEBUG_CACHE]",
0x00400000: "[DEBUG_VERBOSE]",
0x00800000: "[DEBUG_MANAGEABILITY]",
0x80000000: "[DEBUG_ERROR]"
0x00000001: "[INIT]",
0x00000002: "[WARN]",
0x00000004: "[LOAD]",
0x00000008: "[FS]",
0x00000010: "[POOL]",
0x00000020: "[PAGE]",
0x00000040: "[INFO]",
0x00000080: "[DISPATCH]",
0x00000100: "[VARIABLE]",
0x00000200: "[SMI]",
0x00000400: "[BM]",
0x00001000: "[BLKIO]",
0x00004000: "[NET]",
0x00010000: "[UNDI]",
0x00020000: "[LOADFILE]",
0x00080000: "[EVENT]",
0x00100000: "[GCD]",
0x00200000: "[CACHE]",
0x00400000: "[VERBOSE]",
0x00800000: "[MANAGEABILITY]",
0x80000000: "[ERROR]"
}

#
Expand Down Expand Up @@ -713,15 +712,17 @@ def _GetPhaseString(self, Phase):
elif Phase <= self.ADVANCED_LOGGER_PHASE_UNSPECIFIED:
PhaseString = ""
else:
PhaseString = self.PHASE_STRING_LIST[Phase]
# Add an extra space for readability
PhaseString = self.PHASE_STRING_LIST[Phase] + ' '
return PhaseString

#
# Get the formatted debug level string
#
def _GetDebugLevelString(self, DebugLevel):
if DebugLevel in list(self.debug_levels_dict.keys()):
DebugLevelString = self.debug_levels_dict[DebugLevel]
# Add an extra space for readability
DebugLevelString = self.debug_levels_dict[DebugLevel] + ' '
else:
DebugLevelString = ""
return DebugLevelString
Expand Down Expand Up @@ -1001,7 +1002,7 @@ def ReadLogFromUefiInterface():

while rc == 0:
VariableName = 'V'+str(Index)
(rc, var, errorstring) = UefiVar.GetUefiVar(VariableName, 'a021bf2b-34ed-4a98-859c-420ef94f3e94')
(rc, var) = UefiVar.GetUefiVar(VariableName, 'a021bf2b-34ed-4a98-859c-420ef94f3e94')
if (rc == 0):
Index += 1
InFile.write(var)
Expand Down Expand Up @@ -1058,7 +1059,7 @@ def main():
CountOfLines = len(lines)
print(f"{CountOfLines} lines written to {options.OutFilePath}")

except Exception as ex:
except Exception:
print("Error processing log output.")
traceback.print_exc()

Expand All @@ -1070,7 +1071,7 @@ def main():
RawFile.close()
print("RawFile complete")

except Exception as ex:
except Exception:
print("Error processing raw file output.")
traceback.print_exc()

Expand Down
114 changes: 0 additions & 114 deletions AdvLoggerPkg/Application/DecodeUefiLog/UefiVariablesSupportLib.py

This file was deleted.

4 changes: 1 addition & 3 deletions AdvLoggerPkg/Docs/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The following configurations are supported:
| --- | --- |
| DXE Only | Uses DxeCore, DxeRuntime, and Dxe AdvancedLoggerLib libraries for logging from start of DXE CORE through Exit Boot Services. Accepts the PEI Advanced Logger Hob if one is generated. Produces the AdvancedLogger protocol. |
| DXE+SMM | Requires DXE modules above, and adds the Smm AdvancedLoggerLib library. Collects SMM generated messages in the in memory log. |
| PEI | Uses PeiCore and Pei AdvancedLoggerLib libraries. Creates the Advanced Logger Hob if PcdAdvancedLoggerPeiInRAM is set. |
| PEI | Uses PeiCore and Pei AdvancedLoggerLib libraries. |
| SEC | Uses the Sec Advanced Logger Library. SEC requires a fixed load address, so it piggy backs on the Temporary RAM PCD information. Produces a Fixed Address temporary RAM log. When memory is added, the Sec Advanced Logger library converts the Temporary RAM logging information to the PEI Advanced Logger Hob. |
| PEI64 | Uses Pei64 Advanced Logger Library. Requires the SEC fixed address temporary log information in order to log Pei64 bit DEBUG messages. |
| MM | Standalone MM - Loads during PEI phase. |
Expand All @@ -25,10 +25,8 @@ PCD's used by Advanced Logger
| PCD | Function of the PCD|
| --- | --- |
|PcdAdvancedLoggerForceEnable | The default operation is to check if a Logs directory is present in the root of the filesystem. If the UefiLogs directory is present, logging is enabled. When PcdAdvancedLoggerForceEnable is TRUE, and the device is not a USB device, a UefiLogs directory will be created and logging is enabled. When logging is enabled, the proper log files will be created if not already preset.|
|PcdAdvancedLoggerPeiInRAM | For systems that have memory at PeiCore entry. The full in memory log buffer if PcdAdvancedLoggerPages is allocated in the Pei Core constructor and PcdAdvancedLoggerPreMemPages is ignored.|
|PcdAdvancedLoggerFixedInRAM | For systems that have a fixed memory buffer prior to UEFI. The full in memory log buffer is assumed.|
|PcdAdvancedHdwLoggerDebugPrintErrorLevel | The standard debug flags filter which log messages are produced. This PCD allow a subset of log messages to be forwarded to the Hdw Port Lib.|
|PcdAdvancedHdwLoggerDisable | Specifies when to disable writing to the Hdw Port.|
|PcdAdvancedLoggerPreMemPages | Amount of temporary RAM used for the debug log.|
|PcdAdvancedLoggerPages | Amount of system RAM used for the debug log|
|PcdAdvancedLoggerLocator | When enabled, the AdvLogger creates a variable "AdvLoggerLocator" with the address of the LoggerInfo buffer|
Expand Down
Loading
Loading