Skip to content

Commit

Permalink
Merge branch 'release/202302' into personal/joschock/add_hid_parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
joschock authored Oct 13, 2023
2 parents cdb08eb + 4ca8d64 commit bce15a4
Show file tree
Hide file tree
Showing 37 changed files with 2,015 additions and 671 deletions.
2 changes: 1 addition & 1 deletion .azurepipelines/MuDevOpsWrapper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ resources:
type: github
endpoint: microsoft
name: microsoft/mu_devops
ref: refs/tags/v6.5.1
ref: refs/tags/v7.0.0

parameters:
- name: do_ci_build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/auto-approve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ jobs:
approval_check:
if: |
github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'uefibot'
uses: microsoft/mu_devops/.github/workflows/AutoApprover.yml@v6.5.1
uses: microsoft/mu_devops/.github/workflows/AutoApprover.yml@v7.0.0
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ jobs:
merge_check:
if: |
github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'uefibot'
uses: microsoft/mu_devops/.github/workflows/AutoMerger.yml@v6.5.1
uses: microsoft/mu_devops/.github/workflows/AutoMerger.yml@v7.0.0
secrets: inherit
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '>=3.11'
python-version: '3.12'

- name: Generate Package Matrix
id: generate_matrix
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '>=3.11'
python-version: '3.12'
cache: 'pip'
cache-dependency-path: 'pip-requirements.txt'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issue-assignment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ on:

jobs:
apply:
uses: microsoft/mu_devops/.github/workflows/IssueAssignment.yml@v6.5.1
uses: microsoft/mu_devops/.github/workflows/IssueAssignment.yml@v7.0.0
2 changes: 1 addition & 1 deletion .github/workflows/label-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ on:

jobs:
apply:
uses: microsoft/mu_devops/.github/workflows/Labeler.yml@v6.5.1
uses: microsoft/mu_devops/.github/workflows/Labeler.yml@v7.0.0
2 changes: 1 addition & 1 deletion .github/workflows/label-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ on:

jobs:
sync:
uses: microsoft/mu_devops/.github/workflows/LabelSyncer.yml@v6.5.1
uses: microsoft/mu_devops/.github/workflows/LabelSyncer.yml@v7.0.0
2 changes: 1 addition & 1 deletion .github/workflows/release-draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ on:

jobs:
draft:
uses: microsoft/mu_devops/.github/workflows/ReleaseDrafter.yml@v6.5.1
uses: microsoft/mu_devops/.github/workflows/ReleaseDrafter.yml@v7.0.0
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ on:

jobs:
check:
uses: microsoft/mu_devops/.github/workflows/Stale.yml@v6.5.1
uses: microsoft/mu_devops/.github/workflows/Stale.yml@v7.0.0
2 changes: 1 addition & 1 deletion .github/workflows/triage-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ on:

jobs:
triage:
uses: microsoft/mu_devops/.github/workflows/IssueTriager.yml@v6.5.1
uses: microsoft/mu_devops/.github/workflows/IssueTriager.yml@v7.0.0
6 changes: 6 additions & 0 deletions AdvLoggerPkg/Docs/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,12 @@ and the follow change is needed in the .fdf:
The v3 data header supports a new field of hardware debugging level to support setting the serial print configurable
during boot time.

All debug prints will be filtered by multiple build time flags, such as `PcdDebugPrintErrorLevel`, `MDEPKG_NDEBUG`, etc.
Prints that pass such filters will be logged to memory, and then fed to the hardware port library to be checked
against the hardware print level. A full data flow chart is shown below:

![Debug Logging Level Filters](debug_log_level.png)

The default value will be initialized to the value of `PcdAdvancedLoggerHdwPortDebugPrintErrorLevel` in the PEI core,
DXE core, or MM core, whichever comes first during the boot process.

Expand Down
Binary file added AdvLoggerPkg/Docs/debug_log_level.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,5 @@ AdvancedLoggerHdwPortWrite (
IN UINTN NumberOfBytes
)
{
UINTN NumberReturned;

NumberReturned = NumberOfBytes;
if (DebugLevel & PcdGet32 (PcdAdvancedLoggerHdwPortDebugPrintErrorLevel)) {
NumberReturned = SerialPortWrite (Buffer, NumberOfBytes);
}

return NumberReturned;
return SerialPortWrite (Buffer, NumberOfBytes);
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## @file
# Advanced Logger Access library.
# Advanced Logger Hardware Port Library.
#
# Copyright (c) Microsoft Corporation.
#
Expand Down Expand Up @@ -30,10 +30,5 @@
[LibraryClasses]
SerialPortLib

[Protocols]

[Pcd]
gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerHdwPortDebugPrintErrorLevel ## CONSUMES

[Depex]
TRUE
17 changes: 14 additions & 3 deletions AdvLoggerPkg/Library/AdvancedLoggerLib/AdvancedLoggerCommon.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,24 @@ AdvancedLoggerWrite (
// If LoggerInfo == NULL, assume there is a HdwPort and it has not been disabled. This
// does occur in SEC
if ((LoggerInfo == NULL) || (!LoggerInfo->HdwPortDisabled)) {
if (DebugLevel & PcdGet32 (PcdAdvancedLoggerHdwPortDebugPrintErrorLevel)) {
AdvancedLoggerHdwPortWrite (DebugLevel, (UINT8 *)Buffer, NumberOfBytes);
}
}

#else
if ((LoggerInfo != NULL) && (!LoggerInfo->HdwPortDisabled)) {
// if we are at a high enough version to support HW_LVL logging, only call the HdwPortWrite if this DebugLevel
// is asked to be logged
// if we are at an older version, check the PCD to see if we should log this message
if (LoggerInfo->Version >= ADVANCED_LOGGER_HW_LVL_VER) {
DebugLevel = (DebugLevel & LoggerInfo->HwPrintLevel);
if (DebugLevel & LoggerInfo->HwPrintLevel) {
AdvancedLoggerHdwPortWrite (DebugLevel, (UINT8 *)Buffer, NumberOfBytes);
}
} else if (DebugLevel & PcdGet32 (PcdAdvancedLoggerHdwPortDebugPrintErrorLevel)) {
AdvancedLoggerHdwPortWrite (DebugLevel, (UINT8 *)Buffer, NumberOfBytes);
}
}

#endif
AdvancedLoggerHdwPortWrite (DebugLevel, (UINT8 *)Buffer, NumberOfBytes);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
SynchronizationLib

[Pcd]
gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerBase
gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerBase ## CONSUMES
gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerHdwPortDebugPrintErrorLevel ## SOMETIMES_CONSUMES

[Depex]
TRUE
TRUE
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@
gEfiDebugPortProtocolGuid ## CONSUMES

[Pcd]
gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerHdwPortDebugPrintErrorLevel ## SOMETIMES_CONSUMES
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,8 @@
[Guids]
gAdvancedLoggerHobGuid

[Pcd]
gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerHdwPortDebugPrintErrorLevel ## SOMETIMES_CONSUMES

[Depex]
TRUE
TRUE
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@
gAdvancedLoggerPpiGuid ## CONSUMES

[Pcd]
gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerHdwPortDebugPrintErrorLevel ## SOMETIMES_CONSUMES
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@

[Pcd]
gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerBase ## CONSUMES
gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerHdwPortDebugPrintErrorLevel ## SOMETIMES_CONSUMES
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@
gAdvancedLoggerProtocolGuid ## CONSUMES

[Pcd]
gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerHdwPortDebugPrintErrorLevel ## SOMETIMES_CONSUMES
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerBase ## CONSUMES
gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerPreMemPages ## CONSUMES
gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerPages ## CONSUMES
gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerHdwPortDebugPrintErrorLevel ## CONSUMES

[BuildOptions]
*_*_*_CC_FLAGS = -D ADVANCED_LOGGER_SEC=1
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@
gAdvancedLoggerProtocolGuid ## CONSUMES

[Pcd]
gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerHdwPortDebugPrintErrorLevel ## SOMETIMES_CONSUMES
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/

#include <Library/ArmLib.h>
#include <Protocol/MemoryAttribute.h>
#include "../PagingAuditCommon.h"

extern MEMORY_PROTECTION_DEBUG_PROTOCOL *mMemoryProtectionProtocol;
Expand Down Expand Up @@ -75,7 +76,6 @@ GetFlatPageTableData (
UINTN NumPage1GNotPresent = 0;
UINT64 RootEntryCount = 0;
UINT64 Address;
BOOLEAN Valid;

// Count parameters should be provided.
if ((Pte1GCount == NULL) || (Pte2MCount == NULL) || (Pte4KCount == NULL) || (PdeCount == NULL) || (GuardCount == NULL)) {
Expand Down Expand Up @@ -116,13 +116,12 @@ GetFlatPageTableData (
for (Index1 = 0x0; Index1 < TT_ENTRY_COUNT; Index1++ ) {
Index2 = 0;
Index3 = 0;
Valid = TRUE;
if ((Pte1G[Index1] & 0x1) == 0) {
NumPage1GNotPresent++;
Valid = FALSE;
continue;
}

if (!IS_BLOCK (Pte1G[Index1], 1) && Valid) {
if (!IS_BLOCK (Pte1G[Index1], 1)) {
Pte2M = (UINT64 *)(Pte1G[Index1] & TT_ADDRESS_MASK);

MyPdeCount++;
Expand All @@ -132,13 +131,12 @@ GetFlatPageTableData (

for (Index2 = 0x0; Index2 < TT_ENTRY_COUNT; Index2++ ) {
Index3 = 0;
Valid = TRUE;
if ((Pte2M[Index2] & 0x1) == 0) {
NumPage2MNotPresent++;
Valid = FALSE;
continue;
}

if (!IS_BLOCK (Pte2M[Index2], 2) && Valid) {
if (!IS_BLOCK (Pte2M[Index2], 2)) {
Pte4K = (UINT64 *)(Pte2M[Index2] & TT_ADDRESS_MASK);
MyPdeCount++;

Expand Down Expand Up @@ -251,10 +249,11 @@ DumpPlatforminfo (
VOID
)
{
CHAR8 TempString[MAX_STRING_SIZE];
UINTN ExecutionLevel;
CHAR8 *ElString;
UINTN StringIndex;
CHAR8 TempString[MAX_STRING_SIZE];
UINTN ExecutionLevel;
CHAR8 *ElString;
UINTN StringIndex;
EFI_MEMORY_ATTRIBUTE_PROTOCOL *MemoryAttributeProtocol;

ExecutionLevel = ArmReadCurrentEL ();

Expand All @@ -268,13 +267,18 @@ DumpPlatforminfo (
ElString = "Unknown";
}

if (EFI_ERROR (gBS->LocateProtocol (&gEfiMemoryAttributeProtocolGuid, NULL, (VOID **)&MemoryAttributeProtocol))) {
MemoryAttributeProtocol = NULL;
}

// Dump the execution level of UEFI
StringIndex = AsciiSPrint (
&TempString[0],
MAX_STRING_SIZE,
"Architecture,AARCH64\nBitwidth,%d\nPhase,DXE\nExecutionLevel,%a\n",
"Architecture,AARCH64\nBitwidth,%d\nPhase,DXE\nExecutionLevel,%a\nMemoryAttributeProtocolPresent,%a\n",
CalculateMaximumSupportAddressBits (),
ElString
ElString,
(MemoryAttributeProtocol == NULL) ? "FALSE" : "TRUE"
);

WriteBufferToFile (L"PlatformInfo", TempString, StringIndex);
Expand Down
Loading

0 comments on commit bce15a4

Please sign in to comment.