Skip to content

winch(aarch64): Correct treatment for stores and other trapping ops#10201

Merged
saulecabrera merged 2 commits intobytecodealliance:mainfrom
saulecabrera:winch-store-flags
Feb 24, 2025
Merged

winch(aarch64): Correct treatment for stores and other trapping ops#10201
saulecabrera merged 2 commits intobytecodealliance:mainfrom
saulecabrera:winch-store-flags

Conversation

@saulecabrera
Copy link
Member

This commit is one more in the series of executing spec tests for aarch64.

It's mostly a small follow-up to #10146, in which I omitted contextualizing the memory flags for stores as well as ensuring that the SP is aligned when emitting other trapping instructions like checked_uadd.

This commit is one more in the series of executing spec tests for
aarch64.

It's mostly a small follow-up to bytecodealliance#10146,
in which I omitted contextualizing the memory flags for stores as well
as ensuring that the SP is aligned when emitting other trapping
instructions like `checked_uadd`.
@saulecabrera saulecabrera requested a review from a team as a code owner February 6, 2025 18:49
@saulecabrera saulecabrera requested review from cfallin and removed request for a team February 6, 2025 18:49
@github-actions github-actions bot added the winch Winch issues or pull requests label Feb 6, 2025
@github-actions
Copy link

github-actions bot commented Feb 6, 2025

Subscribe to Label Action

cc @saulecabrera

Details This issue or pull request has been labeled: "winch"

Thus the following users have been cc'd because of the following labels:

  • saulecabrera: winch

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

saulecabrera added a commit to saulecabrera/wasmtime that referenced this pull request Feb 20, 2025
This commit is a follow-up to
bytecodealliance#10146  and represents
another step toward fixing the remaining issues discovered through spec
tests in the same vein as bytecodealliance#10201

Specifically, this commit ensures that the stack pointer is always in
sync with the shadow stack pointer. The previous approach was lossy
because it only performed the sync when reserving stack space. While
this approach worked in some cases, it failed to account for situations
where the shadow stack pointer might be adjusted and aligned for calls.
As a result, the stack pointer could become unaligned when claiming
stack space, leading to issues at call sites.

It is possible to avoid the unconditional move and perform it only when
alignment is needed, i.e., at call sites and when the real stack pointer
is unaligned. However, as of now, the simplest solution is to always
perform the sync, which integrates best with the current infrastructure.
Copy link
Member

@cfallin cfallin left a comment

Choose a reason for hiding this comment

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

Looks good, sorry for the delay!

@saulecabrera saulecabrera added this pull request to the merge queue Feb 24, 2025
Merged via the queue into bytecodealliance:main with commit 3fb6dc7 Feb 24, 2025
39 checks passed
@saulecabrera saulecabrera deleted the winch-store-flags branch February 24, 2025 15:08
saulecabrera added a commit to saulecabrera/wasmtime that referenced this pull request Feb 26, 2025
This commit is a follow-up to
bytecodealliance#10146  and represents
another step toward fixing the remaining issues discovered through spec
tests in the same vein as bytecodealliance#10201

Specifically, this commit ensures that the stack pointer is always in
sync with the shadow stack pointer. The previous approach was lossy
because it only performed the sync when reserving stack space. While
this approach worked in some cases, it failed to account for situations
where the shadow stack pointer might be adjusted and aligned for calls.
As a result, the stack pointer could become unaligned when claiming
stack space, leading to issues at call sites.

It is possible to avoid the unconditional move and perform it only when
alignment is needed, i.e., at call sites and when the real stack pointer
is unaligned. However, as of now, the simplest solution is to always
perform the sync, which integrates best with the current infrastructure.
github-merge-queue bot pushed a commit that referenced this pull request Feb 26, 2025
* winch(aarch64): Sync SP with SSP when dropping stack

This commit is a follow-up to
#10146  and represents
another step toward fixing the remaining issues discovered through spec
tests in the same vein as #10201

Specifically, this commit ensures that the stack pointer is always in
sync with the shadow stack pointer. The previous approach was lossy
because it only performed the sync when reserving stack space. While
this approach worked in some cases, it failed to account for situations
where the shadow stack pointer might be adjusted and aligned for calls.
As a result, the stack pointer could become unaligned when claiming
stack space, leading to issues at call sites.

It is possible to avoid the unconditional move and perform it only when
alignment is needed, i.e., at call sites and when the real stack pointer
is unaligned. However, as of now, the simplest solution is to always
perform the sync, which integrates best with the current infrastructure.

* Update disassembly tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

winch Winch issues or pull requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants