Skip to content

patina-v19.0.1

Choose a tag to compare

@github-actions github-actions released this 06 Jan 22:34
· 370 commits to refs/heads/main since this release
11184c5

What's Changed

  • [REBASE\&FF] patina\_debugger: allow capturing state with `add_monitor_command` @Javagedes (#1216)
    Change Details
      ## Description

    This commit allows users to add the move keyword to capture state in a monitor command, instead of needing to store it in a global static for access inside the command

    • Impacts functionality?
    • Impacts security?
    • Breaking change?
    • Includes tests?
    • Includes documentation?

    How This Was Tested

    CI, continues to boot.

    Integration Instructions

    This just enables the usage of the keyword move:

    let x: u32 = 5;
    patina_debugger::add_montior_command("custom_command", "Description", move |args, writer| {
        let _ = write!(writer, "Captured state: {x}");
    });

    There is no integration changes necessary.




  • patina\_dxe\_core: move `image.rs` to `pi_dispatcher` @Javagedes (#1212)
    Change Details
      ## Description

    This commit moves image.rs as a sub-module underneath pi_dispatcher and removes the global static variable in favor of a field of the PiDispatcher struct of the core.

    This commit also updates all tests to not rely on the global static, and instead a non-global static core.

    NOTE: This PR changes no logic. All logical changes were handled in #1192. This PR only moves the code and replaces STATIC usage with self usage.

    • Impacts functionality?
    • Impacts security?
    • Breaking change?
    • Includes tests?
    • Includes documentation?

    How This Was Tested

    CI, continues to boot to shell.

    Integration Instructions

    N/A




  • Patina Dxe Core: Add a default environment based test logger @vineelko (#1093)
    Change Details
      ## Description

    Since Patina relies on the log::* API for logging, not configuring a default
    logger can cause log::* calls to appear completely uncovered in llvm-cov
    reports, slightly reducing overall coverage. Adding a simple environment based
    logger avoids this issue. Although this change enables coverage for log::*,
    there are still cases that cannot be covered. For example, in the function
    below, there is no way to get coverage for lines 6 and 7.

    1   1   fn print() {
    2   1       let mut i = 0;
    3   11      for _ in 0..10 {
    4   10          log::info!(
    5   10              "This will be covered {} {}",
    6                   i,
    7                   "This and the above line will not be covered."
    8               );
    9   10          i = i + 1;
    10          }
    11  1   }
    

    The environment logger can be enabled as shown below:
    To enable logging, set the RUST_LOG environment variable to the desired
    log level (e.g., debug, info, warn, error) before running the tests.

    $ RUST_LOG=debug cargo test -p patina_dxe_core allocator::usage_tests::uefi_memory_map -- --nocapture
    or
    PS:> $env:RUST_LOG="debug"; cargo test -p patina_dxe_core allocator::usage_tests::uefi_memory_map -- --nocapture

    For cargo make coverage a corresponding Makefile.toml change will be added
    from patina-devops

    [tasks.test]
    description = "Run tests and collect coverage data without generating reports."
    env = { "RUST_LOG" = "info" }  <---
    ...
    

    How This Was Tested

    cargo make all

    Integration Instructions

    NA




  • patina\_dxe\_core: Additional cleanup of image.rs @Javagedes (#1192)
    Change Details
      ## Description

    This commit performs some additional non-functional cleanup of image.rs to break up the larger functions into smaller chunks that only perform one operation each. This makes understanding and testing the code simpler.

    • Impacts functionality?
    • Impacts security?
    • Breaking change?
    • Includes tests?
    • Includes documentation?

    How This Was Tested

    CI, Boots to shell.

    Integration Instructions

    N/A




  • uefi\_allocator: Show more info on pool assert @makubacki (#1205)
    Change Details
      ## Description

    Show more info to assist debugging when the pool signature is invalid.

    • Impacts functionality?
    • Impacts security?
    • Breaking change?
    • Includes tests?
    • Includes documentation?

    How This Was Tested

    • cargo make all
    • Force a pool signature failure and look at the log

    Integration Instructions

    • N/A


  • publish-mdbook: Use main rust-tool-cache action @Javagedes (#1209)
    Change Details
      ## Description
    • Impacts functionality?
    • Impacts security?
    • Breaking change?
    • Includes tests?
    • Includes documentation?

    How This Was Tested

    N/A

    Integration Instructions

    N/A




  • Improve memory map stability [Rebase \& FF] @makubacki (#1204)
    Change Details
      ## Description

    A series of commits to improve memory map stability and allocation efficiency for loader memory.


    allocator: Remove invalid unit test check

    A non-null memory map pointer is not necessary for getting the
    memory map size with a non-null size pointer.


    Eliminate vector allocation in get_memory_map()

    Moves GCD related functionality for generating the EFI memory map
    into the GCD. Iterates over GCD descriptors in place to avoid
    allocating temporary vectors on every entry.

    Also removes temporary vector allocation when get_memory_map() is
    called to get the memory map size making that flow more efficient.


    allocator: Use high-traffic expansion for loader code

    As an efficiency improvement, use high-traffic allocation
    expansion for loader code allocations, which can be
    relatively large.


    • Impacts functionality?
    • Impacts security?
    • Breaking change?
    • Includes tests?
    • Includes documentation?

    How This Was Tested

    • cargo make all (unit and integration tests)
    • QEMU boot to Windows
    • Intel physical platform boot to Windows

    Integration Instructions

    • N/A


🐛 Bug Fixes

  • patina\_dxe\_core: Prevent stale handles from impacting protocol usage removal @makubacki (#1183)
    Change Details
      ## Description

    Closes #1133

    During device removal, remove_protocol_usage could attempt to drop open-protocol usage after the stored agent or controller handle had already been uninstalled. Its validation would reject the stale handle and return EFI_INVALID_PARAMETER, leaving the usage entry in the protocol database. This could cause the overall driver teardown to see lingering open usages and retry disconnect/reconnect, creating a removal infinite loop.

    The goal in this change is to allow cleanup to proceed even when the recorded handles are stale, ensuring that protocol usage entries are always removed during device removal.

    This matches edk2 behavior which also ignores stale handles during protocol usage removal.

    • Impacts functionality?
    • Impacts security?
    • Breaking change?
    • Includes tests?
    • Includes documentation?

    How This Was Tested

    • cargo make all
    • Enable PXE boot on a physical device with a USB NIC and disconnect it during PXE init. Prior to this change an infinite loop would occur as validate_handle() called in remove_protocol_usage() would return Err(EfiError::InvalidParameter) which would be treated as a failure by core_uninstall_protocol_interface() which then called core_connect_controller() on the handle and return Err(EfiError::AccessDenied) causing the uninstall/reinstall loop.

    Integration Instructions

    • N/A


📖 Documentation Updates

  • patina\_performance: Update README.md to match the new config design @liqiqiii (#1199)
    Change Details
      ## Description

    patina_performance: Update README.md to match the new config design
    The README.md is out-of-date at the part of implementing the config.
    Update to match the latest config design.

    • Impacts functionality?
    • Impacts security?
    • Breaking change?
    • Includes tests?
    • Includes documentation?

    How This Was Tested

    Tested with real hardware, it's working with configs.




  • Add Architecture-specific requirements docs. @joschock (#1202)
    Change Details
      ## Description

    Update Patina Requirements documentation with architecture-specific details for AARCH64 and X64 architectures.

    Closes #1075, #1077, #1078.

    • Impacts functionality?
    • Impacts security?
    • Breaking change?
    • Includes tests?
    • Includes documentation?

    How This Was Tested

    N/A - documentation only. Will pass linting as part of CI gate.

    Integration Instructions

    N/A




Full Changelog: patina-v19.0.0...v19.0.1