Commit Graph

9391 Commits

Author SHA1 Message Date
Alex Crichton
37adfb898b Remove deprecated --enable-* CLI flags (#3524)
These have all migrated to `--wasm-features *` and otherwise having some
for some features but not other features can lead to accidental
confusion.
2021-11-15 17:03:09 -06:00
Nick Fitzgerald
0b1bf104c6 Update miette graphical-forcing comment to reference upstream issue 2021-11-15 14:53:51 -08:00
Alex Crichton
2b0b5d0491 Add today's Cranelift meeting notes (#3522)
* Add today's Cranelift meeting notes

* Update cranelift-11-15.md
2021-11-15 15:21:01 -06:00
Nick Fitzgerald
48ef2c0b84 Clarify comment about force_graphical in miette 2021-11-15 11:26:41 -08:00
Nick Fitzgerald
6164ba3814 ISLE: match cranelift version 2021-11-15 11:17:31 -08:00
Nick Fitzgerald
f27b357702 ISLE: update repo in Cargo.toml 2021-11-15 11:16:24 -08:00
Nick Fitzgerald
4a34d2c55b Remove old ISLE-generated file 2021-11-15 11:14:06 -08:00
Dan Gohman
ea0cb971fb Update to rustix 0.26.2. (#3521)
This pulls in a fix for Android, where Android's seccomp policy on older
versions is to make `openat2` irrecoverably crash the process, so we have
to do a version check up front rather than relying on `ENOSYS` to
determine if `openat2` is supported.

And it pulls in the fix for the link errors when multiple versions of
rsix/rustix are linked in.

And it has updates for two crate renamings: rsix has been renamed to
rustix, and unsafe-io has been renamed to io-extras.
2021-11-15 10:21:13 -08:00
David Craven
81f6228c57 Fix build 32bit. (#3518)
* Fix build 32bit.

* Use ifcfg.
2021-11-15 11:47:02 -06:00
Nick Fitzgerald
b6fd3d0c40 Remove extra, unused Cargo.lock 2021-11-15 09:25:29 -08:00
Chris Fallin
4bde42e789 Merge pull request #3520 from alexcrichton/faster-fuzz
Disable `check_label_branch_invariants` in fuzzing
2021-11-15 08:05:44 -08:00
Alex Crichton
1548ca3c47 Disable check_label_branch_invariants in fuzzing
This commit disables the `MachBuffer::check_label_branch_invariants`
debug check on the fuzzers due to it causing timeouts with the test case
from #3441. Fuzzing leads to a 20-30x slowdown of executed code and
locally the fuzz time it takes to instantiate #3441 drops from 3 minutes
to 6 seconds disabling this function. Note that this should still be
executed during our testing on CI since it's still enabled for debug
assertions.
2021-11-15 07:34:09 -08:00
Alex Crichton
ff1af20479 Add a fuzz mode to stress unaligned wasm addresses (#3516)
Alignment on all memory instructions in wasm is currently best-effort
and not actually required, meaning that whatever wasm actually uses as
an address should work regardless of whether the address is aligned or
not. This is theoretically tested in the fuzzers via
wasm-smith-generated code, but wasm-smith doesn't today have too too
high of a chance of generating an actual successful load/store.

This commit adds a new configuration option to the `Config` generator
for fuzzing which forces usage of a custom linear memory implementation
which is backed by Rust's `Vec<u8>` and forces the base address of
linear memory to be off-by-one relative to the base address of the
`Vec<u8>` itself. This should theoretically force host addresses to
almost always be unaligned, even if wasm addresses are otherwise
aligned.

The main interesting fuzz coverage here is likely to be in the existing
`differential` target which compares running the same module in wasmtime
with two different `Config` values to ensure the same results are
produced. This probably won't increase coverage all that much in the
near future due to wasm-smith rarely generating successful loads/stores,
but in the meantime by hooking this up into `Config` it also means that
we'll be running in comparison against v8 and also ensuring that all
spec tests succeed if misalignment is forced at the hardware level.

As a side effect this commit also cleans up the fuzzers slightly:

* The `DifferentialConfig` struct is removed and folded into `Config`
* The `init_hang_limit` processing is removed since we don't use
  `-ttf`-generated modules from binaryen any more.
* Traps are now asserted to have the same trap code, otherwise
  differential fuzzing fails.
* Some more debug logging was added to the differential fuzzer
2021-11-15 08:24:23 -06:00
Nick Fitzgerald
bfbf2f2f49 ISLE: implement x64 lowering for band_not in ISLE 2021-11-11 15:19:28 -08:00
Chris Fallin
f2939111d9 Merge pull request #3515 from cfallin/wasmtime-meeting-20211111
Wasmtime meeting notes from 2021-11-11.
2021-11-11 09:55:46 -08:00
Chris Fallin
e50d431946 Update meetings/wasmtime/2021/wasmtime-11-11.md
typo fix

Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
2021-11-11 09:55:18 -08:00
Chris Fallin
0a8b08a0d5 Wasmtime meeting notes from 2021-11-11. 2021-11-11 09:33:41 -08:00
Nick Fitzgerald
33fcd6b4a5 x64: special case 0 to use xor in Inst::gen_constant for i128s 2021-11-10 15:57:58 -08:00
Nick Fitzgerald
b5105c025c MachInst: always rematerialize constants, rather than assign them registers
There were a few previous code paths that attempted to handle this, but this new
check handles it for all callers.

Rematerializing constants, rather than assigning and reusing a register, allows
for lower register pressure.
2021-11-10 15:45:43 -08:00
Peter Huene
990f834e27 Merge pull request #3514 from peterhuene/feature-gate-pooling-allocator
Add the `pooling-allocator` feature.
2021-11-10 14:00:33 -08:00
Peter Huene
58aab85680 Add the pooling-allocator feature.
This commit adds the `pooling-allocator` feature to both the `wasmtime` and
`wasmtime-runtime` crates.

The feature controls whether or not the pooling allocator implementation is
built into the runtime and exposed as a supported instance allocation strategy
in the wasmtime API.

The feature is on by default for the `wasmtime` crate.

Closes #3513.
2021-11-10 13:25:55 -08:00
Nick Fitzgerald
bbb4949128 ISLE: use lower_to_amode inside sink_load implementation 2021-11-10 13:21:48 -08:00
Alex Crichton
00feefe9a7 Change the bump-version workflow's schedule (#3512)
* Change the bump-version workflow's schedule

Either I don't understand cron or GitHub doesn't understand cron. It's
not clear which. I think that
https://github.com/bytecodealliance/wasmtime/pull/3511 may have fallen
within our schedule but it was supposed to be on a weekday. Otherwise
https://github.com/bytecodealliance/wasmtime/pull/3499 was certainly
spurious. This commit moves to a simpler "just do it on the same day
each month" and we can manually figure out weekdays and such. Hopefully
this should reduce the number of spurious PRs we're getting to bump
versions.

This also removes the script to force a version bump since I found a
button on the GitHub UI to do the same thing. Additionally I've updated
the patch-release documentation to use this button. Note that this
button takes inputs as well which means we can further automate patch
releases to look even more like normal release process, differing only
in one part of the argument used to trigger the workflow.

* Fix a typo
2021-11-08 10:37:53 -06:00
Adam Bratschi-Kaye
12bfbdfaca Skip generating DWARF info for dead code (#3498)
When encountering a subprogram that is dead code (as indicated by the
dead code proposal
https://dwarfstd.org/ShowIssue.php?issue=200609.1), don't generate debug
output for the subprogram or any of its children.
2021-11-08 09:31:04 -06:00
Pat Hickey
2053e972b7 InstancePre can impl Clone (#3510)
Its a manually written impl, not a derive, because InstancePre<T>: Clone
does not require T: Clone.

The clone should be reasonably inexpensive: Clone for Module is just an
Arc, and Clone for Definition should also just be an Arc on the HostFunc
or Instance variants. An InstancePre shouldnt contain any
Definition::Extern variants because there is not yet a Store associated
with it- right?
2021-11-08 09:11:31 -06:00
Nick Fitzgerald
7a568b19b4 ISLE: run rustfmt on generated code 2021-11-05 15:59:49 -07:00
Nick Fitzgerald
b8494822dc ISLE: finish porting imul lowering to ISLE 2021-11-05 15:41:24 -07:00
Nick Fitzgerald
30d206779e x64: Remove some unreachable code that's been ported to ISLE 2021-11-05 14:28:03 -07:00
Nick Fitzgerald
00e7ca206f ISLE: add a missing type check for whether terms used in expressions have a constructor 2021-11-05 14:05:38 -07:00
Alex Crichton
6be0f82b96 Fix a panic with an invalid name section (#3509)
This commit fixes a panic which can happen on a module with an invalid
name section where one of the functions named has the index `u32::MAX`.
Previously Wasmtime would create a new `FuncIndex` with the indices
found in the name section but the sentinel `u32::MAX` causes a panic.

Cranelift otherwise limits the number of functions through `wasmparser`
which has a hard limit (lower than `u32::MAX`) so this commit applies a
fix of only recording function names for function indices that are
actually present in the module.
2021-11-05 15:08:58 -05:00
Alex Crichton
6bcee7f5f7 Add a configuration option to force "static" memories (#3503)
* Add a configuration option to force "static" memories

In poking around at some things earlier today I realized that one
configuration option for memories we haven't exposed from embeddings
like the CLI is to forcibly limit the size of memory growth and force
using a static memory style. This means that the CLI, for example, can't
limit memory growth by default and memories are only limited in size by
what the OS can give and the wasm's own memory type. This configuration
option means that the CLI can artificially limit the size of wasm linear
memories.

Additionally another motivation for this is for testing out various
codegen ramifications of static/dynamic memories. This is the only way
to force a static memory, by default, for wasm64 memories with no
maximum size listed for example.

* Review feedback
2021-11-03 16:50:49 -05:00
Pat Hickey
6428ac80d0 cargo update -p userfaultfd to 0.4.2 (#3505)
which has bugfixes to work correctly on linux 5.11 and above, which is
required for github's ubuntu-latest builder as of this morning
2021-11-03 16:50:40 -05:00
Benjamin Bouvier
c952969389 Remove unused dependencies (#3490)
* Remove unused dependencies in Cranelift

* add serde to the current workspace

* remove more unused dependencies in wasmtime?
2021-11-02 12:08:30 -05:00
Chris Fallin
b024603866 Merge pull request #3502 from cfallin/ifcmp-sp
Add back the `ifcmp_sp` CLIF opcode.
2021-11-01 14:04:51 -07:00
Chris Fallin
5e96a447f0 Add back the ifcmp_sp CLIF opcode.
This opcode was removed as part of the old-backend cleanup in #3446.
While this opcode will definitely go away eventually, it is
unfortunately still used today in Lucet (as we just discovered while
working to upgrade Lucet's pinned Cranelift version). Lucet is
deprecated and slated to eventually be completely sunset in favor of
Wasmtime; but until that happens, we need to keep this opcode.
2021-11-01 13:34:31 -07:00
Chris Fallin
9e7760bd83 Merge pull request #3497 from bjorn3/misc_meta_simplifications
Misc meta crate cleanups
2021-11-01 11:24:44 -07:00
Nick Fitzgerald
d0aac82481 Merge pull request #3501 from bytecodealliance/alexcrichton-patch-1
Add cranelift meeting notes for today
2021-11-01 10:42:08 -07:00
Alex Crichton
5b3c570247 Add cranelift meeting notes for today
Not huge this time, mostly a presentation by fitzgen!
2021-11-01 12:31:21 -05:00
bjorn3
86d2ef8952 Fix CI 2021-11-01 18:19:59 +01:00
bjorn3
93e9bb02e4 Review comments 2021-11-01 18:17:57 +01:00
Chris Fallin
2fab40bec6 Merge pull request #3496 from bjorn3/legalizer_changes
Match on InstructionData instead of Opcode inside the legalizer
2021-11-01 09:48:30 -07:00
Nick Fitzgerald
3c1736f828 Merge pull request #3500 from bytecodealliance/fitzgen-patch-1
Add slides for ISLE update in cranelift meeting
2021-11-01 08:28:52 -07:00
Nick Fitzgerald
925a9f0444 Add slides for ISLE update in cranelift meeting 2021-11-01 08:26:43 -07:00
Nils Martel
240835f8e4 Check cranelift benchmarks in CI (#3494)
* Check cranelift benchmarks in CI

* Use appropriate cargo subcommand

to check benchmarks
2021-11-01 09:33:45 -05:00
Alex Crichton
9a27fdad86 Update v8 used during fuzzing (#3493)
This commit updates the crate name from `rusty_v8` to `v8` as well since
the upstream bindings have sinced moved. I originally wanted to do this
to see if a fix for one of our fuzz bugs was pulled in but I don't think
the fix has been pulled in yet. Despite that it seems reasonable to go
ahead and update.
2021-11-01 09:18:11 -05:00
bjorn3
55f8f8ce05 Remove a bit of dead code 2021-10-31 19:57:04 +01:00
bjorn3
f84e1c16c7 Enforce all OperandKind have documentation 2021-10-31 19:57:04 +01:00
bjorn3
e8f3c0c6a9 Use InstructionFormat inside InstructionFormatBuilder 2021-10-31 19:57:04 +01:00
bjorn3
2fbd57e9e2 Remove imm_with_name
It is only used once to rename an imm field to mask
2021-10-31 19:57:04 +01:00
bjorn3
74261ccd79 Never use the first vararg as typevar operand
If an instruction only takes varargs as values, it may have no arguments
at all.
2021-10-31 19:57:04 +01:00