Skip to content

Add safety sections to xsave-family save intrinsics - #2250

Open
kiana1kaslana wants to merge 1 commit into
rust-lang:mainfrom
kiana1kaslana:safety-doc-xsave
Open

kiana1kaslana wants to merge 1 commit into
rust-lang:mainfrom
kiana1kaslana:safety-doc-xsave

Conversation

@kiana1kaslana

@kiana1kaslana kiana1kaslana commented Oct 11, 2026 •

Copy link
Copy Markdown

_xsave, _xsaveopt, _xsavec, _xsaves and their 64-bit variants are declared unsafe but carry no # Safety section. This adds the missing sections.

The size of the XSAVE area these instructions write depends on both save_mask, which selects the features to save, and XCR0, the extended control register in which the OS records the features it has enabled. The safety sections state this relationship and require mem_addr to be valid for writes of the whole area, as well as 64-byte aligned.

Doc-only change.

@rustbot

rustbot commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust Project has assigned @sayantn (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks.

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @Amanieu, @adamgemmell, @davidtwco, @folkertdev, @sayantn
  • @Amanieu, @adamgemmell, @davidtwco, @folkertdev, @sayantn expanded to Amanieu, adamgemmell, davidtwco, folkertdev, sayantn
  • Random selection from Amanieu, adamgemmell, davidtwco, folkertdev, sayantn

@sayantn

sayantn commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

#2255

@rustbot reroll

@rustbot rustbot assigned Amanieu and unassigned sayantn Oct 13, 2026

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants