patina-v20.1.2
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 thelib.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 allocif 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_loggertests. 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
testson#[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-featurestesting, feature-gate regressions go
undetected. Code that accidentally uses a gated module or dependency
outside itscfgfence compiles fine under default features but
breaks for consumers that disable defaults.Since workspace crates like
patina_ffs_extractorsgate optional
compression backends (brotli, crc32, lzma) behind features, and
patina/patina_internal_collectionsgates alloc-dependent code
behind an "alloc" default, verifying the--no-default-featuresbuild
is useful to catch accidental dependencies on gated code.Add a higher level
check-no-default-featurestask 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 allcargo make checkcargo 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_activeinterface 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
Mtrrtrait'sget_memory_ranges()return type fromVec<MtrrMemoryRange>to
impl IntoIterator<Item = MtrrMemoryRange>.The mockall
mock!block still uses the concrete Vec type, triggering therefining_impl_trait_internallint. This commit adds an allow attribute to theget_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 asfrom_fields. - Changed
ProtocolInterface::PROTOCOL_GUIDchanged to use
BinaryGuid, eliminating duplicated GUID values in implementations. - Updated
FromHob::HOB_GUIDandHobParsersBTreeMapkey to
BinaryGuid. - Updated
#[repr(C)]struct fields (GuidHob, FV/FFS headers,
MM communicate header) to useBinaryGuidsince it provides
binary-compatible GUID storage. - Updated the
FromHobproc macro to useBinaryGuid::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 theefi::Guidtype is still used. This is intentional to
potentially simplify the r-efi 6.0.0 integration. In code that
interacts with those interfaces,FromandIntofunctions are used
to simply convert betweenBinaryGuidandefi::Guid. Some code
that exclusively interacts with those interfaces, might also use
efi::Guidfor 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
- GUID constants mostly use
-
patina\_dxe\_core: Add missing safety comments and enable clippy lint @makubacki (#1402)
Change Details
## Description
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 allwith theundocumented_safety_blocksclippy lint enabled inpatina_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