Skip to content

Add EFI_RAM_DISK_PROTOCOL bindings#1490

Open
kat-perez wants to merge 1 commit into
OpenDevicePartnership:mainfrom
kat-perez:kat-perez/issue-65-ramdisk-protocol-binding
Open

Add EFI_RAM_DISK_PROTOCOL bindings#1490
kat-perez wants to merge 1 commit into
OpenDevicePartnership:mainfrom
kat-perez:kat-perez/issue-65-ramdisk-protocol-binding

Conversation

@kat-perez
Copy link
Copy Markdown
Contributor

@kat-perez kat-perez commented Apr 30, 2026

Description

Adds sdk/patina/src/uefi_protocol/ram_disk.rs providing the FFI binding for EFI_RAM_DISK_PROTOCOL. Exposes the Protocol struct, RegisterFn / UnregisterFn type aliases, and the four well-known RamDiskType GUIDs. r-efi doesn't provide this binding today, so it lands here.

Closes OpenDevicePartnership/odp-platform-common#65.

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

How This Was Tested

  • cargo make all

Integration Instructions

  • N/A

@patina-automation
Copy link
Copy Markdown
Contributor

patina-automation Bot commented Apr 30, 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/25763683078

Boot Time to EFI Shell

Platform Elapsed
Q35 (Linux Host) 28.2s
SBSA (Linux Host) 30.9s

Dependencies

Repository Ref
patina 2102fc7
patina-dxe-core-qemu c7e0191
patina-fw-patcher d656f1d
patina-qemu firmware v3.0.0
patina-qemu build script e0231b7

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

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@kat-perez kat-perez force-pushed the kat-perez/issue-65-ramdisk-protocol-binding branch 2 times, most recently from 606b2d5 to d903807 Compare May 1, 2026 00:44
@kat-perez kat-perez changed the base branch from feature/patina-boot to main May 1, 2026 00:44
@github-actions github-actions Bot added impact:non-functional Does not have a functional impact impact:testing Affects testing labels May 1, 2026
@kat-perez kat-perez force-pushed the kat-perez/issue-65-ramdisk-protocol-binding branch from d903807 to e50a168 Compare May 1, 2026 02:53
@kat-perez kat-perez changed the title patina: Add EFI_RAM_DISK_PROTOCOL bindings Add EFI_RAM_DISK_PROTOCOL bindings May 1, 2026
@kat-perez kat-perez force-pushed the kat-perez/issue-65-ramdisk-protocol-binding branch 3 times, most recently from b5a0a29 to 4cc7930 Compare May 1, 2026 13:52
@kat-perez kat-perez self-assigned this May 1, 2026
@kat-perez kat-perez marked this pull request as ready for review May 1, 2026 16:14
@kat-perez kat-perez requested review from Javagedes, makubacki and os-d May 1, 2026 16:15
Copy link
Copy Markdown
Contributor

@os-d os-d left a comment

Choose a reason for hiding this comment

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

Same comment here as the nvme one if Patina boot is planning on consuming this.

//! UEFI RAM Disk Protocol bindings.
//!
//! Used to install a contiguous range of system memory as a virtual block device the system
//! firmware can boot from. The SRE flow uses this to boot the recovery WIM after reading it
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.

This reads as a platform behavior, we should keep the protocol to the broad definition (i.e. nothing in here should talk about SRE)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the catch — pushed an update that drops the SRE / recovery-flow language from the module-level doc. The binding is now described purely in terms of the UEFI protocol behavior (install a host memory range as a virtual block device the firmware can boot from), with no references to specific consumers.

@kat-perez kat-perez force-pushed the kat-perez/issue-65-ramdisk-protocol-binding branch from 4cc7930 to 67efb7d Compare May 4, 2026 15:10
@kat-perez kat-perez requested a review from os-d May 4, 2026 17:45
@makubacki makubacki added this to Patina May 4, 2026
@makubacki makubacki moved this to Backlog in Patina May 4, 2026
@makubacki makubacki removed the status in Patina May 4, 2026
@kat-perez kat-perez force-pushed the kat-perez/issue-65-ramdisk-protocol-binding branch from 67efb7d to 704458d Compare May 12, 2026 00:46
@makubacki
Copy link
Copy Markdown
Collaborator

@kat-perez, given that this is a protocol defined in the UEFI Specification, can you please list the plan you have in mind here to coordinate your work using it with r-efi?

@kat-perez
Copy link
Copy Markdown
Contributor Author

@kat-perez, given that this is a protocol defined in the UEFI Specification, can you please list the plan you have in mind here to coordinate your work using it with r-efi?

I'm treating this as the interim — I'll prep the upstream r-efi patch in parallel and follow up here to swap sdk/patina/uefi_protocol/ram_disk to a re-export once it ships.

Adds sdk/patina/src/uefi_protocol/ram_disk.rs implementing the FFI
binding for EFI_RAM_DISK_PROTOCOL per UEFI 2.10 section 13.16. Exposes
the Protocol struct, RegisterFn / UnregisterFn type aliases, and the
four well-known RamDiskType GUIDs (virtual disk, virtual CD, persistent
variants).

Used by the SRE flow to install the recovery WIM as a virtual block
device after reading it out of the NVMe boot partition into RAM.

Adds two unit tests covering the protocol GUID against the UEFI-spec
value and the distinctness of the four RamDiskType GUIDs.

Closes OpenDevicePartnership#65.
@kat-perez kat-perez force-pushed the kat-perez/issue-65-ramdisk-protocol-binding branch from 704458d to 2102fc7 Compare May 12, 2026 21:22
@makubacki
Copy link
Copy Markdown
Collaborator

makubacki commented May 12, 2026

I'm treating this as the interim — I'll prep the upstream r-efi patch in parallel and follow up here to swap sdk/patina/uefi_protocol/ram_disk to a re-export once it ships.

If this is temporary and you already have the patina_boot crate in patina-components using the patina code from feature/patina-boot branch, can you just add that there until it is in r-efi?

It would be best to avoid adding public content to the normal crate that are intentionally short-lived/misplaced.

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 impact:testing Affects testing

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Add EFI_RAM_DISK_PROTOCOL binding to patina SDK

3 participants