Stream: git-wasmtime

Topic: wasmtime / PR #5652 winch: Use aarch64 backend for code e...


view this post on Zulip Wasmtime GitHub notifications bot (Jan 30 2023 at 15:51):

saulecabrera opened PR #5652 from winch-codegen-use-aarch64-backend to main:

This patch introduces basic Aarch64 code generation by using cranelift-codegen's backend.

This change does not:

The most notable change in this patch is how addressing modes are handled at the MacroAssembler layer: instead of having a canonical address representation, this patch introduces the addressing mode as an associated type in the MacroAssembler trait. This approach has the advantage that gives each ISA enough flexiblity to describe the addressing modes and their constraints in isolation without having to worry on how a particular addressing mode is going to affect other ISAs. In the case of Aarch64 this becomes useful to describe indexed addressing modes (particularly from the stack pointer).

This patch uses the concept of a shadow stack pointer (x28) as a workaround to Aarch64's stack pointer 16-byte alignment. This constraint is enforced by:

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Jan 30 2023 at 15:51):

saulecabrera requested cfallin for a review on PR #5652.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 30 2023 at 15:57):

saulecabrera updated PR #5652 from winch-codegen-use-aarch64-backend to main.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 30 2023 at 15:59):

bjorn3 submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 30 2023 at 15:59):

bjorn3 created PR review comment:

You may want to call .set_skipdata(true) on the built disassembler if you want to use inline constant pools. Otherwise capstone will stop disassembling at the first instruction it can't disassemble (eg due to being a constant pool)

view this post on Zulip Wasmtime GitHub notifications bot (Jan 31 2023 at 01:42):

saulecabrera updated PR #5652 from winch-codegen-use-aarch64-backend to main.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 31 2023 at 18:56):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 31 2023 at 18:56):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 31 2023 at 18:56):

cfallin created PR review comment:

Since this variant only supports pre-/post-indexed forms (i.e., forms that update SP), maybe we can name it SPOffsetWithUpdate (or something less cumbersome, though nothing comes to mind at the moment...)?

view this post on Zulip Wasmtime GitHub notifications bot (Jan 31 2023 at 18:56):

cfallin created PR review comment:

Could we add a block comment somewhere describing what the shadow stack is and how it works? (Or maybe I missed it earlier in which case let's have a reference to docs here!)

view this post on Zulip Wasmtime GitHub notifications bot (Jan 31 2023 at 18:56):

cfallin created PR review comment:

Ah, here's a good description, thanks!

A few questions on invariants:

view this post on Zulip Wasmtime GitHub notifications bot (Feb 01 2023 at 16:54):

saulecabrera updated PR #5652 from winch-codegen-use-aarch64-backend to main.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 01 2023 at 16:55):

saulecabrera submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 01 2023 at 16:55):

saulecabrera created PR review comment:

I renamed this to IndexedSPOffset, let me know if that's clear enough. Else I'm happy to find a better name.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 01 2023 at 16:56):

saulecabrera submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 01 2023 at 16:56):

saulecabrera created PR review comment:

I'd like to keep the documentation of the shadow_sp at regs::shadow_sp(), so I've added a reference here.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 01 2023 at 16:57):

saulecabrera submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 01 2023 at 16:57):

saulecabrera created PR review comment:

I added more details to the documentation here addressing your questions around the invariants also taking as a base our conversation during our meeting.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 01 2023 at 17:01):

saulecabrera updated PR #5652 from winch-codegen-use-aarch64-backend to main.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 02 2023 at 12:24):

saulecabrera requested cfallin for a review on PR #5652.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 02 2023 at 22:23):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 02 2023 at 22:24):

cfallin merged PR #5652.


Last updated: Dec 23 2024 at 12:05 UTC