Skip to content

Document a limitation of the DW_CFA_AARCH64_negate_ra_state.#129

Merged
stuij merged 1 commit intoARM-software:mainfrom
DanielKristofKiss:DW_CFA_AARRCH64_negate_ra_state
Mar 14, 2022
Merged

Document a limitation of the DW_CFA_AARCH64_negate_ra_state.#129
stuij merged 1 commit intoARM-software:mainfrom
DanielKristofKiss:DW_CFA_AARRCH64_negate_ra_state

Conversation

@DanielKristofKiss
Copy link
Copy Markdown
Contributor

DW_CFA_AARCH64_negate_ra_state depends on the previous state of the RA_SIGN_STATE
register which makes complex to handle in cases when the register is set by
DWARF expressions because expression are lasily evaulated in runtime.


The ``DW_CFA_AARCH64_negate_ra_state`` operation negates bit[0] of the
RA_SIGN_STATE pseudo-register. It does not take any operands.
The ``DW_CFA_AARCH64_negate_ra_state`` shall not be mixed with other DWARF operations on the
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i think we should use the "Register Rule Instruction" terminology from 6.4.2.3 of https://www.dwarfstd.org/doc/DWARF5.pdf

because we want to allow "Row State Instructions" from 6.4.2.4. to be mixed with negate_ra_state.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

either that or we should call out DW_CFA_remember_state/restore_state explicitly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks @nsz-arm, change is updated.

@DanielKristofKiss DanielKristofKiss force-pushed the DW_CFA_AARRCH64_negate_ra_state branch from 8f68214 to 424fff7 Compare February 11, 2022 14:34
Copy link
Copy Markdown
Contributor

@walkerkd walkerkd left a comment

Choose a reason for hiding this comment

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

In general this looks OK to me.

Minor wording nit-pick. The DWARF standard does not use "shall not", instead it uses "must not". Suggest we do the same here.

DW_CFA_AARCH64_negate_ra_state depends on the previous state of the RA_SIGN_STATE
register which makes complex to handle in cases when the register is set by
DWARF expressions because expression are lasily evaulated in runtime.
@DanielKristofKiss DanielKristofKiss force-pushed the DW_CFA_AARRCH64_negate_ra_state branch from 424fff7 to 81a633f Compare February 25, 2022 09:47
@DanielKristofKiss
Copy link
Copy Markdown
Contributor Author

@walkerkd Thanks, done.

@stuij stuij added this to the 2022Q1 milestone Feb 25, 2022
@stuij stuij merged commit 23e36bf into ARM-software:main Mar 14, 2022
@sallyarmneale
Copy link
Copy Markdown

Looks good to me

DanielKristofKiss added a commit to llvm/llvm-project that referenced this pull request May 13, 2022
Program may set the RA_SIGN_STATE pseudo register by expressions.
Libunwind expected only the DW_CFA_AARCH64_negate_ra_state could change the value
of the register which leads to runtime errors on PAC enabled systems.
In the recent version of the aadwarf64[1] a limitation is added[2] to forbid the mixing the
DW_CFA_AARCH64_negate_ra_state with other DWARF Register Rule Instructions.

[1] https://github.com/ARM-software/abi-aa/releases/tag/2022Q1
[2] ARM-software/abi-aa#129

Reviewed By: #libunwind, MaskRay

Differential Revision: https://reviews.llvm.org/D123692
DanielKristofKiss added a commit to llvm/llvm-project that referenced this pull request May 18, 2022
Program may set the RA_SIGN_STATE pseudo register by expressions.
Libunwind expected only the DW_CFA_AARCH64_negate_ra_state could change the value
of the register which leads to runtime errors on PAC enabled systems.
In the recent version of the aadwarf64[1] a limitation is added[2] to forbid the mixing the
DW_CFA_AARCH64_negate_ra_state with other DWARF Register Rule Instructions.

[1] https://github.com/ARM-software/abi-aa/releases/tag/2022Q1
[2] ARM-software/abi-aa#129

Reviewed By: #libunwind, MaskRay

Differential Revision: https://reviews.llvm.org/D123692
Reland: test moved because it depends on exceptions.
mem-frob pushed a commit to draperlaboratory/hope-llvm-project that referenced this pull request Oct 7, 2022
Program may set the RA_SIGN_STATE pseudo register by expressions.
Libunwind expected only the DW_CFA_AARCH64_negate_ra_state could change the value
of the register which leads to runtime errors on PAC enabled systems.
In the recent version of the aadwarf64[1] a limitation is added[2] to forbid the mixing the
DW_CFA_AARCH64_negate_ra_state with other DWARF Register Rule Instructions.

[1] https://github.com/ARM-software/abi-aa/releases/tag/2022Q1
[2] ARM-software/abi-aa#129

Reviewed By: #libunwind, MaskRay

Differential Revision: https://reviews.llvm.org/D123692
mem-frob pushed a commit to draperlaboratory/hope-llvm-project that referenced this pull request Oct 7, 2022
Program may set the RA_SIGN_STATE pseudo register by expressions.
Libunwind expected only the DW_CFA_AARCH64_negate_ra_state could change the value
of the register which leads to runtime errors on PAC enabled systems.
In the recent version of the aadwarf64[1] a limitation is added[2] to forbid the mixing the
DW_CFA_AARCH64_negate_ra_state with other DWARF Register Rule Instructions.

[1] https://github.com/ARM-software/abi-aa/releases/tag/2022Q1
[2] ARM-software/abi-aa#129

Reviewed By: #libunwind, MaskRay

Differential Revision: https://reviews.llvm.org/D123692
Reland: test moved because it depends on exceptions.
arichardson pushed a commit to CTSRD-CHERI/libunwind that referenced this pull request Sep 12, 2023
Program may set the RA_SIGN_STATE pseudo register by expressions.
Libunwind expected only the DW_CFA_AARCH64_negate_ra_state could change the value
of the register which leads to runtime errors on PAC enabled systems.
In the recent version of the aadwarf64[1] a limitation is added[2] to forbid the mixing the
DW_CFA_AARCH64_negate_ra_state with other DWARF Register Rule Instructions.

[1] https://github.com/ARM-software/abi-aa/releases/tag/2022Q1
[2] ARM-software/abi-aa#129

Reviewed By: #libunwind, MaskRay

Differential Revision: https://reviews.llvm.org/D123692
arichardson pushed a commit to CTSRD-CHERI/libunwind that referenced this pull request Sep 12, 2023
Program may set the RA_SIGN_STATE pseudo register by expressions.
Libunwind expected only the DW_CFA_AARCH64_negate_ra_state could change the value
of the register which leads to runtime errors on PAC enabled systems.
In the recent version of the aadwarf64[1] a limitation is added[2] to forbid the mixing the
DW_CFA_AARCH64_negate_ra_state with other DWARF Register Rule Instructions.

[1] https://github.com/ARM-software/abi-aa/releases/tag/2022Q1
[2] ARM-software/abi-aa#129

Reviewed By: #libunwind, MaskRay

Differential Revision: https://reviews.llvm.org/D123692
Reland: test moved because it depends on exceptions.
liujinye-sys pushed a commit to open-vela/nuttx_libs_libxx_libcxxabi that referenced this pull request Nov 25, 2024
Program may set the RA_SIGN_STATE pseudo register by expressions.
Libunwind expected only the DW_CFA_AARCH64_negate_ra_state could change the value
of the register which leads to runtime errors on PAC enabled systems.
In the recent version of the aadwarf64[1] a limitation is added[2] to forbid the mixing the
DW_CFA_AARCH64_negate_ra_state with other DWARF Register Rule Instructions.

[1] https://github.com/ARM-software/abi-aa/releases/tag/2022Q1
[2] ARM-software/abi-aa#129

Reviewed By: #libunwind, MaskRay

Differential Revision: https://reviews.llvm.org/D123692
Reland: test moved because it depends on exceptions.
oneseer pushed a commit to oneseer/libcxxabi that referenced this pull request Mar 26, 2025
Program may set the RA_SIGN_STATE pseudo register by expressions.
Libunwind expected only the DW_CFA_AARCH64_negate_ra_state could change the value
of the register which leads to runtime errors on PAC enabled systems.
In the recent version of the aadwarf64[1] a limitation is added[2] to forbid the mixing the
DW_CFA_AARCH64_negate_ra_state with other DWARF Register Rule Instructions.

[1] https://github.com/ARM-software/abi-aa/releases/tag/2022Q1
[2] ARM-software/abi-aa#129

Reviewed By: #libunwind, MaskRay

Differential Revision: https://reviews.llvm.org/D123692
Reland: test moved because it depends on exceptions.
NOKEYCHECK=True
GitOrigin-RevId: c218fd3d7d3764eb123c8429bbcd33bacfe2e633
oneseer pushed a commit to oneseer/libunwind that referenced this pull request Mar 26, 2025
Program may set the RA_SIGN_STATE pseudo register by expressions.
Libunwind expected only the DW_CFA_AARCH64_negate_ra_state could change the value
of the register which leads to runtime errors on PAC enabled systems.
In the recent version of the aadwarf64[1] a limitation is added[2] to forbid the mixing the
DW_CFA_AARCH64_negate_ra_state with other DWARF Register Rule Instructions.

[1] https://github.com/ARM-software/abi-aa/releases/tag/2022Q1
[2] ARM-software/abi-aa#129

Reviewed By: #libunwind, MaskRay

Differential Revision: https://reviews.llvm.org/D123692

NOKEYCHECK=True
GitOrigin-RevId: f6366ef7f4f3cf1182fd70e0c50a9fa54374b612
oneseer pushed a commit to oneseer/libunwind that referenced this pull request Mar 26, 2025
Program may set the RA_SIGN_STATE pseudo register by expressions.
Libunwind expected only the DW_CFA_AARCH64_negate_ra_state could change the value
of the register which leads to runtime errors on PAC enabled systems.
In the recent version of the aadwarf64[1] a limitation is added[2] to forbid the mixing the
DW_CFA_AARCH64_negate_ra_state with other DWARF Register Rule Instructions.

[1] https://github.com/ARM-software/abi-aa/releases/tag/2022Q1
[2] ARM-software/abi-aa#129

Reviewed By: #libunwind, MaskRay

Differential Revision: https://reviews.llvm.org/D123692
Reland: test moved because it depends on exceptions.
NOKEYCHECK=True
GitOrigin-RevId: c218fd3d7d3764eb123c8429bbcd33bacfe2e633
openvela-robot pushed a commit to open-vela/nuttx_libs_libxx_libcxxabi that referenced this pull request Jul 23, 2025
Program may set the RA_SIGN_STATE pseudo register by expressions.
Libunwind expected only the DW_CFA_AARCH64_negate_ra_state could change the value
of the register which leads to runtime errors on PAC enabled systems.
In the recent version of the aadwarf64[1] a limitation is added[2] to forbid the mixing the
DW_CFA_AARCH64_negate_ra_state with other DWARF Register Rule Instructions.

[1] https://github.com/ARM-software/abi-aa/releases/tag/2022Q1
[2] ARM-software/abi-aa#129

Reviewed By: #libunwind, MaskRay

Differential Revision: https://reviews.llvm.org/D123692
Reland: test moved because it depends on exceptions.
liujinye-sys pushed a commit to open-vela/nuttx_libs_libxx_libcxxabi that referenced this pull request Dec 16, 2025
Program may set the RA_SIGN_STATE pseudo register by expressions.
Libunwind expected only the DW_CFA_AARCH64_negate_ra_state could change the value
of the register which leads to runtime errors on PAC enabled systems.
In the recent version of the aadwarf64[1] a limitation is added[2] to forbid the mixing the
DW_CFA_AARCH64_negate_ra_state with other DWARF Register Rule Instructions.

[1] https://github.com/ARM-software/abi-aa/releases/tag/2022Q1
[2] ARM-software/abi-aa#129

Reviewed By: #libunwind, MaskRay

Differential Revision: https://reviews.llvm.org/D123692
Reland: test moved because it depends on exceptions.
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.

5 participants