Commit Graph

379 Commits

Author SHA1 Message Date
Pat Hickey
31145060b2 remove virtfs - it is not suitable for use 2021-02-03 15:04:02 -08:00
Pat Hickey
47a89d3cc2 cargo update. wanted the latest cap-primitives 2021-02-02 10:44:21 -08:00
Pat Hickey
ca657186f2 fix wasmtime doctest 2021-02-01 19:12:20 -08:00
Pat Hickey
0c4aec391e actually empty ready bytes of stdin 2021-02-01 14:43:32 -08:00
Pat Hickey
a4372c8c2e cap-std-sync: test opening a tempdir as ambient and then WasiDir 2021-02-01 13:15:39 -08:00
Pat Hickey
133344e880 woo it passes six tests even though its awful 2021-01-30 13:54:34 -08:00
Pat Hickey
fcecb3fea6 test-programs: test both cap-std-sync and virtfs backend 2021-01-30 13:39:18 -08:00
Pat Hickey
c12cd82fc0 careful now 2021-01-29 21:19:24 -08:00
Pat Hickey
d8f3a62b32 dont try to make a virtfs today. instead, delete virtfs example. 2021-01-29 17:27:05 -08:00
Pat Hickey
95ad13c82d wasi-common: break dep on system-interface by defining our own Advice enum 2021-01-29 17:03:08 -08:00
Pat Hickey
b48e7fcc5d integrate with c-api 2021-01-29 14:09:44 -08:00
Pat Hickey
d5fdd835ab port bench-api 2021-01-29 13:25:06 -08:00
Pat Hickey
11821e5bfd Merge remote-tracking branch 'origin/main' into pch/wasi_common_cap_std 2021-01-29 12:38:13 -08:00
Pat Hickey
e498888732 hook run command up to both wasi snapshots
sharing the same context! at long last
2021-01-29 12:29:30 -08:00
Alex Crichton
f1d922dc2d Update some wasm-tools dependencies
Mostly focused around some small bugfixes and improvements related to
module-linking fuzzing.
2021-01-29 10:04:36 -08:00
Alex Crichton
0e41861662 Implement limiting WebAssembly execution with fuel (#2611)
* Consume fuel during function execution

This commit adds codegen infrastructure necessary to instrument wasm
code to consume fuel as it executes. Currently nothing is really done
with the fuel, but that'll come in later commits.

The focus of this commit is to implement the codegen infrastructure
necessary to consume fuel and account for fuel consumed correctly.

* Periodically check remaining fuel in wasm JIT code

This commit enables wasm code to periodically check to see if fuel has
run out. When fuel runs out an intrinsic is called which can do what it
needs to do in the result of fuel running out. For now a trap is thrown
to have at least some semantics in synchronous stores, but another
planned use for this feature is for asynchronous stores to periodically
yield back to the host based on fuel running out.

Checks for remaining fuel happen in the same locations as interrupt
checks, which is to say the start of the function as well as loop
headers.

* Improve codegen by caching `*const VMInterrupts`

The location of the shared interrupt value and fuel value is through a
double-indirection on the vmctx (load through the vmctx and then load
through that pointer). The second pointer in this chain, however, never
changes, so we can alter codegen to account for this and remove some
extraneous load instructions and hopefully reduce some register
pressure even maybe.

* Add tests fuel can abort infinite loops

* More fuzzing with fuel

Use fuel to time out modules in addition to time, using fuzz input to
figure out which.

* Update docs on trapping instructions

* Fix doc links

* Fix a fuzz test

* Change setting fuel to adding fuel

* Fix a doc link

* Squelch some rustdoc warnings
2021-01-29 08:57:17 -06:00
Pat Hickey
9bd89abc0c rename everything c2 related to the "real" names 2021-01-28 15:34:03 -08:00
Pat Hickey
220509f3ed latest system-interface 2021-01-27 12:17:42 -08:00
Alex Crichton
7f840870c7 cranelift-native: Use libstd feature detection (#2607)
This commit switches cranelift-native to useing the
`is_x86_feature_detected!` macro in the standard library instead of the
`raw-cpuid` crate.
2021-01-26 16:42:11 -06:00
Chris Fallin
3c5416446c Fix cargo-deny issue with raw-cpuid advisory.
cargo-deny tells us that we should upgrade raw-cpuid to v9.0.0. This
new version also seems to lack the `nightly` feature (perhaps it has
been incorporated into the base functionality) so I had to remove this
feature selector to build.
2021-01-25 08:32:06 -08:00
Frank Denis
a0fad6065a Add support for the experimental wasi-crypto APIs (#2597)
* Add support for the experimental wasi-crypto APIs

The sole purpose of the implementation is to allow bindings and
application developers to test the proposed APIs.

Rust and AssemblyScript bindings are also available as examples.

Like `wasi-nn`, it is currently disabled by default, and requires
the `wasi-crypto` feature flag to be compiled in.

* Rename the wasi-crypto/spec submodule

* Add a path dependency into the submodule for wasi-crypto

* Tell the publish script to vendor wasi-crypto
2021-01-25 09:32:58 -06:00
Pat Hickey
2b70ea8b91 windows scheduler passes tests
unfortunately this does essentially nothing to convince me of its
correctness
2021-01-22 18:26:45 -08:00
Pat Hickey
19254bfd72 error mapping for windows! 2021-01-22 15:44:32 -08:00
Pat Hickey
86d369c72a inline poll from yanix 2021-01-21 18:17:49 -08:00
Pat Hickey
16b42a5707 fix 2021-01-21 14:14:05 -08:00
Pat Hickey
85c3b73b4e stdio compiles on windows! 2021-01-21 13:51:18 -08:00
Alex Crichton
4a351ab7fe Update a number of dependencies (#2594)
This commit goes through the dependencies that wasmtime has and updates
versions where possible. This notably brings in a wasmparser/wast update
which has some simd spec changes with new instructions. Otherwise most
of these are just routine updates.
2021-01-21 15:49:13 -06:00
Pat Hickey
fcd00f5de1 move more deps to cap-std-sync, define own SystemTimeSpec 2021-01-21 12:35:55 -08:00
Andronik Ordian
2d5037d84c cache: update zstd to 0.6, disable legacy feature (#2592) 2021-01-21 10:16:07 -06:00
Pat Hickey
f3e40e2fc4 restructure cap-std impls into their own crate 2021-01-20 19:09:15 -08:00
Pat Hickey
657024bd0d latest system-interface provides ReadReady::num_ready_bytes 2021-01-19 14:39:20 -08:00
Han Zhao
32343a7018 Updated Cargo.lock for libc 2021-01-19 19:27:20 +01:00
Pat Hickey
7f7a0be938 wasi-c2: implement a synchronous poll_oneoff in terms of yanix
doesnt work on unix yet! also breaks all the rules about using the
cap-std family instead of rawfds! but this is cool and im happy with it
2021-01-14 17:43:53 -08:00
Alex Crichton
703762c49e Update support for the module linking proposal
This commit updates the various tooling used by wasmtime which has new
updates to the module linking proposal. This is done primarily to sync
with WebAssembly/module-linking#26. The main change implemented here is
that wasmtime now supports creating instances from a set of values, nott
just from instantiating a module. Additionally subtyping handling of
modules with respect to imports is now properly handled by desugaring
two-level imports to imports of instances.

A number of small refactorings are included here as well, but most of
them are in accordance with the changes to `wasmparser` and the updated
binary format for module linking.
2021-01-14 10:37:39 -08:00
Nick Fitzgerald
bc6dc083f0 wasmtime-bench-api: Randomize the locations of heap objects
This helps us avoid measurement bias due to accidental locality of unrelated
heap objects. See *Stabilizer: Statistically Sound Performance Evaluation* by
Curtsinger and Berger for details (although Stabilizer deals with much more than
just the location of heap allocations):
https://people.cs.umass.edu/~emery/pubs/stabilizer-asplos13.pdf
2021-01-12 15:43:26 -08:00
Pat Hickey
b53aecb367 Merge branch 'pch/wiggle_flags_bitflags' into pch/wasi_common_cap_std 2021-01-11 18:31:43 -08:00
Pat Hickey
e2fb99af86 wiggle: depend on bitflags, and re-export it. 2021-01-11 18:04:43 -08:00
Pat Hickey
b1d32f419c use bitflags crate to define bitflags, rather than by hand 2021-01-11 17:48:41 -08:00
Andrew Brown
2adb0e8964 security: upgrade smallvec to 1.6.1
Fixes advisory https://rustsec.org/advisories/RUSTSEC-2021-0003.
2021-01-08 16:54:54 -08:00
Pat Hickey
4a6e92f52f upgrade to cap-std 0.9 2021-01-07 16:47:26 -08:00
Pat Hickey
a900d0431d Merge remote-tracking branch 'origin/main' into pch/wasi_common_cap_std 2021-01-07 16:39:27 -08:00
Nick Fitzgerald
5de5bf1565 Merge pull request #2550 from bytecodealliance/pch/wiggle_trapping
wiggle: introduce Trap enum
2021-01-07 16:23:21 -08:00
Nick Fitzgerald
5ad82de3c5 Bump Wasmtime to 0.22.0; Cranelift to 0.69.0 2021-01-07 14:51:12 -08:00
Pat Hickey
13cd7a4a8e Merge branch 'pch/wiggle_trapping' into pch/wasi_common_cap_std 2021-01-07 14:10:59 -08:00
Pat Hickey
c2004001cb Merge remote-tracking branch 'origin/main' into pch/wasi_common_cap_std 2021-01-07 14:10:43 -08:00
Pat Hickey
cd3adb1abd Trap::I32Exit is a better name 2021-01-07 11:45:11 -08:00
Léo Gaspard
c0c4834c64 wasi-nn: rebuild if the witx files change 2021-01-06 15:56:46 -08:00
Pat Hickey
add601fd6c use cap_rand instead of getrandom 2021-01-04 16:28:35 -08:00
Pat Hickey
c7fcc34487 add clocks! 2021-01-04 16:03:58 -08:00
Pat Hickey
01d74ceb73 Merge remote-tracking branch 'origin/main' into pch/wasi_common_cap_std 2021-01-04 11:19:02 -08:00