Skip to content

Commit

Permalink
Merge branch 'release/202302' into personal/apop5/fixdxecoreonly
Browse files Browse the repository at this point in the history
  • Loading branch information
apop5 authored Nov 14, 2023
2 parents 70c3ff6 + fdf2231 commit 49e0c33
Show file tree
Hide file tree
Showing 105 changed files with 9,343 additions and 949 deletions.
20 changes: 15 additions & 5 deletions .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.1.0
ref: refs/tags/v7.2.0

parameters:
- name: do_ci_build
Expand All @@ -40,6 +40,13 @@ parameters:
displayName: Perform Stuart PR Evaluation
type: boolean
default: true
- name: calculate_code_coverage
displayName: Calculate Code Coverage From Unit Tests
default: false
- name: coverage_publish_target
displayName: Code Coverage Publish Target
type: string
default: 'ado' # 'ado', 'codecov'
- name: container_build
displayName: Flag for whether this repo should do stuart_setup
type: boolean
Expand Down Expand Up @@ -80,14 +87,14 @@ parameters:
jobs:
- template: Jobs/PrGate.yml@mu_devops
parameters:
linux_container_image: ghcr.io/microsoft/mu_devops/ubuntu-22-build:9ab29bc
linux_container_image: ghcr.io/microsoft/mu_devops/ubuntu-22-build:1082f35
${{ if eq(parameters.rust_build, true) }}:
linux_container_options: --security-opt seccomp=unconfined
extra_steps:
- template: Steps/RustSetupSteps.yml@mu_devops
do_ci_build: ${{ parameters.do_ci_build }}
do_ci_setup: ${{ parameters.do_ci_setup }}
do_pr_eval: ${{ parameters.do_pr_eval }}
calculate_code_coverage: ${{ parameters.calculate_code_coverage }}
coverage_publish_target: ${{ parameters.coverage_publish_target }}
do_non_ci_setup: ${{ parameters.do_non_ci_setup }}
do_non_ci_build: ${{ parameters.do_non_ci_build }}
build_matrix: ${{ parameters.build_matrix }}
Expand All @@ -97,14 +104,15 @@ jobs:
tool_chain_tag: $(tool_chain_tag)
vm_image: $(vm_image)
container_build: ${{ parameters.container_build }}
rust_build: ${{ parameters.rust_build }}

- ${{ if eq(parameters.rust_build, true) }}:
- job: CargoCmds
displayName: Workspace Cargo Commands

container:

image: ghcr.io/microsoft/mu_devops/ubuntu-22-build:9ab29bc
image: ghcr.io/microsoft/mu_devops/ubuntu-22-build:1082f35
options: --user root --name mu_devops_build_container --security-opt seccomp=unconfined

steps:
Expand All @@ -113,6 +121,8 @@ jobs:
clean: true
- ${{ parameters.extra_cargo_steps }}
- template: Steps/RustCargoSteps.yml@mu_devops
parameters:
container_build: true

- ${{ parameters.extra_jobs }}

15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#
# This dependabot file is limited to syncing the following type of dependencies. Other files
# are already available in Mu DevOps to sync other dependency types.
# - Rust Crate Dependencies (`cargo`)
# - GitHub Actions (`github-actions`)
# - Python PIP Modules (`pip`)
#
Expand All @@ -26,6 +27,20 @@
version: 2

updates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
timezone: "America/Los_Angeles"
time: "03:00"
commit-message:
prefix: "Rust Dependency"
labels:
- "type:dependencies"
- "type:dependabot"
rebase-strategy: "disabled"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
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.1.0
uses: microsoft/mu_devops/.github/workflows/AutoApprover.yml@v7.2.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.1.0
uses: microsoft/mu_devops/.github/workflows/AutoMerger.yml@v7.2.0
secrets: inherit
32 changes: 28 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- 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 @@ -89,12 +89,12 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- 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 Expand Up @@ -339,9 +339,33 @@ jobs:
- name: CI Build
env:
RUST_ENV_CHECK_TOOL_EXCLUSIONS: "cargo fmt, cargo tarpaulin"
STUART_CODEQL_PATH: ${{ steps.cache_key_gen.outputs.codeql_cli_ext_dep_dir }}
run: stuart_ci_build -c .pytool/CISettings.py -t DEBUG -p ${{ matrix.package }} -a ${{ matrix.archs }} TOOL_CHAIN_TAG=${{ matrix.tool_chain_tag }} --codeql

- name: Build Cleanup
id: build_cleanup
shell: python
run: |
import os
import shutil
from pathlib import Path
dirs_to_delete = ['ia32', 'x64', 'arm', 'aarch64']
def delete_dirs(path: Path):
if path.exists() and path.is_dir():
if path.name.lower() in dirs_to_delete:
print(f'Removed {str(path)}')
shutil.rmtree(path)
return
for child_dir in path.iterdir():
delete_dirs(child_dir)
build_path = Path(os.environ['GITHUB_WORKSPACE'], 'Build')
delete_dirs(build_path)
- name: Upload Build Logs As An Artifact
uses: actions/upload-artifact@v3
if: success() || failure()
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.1.0
uses: microsoft/mu_devops/.github/workflows/IssueAssignment.yml@v7.2.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.1.0
uses: microsoft/mu_devops/.github/workflows/Labeler.yml@v7.2.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.1.0
uses: microsoft/mu_devops/.github/workflows/LabelSyncer.yml@v7.2.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.1.0
uses: microsoft/mu_devops/.github/workflows/ReleaseDrafter.yml@v7.2.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.1.0
uses: microsoft/mu_devops/.github/workflows/Stale.yml@v7.2.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.1.0
uses: microsoft/mu_devops/.github/workflows/IssueTriager.yml@v7.2.0
1 change: 1 addition & 0 deletions .pytool/CISettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def GetPackagesSupported(self):
"AdvLoggerPkg",
"MfciPkg",
"HidPkg",
"MsApplicationPkg",
"MsCorePkg",
"MsGraphicsPkg",
"MsWheaPkg",
Expand Down
1 change: 1 addition & 0 deletions AdvLoggerPkg/AdvLoggerPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@

[Components]
AdvLoggerPkg/Library/BaseDebugLibAdvancedLogger/BaseDebugLibAdvancedLogger.inf
AdvLoggerPkg/Library/BasePanicLibAdvancedLogger/BasePanicLibAdvancedLogger.inf

[Components.IA32]
AdvLoggerPkg/Library/AdvancedLoggerLib/Pei/AdvancedLoggerLib.inf
Expand Down
18 changes: 17 additions & 1 deletion AdvLoggerPkg/Docs/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ The following libraries are used with AdvancedLogger:
| AdvancedLoggerLib | One per module type - used to provide access to the in memory log buffer |
| AdvLoggerSmmAccessLib | Used to intercept GetVariable in order to provide an OS utility the ability to read the log |
| BaseDebugLibAdvancedLogger | Basic Dxe etc DebugLib |
| BasePanicLibAdvancedLogger | Basic PanicLib that applies to all PI boot phases that AdvancedLoggerLib supports. |
| DebugAgent | Used to intercept SEC initialization |
| PeiDebugLibAdvancedLogger | Basic Pei DebugLib |
| AdvancedLoggerHdwPortLib | Hook for a hardware port to capture debug messages as they are written to the log. |
Expand Down Expand Up @@ -242,11 +243,26 @@ and the follow change is needed in the .fdf:
INF AdvLoggerPkg/AdvancedFileLogger/AdvancedFileLogger.inf
```

## Advanced Logger Retrieval From Windows

The Advanced Logger can be retrieved from Windows using the [DecodeUefiLog](../Application/DecodeUefiLog/ReadMe.md)
python utility. The utility runs under windows and retrieves the log through the `AdvLoggerAccessLib` instance
provided by the platform.

If reading of the log fails, please verify that the `AdvLoggerAccessLib` instance in the platform is either the
`AdvLoggerMmAccessLib` or the `AdvLoggerSmmAccessLib` and not the NULL instance provided by MdeModulePkg.

## Hardware Logging Level

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 All @@ -261,5 +277,5 @@ result in hardware printing not functional.

## Copyright

Copyright (C) Microsoft Corporation. All rights reserved.
Copyright (C) Microsoft Corporation. All rights reserved. \
SPDX-License-Identifier: BSD-2-Clause-Patent
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
Loading

0 comments on commit 49e0c33

Please sign in to comment.