Commit Graph

9391 Commits

Author SHA1 Message Date
Nick Fitzgerald
7fd78da23f Merge pull request #3653 from fitzgen/bitselect-isle
cranelift: Port `bitselect` over to ISLE on x64
2022-01-06 13:06:43 -08:00
Nick Fitzgerald
b60a4df2af cranelift: Move bitselect runtest file to shared runtests directory 2022-01-06 11:25:27 -08:00
Nick Fitzgerald
6e0f732993 Fix warning about deprecated std::array::IntoIter 2022-01-06 11:22:54 -08:00
Nick Fitzgerald
23efaf2196 cranelift: Remove unused x64 instruction helpers 2022-01-06 11:22:54 -08:00
Nick Fitzgerald
09aa09fd76 cranelift: Port bitselect over to ISLE on x64 2022-01-06 11:22:54 -08:00
Nick Fitzgerald
ff533dc7d4 Merge pull request #3657 from fitzgen/wasmtime-meetings-2022
meetings: Create meetings agenda docs for Wasmtime through March 2022
2022-01-06 09:39:56 -08:00
Nick Fitzgerald
0d8b912ffc meetings: typo fix: sumbit -> submit 2022-01-06 09:39:09 -08:00
Nick Fitzgerald
8418201ae8 Update meetings/wasmtime/2022/wasmtime-01-06.md
Co-authored-by: Benjamin Bouvier <public@benj.me>
2022-01-06 09:36:06 -08:00
Nick Fitzgerald
5794b522f2 meetings: Create meetings agenda docs for Wasmtime through March 2022 2022-01-06 09:17:53 -08:00
wasmtime-publish
8043c1f919 Release Wasmtime 0.33.0 (#3648)
* Bump Wasmtime to 0.33.0

[automatically-tag-and-release-this-commit]

* Update relnotes for 0.33.0

* Wordsmithing relnotes

Co-authored-by: Wasmtime Publish <wasmtime-publish@users.noreply.github.com>
Co-authored-by: Alex Crichton <alex@alexcrichton.com>
2022-01-05 13:26:50 -06:00
Nick Fitzgerald
98f32968f5 docs: Fix typo in ISLE and Cranelift integration docs (#3652) 2022-01-05 13:17:56 -06:00
Chris Fallin
e2b37a57dc Merge pull request #3639 from bjorn3/machinst_cleanups
Various cleanups around machinst
2022-01-05 10:01:27 -08:00
Chris Fallin
be24edf9d8 Merge pull request #3645 from cfallin/fix-xmm-spillslot-fuzzbug
Fix spillslot size bug in SIMD by removing type-dependent spillslot allocation.
2022-01-04 14:12:11 -08:00
Chris Fallin
833ebeed76 Fix spillslot size bug in SIMD by removing type-dependent spillslot allocation.
This patch makes spillslot allocation, spilling and reloading all based
on register class only. Hence when we have a 32- or 64-bit value in a
128-bit XMM register on x86-64 or vector register on aarch64, this
results in larger spillslots and spills/restores.

Why make this change, if it results in less efficient stack-frame usage?
Simply put, it is safer: there is always a risk when allocating
spillslots or spilling/reloading that we get the wrong type and make the
spillslot or the store/load too small. This was one contributing factor
to CVE-2021-32629, and is now the source of a fuzzbug in SIMD code that
puns an arbitrary user-controlled vector constant over another
stackslot. (If this were a pointer, that could result in RCE. SIMD is
not yet on by default in a release, fortunately.

In particular, we have not been particularly careful about using moves
between values of different types, for example with `raw_bitcast` or
with certain SIMD operations, and such moves indicate to regalloc.rs
that vregs are in equivalence classes and some arbitrary vreg in the
class is provided when allocating the spillslot or spilling/reloading.
Since regalloc.rs does not track actual type, and since we haven't been
careful about moves, we can't really trust this "arbitrary vreg in
equivalence class" to provide accurate type information.

In the fix to CVE-2021-32629 we fixed this for integer registers by
always spilling/reloading 64 bits; this fix can be seen as the analogous
change for FP/vector regs.
2022-01-04 13:24:40 -08:00
Chris Fallin
d399739563 Merge pull request #3646 from cfallin/release-0.32.1-notes
Copy release notes from 0.32.1 patch branch into main RELEASES.md.
2022-01-04 12:07:23 -08:00
Alex Crichton
050cdca4ae Run the "push tag" CI on all release branches (#3644)
This updates our `push-tag.yml` workflow to check all commits to
`release-*` branches in addition to the `main` branch for cmomits which
should be tagged.
2022-01-04 13:24:40 -06:00
Teymour Aldridge
40072f844e Clarify some documentation. (#3641) 2022-01-04 11:15:19 -08:00
Chris Fallin
5fd3b3993e Copy release notes from 0.32.1 patch branch into main RELEASES.md. 2022-01-04 11:01:08 -08:00
Alex Crichton
d2d0396f40 Really fix PRs from bump-version for patch releases (#3631)
Actually poking around the `github` context it looks like for
workflow-dispatch-triggered-events `base_ref` is blank but `ref_name`
has the branch name we're interested in.
2022-01-04 11:40:25 -06:00
bjorn3
17c3c1813f Remove MachInstEmitInfo 2022-01-04 18:06:01 +01:00
bjorn3
552c801557 Remove unused create_unwind_info method 2022-01-04 18:06:01 +01:00
bjorn3
8d1fc75b6b Make MachBackend::triple return &Triple
This avoids an unnecessary clone
2022-01-04 18:06:01 +01:00
bjorn3
4915162230 Remove unnecessary fields from CodeInfo 2022-01-04 18:05:45 +01:00
bjorn3
e98a85e1e2 Make get_mach_backend non-optional 2022-01-04 15:48:19 +01:00
bjorn3
b3aa692a44 Don't return CodeInfo from Context::compile_and_emit
It is already available through ctx.mach_compile_result and rarely
needed.
2022-01-04 15:48:05 +01:00
Chris Fallin
6ae9e815d5 Merge pull request #3635 from teymour-aldridge/patch-1
Add a doclink.
2022-01-03 12:02:30 -08:00
Teymour Aldridge
28ede8356a Add a doclink. 2022-01-03 19:22:21 +00:00
Chris Fallin
224d116bff Merge pull request #3637 from cfallin/fix-doc-build
Fix "Doc build" CI job.
2022-01-03 11:07:15 -08:00
Chris Fallin
54a59ff832 Fix "Doc build" CI job.
It seems that Doxygen 1.9.1 was removed; this upgrades to 1.9.3.
2022-01-03 09:45:22 -08:00
Chris Fallin
3eb82f1d8e Merge pull request #3636 from cfallin/cranelift-meetings-2022
Add Cranelift meeting agendas through May; add item on Jan 10.
2022-01-03 09:40:26 -08:00
Chris Fallin
2fdb3ada68 Fix typos 2022-01-03 09:39:45 -08:00
Chris Fallin
aa8a86cfae Add Cranelift meeting agendas through May; add item on Jan 10. 2022-01-02 17:02:09 -08:00
Alex Crichton
dd85d66ec3 Run PR CI for release branches (#3629)
This was accidentally ommitted from our CI configuration which meant
that release branches didn't get PR CI. They still won't get on-merge CI
but that shouldn't be an issue because the PR CI is the full CI.
2021-12-21 12:52:34 -06:00
Alex Crichton
222d6fbc09 Try to fix patch release process (#3627)
The whole point of patch releases is that they're not on the `main`
branch, so this is an attempt to handle #3621.
2021-12-21 09:50:31 -06:00
Andrew Brown
ad6f76a789 x64: upgrade ittapi-rs crate (for VTune support) (#3623)
This update is no real change in functionality but brings in several of
the latest changes to the `ittapi-rs` library: minor fixes to the C
library, a new license expression for the Cargo crate, better
documentation, updated Rust bindings, and the removal of `cmake` as a
dependency (uses `cc` directly instead).
2021-12-17 19:23:03 -06:00
Andrew Brown
24bc4d6055 docs: replace 'amplxe-cl' with 'vtune' (#3622)
The name of the VTune collector CLI has [now
changed](https://github.com/intel/ittapi/pull/32#discussion_r771417365)
to `vtune`; `amplxe-cl` is deprecated.
2021-12-17 16:59:47 -08:00
Andrew Brown
99b00cd973 docs: update VTune documentation (#3604)
While using VTune, it seemed a good idea to check that the VTune
documentation for Wasmtime was still correct. It is and VTune support
still works (improvements: click-through to x86 assembly is not
available). These changes simply re-organize the documentation and add a
section for running VTune from a GUI.
2021-12-17 15:47:09 -08:00
Alex Crichton
546e901d32 aarch64: Use smaller instruction helpers in ISLE (#3618)
* aarch64: Use smaller instruction helpers in ISLE

This commit moves the aarch64 backend's ISLE to be more similar to the
x64 backend's ISLE where one-liner instruction builders are used for
various forms of instructions instead of always using the
constructor-per-variant-of-`Inst`. Overall I think this change worked
out quite well and sets up some naming idioms as well for various forms
of instructions.

* rebase conflict
2021-12-17 17:28:52 -06:00
Chris Fallin
e10171b7ea Merge pull request #3619 from cfallin/isle-manifest-siphash
Use SipHasher rather than SHA-512 for ISLE manifest.
2021-12-17 13:15:28 -08:00
Chris Fallin
1db76447c5 Merge pull request #3617 from bjorn3/fix_small_popcnt
Fix popcnt for small integers
2021-12-17 13:15:02 -08:00
Chris Fallin
5233175b06 Use SipHasher rather than SHA-512 for ISLE manifest.
Fixes #3609. It turns out that `sha2` is a nontrivial dependency for
Cranelift in many contexts, partly because it pulls in a number of other
crates as well.

One option is to remove the hash check under certain circumstances, as
implemented in #3616. However, this is undesirable for other reasons:
having different dependency options in Wasmtime in particular for
crates.io vs. local builds is not really possible, and so either we
still have the higher build cost in Wasmtime, or we turn off the checks
by default, which goes against the original intent of ensuring developer
safety (no mysterious stale-source bugs).

This PR uses `SipHash` instead, which is built into the standard
library. `SipHash` is deprecated, but it's fixed and deterministic
(across runs and across Rust versions), which is what we need, unlike
the suggested replacement `std::collections::hash_map::DefaultHasher`.
The result is only 64 bits, and is not cryptographically secure, but we
never needed that; we just need a simple check to indicate when we
forget a `rebuild-isle`.
2021-12-17 12:11:05 -08:00
Dan Gohman
7b346b1f12 Update to cap-std 0.22.0. (#3611)
* Update to cap-std 0.22.0.

The main change relevant to Wasmtime here is that this includes the
rustix fix for compilation errors on Rust nightly with the `asm!` macro.

* Add itoa to deny.toml.

* Update the doc and fuzz builds to the latest Rust nightly.

* Update to libc 0.2.112 to pick up the `POLLRDHUP` fix.

* Update to cargo-fuzz 0.11, for compatibility with Rust nightly.

This appears to be the fix for rust-fuzz/cargo-fuzz#277.
2021-12-17 12:00:11 -08:00
bjorn3
32c3afe4b3 Add regression runtests 2021-12-17 20:58:32 +01:00
bjorn3
1dbb747d59 Fix popcnt for small integers 2021-12-17 20:39:53 +01:00
Alex Crichton
e94ebc2263 aarch64: Translate rot{r,l} to ISLE (#3614)
This commit translates the `rotl` and `rotr` lowerings already existing
to ISLE. The port was relatively straightforward with the biggest
changing being the instructions generated around i128 rotl/rotr
primarily due to register changes.
2021-12-17 12:37:17 -06:00
Alex Crichton
d8974ce6bc aarch64: Migrate ishl/ushr/sshr to ISLE (#3608)
* aarch64: Migrate ishl/ushr/sshr to ISLE

This commit migrates the `ishl`, `ushr`, and `sshr` instructions to
ISLE. These involve special cases for almost all types of integers
(including vectors) and helper functions for the i128 lowerings since
the i128 lowerings look to be used for other instructions as well. This
doesn't delete the i128 lowerings in the Rust code just yet because
they're still used by Rust lowerings, but they should be deletable in
due time once those lowerings are translated to ISLE.

* Use more descriptive names for i128 lowerings

* Use a with_flags-lookalike for csel

* Use existing `with_flags_*`

* Coment backwards order

* Update generated code
2021-12-16 17:37:53 -06:00
Chris Fallin
e1e2f3ca15 Merge pull request #3610 from cfallin/fix-narrow-type-rotate
Fix some 16- and 8-bit behavior in x64 backend related to rotates.
2021-12-16 14:06:52 -08:00
Chris Fallin
fd171ca063 Fix OperandSize: need clamp-to-32-bit behavior in most cases, but true-width for shifts. 2021-12-16 12:32:28 -08:00
Chris Fallin
1323ae417e Fix some 16- and 8-bit behavior in x64 backend related to rotates.
Uncovered by @bjorn3 (thanks!): 8- and 16-bit rotates were not working
properly in recent versions of Cranelift with part of the lowering
migrated to ISLE.

This PR fixes a few issues:

- 8- and 16-bit rotate-left needs to mask a constant amount, if any,
  because we use a 32-bit rotate instruction and so don't get the
  appropriate shift-amount masking for free from x86 semantics.

- `operand_size_from_type` was incorrect: it only handled 32- and 64-bit
  types and silently returned `OperandSize::Size32` for everything else.
  Now uses the `OperandSize::from_ty(ty)` helper as the pre-ISLE code
  did.

Our test coverage for narrow value types is not great; this PR adds some
runtests for rotl/rotr but more would always be better!
2021-12-16 11:34:24 -08:00
Alex Crichton
d29b7c8a59 Fix a simd shuffle test (#3607)
Cranelift shuffles require indices to be in-bounds, which the
avx512-using backend also requires via a debug assert, so this commit
fixes a test with simd shuffles to only use in-bounds indices.

This is motivated by another failure on CI where the machine we were
running on presumably had avx512 things enabled. This should fix those
failures.

Closes #3581
2021-12-16 10:36:52 -08:00