Skip to content

Arm64-SVE: Add scheme for scalable SVE state in the CONTEXT record - #133152

Open
snickolls-arm wants to merge 2 commits into
dotnet:mainfrom
snickolls-arm:sve-suspension
Open

snickolls-arm wants to merge 2 commits into
dotnet:mainfrom
snickolls-arm:sve-suspension

Conversation

@snickolls-arm

Copy link
Copy Markdown
Contributor

Replaces the fixed-length SVE state from the CONTEXT record with dynamically allocated space, similar to XSTATE, for saving and restoring vector/predicate register state, and the first-faulting register.

This reduces the size of the CONTEXT structure, as the SVE state is now optional. Subsystems that want to consume SVE state should set XSTATE_MASK_ARM64_SVE in CONTEXT::XStateFeaturesMask and allocate sufficient storage space for the trailer.

Replaces the fixed-length SVE state from the CONTEXT record with
dynamically allocated space, similar to XSTATE, for saving and restoring
vector/predicate register state, and the first-faulting register.

This reduces the size of the CONTEXT structure, as the SVE state is now
optional. Subsystems that want to consume SVE state should set
XSTATE_MASK_ARM64_SVE in CONTEXT::XStateFeaturesMask and allocate
sufficient storage space for the trailer.
@github-actions github-actions Bot added the area-PAL-coreclr only for closed issues label Sep 3, 2026
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Sep 3, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@snickolls-arm

Copy link
Copy Markdown
Contributor Author

@dotnet/arm64-contrib

I originally planned this work thinking that it was necessary to ensure SVE vector state is preserved across suspension, though I have learned that it's not while writing this patch, as the OS suspension context will do that already.

IIUC x64 saves its vector state in CONTEXT records with XSTATE, so I have updated ARM64's CONTEXT to have a similar view of SVE vector state. If anyone would be able to help me understand where this state might be used, that could be useful for future work.

I have tried to keep this data structure as simple as possible so it's easy to port to XSTATE format later on.

@dhartglassMSFT

Copy link
Copy Markdown
Contributor

@janvorli would you be an appropriate person to take a look here? pal/CONTEXT changes

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-PAL-coreclr only for closed issues community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants