Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Jul 23, 2024

Backport of #105059 to release/9.0-preview7

/cc @tannergooding

Customer Impact

  • Customer reported
  • Found internally

.NET 9 has introduced experimental support for the SVE instruction set for the Arm64 platform. While this feature work is considered experimental and some functionality is expected to be incomplete, it is still important that key scenarios function so that developers can successfully use the functionality in non-production scenarios.

The support for saving/restoring SVE state as part of thread suspension had been added for Unix platforms, but had not yet been added for Windows. As such, developers utilizing the SVE APIs on Windows could see corruption of state if a GC were to occur and cause the underlying thread to be suspended.

Regression

  • Yes
  • No

This is not a regression, it is impacting a new feature that was developed as part of .NET 9

Testing

As we do not currently have SVE capable machines in our CI pool, manual validation was done on the internal SVE capable machines we have in our hardware lab.

This manual validation included using SVE instructions, forcing a GC suspension to occur, and observing that the state was no longer trashed after the GC completed and the managed code was allowed to continue executing.

Risk

Low. This is ensuring that the general thread suspension support saves/restores state that is unique to experimental SVE feature.

It is worth noting, however, that the thread suspension logic is centralized and needs to work without context as to whether any SVE is actually in use. This means that all context save/restore queries made to the OS are now requesting that SVE state be preserved even if the process does not otherwise use the feature. On OS versions or hardware that does not support SVE, this additional XSTATE_MASK_ARM64_SVE flag is ignored (https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-setxstatefeaturesmask#remarks) and we correctly check for such support before attempting to access SVE related data from the returned CONTEXT. This will not impact non SVE related state and is completely transparent to the user, but is still worth calling out given that it isn't strictly isolated to only contexts where the user has opted to use SVE related APIs.

@ghost ghost added the area-PAL-coreclr label Jul 23, 2024
@tannergooding
Copy link
Member

CC. @JulieLeeMSFT, @jeffschwMSFT for approval so the servicing-consider label can be applied

CC. @kunalspathak, @TIHan, and @janvorli for review since you approved the original PR. -- No changes or merge conflicts, it just missed the snap cutoff by a couple minutes and so needs to be backported explicitly

@jeffschwMSFT jeffschwMSFT added the Servicing-consider Issue for next servicing release review label Jul 23, 2024
Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

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

lgtm. we will take for consideration in Preview 7

@rbhanda rbhanda added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Jul 23, 2024
@carlossanlop
Copy link
Contributor

No CI failures, signed-off, approved by Tactics. Ready to merge.

@carlossanlop carlossanlop merged commit c7eb733 into release/9.0-preview7 Jul 23, 2024
@carlossanlop carlossanlop deleted the backport/pr-105059-to-release/9.0-preview7 branch July 23, 2024 21:20
@github-actions github-actions bot locked and limited conversation to collaborators Aug 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-PAL-coreclr Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants