Skip to content

patina-v20.1.2

Choose a tag to compare

@github-actions github-actions released this 18 Mar 17:28
· 220 commits to refs/heads/main since this release
4e014bd

What's Changed

  • [patina/sdk] clean up the usage of allocator @kuqin12 (#1401)
    Change Details
      ## Description

    This change guards the usage of allocators behind "alloc" to a few remaining instances in Patina SDK. So that the crate can provide more fundamental functionalities without dependencies on allocator.

    In addition, it removes the extern crate alloc; within the crate and only declare it in the lib.rs, which serves as a central feature controller that governs the entirety of the crate.

    Resolves #1403

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

    How This Was Tested

    This was tested by building a binary without global allocator and booted to UEFI shell on Q35.

    Integration Instructions

    Nothing in addition to building the binary with --features alloc if a binary needs allocator functionality.




  • [painta\_stacktrace] remove alloc usage @kuqin12 (#1411)
    Change Details
      ## Description

    Current patina_stacktrace is pulling in alloc from source code. However, as basic functionality as the crate provides, the dependency is improperly included.

    This change removes the dependency.

    Resolves #1410

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

    How This Was Tested

    The change is not a functional change and was tested with local build.

    Integration Instructions

    N/A

      </blockquote>
      <hr>
    </details>
    
  • Check and test without default features [Rebase \& FF] @makubacki (#1404)
    Change Details
      ## Description

    Two changes. One to fix a pre-existing issue in patina_adv_logger tests. One to check and test without default features.

    I'll take the Makefile.toml changes to patina-devops once they're accepted here.


    patina_adv_logger: gate writer tests on the "reader" feature

    writer.rs tests import crate::reader::AdvancedLogReader, but
    the reader module is conditionally compiled behind
    #[cfg(any(doc, feature = "reader"))].

    This works when default features are enabled since the "component"
    default feature transitively enables "reader".

    This change gates tests on #[cfg(all(test, feature = "reader"))]
    so it compiles cleanly when default features are disabled.


    Makefile.toml: Check and test without default features

    Without --no-default-features testing, feature-gate regressions go
    undetected. Code that accidentally uses a gated module or dependency
    outside its cfg fence compiles fine under default features but
    breaks for consumers that disable defaults.

    Since workspace crates like patina_ffs_extractors gate optional
    compression backends (brotli, crc32, lzma) behind features, and
    patina/patina_internal_collections gates alloc-dependent code
    behind an "alloc" default, verifying the --no-default-features build
    is useful to catch accidental dependencies on gated code.

    Add a higher level check-no-default-features task with two parallel
    subtasks:

    • check-no-default-features-code:
      • cargo check --no-default-features
    • check-no-default-features-tests:
      • cargo test --no-run --no-default-features

    Run the task in cargo make all.


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

    How This Was Tested

    • cargo make all
    • cargo make check
    • cargo make check-no-default-features

    Integration Instructions

    • N/A


  • Ingest patina-paging 11.0.2 and use new open\_active interface @cfernald (#1408)
    Change Details
      ## Description

    Patina-paging 11.0.2 introduces support for reading/editing existing 5-level page tables on AArch64. This is required for EDK2 20511 based system that have FEAT_LPA2 support. To use this change, this commit switches to use the new open_active interface for both AArch64 and x64, which also simplifies the consumer by handling level detection in the paging library.

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

    How This Was Tested

    • Boot test w/ debugger on Q35
    • Boot test w/ debugger on SBSA

    Integration Instructions

    N/A




  • patina\_internal\_cpu: Allow refining impl trait in Mtrr mock @makubacki (#1400)
    Change Details
      ## Description

    patina_mtrr 1.1.5 changed the Mtrr trait's get_memory_ranges() return type from Vec<MtrrMemoryRange> to
    impl IntoIterator<Item = MtrrMemoryRange>.

    The mockall mock! block still uses the concrete Vec type, triggering the refining_impl_trait_internal lint. This commit adds an allow attribute to the get_memory_ranges() method in the mock to suppress the lint.

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

    How This Was Tested

    • cargo make all

    Integration Instructions

    • N/A


📖 Documentation Updates

  • Readme Updates [Rebase \& FF] @makubacki (#1412)
    Change Details
      ## Description

    A series of commits for small changes to the readme to clarify some topics in recent discussions.


    README.md: Update code readiness status

    Update the status to indicate that the repository is no longer in a
    "beta" stage, but also add a note about the expected stability of the
    main branch and the need to verify the readiness of new components.


    CONTRIBUTING.md: Add Patina AI Policy

    Closes #1414

    Clarifies the expectations for contributions that are AI-assisted
    to Patina.


    README.md: Elaborate on key points in the Background section

    Add some more detail to clarify common misunderstandings about Patina.


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

    How This Was Tested

    • cargo make all

    Integration Instructions

    • N/A

    Note: A corresponding CONTRIBUTING.md change that will be synced to all Patina repos is in OpenDevicePartnership/patina-devops#99. That change is directly included here for visibility prior to the sync.




  • Increase Patina GUID Usage [Rebase \& FF] @makubacki (#1391)
    Change Details
      ## Description

    A series of commits to increase adoption of Patina GUID types in the codebase.


    sdk: Make BinaryGuid::from_bytes() const

    This function wraps efi::Guid::from_bytes() which is const. It is
    made const as well.


    BinaryGuid: Derive Ord and PartialOrd

    Add Ord and PartialOrd derives to BinaryGuid, enabling its use as a
    BTreeMap key.

    Adds a test to verify BinaryGuid's derived ordering matches Guid<'a>'s
    byte-order comparison for a set of GUID pairs.


    guid: Convert GUID types to BinaryGuid

    Resolves #1105

    Converts all GUID constants, trait associated types, struct fields,
    and other uses to Patina GUID types across the codebase.

    Key changes:

    • GUID constants mostly use BinaryGuid::from_string() since strings
      are more readable than fields. In some cases, a field may have been
      a simple numbering sequence like "123456...", in which case it may
      have been left as from_fields.
    • Changed ProtocolInterface::PROTOCOL_GUID changed to use
      BinaryGuid, eliminating duplicated GUID values in implementations.
    • Updated FromHob::HOB_GUID and HobParsers BTreeMap key to
      BinaryGuid.
    • Updated #[repr(C)] struct fields (GuidHob, FV/FFS headers,
      MM communicate header) to use BinaryGuid since it provides
      binary-compatible GUID storage.
    • Updated the FromHob proc macro to use BinaryGuid::from_string().
    • Updated a lot of code to use Patina GUID types instead of the r-efi
      GUID type.

    There were a few places, particularly in UEFI Spec FFI interfaces,
    where the efi::Guid type is still used. This is intentional to
    potentially simplify the r-efi 6.0.0 integration. In code that
    interacts with those interfaces, From and Into functions are used
    to simply convert between BinaryGuid and efi::Guid. Some code
    that exclusively interacts with those interfaces, might also use
    efi::Guid for local GUID definitions instead of Patina GUID types.


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

    How This Was Tested

    • cargo make all
    • patina-qemu Q35 and SBSA boot to EFI shell
    • Tested boot to Windows on a physical Intel platform

    Integration Instructions

    • N/A - Patina refactor


  • patina\_dxe\_core: Add missing safety comments and enable clippy lint @makubacki (#1402)
    Change Details
      ## Description

    Closes #583
    Closes #1396

    Adds safety comments to the remaining unsafe blocks in patina_dxe_core and enables the clippy lint for missing safety docs.

    This allows future contributions to have the lint enforced.

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

    How This Was Tested

    • cargo make all with the undocumented_safety_blocks clippy lint enabled in patina_dxe_core

    Integration Instructions

    • N/A - Safety comments that have no functional impact

    Note: Skipping code coverage check on this PR.




Full Changelog: patina-v20.1.1...v20.1.2