Skip to content

RFC: ACPI Service Interface Changes#1474

Open
Javagedes wants to merge 4 commits into
OpenDevicePartnership:mainfrom
Javagedes:personal/joeyvagedes/rfc/acpi-interface
Open

RFC: ACPI Service Interface Changes#1474
Javagedes wants to merge 4 commits into
OpenDevicePartnership:mainfrom
Javagedes:personal/joeyvagedes/rfc/acpi-interface

Conversation

@Javagedes
Copy link
Copy Markdown
Contributor

@Javagedes Javagedes commented Apr 22, 2026

Description

Current Status: Draft

Implementation Example: In the works

This RFC proposes interface changes to reduce the two services (Service<dyn AcpiProvider> and
Service<AcpiTableManager>) to a single Service<dyn Acpi> service and provide a public Helper struct, Table for
managing ACPI tables both internal to the service implementation and as a consumer of the service. This Table
structure would better support multiple types of ACPI tables, such as statically sized and dynamically sized ACPI
tables.

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

How This Was Tested

N/A

Integration Instructions

N/A

@patina-automation
Copy link
Copy Markdown
Contributor

patina-automation Bot commented Apr 22, 2026

✅ QEMU Validation Passed

All QEMU validation jobs completed successfully.

Note: Q35 is only built on Windows hosts (QEMU boot is disabled due to a QEMU vfat issue).

Workflow run: https://github.com/OpenDevicePartnership/patina/actions/runs/24806567886

Boot Time to EFI Shell

Platform Elapsed
Q35 (Linux Host) 26.6s
SBSA (Linux Host) 55.5s

Dependencies

Repository Ref
patina d22dcfa
patina-dxe-core-qemu 364a9fb
patina-fw-patcher 3960603
patina-qemu firmware v3.0.0
patina-qemu build script ec854d2

This comment was automatically generated by the Patina QEMU PR Validation Post workflow.

@github-actions github-actions Bot added the impact:non-functional Does not have a functional impact label Apr 22, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@@ -0,0 +1,554 @@
# RFC: `patina_acpi` service interface improvements
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One process question, should this be an amendment to the original patina-acpi RFC instead of a new one?


The final benefit is that of safety. This change removes many different areas of the code wrapped in `unsafe`, and most
importantly, stops the `get_acpi_table` method from returning a pointer directly to the actual ACPI table in memory.
Instead, it will now copy the bytes into new memory and provide that to the user. The EDKII EFIAPI side will need to
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Instead, it will now copy the bytes into new memory and provide that to the user. The EDKII EFIAPI side will need to
Instead, it will now copy the bytes into new memory and provide that to the user. The C FFI interface will need to

nit: Not scoped to EDK II


The prior implementation generically stored each ACPI table as a pointer to a leaked union representing the ACPI
table. It would then provide direct pointer access to the caller of `get_acpi_table` both for the patina component
and caller of the EDK II protocol. Additionally, the generic methods (such as `get_acpi_table<T>`) would directly
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
and caller of the EDK II protocol. Additionally, the generic methods (such as `get_acpi_table<T>`) would directly
and caller of the UEFI spec protocol. Additionally, the generic methods (such as `get_acpi_table<T>`) would directly

Comment thread docs/src/rfc/text/0000-acpi-interface-improvements.md
///
/// This trait has two roles: (1) Ensure that each element can be converted to and from bytes using `zerocopy` and
/// (2) to differentiate between Sized and Unsized elements for indexing optimizations.
pub trait Element: IntoBytes + FromBytes + Immutable + KnownLayout + Unaligned {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the sake of avoiding internal panics, should these be TryFromBytes to allow handling malform/unexpected elements without panicking in the parser?

/// An element that can be used for the variable-length array portion of DST ACPI tables.
///
/// This trait has two roles: (1) Ensure that each element can be converted to and from bytes using `zerocopy` and
/// (2) to differentiate between Sized and Unsized elements for indexing optimizations.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does ZeroCopy work is element can take different forms? A good example is the MADT where not only are the elements different sizes but also completely different but well-structured contents. This could be a union, but I assume zerocopy may be unhappy if the union size is greater than the bytes provided.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants