Skip to content

3945_arm_cca_v5_s3: Initial patches for enabling RME support#12380

Merged
mergify[bot] merged 4 commits intotianocore:masterfrom
samimujawar:3945_arm_cca_v5_s3
Apr 21, 2026
Merged

3945_arm_cca_v5_s3: Initial patches for enabling RME support#12380
mergify[bot] merged 4 commits intotianocore:masterfrom
samimujawar:3945_arm_cca_v5_s3

Conversation

@samimujawar
Copy link
Copy Markdown
Contributor

Initial patches for enabling RME support

This is an initial set of patches that:

  • Implement a helper function to detect RME support
  • Add an API to set/clear the Arm CCA memory protect attribute bit in the page tables
  • Preserve the Realm protection attribute bit
  • Add a missing implementation of FreeAlignedPages() in PrePiMemoryAllocationLib.

Note: This is a PR series that includes patches from PR #12224

  • Breaking change?
    • NO
  • Impacts security?
    • NO
  • Includes tests?
    • No explicit test, run Kvmtool guest firmware.

How This Was Tested

Only build tested. Actual functionality can only be tested when the remaining patches from PR #12224 are integrated in the future.

Integration Instructions

N/A

Comment thread EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c
Comment thread UefiCpuPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c Outdated
Comment thread UefiCpuPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c Outdated
@mergify
Copy link
Copy Markdown

mergify Bot commented Apr 10, 2026

PR can not be merged due to conflict. Please rebase and resubmit

@samimujawar samimujawar force-pushed the 3945_arm_cca_v5_s3 branch 2 times, most recently from 87ca83c to 0150ca4 Compare April 13, 2026 08:03
@samimujawar samimujawar mentioned this pull request Apr 16, 2026
3 tasks
@samimujawar
Copy link
Copy Markdown
Contributor Author

@leiflindholm If there are no further comments, can we merge this branch, please?

@samimujawar samimujawar force-pushed the 3945_arm_cca_v5_s3 branch 2 times, most recently from 0945a5c to 0dc391b Compare April 21, 2026 07:56
samimujawar and others added 4 commits April 21, 2026 15:07
Add helper function to check if the Realm Management
Extension (RME) is implemented by the hardware.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
When creating the identity mapping, copy the 'unprotected' top bit from
the physical address as an attribute in the PTE. The virtual address
then points to the top half of the address space, which in a Realm is
the unprotected half, shared with the host.

Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Arm CCA requires the software in a Realm to treat the most
significant bit of an IPA as a protection attribute. To
enable/disable sharing of memory regions with the host, the
protection attribute needs to be set/cleared accordingly.

Therefore, introduce ArmCcaSetMemoryProtectionAttribute() so
that the memory regions can be shared/unshared with the host.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
The PrePiMemoryAllocationLib supports AllocateAlignedPages(),
however is missing the corresponding FreeAlignedPages().

Although the FreeAlignedPages() in PrePiMemoryAllocationLib
does not support the ability to free pages in the PrePei Memory
Allocator and the allocated memory is lost, it would be good
to have an empty implementation of FreeAlignedPages() so that
implementations utilises the correct deallocation function.

Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
@leiflindholm
Copy link
Copy Markdown
Member

@leiflindholm If there are no further comments, can we merge this branch, please?

Yeah, I think others have had enough of an opportunity to comment.

@leiflindholm leiflindholm added the push Auto push patch series in PR if all checks pass label Apr 21, 2026
@mergify mergify Bot added the queued label Apr 21, 2026
@mergify
Copy link
Copy Markdown

mergify Bot commented Apr 21, 2026

Merge Queue Status

  • Entered queue2026-04-21 16:55 UTC · Rule: default
  • Checks skipped · PR is already up-to-date
  • Merged2026-04-21 16:55 UTC · at 806c4c61e4d02f4fe0b0a049fc79861d469d5dc6 · rebase

This pull request spent 12 seconds in the queue, including 1 second running CI.

Required conditions to merge
  • #approved-reviews-by >= 1 [🛡 GitHub branch protection]
  • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = tianocore.PatchCheck
    • check-neutral = tianocore.PatchCheck
    • check-skipped = tianocore.PatchCheck
  • any of [🛡 GitHub branch protection]:
    • check-success = ArmVirtPkg - Ubuntu GCC - PR
    • check-neutral = ArmVirtPkg - Ubuntu GCC - PR
    • check-skipped = ArmVirtPkg - Ubuntu GCC - PR
  • any of [🛡 GitHub branch protection]:
    • check-success = EmulatorPkg - Ubuntu GCC - PR
    • check-neutral = EmulatorPkg - Ubuntu GCC - PR
    • check-skipped = EmulatorPkg - Ubuntu GCC - PR
  • any of [🛡 GitHub branch protection]:
    • check-success = EmulatorPkg - Windows VS - PR
    • check-neutral = EmulatorPkg - Windows VS - PR
    • check-skipped = EmulatorPkg - Windows VS - PR
  • any of [🛡 GitHub branch protection]:
    • check-success = OvmfPkg - Ubuntu GCC - PR
    • check-neutral = OvmfPkg - Ubuntu GCC - PR
    • check-skipped = OvmfPkg - Ubuntu GCC - PR
  • any of [🛡 GitHub branch protection]:
    • check-success = OvmfPkg - Windows VS - PR
    • check-neutral = OvmfPkg - Windows VS - PR
    • check-skipped = OvmfPkg - Windows VS - PR
  • any of [🛡 GitHub branch protection]:
    • check-success = Windows VS - PR
    • check-neutral = Windows VS - PR
    • check-skipped = Windows VS - PR
  • any of [🛡 GitHub branch protection]:
    • check-success = Ubuntu GCC - PR
    • check-neutral = Ubuntu GCC - PR
    • check-skipped = Ubuntu GCC - PR
  • any of [🛡 GitHub branch protection]:
    • check-success = Validate Pull Request Formatting
    • check-neutral = Validate Pull Request Formatting
    • check-skipped = Validate Pull Request Formatting
  • any of [🛡 GitHub branch protection]:
    • check-success = ArmVirtPkg - Ubuntu - CLANGPDB
    • check-neutral = ArmVirtPkg - Ubuntu - CLANGPDB
    • check-skipped = ArmVirtPkg - Ubuntu - CLANGPDB
  • any of [🛡 GitHub branch protection]:
    • check-success = OvmfPkg - Ubuntu - CLANGPDB
    • check-neutral = OvmfPkg - Ubuntu - CLANGPDB
    • check-skipped = OvmfPkg - Ubuntu - CLANGPDB
  • any of [🛡 GitHub branch protection]:
    • check-success = Ubuntu - CLANGPDB
    • check-neutral = Ubuntu - CLANGPDB
    • check-skipped = Ubuntu - CLANGPDB
  • any of [🛡 GitHub branch protection]:
    • check-success = Windows - CLANGPDB
    • check-neutral = Windows - CLANGPDB
    • check-skipped = Windows - CLANGPDB
  • any of [🛡 GitHub branch protection]:
    • check-success = EmulatorPkg - Windows - CLANGPDB
    • check-neutral = EmulatorPkg - Windows - CLANGPDB
    • check-skipped = EmulatorPkg - Windows - CLANGPDB

@mergify mergify Bot merged commit b5f1199 into tianocore:master Apr 21, 2026
161 of 162 checks passed
@mergify mergify Bot removed the queued label Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

push Auto push patch series in PR if all checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants