OpenDevicePartnership / OpenDevicePartnership/patina

[Feature]: runtime stack allocation for exception stack in aarch64.

Open
#781 2 comments 0 reactions 1 assignee View on GitHub

@cfernald is already working on this.

Since Nov 13, 2025.

state:needs-triage type:feature-request urgency:medium
Dominant language
Rust
Stars
544
Forks
54
Avg merge
1d 8h
Merged PRs (30d)
30

Description

Feature Overview

Presently, the aarch64 cpu module sets up an alternate "SP_EL0" stack for exception handling used when the SP from the exception source could be corrupt. This is done by reserving a data area in core\patina_internal_cpu\src\interrupts\aarch64\exception_handler.asm:

  .section .data

  .global sp_el0_end

# Stack for SP_EL0 of 0x10000 bytes. Also set to 8KB aligned, which corresponds to BIT13.
  .align 13
sp_el0_start:
  .space 0x10000
sp_el0_end:

However, this has a couple of dis-advantages: 1) it increases the size of the built core image, and 2) it is fixed at build time, which precludes runtime configuration scenarios (i.e. "I enabled the debugger on this boot and need more exception stack for it").

This feature request is filed to track updating the design point to allow runtime replacement of the alternate exception stack to address above disadvantages.

Solution Overview

Presumably an API to the aarch64 CPU module to allow caller to reallocate/move the alternate exception stack, plus a configuration story so it can be used e.g. by platform integrator or debugger.

Alternatives Considered

status quo: disadvantages noted above.

Urgency

Medium

Are you going to implement the feature request?

Someone else needs to implement the feature

Do you need maintainer feedback?

No maintainer feedback needed

Anything else?

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.