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

Advanced Logger Dump Windows Executable #452

Conversation

VivianNK
Copy link
Contributor

@VivianNK VivianNK commented Mar 22, 2024

Description

Console app to get Advanced Logger dump.

For each item, place an "x" in between [ and ] if true. Example: [x].
(you can also check items in the GitHub UI)

In draft, need to clean up and rebase so there are 47 irrelevant commits.

  • 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, ...
  • [ x] 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

Built and ran on ARM and x64 machines. Verified output was identical to DecodeUefiLog script raw dump.

Integration Instructions

N/A

dependabot bot and others added 30 commits October 26, 2023 20:51
Bumps
[edk2-pytool-extensions](https://github.com/tianocore/edk2-pytool-extensions)
from 0.25.0 to 0.25.1.

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…rosoft#342)

## Description

This crate provides a rust wrapper around UEFI HII Keyboard Layout
structures. The relevant structures defined in the UEFI spec are not
well-suited for direct definition in rust; so this crate defines
analogous rust structures and provides serialization/deserialization
support for converting the rust structures into byte buffers and vice
versa. This crate uses the `scroll` crate
(https://github.com/m4b/scroll) to facilitate
serialization/deserialization of the Hii structures.

## Examples and Usage
Retrieving a default (en-US) layout, writing it to a buffer, and then
reading the buffer back into a rust structure:

```
 use hii_keyboard_layout::{get_default_keyboard_pkg, HiiKeyboardPkg};
 use scroll::{Pread, Pwrite};
 let mut buffer = [0u8; 4096];

 let package = get_default_keyboard_pkg();
 buffer.pwrite(&package, 0).unwrap();

 let package2: HiiKeyboardPkg = buffer.pread(0).unwrap();
 assert_eq!(package, package2);
```

- [x] Impacts functionality?
  - Introduces a new crate providing support for HII layouts.
- [ ] Impacts security?
- [ ] Breaking change?
- [x] Includes tests?
  - Includes standard rust unit tests. 
- [x] Includes documentation?
  - Includes standard rust documentation.

## How This Was Tested

Verified by included unit tests.

## Integration Instructions
This crate requires the "scroll," "num-traits" and "num-drive" crates,
so platforms intending to use it will need to add these as dependencies
in their workspace Cargo.toml files. This PR does this for the workspace
Cargo.toml that is at the root of mu_plus.

Sample:
``` 
scroll = { version = "0.11", default-features = false, features = ["derive"]}
num-traits = { version = "0.2", default-features = false}
num-derive = { version = "0.4", default-features = false}
Bumps
[edk2-pytool-library](https://github.com/tianocore/edk2-pytool-library)
from 0.19.1 to 0.19.3.

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
## Description

Adds a new library class (InputChannelLib) that allows the TPM replay
event log to be passed through a platform-specific mechanism.

- [x] 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

- Passed FW CFG TPM event log through QemuQ35Pkg
- Verified library integrated without a custom log being passed uses
  lower priority input channels as expected
- Verified BaseInputChannelLibNull is functionally usable for skipping
  custom log input.

## Integration Instructions

Add
`InputChannelLib|TpmTestingPkg/Library/BaseInputChannelLibNull/BaseInputChannelLibNull.inf`
to a platform that uses the TPM Replay feature but does not provide a
custom input channel
instance.

Signed-off-by: Michael Kubacki <[email protected]>
…arameter (microsoft#349)

synced local file(s) with
[microsoft/mu_devops](https://github.com/microsoft/mu_devops).

🤖: View the [Repo File Sync Configuration
File](https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml)
to see how files are synced.

---

This PR was created automatically by the
[repo-file-sync-action](https://github.com/BetaHuhn/repo-file-sync-action)
workflow run
[#6774774926](https://github.com/microsoft/mu_devops/actions/runs/6774774926)

Signed-off-by: Project Mu UEFI Bot <[email protected]>
## Description

Adds an instance of PanicLib that outputs through advanced logger
using AdvancedLoggerLib.

This allows platforms already using advanced logger to use this
library instance which can decrease the size impact as opposed to
linking to output stacks like serial that might be redundant when
advanced logger is active.

- [x] 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, ...
- [x] 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

- Physical IA32/X64 platform with advanced logger used in PEI

---

Example of a test `PANIC()` placed in `ResetSystemPei` through this
library
instance:

```
PANIC [ResetSystemPei] d:\src\ws\MU_BASECORE\MdeModulePkg\Universal\ResetSystemPei\ResetSystem.c(110): Test panic
```

## Integration Instructions

Use this library instance if routing panic messages through advanced
logger
is preferred.

Signed-off-by: Michael Kubacki <[email protected]>
## Description

Adds HID keyboard support to UefiHidDxe input driver.

- [x] Impacts functionality?
  - Adds keyboard support.
- [ ] Impacts security?
- [ ] Breaking change?
- [ ] Includes tests?
- [x] Includes documentation?
  - standard rustdocs
## How This Was Tested

Tested with USB keyboard support in QEMU. Early iterations also tested
in hardware.

## Integration Instructions
Platforms will need to add `HiiKeyboardLayout = {path =
"HidPkg/Crates/HiiKeyboardLayout"}` to the `[workspace.dependencies]` in
their cargo.toml if not already present.
Bumps
[edk2-pytool-library](https://github.com/tianocore/edk2-pytool-library)
from 0.19.3 to 0.19.4.

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps
[edk2-pytool-extensions](https://github.com/tianocore/edk2-pytool-extensions)
from 0.25.1 to 0.26.0.

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Michael Kubacki <[email protected]>
synced local file(s) with
[microsoft/mu_devops](https://github.com/microsoft/mu_devops).

🤖: View the [Repo File Sync Configuration
File](https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml)
to see how files are synced.

---

This PR was created automatically by the
[repo-file-sync-action](https://github.com/BetaHuhn/repo-file-sync-action)
workflow run
[#6854437789](https://github.com/microsoft/mu_devops/actions/runs/6854437789)

Signed-off-by: Project Mu UEFI Bot <[email protected]>
## Description

When using advanced logger starting from DxeCore, the library
constructor will allocate space for the advanced logger buffer.
When this allocation takes place, the associated global variable
`mMaxAddress` will be created to specify the last address for the log
buffer.

In the DxeCore case, the calculation for `mMaxAddress` did not take into
account the size of the `ADVANCED_LOGGER_INFO` structure that is at the
start of the buffer, resulting in an inconsistent address between
`mMaxAddress` and `LoggerInfo->LogBuffer + LoggerInfo->LogBufferSize`

All other instances of this code use `LoggerInfo->LogBuffer +
LoggerInfo->LogBufferSize`, so change DxeCore library instance to use
the same logic as other library instances.


For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [X] 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
Found by setting debug messages to such a high level that the end of the
buffer was reached, resulting in incorrect checks of `mMaxAddress`
overwriting the end of the buffer.

Incorrect logic was tripped up in `ValidateInfoBlock()` where
`mMaxAddress` would cause a return of `false`, which in turn would
result in NULL being returned from an arbitrary call to
`AdvancedLoggerGetLoggerInfo`.

## Integration Instructions
n/a
…ft#345)

## Description

This change adds an inspection of `mLoggerInfo` variable before reading
from GetTime() runtime service. As the advanced logger design expects
the `mLoggerInfo` to be set to NULL, we should always check the pointer
before usage, otherwise page fault could occur under certain edge cases.

- [x] 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

This was tested on QEMU Q35 platform.

## Integration Instructions

N/A

---------

Co-authored-by: Michael Kubacki <[email protected]>
Bumps
[edk2-pytool-extensions](https://github.com/tianocore/edk2-pytool-extensions)
from 0.26.0 to 0.26.2.

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
## Description

Fix an issue where rust boot services allocator implementation could
deadlock if memory allocations were attempted at different TPLs.
Deadlock occurs in following scenario:
1. Task running at low TPL initiates an allocation request.
2. While that allocation is in progress and the lock is held, an
interrupt occurs, and a new task executes at a higher TPL
3. new task attempts an allocation. 

Deadlock occurs because the higher TPL task cannot acquire the lock
because it is held by the lower TPL task, and the lower TPL task cannot
make forward progress because it has been interrupted by the higher TPL
task.

To resolve this, this PR updates the allocation implementation to remove
the spinlock. An AtomicPtr is used to give well-ordered access to the
bootservices pointer used as the basis for the allocation
implementation. Other aspects of the implementation (i.e. creation of
the allocation tracker) are already thread-safe or are the
responsibility of the boot services implementation.

PR also contains some minor style cleanup. 

- [ ] Impacts functionality?
- [ ] Impacts security?
- [ ] Breaking change?
- [x] Includes tests?
- RustBootServicesAllocatorDxe unit tests updated to accommodate new
implementation.
- [ ] Includes documentation?

## How This Was Tested

Verified boot on QEMU.

## Integration Instructions

N/A
## Description

This PR resolves an issue where invocation of the debugln!() macro could
result in deadlock due to contention between two different TPL levels.
The deadlock occurs in the following scenario:

1. A task running at a lower TPL invokes debugln!() and acquires the
spinlock on the logger object.
2. That task is interrupted by a TPL running at a higher level (the
lower task has not released the lock).
3. The higher TPL invokes debugln!(). 

In this scenario, the higher TPL task cannot make forward progress
because it cannot acquire the lock held by the lower TPL task, and the
lower TPL task is not executing because it was interrupted by the higher
TPL task.

This resolves the issue by changing the "lock" to a "try_lock" - in the
scenario above, this allows the higher TPL task to make forward
progress. This has the downside of dropping the message from the higher
TPL task; so this is only intended as an interim fix.

- [ ] Impacts functionality?
- [ ] Impacts security?
- [ ] Breaking change?
- [ ] Includes tests?
- [ ] Includes documentation?

## How This Was Tested

Reproduced the issue using QEMU emulator; with this change the above
flow no longer deadlocks.

## Integration Instructions

N/A
## Description

USB HID specification 1.11
(https://www.usb.org/document-library/device-class-definition-hid-111)
section 7.2.6 states:
```
When initialized, all devices default to report protocol. However the host should 
not make any assumptions about the device’s state and should set the desired 
protocol whenever initializing a device. 
```

In testing actual devices, it has been observed that some actual
endpoint HID devices come up in "boot protocol" rather than "report
protocol." This PR implements the recommendation that the host (in this
case, the UsbHidDxe driver) not make any assumptions about device state,
and explicitly sets report protocol for devices that implement the
"boot" interface subclass.

The PR also makes a minor adjustment to debug verbosity. 

- [ ] Impacts functionality?
- [ ] Impacts security?
- [ ] Breaking change?
- [ ] Includes tests?
- [ ] Includes documentation?

## How This Was Tested

Verified with QEMU that command is sent; verified with hardware that has
this issue that SetProtocol resolves it.

## Integration Instructions

N/A
## Description

Update one DSC file to use the new stack cookie library, and
MdePkg/MdeLibs.dsc.inc contains the definitions for the new stack cookie
libraries for the remaining DSC files.

- [x] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [x] 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

Tested on Q35 GCC and MSVC builds

## Integration Instructions

N/A
Bumps
[edk2-pytool-library](https://github.com/tianocore/edk2-pytool-library)
from 0.19.4 to 0.19.6.

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
## Description

EDK2 added EfiUnacceptedMemoryType to the memory type list. This update
adds this memory type to the memory protection test app and skips it
because it is not allocatable.

- [x] 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

Tested on Q35

## Integration Instructions

N/A
Allows TCG event logs with the "crypto agile format" to be decoded
similar to those generated for TPM Replay by the script.

This includes the log produced by Windows (usually present in the
C:\Windows\Logs\MeasuredBoot directory).

The log is passed with the existing log input parameter "-e".

Example:
  TpmReplay.py -e WindowsLog.log -o YamlLog.yaml -l TxtLog.txt -v

Signed-off-by: Michael Kubacki <[email protected]>
Adds the capability to recognize UEFI variable data in UEFI variable
events (e.g. EV_EFI_VARIABLE_DRIVER_CONFIG) and output that to the
YAML file and text log.

This makes inspecting and configuring UEFI variables more user
friendly.

Signed-off-by: Michael Kubacki <[email protected]>
Add support for accepting SHA1 hashes.

Signed-off-by: Michael Kubacki <[email protected]>
Uses a local logger instance to avoid using the root logger to avoid
picking up log output from external libraries.

Signed-off-by: Michael Kubacki <[email protected]>
Updates the string formatting for UEFI variable data to return a
hexadecimal string followed by a decoded ASCII representation to
make the data easier to view.

This can be seen in a file specified using the `-l` parameter in
combination with `-v` to output verbose text to the file.

Signed-off-by: Michael Kubacki <[email protected]>
Describes crytpo agile event log and UEFI variable decode support.

Signed-off-by: Michael Kubacki <[email protected]>
joschock and others added 18 commits November 29, 2023 12:54
…println instead of AdvLoggerProtocol - useful for test environments.
)

## Description

Splitting inf's for PEI and DXE FrameBufferMemDrawLib to support
building for 64bit PEIM.

- [ ] 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, ...
- [x] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
Remove old inf path and add the separate PEI and DXE inf to DSC files.
- [ ] 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

Verified platform packages consuming the library can build fine and
FrameBufferDraw works as expected for PEI and DXE graphics.

## Integration Instructions

Update dsc file to remove the old inf path and include separate PEI and
DXE infs.
…Files (microsoft#376)

## Description

The reset test method is not supported on ARM platforms currently
(support will be added later, but it's not high priority because this
test method often takes 40+ minutes). This PR separates the
initialization of this testing method to architecture specific logic so
the test method is not attempted on ARM platforms.

This also fixes a build error on ARM platforms caused by
DefaultExceptionHandlerLib being included (which does not support
UEFI_APPLICATION without a MU override).

- [x] 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

Running the updated test app on Q35 and SBSA

## Integration Instructions

N/A
…t#377)

## Description

Adds SecureBootKeyStoreLib which provides secureboot key store options
by consuming fixed at build PCDs that represent the Pk, Db, 3PDb, Kek,
and Dbx.

- [x] Impacts functionality?
- Adds 5 new PCDs to represent the Pk, Db, 3PDb, Kek, and Dbx, which are
consumed by SedcureBootKeyStoreLibOem when configuring SecureBoot.
- [ ] 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

Verified secureboot is properly enabled on Qemu35Pkg for Microsoft and
Microsoft 3rd party.

## Integration Instructions

Generate the following PCDs for your platform DSC:
1. gOemPkgTokenSpaceGuid.PcdDefaultKek
2. gOemPkgTokenSpaceGuid.PcdDefaultDb
3. gOemPkgTokenSpaceGuid.PcdDefault3PDb
4. gOemPkgTokenSpaceGuid.PcdDefaultDbx
5. gOemPkgTokenSpaceGuid.PcdDefaultPk

It is highly suggested, but not required, that each pcd is generated by
running BaseTools `BinToPcd` over the binary blobs created in
[secureboot_objects](https://github.com/microsoft/secureboot_objects),
then including them in the platform's DSC file.

---------

Co-authored-by: Michael Kubacki <[email protected]>
Bumps
[edk2-pytool-library](https://github.com/tianocore/edk2-pytool-library)
from 0.19.6 to 0.19.7.

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
## Description

MemoryProtectionTestApp was written before Project Mu supported an ARM
platform and Standalone MM. The test app generates the test cases for
both the SMM and DXE environments. The SMM tests will report failure for
Arm platforms and platforms using Standalone MM, so this update
separates the test app into SMM and DXE versions.

The SMM version will still require a driver to handle the SMI calls. To
reduce confusing naming, MemoryProtectionTestSmm (the driver supporting
SMM memory protection testing) has been renamed to
SmmMemoryProtectionTestDriver.

- [x] 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

SMM test was checked on a physical x86 platform. The DXE test was
checked on Q35 and SBSA

## Integration Instructions

Instances of

`

UefiTestingPkg/FunctionalSystemTests/MemoryProtectionTest/App/MemoryProtectionTestApp.inf
`

will need to be updated to


`UefiTestingPkg/FunctionalSystemTests/MemoryProtectionTest/App/SmmMemoryProtectionTestApp.inf

UefiTestingPkg/FunctionalSystemTests/MemoryProtectionTest/App/DxeMemoryProtectionTestApp.inf
`

And instances of

`

UefiTestingPkg/FunctionalSystemTests/MemoryProtectionTest/Smm/MemoryProtectionTestSmm.inf
`

will need to be updated to

`

UefiTestingPkg/FunctionalSystemTests/MemoryProtectionTest/Driver/SmmMemoryProtectionTestDriver.inf
`
## Description

This change updated some print levels and added the PDB name for images
being looked at.

- [ ] 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, ...
- [x] 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

Tested on proprietary virtual ARM platform and verified updated prints
works as expected.

## Integration Instructions

N/A
…icrosoft#381)

## Description

1. MemoryOutsideEfiMemoryMapIsInaccessible checks if memory not present
in the EFI memory map has the EFI_MEMORY_RP attribute. The previous
version of this test assumed that the memory range spanned by the EFI
memory map was contiguous which is sometimes not the case on platforms.
This update changes the flow of the test to look at interstitial gaps in
the memory map and not just those on the flanks.

2. The EFI memory map returned through the boot services table is
sometimes out of order. This update sorts the memory map and memory
space map whenever they're populated for a test.

3. The X64 MemoryOutsideEfiMemoryMapIsInaccessible HTML test had a typo
which is fixed in this update.

- [x] 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, ...
- [x] 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

Tested on Q35 and ARM

## Integration Instructions

N/A
Bumps [actions/setup-python](https://github.com/actions/setup-python)
from 4 to 5.

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
# 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

This change added support for enablement/disablement of advanced file
logger through policy services. Platforms intending to support this
functionality should produce policy prior to the driver load. The
default configuration is set to file logger enabled.

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [x] 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, ...
- [x] 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

This is tested on QEMU Q35 and verified that not creating policy will
remain producing log files, and disabling the policy will prevent the
driver from logging any files to ESP.

## Integration Instructions

In platform code, use `SetPolicy` with `gAdvancedFileLoggerPolicyGuid`
to produce a policy entry for file logger driver to consume.
Some header files, such as those which define structures or classes,
cannot be included more than once within a translation unit, as doing
so would cause a redefinition error. Such headers must be guarded to
prevent ill-effects from multiple inclusion. Similarly, if header
files include other header files, and this inclusion graph contains
a cycle, then at least one file within the cycle must contain header
guards in order to break the cycle. Because of cases like these, all
headers should be guarded as a matter of good practice, even if they
do not strictly need to be.

Furthermore, most modern compilers contain optimizations which are
triggered by header guards. If the header guard strictly conforms
to the pattern that compilers expect, then inclusions of that
header other than the first have absolutely no effect: the file
isn't re-read from disk, nor is it re-tokenised or re-preprocessed.
This can result in a noticeable, albeit minor, improvement to
compilation time.

Signed-off-by: Michael Kubacki <[email protected]>
Removes `MsWheaCMOSStoreClearAll()` which is scoped to the file and
not used. Improves code readability and maintenance.

Signed-off-by: Michael Kubacki <[email protected]>
Removes an unnecessary condition since unsigned values are always
greater than or equal to 0.

Signed-off-by: Michael Kubacki <[email protected]>
…icrosoft#386)

## Description

Checks the index is within expected bounds before accessing the array.

- [ ] 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

CodeQL and package compilation.

## Integration Instructions

N/A

Signed-off-by: Michael Kubacki <[email protected]>
… to unit test capability and general architecture. (microsoft#374)

## Description

This PR introduces a "v2" implementation of UefiHidDxe that has
significant refactoring to support unit tests and architectural
improvements.
- UefiHidDxeV2 code coverage with unit tests is ~80% or greater for all
modules of the UefiHidDxe crate
- Better separation between FFI layers and native rust layers 

The long term plan is to eventually remove the original UefiHidDxe in
favor of this implementation.

- [x] Impacts functionality?
- Driver provides the same functionality as UefiHidDxe which should be
considered deprecated going forward.
- [ ] Impacts security?
- [ ] Breaking change?
- [x] Includes tests?
  - Includes Rust unit tests covering all new modules.
- [x] Includes documentation?
  - Standard rustdocs included.

## How This Was Tested

Tested under QEMU using simulated USB keyboard and mouse.

## Integration Instructions

UefiHidDxeV2 is a drop-in replacement for UefiHidDxe; platforms that
wish to move to the new implementation can do so by pulling in the new
UefiHidDxeV2 and adding the necessary mockall crate to their workspace
Cargo.toml.
@github-actions github-actions bot added language:python Pull requests that update Python code impact:non-functional Does not have a functional impact type:documentation Improvements or additions to documentation labels Mar 22, 2024
@VivianNK VivianNK requested a review from apop5 March 22, 2024 01:18
@VivianNK VivianNK closed this Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact:non-functional Does not have a functional impact language:python Pull requests that update Python code type:documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants