Skip to content

ArmPkg: StMM: Use x29 register to store stack address #11027

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mgamal
Copy link

@mgamal mgamal commented May 1, 2025

Description

Now that the use of 18 registers for FF-A is supported. Registers from x0-x17 can be used by FF-A to return call results. StMM also uses registers x19-x23 to store SPMC boot information.

Use the x29 register to store the stack address instead of x12 to avoid it being clobbered by FF-A calls.

The x29 register is normally used as a Frame Pointer Register, but it's not used as such in this context, so it could be used here.

  • 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

Tested running rust-spmc as an EL-1 SPMC

Integration Instructions

N/A

Now that the use of 18 registers for FF-A is supported. Registers
from x0-x17 can be used by FF-A to return call results. StMM also uses
registers x19-x23 to store SPMC boot information.

Use the x29 register to store the stack address instead of x12
to avoid it being clobbered by FF-A calls.

The x29 is normally used as a Frame Pointer Register, but it's not
used as such in this context, so it could be used here.

Signed-off-by: Mohamed Gamal Morsy <[email protected]>
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.

1 participant