Skip to content

ArmPkg/Library: optimise StandaloneMmMmuLib with FF-A v1.3#12430

Open
LeviYeoReum wants to merge 1 commit intotianocore:masterfrom
LeviYeoReum:stmm_opt_set_mem
Open

ArmPkg/Library: optimise StandaloneMmMmuLib with FF-A v1.3#12430
LeviYeoReum wants to merge 1 commit intotianocore:masterfrom
LeviYeoReum:stmm_opt_set_mem

Conversation

@LeviYeoReum
Copy link
Copy Markdown
Contributor

Description

commit 4ca452c ("ArmPkg/Library: Update StandaloneMmuLib with FF-A v1.2 with page granularity") introduced page-granular memory permission updates to fix the StandaloneMm load failure.

However, this approach results in issuing an SMC call per page when updating permissions over a region.

Since FF-A Memory Management Protocol v1.3 [0],
FFA_MEM_PERM_GET has been updated to return the number of contiguous pages that share the same memory permission starting from a base address.

With this change, update memory permissions in bulk (per contiguous page range) to reduce the number of SMC calls, leveraging FF-A Memory Management Protocol v1.3 [0].

Link: https://developer.arm.com/documentation/den0140/latest [0]

  • Breaking change?
    • Breaking change - Does this PR cause a break in build or boot behavior?
    • Examples: Does it add a new library class or move a module to a different repo.
  • Impacts security?
    • Security - Does this PR have a direct security impact?
    • Examples: Crypto algorithm change or buffer overflow fix.
  • Includes tests?
    • Tests - Does this PR include any explicit test code?
    • Examples: Unit tests or integration tests.

How This Was Tested

Boot testing StandaloneMm in FVP revC

Integration Instructions

N/A

Copy link
Copy Markdown
Contributor

@samimujawar samimujawar left a comment

Choose a reason for hiding this comment

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

Minor suggestion, otherwise this patch looks good to me.

commit 4ca452c ("ArmPkg/Library: Update StandaloneMmuLib with
FF-A v1.2 with page granularity") introduced page-granular memory
permission updates to fix the StandaloneMm load failure.

However, this approach results in issuing an SMC call
per page when updating permissions over a region.

Since FF-A Memory Management Protocol v1.3 [0],
FFA_MEM_PERM_GET has been updated to return the number of contiguous
pages that share the same memory permission starting from a base address.

With this change, update memory permissions in bulk
(per contiguous page range) to reduce the number of SMC calls,
leveraging FF-A Memory Management Protocol v1.3 [0].

Link: https://developer.arm.com/documentation/den0140/latest [0]
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants